|
- using Learun.Application.Organization;
- using Learun.Application.TwoDevelopment.EducationalAdministration;
- using Learun.Application.TwoDevelopment.EvaluationTeach;
- using Learun.Util;
- using Nancy;
- using System;
- using System.Collections.Generic;
-
- namespace Learun.Application.WebApi.Modules
- {
- /// <summary>
- /// 版 本 Learun-ADMS V7.0.0 数字化智慧校园
- /// Copyright (c) 2013-2018 北京泉江科技有限公司
- /// 创建人:数字化智慧校园-框架开发组
- /// 日 期:2018.01.04
- /// 描 述:部门管理
- /// </summary>
- public class StuLeaveManagementApi : BaseApi
- {
- private StuLeaveManagementIBLL stuLeaveManagementBLL = new StuLeaveManagementBLL();
-
- public StuLeaveManagementApi()
- : base("/learun/adms/stuleavemanagement")
- {
- Get["/pagelist"] = GetPageList;
- Get["/list"] = GetList;
- Get["/form"] = GetForm;
- Post["/delete"] = DeleteForm;
- Post["/save"] = SaveForm;
- Post["/submit"] = Submit;
- Post["/savecheck"] = SaveCheckForm;
- }
-
- /// <summary>
- /// 获取页面显示列表分页数据
- /// <summary>
- /// <param name="_"></param>
- /// <returns></returns>
- public Response GetPageList(dynamic _)
- {
- ReqPageParam parameter = this.GetReqData<ReqPageParam>();
- var data = stuLeaveManagementBLL.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);
- }
- /// <summary>
- /// 获取页面显示列表数据
- /// <summary>
- /// <param name="_"></param>
- /// <returns></returns>
- public Response GetList(dynamic _)
- {
- string queryJson = this.GetReqData();
- var data = stuLeaveManagementBLL.GetList(queryJson);
- return Success(data);
- }
- /// <summary>
- /// 获取表单数据
- /// <summary>
- /// <param name="_"></param>
- /// <returns></returns>
- public Response GetForm(dynamic _)
- {
- string keyValue = this.GetReqData();
- var StuMailData = stuLeaveManagementBLL.GetStuLeaveManagementEntity(keyValue);
- var jsonData = new
- {
- StuMail = StuMailData,
- };
- return Success(jsonData);
- }
-
- #region 提交数据
-
- /// <summary>
- /// 删除实体数据
- /// <param name="_"></param>
- /// <summary>
- /// <returns></returns>
- public Response DeleteForm(dynamic _)
- {
- string keyValue = this.GetReqData();
- stuLeaveManagementBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// <param name="_"></param>
- /// <summary>
- /// <returns></returns>
- public Response SaveForm(dynamic _)
- {
- ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
- StuLeaveManagementEntity entity = parameter.strEntity.ToObject<StuLeaveManagementEntity>();
- entity.CreateTime = DateTime.Now;
- entity.CreateUserId = this.userInfo.userId;
- entity.CreateUserName = this.userInfo.realName;
- entity.CheckStatus = "0";
- stuLeaveManagementBLL.SaveEntity(parameter.keyValue, entity);
- return Success("保存成功!");
- }
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// <param name="_"></param>
- /// <summary>
- /// <returns></returns>
- public Response SaveCheckForm(dynamic _)
- {
- ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
- StuLeaveManagementEntity entity = parameter.strEntity.ToObject<StuLeaveManagementEntity>();
- var loginInfo = LoginUserInfo.Get();
- entity.CheckUserId = loginInfo.userId;
- entity.CheckUserNo = loginInfo.account;
- entity.CheckTime = DateTime.Now;
- if (entity.CheckStatus == "1")
- {
- entity.CheckStatus = "2";
- }
- else
- {
- entity.CheckStatus = "3";
- }
- stuLeaveManagementBLL.SaveEntity(parameter.keyValue, entity);
- return Success("保存成功!");
- }
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// <param name="_"></param>
- /// <summary>
- /// <returns></returns>
- public Response Submit(dynamic _)
- {
- ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
- stuLeaveManagementBLL.DoSubmit(parameter.keyValue);
- return Success("提交成功!");
- }
- #endregion
-
- #region 私有类
-
- /// <summary>
- /// 表单实体类
- /// <summary>
- private class ReqFormEntity
- {
- public string keyValue { get; set; }
- public string strEntity { get; set; }
- }
- #endregion
- }
- }
|