ThroughWaterController.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 ThroughWaterController : MvcControllerBase
  14. {
  15. private InstallApplyBLL InstallApplybll = new InstallApplyBLL();
  16. //
  17. // GET: /InstallManage/ThroughWater/
  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 = 2;
  32. entity.AcceptType = 1;
  33. entity.ThroughWaterType = 0;
  34. }
  35. else
  36. {
  37. entity.SurveyType = 1;
  38. entity.budgetType = 1;
  39. entity.MasterVerifyType = 1;
  40. entity.PayMentType = 1;
  41. entity.ConstructionType = 2;
  42. entity.AcceptType = 1;
  43. entity.ThroughWaterType = int.Parse(type);
  44. }
  45. if (!string.IsNullOrEmpty(startTime) && !string.IsNullOrEmpty(endTime))
  46. {
  47. var data = InstallApplybll.getInstallApplyList(startTime, endTime, pagination, entity);
  48. var watch = CommonHelper.TimerStart();
  49. var JsonData = new
  50. {
  51. rows = JsonConvert.DeserializeObject(data),
  52. total = pagination.total,
  53. page = pagination.page,
  54. records = pagination.records,
  55. costtime = CommonHelper.TimerEnd(watch)
  56. };
  57. return Content(JsonData.ToJson());
  58. }
  59. else
  60. {
  61. entity.SurveyType = 1;
  62. entity.budgetType = 1;
  63. entity.MasterVerifyType = 1;
  64. entity.PayMentType = 1;
  65. entity.ConstructionType = 2;
  66. entity.AcceptType = 1;
  67. entity.ThroughWaterType = 0 ;
  68. var data = InstallApplybll.getInstallApplyList(startTime, endTime, pagination, entity);
  69. var watch = CommonHelper.TimerStart();
  70. var JsonData = new
  71. {
  72. rows = JsonConvert.DeserializeObject(data),
  73. total = pagination.total,
  74. page = pagination.page,
  75. records = pagination.records,
  76. costtime = CommonHelper.TimerEnd(watch)
  77. };
  78. return Content(JsonData.ToJson());
  79. }
  80. return Content("");
  81. }
  82. public ActionResult UpdateType(String appId, String Type)
  83. {
  84. InstallApplybll.UpdateThroughWater(appId, Type);
  85. return Success("成功");
  86. }
  87. }
  88. }