EngineerController.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using LeaRun.Application.Busines.InstallManage;
  2. using LeaRun.Application.Entity.InstallManage;
  3. using LeaRun.Util;
  4. using LeaRun.Util.WebControl;
  5. using Newtonsoft.Json;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Web;
  10. using System.Web.Mvc;
  11. namespace LeaRun.Application.Web.Areas.InstallManage.Controllers
  12. {
  13. public class EngineerController : MvcControllerBase
  14. {
  15. private InstallApplyBLL InstallApplybll = new InstallApplyBLL();
  16. //
  17. // GET: /InstallManage/Engineer/
  18. public ActionResult Index()
  19. {
  20. return View();
  21. }
  22. public ActionResult GetListJson(string startTime, string endTime, String type, Pagination pagination)
  23. {
  24. InstallApplyEntity entity = new InstallApplyEntity();
  25. if (type == null)
  26. {
  27. entity.SurveyType = 1;
  28. entity.budgetType = 1;
  29. entity.MasterVerifyType = 1;
  30. entity.PayMentType = 1;
  31. entity.ConstructionType = 0;
  32. }
  33. else
  34. {
  35. entity.SurveyType = 1;
  36. entity.budgetType = 1;
  37. entity.MasterVerifyType = 1;
  38. entity.PayMentType = 1;
  39. entity.ConstructionType = int.Parse(type);
  40. }
  41. if (!string.IsNullOrEmpty(startTime) && !string.IsNullOrEmpty(endTime))
  42. {
  43. var data = InstallApplybll.getInstallApplyList(startTime, endTime, pagination, entity);
  44. var watch = CommonHelper.TimerStart();
  45. var JsonData = new
  46. {
  47. rows = JsonConvert.DeserializeObject(data),
  48. total = pagination.total,
  49. page = pagination.page,
  50. records = pagination.records,
  51. costtime = CommonHelper.TimerEnd(watch)
  52. };
  53. return Content(JsonData.ToJson());
  54. }
  55. else
  56. {
  57. entity.SurveyType = 1;
  58. entity.budgetType = 1;
  59. entity.MasterVerifyType = 1;
  60. entity.PayMentType = 1;
  61. entity.ConstructionType = 0;
  62. var data = InstallApplybll.getInstallApplyList(startTime, endTime, pagination, entity);
  63. var watch = CommonHelper.TimerStart();
  64. var JsonData = new
  65. {
  66. rows = JsonConvert.DeserializeObject(data),
  67. total = pagination.total,
  68. page = pagination.page,
  69. records = pagination.records,
  70. costtime = CommonHelper.TimerEnd(watch)
  71. };
  72. return Content(JsonData.ToJson());
  73. }
  74. return Content("");
  75. }
  76. public ActionResult UpdateType(String appId,String Type)
  77. {
  78. InstallApplybll.UpdateEngineer(appId, Type);
  79. return Success("成功");
  80. }
  81. }
  82. }