@@ -0,0 +1,117 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.Web.Areas.LR_Desktop.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 10:04 | |||
/// 描 述:计算项目管理 | |||
/// </summary> | |||
public class CalculateProjectController : MvcControllerBase | |||
{ | |||
private CalculateProjectIBLL calculateProjectIBLL = new CalculateProjectBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = calculateProjectIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var CalculateProjectData = calculateProjectIBLL.GetCalculateProjectEntity( keyValue ); | |||
var jsonData = new { | |||
CalculateProject = CalculateProjectData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
calculateProjectIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
CalculateProjectEntity entity = strEntity.ToObject<CalculateProjectEntity>(); | |||
calculateProjectIBLL.SaveEntity(keyValue,entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,125 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.Web.Areas.LR_Desktop.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:26 | |||
/// 描 述:公式子表 | |||
/// </summary> | |||
public class FormulaChildController : MvcControllerBase | |||
{ | |||
private FormulaChildIBLL formulaChildIBLL = new FormulaChildBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取左侧树形数据 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetTree() | |||
{ | |||
var data = formulaChildIBLL.GetTree(); | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = formulaChildIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var FormulaChildData = formulaChildIBLL.GetFormulaChildEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
FormulaChild = FormulaChildData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
formulaChildIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveList(string mainEntity, List<FormulaChildEntity> strEntity) | |||
{ | |||
FormulaChildEntity model = mainEntity.ToObject<FormulaChildEntity>(); | |||
formulaChildIBLL.SaveList(model.MainId, strEntity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,141 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.Web.Areas.LR_Desktop.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:07 | |||
/// 描 述:公式管理 | |||
/// </summary> | |||
public class FormulaMainController : MvcControllerBase | |||
{ | |||
private FormulaMainIBLL formulaMainIBLL = new FormulaMainBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult FormChild() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = formulaMainIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var FormulaMainData = formulaMainIBLL.GetFormulaMainEntity( keyValue ); | |||
var jsonData = new { | |||
FormulaMain = FormulaMainData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取子表数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormChildList(string keyValue) | |||
{ | |||
var list = formulaMainIBLL.GetFormChildList(keyValue); | |||
return Success(list); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
formulaMainIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
FormulaMainEntity entity = strEntity.ToObject<FormulaMainEntity>(); | |||
formulaMainIBLL.SaveEntity(keyValue,entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
@{ | |||
ViewBag.Title = "计算项目管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="CalculateProject"> | |||
<div class="lr-form-item-title">计算项<font face="宋体">*</font></div> | |||
<input id="Name" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="CalculateProject"> | |||
<div class="lr-form-item-title">类型<font face="宋体">*</font></div> | |||
<div id="Type" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="CalculateProject" id="valueDiv" style="display: none"> | |||
<div class="lr-form-item-title">值<font face="宋体">*</font></div> | |||
<input id="Value" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="CalculateProject" > | |||
<div class="lr-form-item-title">排序<font face="宋体">*</font></div> | |||
<input id="Sort" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="CalculateProject"> | |||
<div class="lr-form-item-title">选项<font face="宋体">*</font></div> | |||
<div id="IsEnable"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/CalculateProject/Form.js") |
@@ -0,0 +1,70 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-06-22 10:04 | |||
* 描 述:计算项目管理 | |||
*/ | |||
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 () { | |||
$('#Type').lrDataItemSelect({ | |||
code: 'projectType', select: function (item) { | |||
if (item) { | |||
if (item.id == '常量') { | |||
$("#valueDiv").attr("style", "display:block;"); | |||
} else { | |||
$("#valueDiv").attr("style", "display:none;"); | |||
} | |||
} | |||
} | |||
}); | |||
$('#IsEnable').lrRadioCheckbox({ | |||
type: 'radio', | |||
code: 'EnableStatus', | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/LR_Desktop/CalculateProject/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var strEntity = JSON.stringify($('body').lrGetFormData()); | |||
if (strEntity.type == '常量' && !strEntity.value) { | |||
return learun.alert.warning('值不能为空!'); | |||
} | |||
var postData = { | |||
strEntity: strEntity | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/LR_Desktop/CalculateProject/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,41 @@ | |||
@{ | |||
ViewBag.Title = "计算项目管理"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">计算项</div> | |||
<input id="Name" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">类型</div> | |||
<div id="Type"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/CalculateProject/Index.js") |
@@ -0,0 +1,111 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-06-22 10:04 | |||
* 描 述:计算项目管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#Type').lrDataItemSelect({ code: 'projectType' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/LR_Desktop/CalculateProject/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/LR_Desktop/CalculateProject/Form?keyValue=' + keyValue, | |||
width: 600, | |||
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 + '/LR_Desktop/CalculateProject/DeleteForm', { keyValue: keyValue}, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/LR_Desktop/CalculateProject/GetPageList', | |||
headData: [ | |||
{ label: "计算项", name: "Name", width: 150, align: "left"}, | |||
{ label: "类型", name: "Type", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op,$cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'projectType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
}}, | |||
{ label: "值", name: "Value", width: 100, align: "left"}, | |||
{ label: "排序", name: "Sort", width: 100, align: "left"}, | |||
{ label: "状态", name: "IsEnable", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == 0 ? "<span class=\"label label-danger\">禁用</span>" : "<span class=\"label label-success\">启用</span>"; | |||
}}, | |||
], | |||
mainId:'Id', | |||
isPage: true, | |||
sidx: 'Sort', | |||
sord: 'ASC', | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,19 @@ | |||
@{ | |||
ViewBag.Title = "公式子表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="FormulaChild" > | |||
<div class="lr-form-item-title">上级<font face="宋体">*</font></div> | |||
<div id="MainId" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="FormulaChild" > | |||
<div class="lr-form-item-title">计算项目<font face="宋体">*</font></div> | |||
<div id="ProjectId" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="FormulaChild" > | |||
<div class="lr-form-item-title">顺序<font face="宋体">*</font></div> | |||
<input id="Sort" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/FormulaChild/Form.js") |
@@ -0,0 +1,52 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-06-22 11:26 | |||
* 描 述:公式子表 | |||
*/ | |||
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 () { | |||
$('#MainId').lrDataSourceSelect({ code: 'FormulaMain',value: 'id',text: 'name' }); | |||
$('#ProjectId').lrDataSourceSelect({ code: 'CalculateProject',value: 'id',text: 'name' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/LR_Desktop/FormulaChild/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/LR_Desktop/FormulaChild/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,37 @@ | |||
@{ | |||
ViewBag.Title = "公式子表"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout lr-layout-left-center" id="lr_layout"> | |||
<div class="lr-layout-left"> | |||
<div class="lr-layout-wrap"> | |||
<div class="lr-layout-title lrlg ">树形列表</div> | |||
<div id="dataTree" class="lr-layout-body"></div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap "> | |||
<div class="lr-layout-title"> | |||
<span id="titleinfo" class="lrlg">列表信息</span> | |||
</div> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
<a id="lr_main" class="btn btn-default"><i class="fa fa-plus"></i> 分类管理</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/FormulaChild/Index.js") |
@@ -0,0 +1,136 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-06-22 11:26 | |||
* 描 述:公式子表 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 初始化左侧树形数据 | |||
$('#dataTree').lrtree({ | |||
url: top.$.rootUrl + '/LR_Desktop/FormulaChild/GetTree', | |||
nodeClick: function (item) { | |||
page.search({ MainId: item.value }); | |||
} | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/LR_Desktop/FormulaChild/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/LR_Desktop/FormulaChild/Form?keyValue=' + keyValue, | |||
width: 600, | |||
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 + '/LR_Desktop/FormulaChild/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
//分类管理 | |||
$('#lr_main').on('click', function () { | |||
learun.layerForm({ | |||
id: 'index', | |||
title: '分类管理', | |||
url: top.$.rootUrl + '/LR_Desktop/FormulaMain/Index', | |||
width: 1000, | |||
height: 700, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/LR_Desktop/FormulaChild/GetPageList', | |||
headData: [ | |||
{ | |||
label: "上级", name: "MainId", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'FormulaMain', | |||
key: value, | |||
keyId: '', | |||
callback: function (_data) { | |||
callback(_data['']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "计算项目", name: "ProjectId", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CalculateProject', | |||
key: value, | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "顺序", name: "Sort", width: 100, 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(); | |||
} |
@@ -0,0 +1,23 @@ | |||
@{ | |||
ViewBag.Title = "公式管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="FormulaMain" > | |||
<div class="lr-form-item-title">名称<font face="宋体">*</font></div> | |||
<input id="Name" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="FormulaMain" > | |||
<div class="lr-form-item-title">排序<font face="宋体">*</font></div> | |||
<input id="Sort" type="number" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="FormulaMain" > | |||
<div class="lr-form-item-title">选项<font face="宋体">*</font></div> | |||
<div id="IsEnable"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="FormulaMain" > | |||
<div class="lr-form-item-title">描述</div> | |||
<textarea id="Desc" class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/FormulaMain/Form.js") |
@@ -0,0 +1,54 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-06-22 11:07 | |||
* 描 述:公式管理 | |||
*/ | |||
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 () { | |||
$('#IsEnable').lrRadioCheckbox({ | |||
type: 'radio', | |||
code: 'EnableStatus', | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/LR_Desktop/FormulaMain/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/LR_Desktop/FormulaMain/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,18 @@ | |||
@{ | |||
ViewBag.Title = "公式子表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">上级<font face="宋体">*</font></div> | |||
<div id="MainId" isvalid="yes" checkexpession="NotNull"></div><a id="lr_add" class="btn" style="position: relative;margin: -48px 0 0 -67px;"><i class="fa fa-plus"></i> </a> | |||
</div> | |||
<div id="content1"> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" style="color: red; margin-top: 20px;"> | |||
<div class="lr-form-item-title">公式:</div> | |||
<div id="result" style="margin-top: 5px;"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/FormulaMain/FormChild.js") |
@@ -0,0 +1,193 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-06-22 11:26 | |||
* 描 述:公式子表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var arr = []; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
page.addcontent(); | |||
}, | |||
bind: function () { | |||
$('#MainId').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' }); | |||
$('#ProjectId').lrDataSourceSelect({ code: 'CalculateProject', value: 'id', text: 'name' }); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
page.addcontent(); | |||
}); | |||
// 删除 | |||
$('#form').on('click', | |||
'.child_delete', | |||
function () { | |||
var id = $(this).attr("id"); | |||
//删除当前行 | |||
$('#' + id).remove(); | |||
//从数组删除 | |||
//如果存在删除 | |||
removeByValue(arr, 'iid', id); | |||
//重新排序并显示 | |||
arr.sort(sortBy("Sort")); | |||
page.refreshRes(); | |||
}); | |||
//失去焦点,重新排序并显示 | |||
$('#form').on('blur', | |||
'.sort', | |||
function () { | |||
var id = $(this)[0].id; | |||
var parId = id.replace('Sort', ''); | |||
arr.forEach(m => { | |||
if (m.iid == parId) { | |||
return m.Sort = $('#' + id).val(); | |||
} | |||
}); | |||
arr.sort(sortBy("Sort")); | |||
page.refreshRes(); | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/LR_Desktop/FormulaMain/GetFormChildList?keyValue=' + keyValue, function (data) { | |||
$('#content1').html(''); | |||
var html = ''; | |||
if (data) { | |||
$('#MainId').lrselectSet(data[0].MainId); | |||
for (var i = 0; i < data.length; i++) { | |||
var id = learun.newGuid(); | |||
var html = ''; | |||
html += '<div id="' + id + '">'; | |||
html += '<div class="col-xs-6 lr-form-item" data-table="FormulaChild">'; | |||
html += '<div class="lr-form-item-title"><a id="' + id + '" class="btn child_delete"><i class="fa fa-trash-o"></i> </a>计算项目<font face="宋体">*</font></div>'; | |||
html += '<div id="pro' + id + '" class="project" isvalid="yes" checkexpession="NotNull"></div>'; | |||
html += '</div>'; | |||
html += '<div class="col-xs-6 lr-form-item" data-table="FormulaChild">'; | |||
html += '<div class="lr-form-item-title">顺序<font face="宋体">*</font></div>'; | |||
html += '<input id="Sort' + id + '" type="number" class="form-control sort" isvalid="yes" checkexpession="NotNull" value="' + data[i].Sort + '"/>'; | |||
html += '</div>'; | |||
html += '</div>'; | |||
$('#content1').append(html); | |||
$('#pro' + id).lrDataSourceSelect({ | |||
code: 'CalculateProject', | |||
value: 'id', | |||
text: 'name', | |||
select: | |||
function (item) { | |||
if (item) { | |||
var id = $(this).attr('id'); | |||
var parId = id.replace('pro', ''); | |||
if (arr.indexOf(parId) != -1) { | |||
//如果存在删除 | |||
removeByValue(arr, 'iid', parId); | |||
} | |||
arr.push({ iid: parId, ProjectId: item.id, ProjectName: item.name, Sort: $('#Sort' + parId).val() }); | |||
arr.sort(sortBy("Sort")); | |||
page.refreshRes(); | |||
} | |||
} | |||
}); | |||
$('#pro' + id).lrselectSet(data[i].ProjectId); | |||
} | |||
} else { | |||
page.addcontent(); | |||
} | |||
}); | |||
} | |||
}, | |||
addcontent: function () { | |||
var id = learun.newGuid(); | |||
var html = ''; | |||
html += '<div id="' + id + '">'; | |||
html += '<div class="col-xs-6 lr-form-item" data-table="FormulaChild">'; | |||
html += '<div class="lr-form-item-title"><a id="' + id + '" class="btn child_delete"><i class="fa fa-trash-o"></i> </a>计算项目<font face="宋体">*</font></div>'; | |||
html += '<div id="pro' + id + '" class="project" isvalid="yes" checkexpession="NotNull"></div>'; | |||
html += '</div>'; | |||
html += '<div class="col-xs-6 lr-form-item" data-table="FormulaChild">'; | |||
html += '<div class="lr-form-item-title">顺序<font face="宋体">*</font></div>'; | |||
html += '<input id="Sort' + id + '" type="number" class="form-control sort" isvalid="yes" checkexpession="NotNull" />'; | |||
html += '</div>'; | |||
html += '</div>'; | |||
$('#content1').append(html); | |||
$('#pro' + id).lrDataSourceSelect({ | |||
code: 'CalculateProject', | |||
value: 'id', | |||
text: 'name', | |||
select: | |||
function (item) { | |||
if (item) { | |||
var id = $(this).attr('id'); | |||
var parId = id.replace('pro', ''); | |||
if (arr.indexOf(parId) != -1) { | |||
//如果存在删除 | |||
removeByValue(arr, 'iid', parId); | |||
} | |||
arr.push({ iid: parId, ProjectId: item.id, ProjectName: item.name, Sort: $('#Sort' + parId).val() }); | |||
arr.sort(sortBy("Sort")); | |||
page.refreshRes(); | |||
} | |||
} | |||
}); | |||
}, | |||
refreshRes: function () { | |||
//页面显示公式结果 | |||
var text = ''; | |||
arr.forEach(m => { | |||
text += m.ProjectName; | |||
}); | |||
$('#result').html(text); | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var strEntity = JSON.stringify($('body').lrGetFormData()); | |||
var postData = { | |||
mainEntity: strEntity, | |||
strEntity: arr | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/LR_Desktop/FormulaChild/SaveList', postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
//删除数组元素 | |||
function removeByValue(arr, attr, value) { | |||
var index = 0; | |||
for (var i in arr) { | |||
if (arr[i][attr] == value) { | |||
index = i; | |||
break; | |||
} | |||
} | |||
arr.splice(index, 1); | |||
} | |||
//数组排序 | |||
function sortBy(props) { | |||
return function (a, b) { | |||
return a[props] - b[props]; | |||
} | |||
} | |||
} |
@@ -0,0 +1,38 @@ | |||
@{ | |||
ViewBag.Title = "公式管理"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">名称</div> | |||
<input id="Name" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_editgs" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑公式</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/FormulaMain/Index.js") |
@@ -0,0 +1,117 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-06-22 11:07 | |||
* 描 述:公式管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/LR_Desktop/FormulaMain/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/LR_Desktop/FormulaMain/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 编辑公式 | |||
$('#lr_editgs').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/LR_Desktop/FormulaMain/FormChild?keyValue=' + keyValue, | |||
width: 600, | |||
height: 500, | |||
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 + '/LR_Desktop/FormulaMain/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetPageList', | |||
headData: [ | |||
{ label: "名称", name: "Name", width: 100, align: "left" }, | |||
{ label: "排序", name: "Sort", width: 100, align: "left" }, | |||
{ | |||
label: "状态", name: "IsEnable", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == 0 ? "<span class=\"label label-danger\">禁用</span>" : "<span class=\"label label-success\">启用</span>"; | |||
} | |||
}, | |||
{ label: "公式", name: "Result", width: 250, align: "left" }, | |||
{ label: "描述", name: "Desc", width: 100, 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(); | |||
} |
@@ -814,6 +814,9 @@ | |||
<Compile Include="Areas\LogisticsManagement\Controllers\ProjectTypeManageController.cs" /> | |||
<Compile Include="Areas\LogisticsManagement\Controllers\ProjectManageController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\FillinFromController.cs" /> | |||
<Compile Include="Areas\LR_Desktop\Controllers\CalculateProjectController.cs" /> | |||
<Compile Include="Areas\LR_Desktop\Controllers\FormulaMainController.cs" /> | |||
<Compile Include="Areas\LR_Desktop\Controllers\FormulaChildController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -1285,6 +1288,7 @@ | |||
<Content Include="Areas\LR_Desktop\Views\DTSetting\App\AppIndex.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\DTSetting\PC\PcIndex.css" /> | |||
<Content Include="Areas\LR_Desktop\Views\DTSetting\PC\PcIndex.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\FormulaMain\FormChild.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\MessageRind\Form.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Form.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Index.js" /> | |||
@@ -6490,6 +6494,18 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\FillinFrom\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\FillinFrom\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\FillinFrom\Form.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\CalculateProject\Index.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\CalculateProject\Index.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\CalculateProject\Form.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\CalculateProject\Form.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\FormulaMain\Index.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\FormulaMain\Index.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\FormulaMain\Form.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\FormulaMain\Form.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\FormulaChild\Index.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\FormulaChild\Index.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\FormulaChild\Form.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\FormulaChild\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElectivePre\" /> | |||
@@ -7323,6 +7339,7 @@ | |||
<Content Include="Areas\LogisticsManagement\Views\ProjectPhaseManage\Index.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ProjectDataManage\Form.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ProjectDataManage\Index.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\FormulaMain\FormChild.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 10:04 | |||
/// 描 述:计算项目管理 | |||
/// </summary> | |||
public class CalculateProjectMap : EntityTypeConfiguration<CalculateProjectEntity> | |||
{ | |||
public CalculateProjectMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("CALCULATEPROJECT"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:26 | |||
/// 描 述:公式子表 | |||
/// </summary> | |||
public class FormulaChildMap : EntityTypeConfiguration<FormulaChildEntity> | |||
{ | |||
public FormulaChildMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("FORMULACHILD"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:07 | |||
/// 描 述:公式管理 | |||
/// </summary> | |||
public class FormulaMainMap : EntityTypeConfiguration<FormulaMainEntity> | |||
{ | |||
public FormulaMainMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("FORMULAMAIN"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -566,6 +566,9 @@ | |||
<Compile Include="ReceiveSendFeeManagement\FD_BudgetBasicsMap.cs" /> | |||
<Compile Include="ReceiveSendFeeManagement\FD_IncomeManageMap.cs" /> | |||
<Compile Include="ReceiveSendFeeManagement\FD_PayManageMap.cs" /> | |||
<Compile Include="LR_Desktop\CalculateProjectMap.cs" /> | |||
<Compile Include="LR_Desktop\FormulaMainMap.cs" /> | |||
<Compile Include="LR_Desktop\FormulaChildMap.cs" /> | |||
<Compile Include="LogisticsManagement\ProjectTypeManageMap.cs" /> | |||
<Compile Include="LogisticsManagement\ProjectManageMap.cs" /> | |||
<Compile Include="EducationalAdministration\FillinFromMap.cs" /> | |||
@@ -0,0 +1,125 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 10:04 | |||
/// 描 述:计算项目管理 | |||
/// </summary> | |||
public class CalculateProjectBLL : CalculateProjectIBLL | |||
{ | |||
private CalculateProjectService calculateProjectService = new CalculateProjectService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<CalculateProjectEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return calculateProjectService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取CalculateProject表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public CalculateProjectEntity GetCalculateProjectEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return calculateProjectService.GetCalculateProjectEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
calculateProjectService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, CalculateProjectEntity entity) | |||
{ | |||
try | |||
{ | |||
calculateProjectService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 10:04 | |||
/// 描 述:计算项目管理 | |||
/// </summary> | |||
public class CalculateProjectEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 计算项名称 | |||
/// </summary> | |||
[Column("NAME")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 类型(常量、变量) | |||
/// </summary> | |||
[Column("TYPE")] | |||
public string Type { get; set; } | |||
/// <summary> | |||
/// 常量值 | |||
/// </summary> | |||
[Column("VALUE")] | |||
public string Value { get; set; } | |||
/// <summary> | |||
/// 是否启用 | |||
/// </summary> | |||
[Column("ISENABLE")] | |||
public int? IsEnable { get; set; } | |||
/// <summary> | |||
/// 排序 | |||
/// </summary> | |||
[Column("SORT")] | |||
public int? Sort { get; set; } | |||
/// <summary> | |||
/// 创建时间 | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// 创建人 | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// 创建人 | |||
/// </summary> | |||
[Column("CREATEUSERNAME")] | |||
public string CreateUserName { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
this.CreateTime=DateTime.Now; | |||
var userinfo = LoginUserInfo.Get(); | |||
this.CreateUserId = userinfo.userId; | |||
this.CreateUserName = userinfo.realName; | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,48 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 10:04 | |||
/// 描 述:计算项目管理 | |||
/// </summary> | |||
public interface CalculateProjectIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<CalculateProjectEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取CalculateProject表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
CalculateProjectEntity GetCalculateProjectEntity(string keyValue); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, CalculateProjectEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,158 @@ | |||
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.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 10:04 | |||
/// 描 述:计算项目管理 | |||
/// </summary> | |||
public class CalculateProjectService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<CalculateProjectEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.Id, | |||
t.Name, | |||
t.Type, | |||
t.Value, | |||
t.IsEnable,t.Sort | |||
"); | |||
strSql.Append(" FROM CalculateProject t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["Name"].IsEmpty()) | |||
{ | |||
dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Name Like @Name "); | |||
} | |||
if (!queryParam["Type"].IsEmpty()) | |||
{ | |||
dp.Add("Type",queryParam["Type"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Type = @Type "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<CalculateProjectEntity>(strSql.ToString(),dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取CalculateProject表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public CalculateProjectEntity GetCalculateProjectEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<CalculateProjectEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<CalculateProjectEntity>(t=>t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, CalculateProjectEntity 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 | |||
} | |||
} |
@@ -0,0 +1,191 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:26 | |||
/// 描 述:公式子表 | |||
/// </summary> | |||
public class FormulaChildBLL : FormulaChildIBLL | |||
{ | |||
private FormulaChildService formulaChildService = new FormulaChildService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<FormulaChildEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return formulaChildService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取FormulaChild表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public FormulaChildEntity GetFormulaChildEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return formulaChildService.GetFormulaChildEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取左侧树形数据 | |||
/// <summary> | |||
/// <returns></returns> | |||
public List<TreeModel> GetTree() | |||
{ | |||
try | |||
{ | |||
DataTable list = formulaChildService.GetSqlTree(); | |||
List<TreeModel> treeList = new List<TreeModel>(); | |||
foreach (DataRow item in list.Rows) | |||
{ | |||
TreeModel node = new TreeModel | |||
{ | |||
id = item["Id"].ToString(), | |||
text = item["Name"].ToString(), | |||
value = item["Id"].ToString(), | |||
showcheck = false, | |||
checkstate = 0, | |||
isexpand = true, | |||
parentId = "0", | |||
}; | |||
treeList.Add(node); | |||
} | |||
return treeList.ToTree(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
formulaChildService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, FormulaChildEntity entity) | |||
{ | |||
try | |||
{ | |||
formulaChildService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveList(string MainId, List<FormulaChildEntity> strEntity) | |||
{ | |||
try | |||
{ | |||
formulaChildService.SaveList(MainId, strEntity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,85 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:26 | |||
/// 描 述:公式子表 | |||
/// </summary> | |||
public class FormulaChildEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 主表Id | |||
/// </summary> | |||
[Column("MAINID")] | |||
public string MainId { get; set; } | |||
/// <summary> | |||
/// 计算项目Id | |||
/// </summary> | |||
[Column("PROJECTID")] | |||
public string ProjectId { get; set; } | |||
/// <summary> | |||
/// 顺序 | |||
/// </summary> | |||
[Column("SORT")] | |||
public int? Sort { get; set; } | |||
/// <summary> | |||
/// 创建时间 | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// 创建人 | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// 创建人 | |||
/// </summary> | |||
[Column("CREATEUSERNAME")] | |||
public string CreateUserName { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
this.CreateTime = DateTime.Now; | |||
var userinfo = LoginUserInfo.Get(); | |||
this.CreateUserId = userinfo.userId; | |||
this.CreateUserName = userinfo.realName; | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
/// <summary> | |||
/// 计算项名称 | |||
/// </summary> | |||
[NotMapped] | |||
public string ProjectName { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,55 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:26 | |||
/// 描 述:公式子表 | |||
/// </summary> | |||
public interface FormulaChildIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<FormulaChildEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取FormulaChild表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
FormulaChildEntity GetFormulaChildEntity(string keyValue); | |||
/// <summary> | |||
/// 获取左侧树形数据 | |||
/// <summary> | |||
/// <returns></returns> | |||
List<TreeModel> GetTree(); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, FormulaChildEntity entity); | |||
void SaveList(string MainId, List<FormulaChildEntity> strEntity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,217 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:26 | |||
/// 描 述:公式子表 | |||
/// </summary> | |||
public class FormulaChildService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<FormulaChildEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.Id, | |||
t.MainId, | |||
t.ProjectId, | |||
t.Sort | |||
"); | |||
strSql.Append(" FROM FormulaChild t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["MainId"].IsEmpty()) | |||
{ | |||
dp.Add("MainId", queryParam["MainId"].ToString(), DbType.String); | |||
strSql.Append(" AND t.MainId=@MainId "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<FormulaChildEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取FormulaChild表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public FormulaChildEntity GetFormulaChildEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<FormulaChildEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取树形数据 | |||
/// </summary> | |||
/// <returns></returns> | |||
public DataTable GetSqlTree() | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindTable(" SELECT Id,Name FROM FormulaMain where IsEnable=1 order by Sort"); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<FormulaChildEntity>(t => t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, FormulaChildEntity 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); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 添加子表 | |||
/// </summary> | |||
/// <param name="MainId"></param> | |||
/// <param name="strEntity"></param> | |||
public void SaveList(string MainId, List<FormulaChildEntity> strEntity) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||
try | |||
{ | |||
var delSql = $"delete from FormulaChild where MainId='{MainId}'"; | |||
db.ExecuteBySql(delSql); | |||
var projectNames= strEntity.OrderBy(x => x.Sort).Select(x=>x.ProjectName).ToList(); | |||
var result = string.Join("", projectNames.ToArray()); | |||
string updSql = $"update FormulaMain set Result='{result}' where Id='{MainId}'"; | |||
db.ExecuteBySql(updSql); | |||
foreach (var item in strEntity) | |||
{ | |||
FormulaChildEntity entity = new FormulaChildEntity(); | |||
entity.Create(); | |||
entity.MainId = MainId; | |||
entity.ProjectId = item.ProjectId; | |||
entity.Sort = item.Sort; | |||
db.Insert(entity); | |||
} | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,150 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:07 | |||
/// 描 述:公式管理 | |||
/// </summary> | |||
public class FormulaMainBLL : FormulaMainIBLL | |||
{ | |||
private FormulaMainService formulaMainService = new FormulaMainService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<FormulaMainEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return formulaMainService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取FormulaMain表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public FormulaMainEntity GetFormulaMainEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return formulaMainService.GetFormulaMainEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取FormulaMain表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public IEnumerable<FormulaChildEntity> GetFormChildList(string keyValue) | |||
{ | |||
try | |||
{ | |||
return formulaMainService.GetFormChildList(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
formulaMainService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, FormulaMainEntity entity) | |||
{ | |||
try | |||
{ | |||
formulaMainService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:07 | |||
/// 描 述:公式管理 | |||
/// </summary> | |||
public class FormulaMainEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
[Column("NAME")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 描述 | |||
/// </summary> | |||
[Column("DESC")] | |||
public string Desc { get; set; } | |||
/// <summary> | |||
/// 排序 | |||
/// </summary> | |||
[Column("SORT")] | |||
public int? Sort { get; set; } | |||
/// <summary> | |||
/// 是否启用 | |||
/// </summary> | |||
[Column("ISENABLE")] | |||
public int? IsEnable { get; set; } | |||
/// <summary> | |||
/// 公式 | |||
/// </summary> | |||
[Column("RESULT")] | |||
public string Result { get; set; } | |||
/// <summary> | |||
/// 创建时间 | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// 创建人 | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// 创建人 | |||
/// </summary> | |||
[Column("CREATEUSERNAME")] | |||
public string CreateUserName { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
this.CreateTime = DateTime.Now; | |||
var userinfo = LoginUserInfo.Get(); | |||
this.CreateUserId = userinfo.userId; | |||
this.CreateUserName = userinfo.realName; | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,50 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:07 | |||
/// 描 述:公式管理 | |||
/// </summary> | |||
public interface FormulaMainIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<FormulaMainEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取FormulaMain表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
FormulaMainEntity GetFormulaMainEntity(string keyValue); | |||
IEnumerable<FormulaChildEntity> GetFormChildList(string keyValue); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, FormulaMainEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,179 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-22 11:07 | |||
/// 描 述:公式管理 | |||
/// </summary> | |||
public class FormulaMainService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<FormulaMainEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.Id, | |||
t.Name, | |||
t.Sort, | |||
t.IsEnable, | |||
t.[Desc], | |||
t.[Result] | |||
"); | |||
strSql.Append(" FROM FormulaMain t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["Name"].IsEmpty()) | |||
{ | |||
dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Name Like @Name "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<FormulaMainEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取FormulaMain表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public FormulaMainEntity GetFormulaMainEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<FormulaMainEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取子表数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public IEnumerable<FormulaChildEntity> GetFormChildList(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<FormulaChildEntity>(x => x.MainId == keyValue).OrderBy(x => x.Sort); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<FormulaMainEntity>(t => t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, FormulaMainEntity 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 | |||
} | |||
} |
@@ -1693,6 +1693,18 @@ | |||
<Compile Include="EducationalAdministration\FillinFrom\FillinFromService.cs" /> | |||
<Compile Include="EducationalAdministration\FillinFrom\FillinFromBLL.cs" /> | |||
<Compile Include="EducationalAdministration\FillinFrom\FillinFromIBLL.cs" /> | |||
<Compile Include="LR_Desktop\CalculateProject\CalculateProjectEntity.cs" /> | |||
<Compile Include="LR_Desktop\CalculateProject\CalculateProjectService.cs" /> | |||
<Compile Include="LR_Desktop\CalculateProject\CalculateProjectBLL.cs" /> | |||
<Compile Include="LR_Desktop\CalculateProject\CalculateProjectIBLL.cs" /> | |||
<Compile Include="LR_Desktop\FormulaMain\FormulaMainEntity.cs" /> | |||
<Compile Include="LR_Desktop\FormulaMain\FormulaMainService.cs" /> | |||
<Compile Include="LR_Desktop\FormulaMain\FormulaMainBLL.cs" /> | |||
<Compile Include="LR_Desktop\FormulaMain\FormulaMainIBLL.cs" /> | |||
<Compile Include="LR_Desktop\FormulaChild\FormulaChildEntity.cs" /> | |||
<Compile Include="LR_Desktop\FormulaChild\FormulaChildService.cs" /> | |||
<Compile Include="LR_Desktop\FormulaChild\FormulaChildBLL.cs" /> | |||
<Compile Include="LR_Desktop\FormulaChild\FormulaChildIBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||