LevelStandardController.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 LevelStandardController : Controller
  15. {
  16. public ILevelStandardServices LevelStandardServices { get; set; }
  17. public ActionResult List()
  18. {
  19. return View();
  20. }
  21. public ActionResult Edit(Guid? LevelStandardID)
  22. {
  23. LevelStandardView levelStandardView = new LevelStandardView();
  24. if (LevelStandardID.HasValue)
  25. {
  26. levelStandardView = LevelStandardServices.GetLevelStandardView(LevelStandardID);
  27. }
  28. return View(levelStandardView);
  29. }
  30. [HttpPost]
  31. public ActionResult List(QueryParamsModel pararms)
  32. {
  33. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  34. var employmentTypeID = pararms.getExtraInt("ddlEmploymentType") == DropdownList.PLEASE_SELECT ? null : pararms.getExtraInt("ddlEmploymentType");
  35. var teacherTypeID = pararms.getExtraInt("ddlTeacherType") == DropdownList.PLEASE_SELECT ? null : pararms.getExtraInt("ddlTeacherType");
  36. var paymentLevel = pararms.getExtraInt("ddlPaymentLevel") == DropdownList.PLEASE_SELECT ? null : pararms.getExtraInt("ddlPaymentLevel");
  37. if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
  38. return base.Json(LevelStandardServices.GetLevelStandardViewList(configuretView, employmentTypeID, teacherTypeID, paymentLevel, (int)pararms.page, (int)pararms.rows));
  39. }
  40. [HttpPost]
  41. public ActionResult Edit(LevelStandardView levelStandardView)
  42. {
  43. try
  44. {
  45. LevelStandardServices.Save(levelStandardView);
  46. return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" });
  47. }
  48. catch (Exception ex)
  49. {
  50. return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message });
  51. }
  52. }
  53. [HttpPost]
  54. public ActionResult Delete(string levelStandardIDs)
  55. {
  56. try
  57. {
  58. List<Guid?> list = levelStandardIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
  59. LevelStandardServices.Delete(list);
  60. return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" });
  61. }
  62. catch (Exception ex)
  63. {
  64. return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message });
  65. }
  66. }
  67. }
  68. }