using Nancy;
using Learun.Util;
using System.Collections.Generic;
using Learun.Application.TwoDevelopment.EducationalAdministration;
namespace Learun.Application.WebApi
{
///
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2020-04-21 09:27
/// 描 述:扫码入校记录
///
public class R_EnterSchoolApi : BaseApi
{
private R_EnterSchoolIBLL r_EnterSchoolIBLL = new R_EnterSchoolBLL();
///
/// 注册接口
///
public R_EnterSchoolApi()
: base("/Learun/EducationalAdministration/R_EnterSchool")
{
Get["/pagelist"] = GetPageList;
Get["/list"] = GetList;
Get["/form"] = GetForm;
Post["/delete"] = DeleteForm;
Post["/save"] = SaveForm;
}
#region 获取数据
///
/// 获取页面显示列表分页数据
///
///
///
public Response GetPageList(dynamic _)
{
ReqPageParam parameter = this.GetReqData();
var data = r_EnterSchoolIBLL.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 GetList(dynamic _)
{
string queryJson = this.GetReqData();
var data = r_EnterSchoolIBLL.GetList(queryJson);
return Success(data);
}
///
/// 获取表单数据
///
///
///
public Response GetForm(dynamic _)
{
string keyValue = this.GetReqData();
var R_EnterSchoolData = r_EnterSchoolIBLL.GetR_EnterSchoolEntity( keyValue );
var jsonData = new {
R_EnterSchool = R_EnterSchoolData,
};
return Success(jsonData);
}
#endregion
#region 提交数据
///
/// 删除实体数据
///
///
///
public Response DeleteForm(dynamic _)
{
string keyValue = this.GetReqData();
r_EnterSchoolIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
///
/// 保存实体数据(新增、修改)
///
///
///
public Response SaveForm(dynamic _)
{
ReqFormEntity parameter = this.GetReqData();
R_EnterSchoolEntity entity = parameter.strEntity.ToObject();
r_EnterSchoolIBLL.SaveEntity(this.userInfo,parameter.keyValue,entity);
return Success("保存成功!");
}
#endregion
#region 私有类
///
/// 表单实体类
///
private class ReqFormEntity {
public string keyValue { get; set; }
public string strEntity{ get; set; }
}
#endregion
}
}