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