PracticeRateController.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 PracticeRateController : Controller
  14. {
  15. public IPracticeRateServices PracticeRateServices { get; set; }
  16. public ActionResult List()
  17. {
  18. return View();
  19. }
  20. public ActionResult Edit(Guid? PracticeRateID)
  21. {
  22. PracticeRateView practiceRateView = new PracticeRateView();
  23. if (PracticeRateID.HasValue)
  24. {
  25. practiceRateView = PracticeRateServices.GetPracticeRateView(PracticeRateID);
  26. }
  27. return View(practiceRateView);
  28. }
  29. [HttpPost]
  30. public ActionResult List(QueryParamsModel pararms)
  31. {
  32. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  33. if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
  34. return base.Json(PracticeRateServices.GetPracticeRateViewList(configuretView, (int)pararms.page, (int)pararms.rows));
  35. }
  36. [HttpPost]
  37. public ActionResult Edit(PracticeRateView practiceRateView)
  38. {
  39. try
  40. {
  41. PracticeRateServices.Save(practiceRateView);
  42. return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" });
  43. }
  44. catch (Exception ex)
  45. {
  46. return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message });
  47. }
  48. }
  49. [HttpPost]
  50. public ActionResult Delete(string practiceRateIDs)
  51. {
  52. try
  53. {
  54. List<Guid?> list = practiceRateIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
  55. PracticeRateServices.Delete(list);
  56. return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" });
  57. }
  58. catch (Exception ex)
  59. {
  60. return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message });
  61. }
  62. }
  63. }
  64. }