using Learun.Application.TwoDevelopment.AssetManagementSystem; using Nancy; namespace Learun.Application.WebApi { /// /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 /// Copyright (c) 2013-2018 北京泉江科技有限公司 /// 创 建:超级管理员 /// 日 期:2019-10-17 17:01 /// 描 述:盘点单列表 /// public class InventoryApi : BaseApi { private readonly Ass_InventoryIBLL inventoryIBLL = new Ass_InventoryBLL(); /// /// 注册接口 /// public InventoryApi() : base("/Learun/AssetManagementSystem/Inventory") { Get["/pagelist"] = GetPageList; Get["/form"] = GetForm; Post["/delete"] = DeleteForm; } #region  提交数据 /// /// 删除实体数据 /// /// /// public Response DeleteForm(dynamic _) { var keyValue = GetReqData(); inventoryIBLL.DeleteEntity(keyValue); return Success("删除成功!"); } #endregion #region  私有类 /// /// 表单实体类 /// private class ReqFormEntity { public string keyValue { get; set; } public string strEntity { get; set; } } #endregion #region  获取数据 /// /// 获取页面显示列表分页数据 /// /// /// public Response GetPageList(dynamic _) { var parameter = GetReqData(); var data = inventoryIBLL.GetPageList(parameter.pagination, parameter.queryJson); var jsonData = new { rows = data, parameter.pagination.total, parameter.pagination.page, parameter.pagination.records }; return Success(jsonData); } /// /// 获取表单数据 /// /// /// public Response GetForm(dynamic _) { var keyValue = GetReqData(); var Ass_InventoryData = inventoryIBLL.GetAss_InventoryEntity(keyValue); var jsonData = new { Ass_Inventory = Ass_InventoryData }; return Success(jsonData); } #endregion } }