123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using LeaRun.Application.Busines.InstallManage;
- using LeaRun.Application.Entity.InstallManage;
- using LeaRun.Util;
- using LeaRun.Util.WebControl;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace LeaRun.Application.Web.Areas.InstallManage.Controllers
- {
- public class InstallSurveyController : MvcControllerBase
- {
- private InstallApplyBLL InstallApplybll = new InstallApplyBLL();
- //
- // GET: /InstallManage/InstallSurvey/
- public ActionResult Index()
- {
- return View();
- }
- public ActionResult Form()
- {
- return View();
- }
- #region 获取数据
- [HttpGet]
- public ActionResult GetListJson(string startTime, string endTime,String type, Pagination pagination)
- {
- InstallApplyEntity entity = new InstallApplyEntity();
- if (type == null)
- {
- entity.SurveyType = 0;
- }
- else
- {
- entity.SurveyType = int.Parse(type);
- }
- if (!string.IsNullOrEmpty(startTime) && !string.IsNullOrEmpty(endTime))
- {
- var data = InstallApplybll.getInstallApplyList(startTime, endTime, pagination,entity);
- var watch = CommonHelper.TimerStart();
- var JsonData = new
- {
- rows = JsonConvert.DeserializeObject(data),
- total = pagination.total,
- page = pagination.page,
- records = pagination.records,
- costtime = CommonHelper.TimerEnd(watch)
- };
- return Content(JsonData.ToJson());
- }
- else
- {
- entity.SurveyType = 0;
- var data = InstallApplybll.getInstallApplyList(startTime, endTime, pagination, entity);
- var watch = CommonHelper.TimerStart();
- var JsonData = new
- {
- rows = JsonConvert.DeserializeObject(data),
- total = pagination.total,
- page = pagination.page,
- records = pagination.records,
- costtime = CommonHelper.TimerEnd(watch)
- };
- return Content(JsonData.ToJson());
- }
- return Content("");
- }
- public ActionResult GetFormJson(String keyValue)
- {
- var data = InstallApplybll.GetFormJson(keyValue);
- return ToJsonResult(data);
- }
- [HttpPost]
- [AjaxOnly]
- public ActionResult SaveSurvey(String SurveySugget, int Apply_ID)
- {
- InstallApplybll.SaveSurvey(SurveySugget, Apply_ID);
- return Success("操作成功。");
- }
- #endregion
- }
- }
|