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.
 
 
 
 
 
 

109 lines
3.4 KiB

  1. using Nancy;
  2. using Learun.Util;
  3. using System.Collections.Generic;
  4. using System;
  5. using Learun.Application.TwoDevelopment.LogisticsManagement;
  6. namespace Learun.Application.WebApi
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  10. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2022-09-16 14:43
  13. /// 描 述:学生日常规管理
  14. /// </summary>
  15. public class Acc_StuDayRoutineApi : BaseApi
  16. {
  17. private Acc_StuDayRoutineIBLL acc_StuDayRoutineIBLL = new Acc_StuDayRoutineBLL();
  18. /// <summary>
  19. /// 注册接口
  20. /// <summary>
  21. public Acc_StuDayRoutineApi()
  22. : base("/Learun/adms/LogisticsManagement/Acc_StuDayRoutine")
  23. {
  24. Get["/pagelist"] = GetPageList;
  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 = acc_StuDayRoutineIBLL.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 GetForm(dynamic _)
  54. {
  55. string keyValue = this.GetReqData();
  56. var Acc_StuDayRoutineData = acc_StuDayRoutineIBLL.GetAcc_StuDayRoutineEntity(keyValue);
  57. var jsonData = new
  58. {
  59. Acc_StuDayRoutine = Acc_StuDayRoutineData,
  60. };
  61. return Success(jsonData);
  62. }
  63. #endregion
  64. #region 提交数据
  65. /// <summary>
  66. /// 删除实体数据
  67. /// <param name="_"></param>
  68. /// <summary>
  69. /// <returns></returns>
  70. public Response DeleteForm(dynamic _)
  71. {
  72. string keyValue = this.GetReqData();
  73. acc_StuDayRoutineIBLL.DeleteEntity(keyValue);
  74. return Success("删除成功!");
  75. }
  76. /// <summary>
  77. /// 保存实体数据(新增、修改)
  78. /// <param name="_"></param>
  79. /// <summary>
  80. /// <returns></returns>
  81. public Response SaveForm(dynamic _)
  82. {
  83. ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
  84. Acc_StuDayRoutineEntity entity = parameter.strEntity.ToObject<Acc_StuDayRoutineEntity>();
  85. acc_StuDayRoutineIBLL.SaveEntity(parameter.keyValue, entity);
  86. return Success("保存成功!");
  87. }
  88. #endregion
  89. #region 私有类
  90. /// <summary>
  91. /// 表单实体类
  92. /// <summary>
  93. private class ReqFormEntity
  94. {
  95. public string keyValue { get; set; }
  96. public string strEntity { get; set; }
  97. }
  98. #endregion
  99. }
  100. }