using LeaRun.Application.Busines.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 InstallApplyController : MvcControllerBase { private InstallApplyBLL InstallApplybll = new InstallApplyBLL(); // // GET: /InstallManage/InstallApply/ #region 功能视图 public ActionResult Index() { return View(); } public ActionResult Form() { return View(); } #endregion #region 获取数据 public ActionResult GetListJson(string startTime, string endTime, Pagination pagination) { if (!string.IsNullOrEmpty(startTime) && !string.IsNullOrEmpty(endTime)) { var data = InstallApplybll.getInstallApplyList(startTime, endTime, pagination); 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 { var data = InstallApplybll.getInstallApplyList(startTime, endTime, pagination); 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(""); } #endregion #region 保存数据 [HttpPost] [AjaxOnly] public ActionResult SaveApply(String Apply_Number, String CustomerName, String LinkMan, String LinkManMobile, String CustomerAddr, String ApplyHouseHold_Num) { InstallApplybll.SaveApply(Apply_Number, CustomerName, LinkMan, LinkManMobile, CustomerAddr, ApplyHouseHold_Num); return Success("操作成功。"); } #endregion } }