StaffStandardController.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. namespace EMIS.Web.Controllers.PaymentManage
  11. {
  12. [Authorization]
  13. public class StaffStandardController : Controller
  14. {
  15. public IStaffStandardServices StaffStandardServices { get; set; }
  16. public ActionResult List()
  17. {
  18. return View();
  19. }
  20. public ActionResult Edit(Guid? StaffStandardID)
  21. {
  22. StaffStandardView staffStandardView = new StaffStandardView();
  23. if (StaffStandardID.HasValue)
  24. {
  25. staffStandardView = StaffStandardServices.GetStaffStandardView(StaffStandardID);
  26. }
  27. return View(staffStandardView);
  28. }
  29. [HttpPost]
  30. public ActionResult List(QueryParamsModel pararms)
  31. {
  32. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  33. var collegeID = pararms.getExtraGuid("cgbCollege");
  34. var departmentID = pararms.getExtraGuid("cgbDepartment");
  35. var userID = pararms.getExtraGuid("cgbUser");
  36. if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
  37. return base.Json(StaffStandardServices.GetStaffStandardViewList(configuretView, collegeID, departmentID, userID, (int)pararms.page, (int)pararms.rows));
  38. }
  39. [HttpPost]
  40. public ActionResult Edit(StaffStandardView staffStandardView)
  41. {
  42. try
  43. {
  44. StaffStandardServices.Save(staffStandardView);
  45. return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" });
  46. }
  47. catch (Exception ex)
  48. {
  49. return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message });
  50. }
  51. }
  52. [HttpPost]
  53. public ActionResult Delete(string staffStandardIDs)
  54. {
  55. try
  56. {
  57. List<Guid?> list = staffStandardIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
  58. StaffStandardServices.Delete(list);
  59. return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" });
  60. }
  61. catch (Exception ex)
  62. {
  63. return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message });
  64. }
  65. }
  66. }
  67. }