You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TextBookOutController.cs 5.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.EducationalAdministration;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System;
  7. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  11. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2022-03-05 11:17
  14. /// 描 述:TextBookOut
  15. /// </summary>
  16. public class TextBookOutController : MvcControllerBase
  17. {
  18. private TextBookOutIBLL textBookOutIBLL = new TextBookOutBLL();
  19. private TextBookInOutIBLL textBookInOutIBLL = new TextbookInOutBLL();
  20. #region 视图功能
  21. /// <summary>
  22. /// 主页面
  23. /// <summary>
  24. /// <returns></returns>
  25. [HttpGet]
  26. public ActionResult Index()
  27. {
  28. return View();
  29. }
  30. /// <summary>
  31. /// 表单页
  32. /// <summary>
  33. /// <returns></returns>
  34. [HttpGet]
  35. public ActionResult Form()
  36. {
  37. return View();
  38. }
  39. /// <summary>
  40. /// 入库表单页
  41. /// <summary>
  42. /// <returns></returns>
  43. [HttpGet]
  44. public ActionResult FormOut()
  45. {
  46. ViewBag.BookCode = "CK" + DateTime.Now.ToString("yyyyMMddHHmmss");
  47. return View();
  48. }
  49. /// <summary>
  50. /// 明细查看
  51. /// <summary>
  52. /// <returns></returns>
  53. [HttpGet]
  54. public ActionResult FormView()
  55. {
  56. return View();
  57. }
  58. /// <summary>
  59. /// 明细删除
  60. /// <summary>
  61. /// <returns></returns>
  62. [HttpGet]
  63. public ActionResult FormDelete()
  64. {
  65. return View();
  66. }
  67. #endregion
  68. #region 获取数据
  69. /// <summary>
  70. /// 获取页面显示列表数据
  71. /// </summary>
  72. /// <param name="pagination">分页参数</param>
  73. /// <param name="queryJson">查询参数</param>
  74. /// <returns></returns>
  75. [HttpGet]
  76. [AjaxOnly]
  77. public ActionResult GetPageList(string pagination, string queryJson)
  78. {
  79. Pagination paginationobj = pagination.ToObject<Pagination>();
  80. var data = textBookOutIBLL.GetPageList(paginationobj, queryJson);
  81. var jsonData = new
  82. {
  83. rows = data,
  84. total = paginationobj.total,
  85. page = paginationobj.page,
  86. records = paginationobj.records
  87. };
  88. return Success(jsonData);
  89. }
  90. /// <summary>
  91. /// 获取表单数据
  92. /// </summary>
  93. /// <param name="keyValue">主键</param>
  94. /// <returns></returns>
  95. [HttpGet]
  96. [AjaxOnly]
  97. public ActionResult GetFormData(string keyValue)
  98. {
  99. var TextBookInOutData = textBookInOutIBLL.GetKCEntity(keyValue);
  100. var TextBookOutData = textBookOutIBLL.GetListByCode(TextBookInOutData.BookCode);
  101. var jsonData = new
  102. {
  103. TextBookInOut = TextBookInOutData,
  104. TextBookOut = TextBookOutData,
  105. };
  106. return Success(jsonData);
  107. }
  108. /// <summary>
  109. /// 获取表单数据
  110. /// </summary>
  111. /// <param name="keyValue">主键</param>
  112. /// <returns></returns>
  113. [HttpGet]
  114. [AjaxOnly]
  115. public ActionResult GetFormDataEdit(string keyValue)
  116. {
  117. var TextBookInOutData = textBookInOutIBLL.GetKCEntity(keyValue);
  118. var jsonData = new
  119. {
  120. TextBookInOut = TextBookInOutData,
  121. };
  122. return Success(jsonData);
  123. }
  124. #endregion
  125. #region 提交数据
  126. /// <summary>
  127. /// 删除实体数据
  128. /// </summary>
  129. /// <param name="keyValue">主键</param>
  130. /// <returns></returns>
  131. [HttpPost]
  132. [AjaxOnly]
  133. public ActionResult DeleteForm(string keyValue)
  134. {
  135. textBookOutIBLL.DeleteEntity(keyValue);
  136. return Success("删除成功!");
  137. }
  138. /// <summary>
  139. /// 保存实体数据(新增、修改)
  140. /// </summary>
  141. /// <param name="keyValue">主键</param>
  142. /// <param name="strEntity">实体</param>
  143. /// <returns></returns>
  144. [HttpPost]
  145. [ValidateAntiForgeryToken]
  146. [AjaxOnly]
  147. public ActionResult SaveForm(string keyValue, string strEntity, string strTextBookOutList)
  148. {
  149. TextbookInOutEntity entity = strEntity.ToObject<TextbookInOutEntity>();
  150. List<TextBookOutEntity> textBookOutList = strTextBookOutList.ToObject<List<TextBookOutEntity>>();
  151. textBookOutIBLL.SaveEntity(keyValue, entity, textBookOutList);
  152. if (keyValue != null)
  153. {
  154. }
  155. return Success("保存成功!");
  156. }
  157. #endregion
  158. }
  159. }