StudentCountRateController.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.CommonLogic.PaymentManage;
  7. using EMIS.ViewModel.PaymentManage;
  8. using EMIS.ViewModel;
  9. using EMIS.Web.Controls;
  10. using Bowin.Web.Controls.Mvc;
  11. namespace EMIS.Web.Controllers.PaymentManage
  12. {
  13. [Authorization]
  14. public class StudentCountRateController : Controller
  15. {
  16. public IStudentCountRateServices StudentCountRateServices { get; set; }
  17. public ActionResult List()
  18. {
  19. var commonStudentCountRate = StudentCountRateServices.GetCommonStudentCountRateView();
  20. return View(commonStudentCountRate);
  21. }
  22. public ActionResult Edit(Guid? StudentCountRateID)
  23. {
  24. StudentCountRateView studentCountRateView = new StudentCountRateView();
  25. if (StudentCountRateID.HasValue)
  26. {
  27. studentCountRateView = StudentCountRateServices.GetStudentCountRateView(StudentCountRateID);
  28. }
  29. return View(studentCountRateView);
  30. }
  31. [HttpPost]
  32. public ActionResult List(QueryParamsModel pararms)
  33. {
  34. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  35. if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
  36. return base.Json(StudentCountRateServices.GetStudentCountRateViewList(configuretView, (int)pararms.page, (int)pararms.rows));
  37. }
  38. [HttpPost]
  39. public ActionResult CommonSave(StudentCountRateView studentCountRateView)
  40. {
  41. try
  42. {
  43. if (studentCountRateView != null)
  44. {
  45. StudentCountRateServices.Save(studentCountRateView);
  46. }
  47. return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" });
  48. }
  49. catch (Exception ex)
  50. {
  51. return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message });
  52. }
  53. }
  54. [HttpPost]
  55. public ActionResult Edit(StudentCountRateView studentCountRateView)
  56. {
  57. try
  58. {
  59. StudentCountRateServices.Save(studentCountRateView);
  60. return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" });
  61. }
  62. catch (Exception ex)
  63. {
  64. return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message });
  65. }
  66. }
  67. [HttpPost]
  68. public ActionResult Delete(string studentCountRateIDs)
  69. {
  70. try
  71. {
  72. List<Guid?> list = studentCountRateIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
  73. StudentCountRateServices.Delete(list);
  74. return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" });
  75. }
  76. catch (Exception ex)
  77. {
  78. return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message });
  79. }
  80. }
  81. }
  82. }