You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

117 rivejä
3.7 KiB

  1. using Nancy;
  2. using Learun.Util;
  3. using System.Collections.Generic;
  4. using Learun.Application.TwoDevelopment.PersonnelManagement;
  5. namespace Learun.Application.WebApi
  6. {
  7. /// <summary>
  8. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  9. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  10. /// 创 建:超级管理员
  11. /// 日 期:2020-02-03 14:44
  12. /// 描 述:疫情详细信息
  13. /// </summary>
  14. public class ContactsDetailsApi : BaseApi
  15. {
  16. private ContactsDetailsIBLL contactsDetailsIBLL = new ContactsDetailsBLL();
  17. /// <summary>
  18. /// 注册接口
  19. /// <summary>
  20. public ContactsDetailsApi()
  21. : base("/Learun/adms/PersonnelManagement/ContactsDetails")
  22. {
  23. Get["/pagelist"] = GetPageList;
  24. Get["/list"] = GetList;
  25. Get["/form"] = GetForm;
  26. Post["/delete"] = DeleteForm;
  27. Post["/save"] = SaveForm;
  28. }
  29. #region 获取数据
  30. /// <summary>
  31. /// 获取页面显示列表分页数据
  32. /// <summary>
  33. /// <param name="_"></param>
  34. /// <returns></returns>
  35. public Response GetPageList(dynamic _)
  36. {
  37. ReqPageParam parameter = this.GetReqData<ReqPageParam>();
  38. var data = contactsDetailsIBLL.GetPageList(parameter.pagination, parameter.queryJson);
  39. var jsonData = new
  40. {
  41. rows = data,
  42. total = parameter.pagination.total,
  43. page = parameter.pagination.page,
  44. records = parameter.pagination.records
  45. };
  46. return Success(jsonData);
  47. }
  48. /// <summary>
  49. /// 获取页面显示列表数据
  50. /// <summary>
  51. /// <param name="_"></param>
  52. /// <returns></returns>
  53. public Response GetList(dynamic _)
  54. {
  55. string queryJson = this.GetReqData();
  56. var data = contactsDetailsIBLL.GetList(queryJson);
  57. return Success(data);
  58. }
  59. /// <summary>
  60. /// 获取表单数据
  61. /// <summary>
  62. /// <param name="_"></param>
  63. /// <returns></returns>
  64. public Response GetForm(dynamic _)
  65. {
  66. string keyValue = this.GetReqData();
  67. var ContactsDetailsData = contactsDetailsIBLL.GetContactsDetailsEntity( keyValue );
  68. var jsonData = new {
  69. ContactsDetails = ContactsDetailsData,
  70. };
  71. return Success(jsonData);
  72. }
  73. #endregion
  74. #region 提交数据
  75. /// <summary>
  76. /// 删除实体数据
  77. /// <param name="_"></param>
  78. /// <summary>
  79. /// <returns></returns>
  80. public Response DeleteForm(dynamic _)
  81. {
  82. string keyValue = this.GetReqData();
  83. contactsDetailsIBLL.DeleteEntity(keyValue);
  84. return Success("删除成功!");
  85. }
  86. /// <summary>
  87. /// 保存实体数据(新增、修改)
  88. /// <param name="_"></param>
  89. /// <summary>
  90. /// <returns></returns>
  91. public Response SaveForm(dynamic _)
  92. {
  93. ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
  94. ContactsDetailsEntity entity = parameter.strEntity.ToObject<ContactsDetailsEntity>();
  95. contactsDetailsIBLL.SaveEntity(this.userInfo,parameter.keyValue,entity);
  96. return Success("保存成功!");
  97. }
  98. #endregion
  99. #region 私有类
  100. /// <summary>
  101. /// 表单实体类
  102. /// <summary>
  103. private class ReqFormEntity {
  104. public string keyValue { get; set; }
  105. public string strEntity{ get; set; }
  106. }
  107. #endregion
  108. }
  109. }