diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs new file mode 100644 index 000000000..8479f9349 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs @@ -0,0 +1,121 @@ +using Nancy; +using Learun.Util; +using System.Collections.Generic; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using static Learun.Application.WebApi.Modules.StuInfoFreshApi; +using System; +using System.IO; +using System.Linq; +using Learun.Application.Base.SystemModule; +using Learun.Application.OA; +using Learun.Application.OA.File.FileInfo; +using Learun.Application.TwoDevelopment.LogisticsManagement; +using Learun.Application.TwoDevelopment.LR_Desktop; +using Learun.Application.WorkFlow; +using Microsoft.Ajax.Utilities; + +namespace Learun.Application.WebApi +{ + ///2022.11.14 + /// + /// 学生请假 + /// + + public class StuLeaveManagementApi : BaseApi + { + + private StuLeaveManagementIBLL stuLeaveManagementIBLL = new StuLeaveManagementBLL(); + + /// + /// 注册接口 + /// + public StuLeaveManagementApi() + : base("/Learun/adms/EducationalAdministration/StuLeaveManagement") + { + Get["/pagelist"] = GetPageList; + Get["/form"] = GetForm; + Post["/delete"] = DeleteForm; + Post["/save"] = SaveForm; + } + #region 获取数据 + + /// + /// 获取页面显示列表分页数据 + /// + /// + /// + public Response GetPageList(dynamic _) + { + ReqPageParam parameter = this.GetReqData(); + var data = stuLeaveManagementIBLL.GetPageList(parameter.pagination, parameter.queryJson); + var jsonData = new + { + rows = data, + total = parameter.pagination.total, + page = parameter.pagination.page, + records = parameter.pagination.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// + /// + public Response GetForm(dynamic _) + { + string keyValue = this.GetReqData(); + var StuLeaveManagementData = stuLeaveManagementIBLL.GetStuLeaveManagementEntity(keyValue); + var jsonData = new + { + StuLeaveManagement = StuLeaveManagementData, + }; + return Success(jsonData); + } + + + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// + /// + public Response DeleteForm(dynamic _) + { + string keyValue = this.GetReqData(); + stuLeaveManagementIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// + /// + public Response SaveForm(dynamic _) + { + ReqFormEntity parameter = this.GetReqData(); + StuLeaveManagementEntity entity = parameter.strEntity.ToObject(); + stuLeaveManagementIBLL.SaveEntity(parameter.keyValue, entity); + return Success("保存成功!"); + } + #endregion + + #region 私有类 + + /// + /// 表单实体类 + /// + private class ReqFormEntity + { + public string keyValue { get; set; } + public string strEntity { get; set; } + } + #endregion + + } + +} \ No newline at end of file