InstallAcceptController.cs 3.1 KB

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