diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs new file mode 100644 index 000000000..5968fcd23 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs @@ -0,0 +1,121 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Util; +using System.Data; +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-03-02 10:37 + /// 描 述:教材库存表 + /// + public class TextbookInOutController : MvcControllerBase + { + private TextbookInOutIBLL textbookInOutIBLL = new TextbookInOutBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList( string queryJson ) + { + var data = textbookInOutIBLL.GetList(queryJson); + return Success(data); + } + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = textbookInOutIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var data = textbookInOutIBLL.GetEntity(keyValue); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + textbookInOutIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue,TextbookInOutEntity entity) + { + textbookInOutIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Form.cshtml new file mode 100644 index 000000000..df551850a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Form.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "教材库存表"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
库存编码*
+ +
+
+
课程*
+
+
+
+
教材
+ +
+
+
教材号
+ +
+
+
出版号
+ +
+
+
第一作者
+ +
+
+
其他作者
+ +
+
+
出版社
+ +
+
+
版次
+ +
+
+
印次
+ +
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextbookInOut/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Form.js new file mode 100644 index 000000000..2f98dbb10 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Form.js @@ -0,0 +1,105 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-03-02 10:37 + * 描 述:教材库存表 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + $('#TextBookName').lrGirdSelect({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=TextBookInfo', + param: { strWhere: " IsDel = '0' and IsValid ='true' " }, + height: 800, + width: 1100, + selectWord: 'textbookname', + value: 'textbookname', + text: 'textbookname', + headData: + [ + { label: "教材号", name: "publishno", width: 150, align: "left" }, + { label: "教材编码", name: "textbookno", width: 150, align: "left" }, + { label: "教材名称", name: "textbookname", width: 150, align: "left" }, + { label: "作者", name: "firstauthor", width: 150, align: "left" }, + { label: "其他作者", name: "otherauthor", width: 100, align: "left" }, + { label: "出版日期", name: "pubdate", width: 100, align: "left" }, + { label: "出版社", name: "publisher", width: 100, align: "left" }, + { + label: "教材类型", name: "textbooktype", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'TextBookType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "教材性质", name: "textbooknature", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'TextBookNature', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "价格", name: "price", width: 50, align: "left" }, + { label: "版次", name: "edition", width: 100, align: "left" }, + { label: "印次", name: "impression", width: 100, align: "left" }, + ], + select: function (item) { + ////赋值 + $("#Price").val(item.price); + $("#PublishNo").val(item.publishno); + $("#TextBookNo").val(item.textbookno); + $("#TextBookName").val(item.textbookname); + $("#FirstAuthor").val(item.firstauthor); + $("#OtherAuthor").val(item.otherauthor); + $("#Publisher").val(item.publisher); + $("#Edition").val(item.edition); + $("#Impression").val(item.impression); + } + }); + $('#IsDel').val(0); + $('#FinallyNum').val(0); + $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#CreateUserID')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#CreateUserID').val(learun.clientdata.get(['userinfo']).realName); + }, + initData: function () { + if (!!selectedRow) { + $('#form').lrSetFormData(selectedRow); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('form').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('form').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextbookInOut/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.cshtml new file mode 100644 index 000000000..4967877a2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.cshtml @@ -0,0 +1,32 @@ +@{ + ViewBag.Title = "教材库存表"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+ +
+
+  查询 +
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextbookInOut/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.js new file mode 100644 index 000000000..b2cfc80c7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.js @@ -0,0 +1,120 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-03-02 10:37 + * 描 述:教材库存表 + */ +var selectedRow; +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/TextbookInOut/Form', + width: 700, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/TextbookInOut/Form?keyValue=' + keyValue, + width: 700, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextbookInOut/DeleteForm', { keyValue: keyValue }, function () { + }); + } + }); + } + }); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/TextbookInOut/GetPageList', + headData: [ + { label: '库存单号', name: 'BookCode', width: 200, align: "left" }, + { + label: "课程", name: "LessonNo", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', + key: value, + keyId: 'lessonno', + callback: function (_data) { + callback(_data['lessonname']); + } + }); + } + }, + { label: '教材名称', name: 'TextBookName', width: 200, align: "left" }, + { label: '教材号', name: 'TextBookNo', width: 200, align: "left" }, + { label: '出版号', name: 'PublishNo', width: 200, align: "left" }, + { label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" }, + { label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" }, + //{ label: '出版日期', name: 'Pubdate', width: 200, align: "left" }, + { label: '出版社', name: 'Publisher', width: 200, align: "left" }, + { label: '版次', name: 'Edition', width: 200, align: "left" }, + { label: '印次', name: 'Impression', width: 200, align: "left" }, + { label: '创建人', name: 'CreateTime', width: 200, align: "left" }, + { label: '创建用户', name: 'CrateUserID', width: 200, align: "left" }, + { label: '修改人', name: 'UpTime', width: 200, align: "left" }, + { label: '修改用户', name: 'UpUserID', width: 200, align: "left" }, + { label: '当前数量', name: 'FinallyNum', width: 200, align: "left" }, + { label: '备注', name: 'Remark', width: 200, align: "left" }, + + ], + mainId: 'ID', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js index 692230d71..adaf82b2a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js @@ -48,7 +48,7 @@ var bootstrap = function ($, learun) { $('#content').append(html); $('#' + data[i].ID).lrselect({ - value: "stuid", + value: "stuno", text: "stuname", url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', param: { code: "StuInfoBasic", strWhere: strWhere }, @@ -56,7 +56,7 @@ var bootstrap = function ($, learun) { // console.log(item); var stuid = ''; if (item) { - stuid = item.stuid; + stuid = item.stuno; } var id = $(this).attr('id'); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 89c1bfede..0d0983c53 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -841,6 +841,7 @@ + @@ -6663,6 +6664,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TextbookInOutMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TextbookInOutMap.cs new file mode 100644 index 000000000..0b47760e9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TextbookInOutMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-03-02 10:37 + /// 描 述:教材库存表 + /// + public class TextbookInOutMap : EntityTypeConfiguration + { + public TextbookInOutMap() + { + #region 表、主键 + //表 + this.ToTable("TEXTBOOKINOUT"); + //主键 + this.HasKey(t => t.ID); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index df58e66fb..4cfc93979 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -595,6 +595,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs new file mode 100644 index 000000000..27e84851e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs @@ -0,0 +1,148 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-03-02 10:37 + /// 描 述:教材库存表 + /// + public class TextbookInOutBLL : TextbookInOutIBLL + { + private TextbookInOutService textbookInOutService = new TextbookInOutService(); + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList( string queryJson ) + { + try + { + return textbookInOutService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return textbookInOutService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public TextbookInOutEntity GetEntity(string keyValue) + { + try + { + return textbookInOutService.GetEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + textbookInOutService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, TextbookInOutEntity entity) + { + try + { + textbookInOutService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs new file mode 100644 index 000000000..9804e5028 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs @@ -0,0 +1,158 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; +namespace Learun.Application.TwoDevelopment.EducationalAdministration + +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-03-02 10:37 + /// 描 述:教材库存表 + /// + public class TextbookInOutEntity + { + #region 实体成员 + /// + /// ID + /// + /// + [Column("ID")] + public string ID { get; set; } + /// + /// InorOut + /// + /// + [Column("INOROUT")] + public string InorOut { get; set; } + /// + /// BookCode + /// + /// + [Column("BOOKCODE")] + public string BookCode { get; set; } + /// + /// 课程 + /// + /// + [Column("LESSONNO")] + public string LessonNo { get; set; } + /// + /// PublishNo + /// + /// + [Column("PUBLISHNO")] + public string PublishNo { get; set; } + /// + /// 教材号 + /// + /// + [Column("TEXTBOOKNO")] + public string TextBookNo { get; set; } + /// + /// 教材名称 + /// + /// + [Column("TEXTBOOKNAME")] + public string TextBookName { get; set; } + /// + /// 第一作者 + /// + /// + [Column("FIRSTAUTHOR")] + public string FirstAuthor { get; set; } + /// + /// 其他作者 + /// + /// + [Column("OTHERAUTHOR")] + public string OtherAuthor { get; set; } + /// + /// 出版日期 + /// + /// + [Column("PUBDATE")] + public DateTime? Pubdate { get; set; } + /// + /// 出版社 + /// + /// + [Column("PUBLISHER")] + public string Publisher { get; set; } + /// + /// 版次 + /// + /// + [Column("EDITION")] + public string Edition { get; set; } + /// + /// 印次 + /// + /// + [Column("IMPRESSION")] + public string Impression { get; set; } + /// + /// 创建人 + /// + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// 创建版次 + /// + /// + [Column("CRATEUSERID")] + public string CrateUserID { get; set; } + /// + /// UpTime + /// + /// + [Column("UPTIME")] + public DateTime? UpTime { get; set; } + /// + /// UpUserID + /// + /// + [Column("UPUSERID")] + public string UpUserID { get; set; } + /// + /// FinallyNum + /// + /// + [Column("FINALLYNUM")] + public decimal? FinallyNum { get; set; } + /// + /// variate + /// + /// + [Column("VARIATE")] + public decimal? variate { get; set; } + /// + /// Remark + /// + /// + [Column("REMARK")] + public string Remark { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.ID = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.ID = keyValue; + } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs new file mode 100644 index 000000000..706c97878 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs @@ -0,0 +1,55 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-03-02 10:37 + /// 描 述:教材库存表 + /// + public interface TextbookInOutIBLL + { + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + IEnumerable GetList( string queryJson ); + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取实体数据 + /// + /// 主键 + /// + TextbookInOutEntity GetEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, TextbookInOutEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs new file mode 100644 index 000000000..7753ab5f1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs @@ -0,0 +1,204 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-03-02 10:37 + /// 描 述:教材库存表 + /// + public class TextbookInOutService : RepositoryFactory + { + #region 构造函数和属性 + + private string fieldSql; + /// + /// 构造方法 + /// + public TextbookInOutService() + { + fieldSql=@" + t.ID, + t.InorOut, + t.BookCode, + t.LessonNo, + t.PublishNo, + t.TextBookNo, + t.TextBookName, + t.FirstAuthor, + t.OtherAuthor, + t.Pubdate, + t.Publisher, + t.Edition, + t.Impression, + t.CreateTime, + t.CrateUserID, + t.UpTime, + t.UpUserID, + t.FinallyNum, + t.variate, + t.Remark + "; + } + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 条件参数 + /// + public IEnumerable GetList( string queryJson ) + { + try + { + //参考写法 + //var queryParam = queryJson.ToJObject(); + // 虚拟参数 + //var dp = new DynamicParameters(new { }); + //dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM TextbookInOut t "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 条件参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM TextbookInOut t "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public TextbookInOutEntity GetEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t=>t.ID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, TextbookInOutEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 0c9c09fe1..2f14e2a28 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -1802,6 +1802,10 @@ + + + +