CertisfierServicesController.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.CerificateManage;
  7. using EMIS.ViewModel;
  8. using EMIS.Web.Controls;
  9. using Bowin.Web.Controls.Mvc;
  10. using EMIS.Utility;
  11. using EMIS.ViewModel.CerificateManage;
  12. namespace EMIS.Web.ServiceControllers.CertisfierManage
  13. {
  14. public class CertisfierServicesController : Controller
  15. {
  16. public ICertisfierDistributeServices ICertisfierDistributeService { get; set; }
  17. /// <summary>
  18. /// 证书列表查询
  19. /// </summary>
  20. /// <param name="pararms"></param>
  21. /// <returns></returns>
  22. public ActionResult CertisfierListView(Guid userID, int? pageIndex, int? pageSize)
  23. {
  24. return base.Json(ICertisfierDistributeService.GetCertificateMobileViewGrid(pageIndex, pageSize, userID));
  25. }
  26. /// <summary>
  27. /// 领取方式列表
  28. /// </summary>
  29. /// <returns></returns>
  30. public ActionResult DictionaryDropDown()
  31. {
  32. List<DropdownListItem> list = DictionaryHelper.GetDictionaryValue(EMIS.ViewModel.DictionaryItem.ER_CertisfierDistributeType)
  33. .Where(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE)
  34. .Select(x => new DropdownListItem { Text = x.Name, Value = x.Value.ToString() }).ToList();
  35. return base.Json(list);
  36. }
  37. /// <summary>
  38. /// 修改领取方式
  39. /// </summary>
  40. /// <param name="view"></param>
  41. /// <returns></returns>
  42. public ActionResult StuEdit(CertificateMobileView view)
  43. {
  44. try
  45. {
  46. CerificateView certificateView = new CerificateView();
  47. certificateView.CertisfierDistributeID = view.CertisfierDistributeID;
  48. certificateView.DistributeTypeID = view.DistributeTypeID;
  49. certificateView.EntrustDistributer = view.ContactPerson;
  50. certificateView.ContactPerson = view.ContactPerson;
  51. certificateView.ContactNo = view.ContactNo;
  52. certificateView.MailContactNo = view.ContactNo;
  53. certificateView.ContactIDNo = view.ContactIDNo;
  54. certificateView.Address = view.Address;
  55. ICertisfierDistributeService.UpdateCertisfierDistributeType(certificateView);
  56. return Json(new
  57. {
  58. isSuccess = true,
  59. message = "保存成功。"
  60. });
  61. }
  62. catch (Exception ex)
  63. {
  64. return Json(new
  65. {
  66. isSuccess = false,
  67. message = "保存失败,原因:" + ex.Message
  68. });
  69. }
  70. }
  71. /// <summary>
  72. /// 获取字典
  73. /// </summary>
  74. /// <param name="ID"></param>
  75. /// <returns></returns>
  76. public ActionResult GetView(Guid ID)
  77. {
  78. var view = ICertisfierDistributeService.GetView(ID);
  79. return Json(view);
  80. }
  81. }
  82. }