Parcourir la source

党办管理

怀来职教中心中职
ndbs il y a 1 an
Parent
révision
b53d42d695
11 fichiers modifiés avec 322 ajouts et 106 suppressions
  1. +38
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/PartyCateController.cs
  2. +6
    -22
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Form.cshtml
  3. +22
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Form.js
  4. +6
    -13
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Index.cshtml
  5. +13
    -14
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Index.js
  6. +5
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/Index.cshtml
  7. +81
    -7
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/Index.js
  8. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj
  9. +108
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateBLL.cs
  10. +7
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateIBLL.cs
  11. +35
    -44
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateService.cs

+ 38
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/PartyCateController.cs Voir le fichier

@@ -85,6 +85,44 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
var data = partyCateIBLL.GetEntity(keyValue);
return Success(data);
}

/// <summary>
/// 获取左侧树形数据
/// <summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetTree(string CType)
{
var data = partyCateIBLL.GetTree(CType);
return Success(data);
}

/// <summary>
/// 获取字典分类列表(树结构)
/// </summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetClassifyTree(string CType)
{
var data = partyCateIBLL.GetClassifyTree(CType);
return this.JsonResult(data);
}

/// <summary>
/// 获取目录分类列表
/// </summary>
/// <param name="keyword">关键词(名称/编码)</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetClassifyList(string keyword, string CType)
{
var data = partyCateIBLL.GetClassifyList(keyword, CType);
return this.JsonResult(data);
}

#endregion

#region 提交数据


+ 6
- 22
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Form.cshtml Voir le fichier

@@ -3,33 +3,17 @@
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">ID<font face="宋体">*</font></div>
<input id="ID" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">上级</div>
<div id="CParentId"></div>
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">Name<font face="宋体">*</font></div>
<div class="col-xs-12 lr-form-item">
<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-6 lr-form-item">
<div class="lr-form-item-title">CType<font face="宋体">*</font></div>
<input id="CType" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">父Id<font face="宋体">*</font></div>
<input id="CParentId" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">排序<font face="宋体">*</font></div>
<input id="COrder" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">Creator<font face="宋体">*</font></div>
<input id="Creator" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">Createtime<font face="宋体">*</font></div>
<input id="Createtime" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
</div>
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/PartyCate/Form.js")

+ 22
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Form.js Voir le fichier

@@ -5,6 +5,9 @@
* 描 述:PartyCate
*/
var acceptClick;
var parentId = request('parentId');
var CType = request('CType');
var selectedRow = top.layer_ClassifyIndex.selectedRow;
var keyValue = request('keyValue');
var bootstrap = function ($, learun) {
"use strict";
@@ -14,6 +17,13 @@ var bootstrap = function ($, learun) {
page.initData();
},
bind: function () {
// 上级
$('#CParentId').lrselect({
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/GetClassifyTree?CType=' + CType,
type: 'tree',
allowSearch: true,
maxHeight: 225
}).lrselectSet(parentId);
},
initData: function () {
if (!!selectedRow) {
@@ -26,7 +36,19 @@ var bootstrap = function ($, learun) {
if (!$('#form').lrValidform()) {
return false;
}
var postData = $('#form').lrGetFormData(keyValue);
if (postData["CParentId"] == '' || postData["CParentId"] == '&nbsp;') {
postData["CParentId"] = '0';
}
if (CType) {
postData.CType = CType;
}
else if (postData["CParentId"] == keyValue) {
learun.alert.error('上级不能是自己本身');
return false;
}
var postData = $('#form').lrGetFormData();
Console.log(postData,"postData")
$.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/PartyCate/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {


+ 6
- 13
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Index.cshtml Voir le fichier

@@ -2,23 +2,16 @@
ViewBag.Title = "PartyCate";
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">树形目录</div>
<div id="tree" class="lr-layout-body"></div>
</div>
</div>
<div class="lr-layout">
<div class="lr-layout-center">
<div class="lr-layout-wrap">
<div class="lr-layout-title">标题</div>
<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">
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" />
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入名称/编码" />
</div>
<div class="lr-layout-tool-item">
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;查询</a>
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;<span class="lrlt">查询</span></a>
</div>
</div>
<div class="lr-layout-tool-right">
@@ -26,8 +19,8 @@
<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>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
</div>
</div>


+ 13
- 14
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Index.js Voir le fichier

@@ -30,8 +30,8 @@ var bootstrap = function ($, learun) {
id: 'form',
title: '新增',
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/Form',
width: 700,
height: 400,
width: 400,
height: 300,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
@@ -46,8 +46,8 @@ var bootstrap = function ($, learun) {
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/Form?keyValue=' + keyValue,
width: 700,
height: 400,
width: 400,
height: 300,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
@@ -60,7 +60,8 @@ var bootstrap = function ($, learun) {
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/PartyCate/DeleteForm', { keyValue: keyValue}, function () {
learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/PartyCate/DeleteForm', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
@@ -71,16 +72,14 @@ var bootstrap = function ($, learun) {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/GetPageList',
headData: [
{ label: 'ID', name: 'ID', width: 200, align: "left" },
{ label: 'Name', name: 'Name', width: 200, align: "left" },
{ label: 'CType', name: 'CType', width: 200, align: "left" },
{ label: '父Id', name: 'CParentId', width: 200, align: "left" },
{ label: '排序', name: 'COrder', width: 200, align: "left" },
{ label: 'Creator', name: 'Creator', width: 200, align: "left" },
{ label: 'Createtime', name: 'Createtime', width: 200, align: "left" },
{ label: '名称', name: 'Name', width: 200, align: "left" },
{ label: '排序', name: 'COrder', width: 200, align: "left" },
],
mainId:'ID',
isPage: true
mainId: 'ID',
sidx: 'COrder desc',
isTree: true,
parentId: 'CParentId',
reloadSelected: true
});
page.search();
},


+ 5
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/Index.cshtml Voir le fichier

@@ -2,7 +2,7 @@
ViewBag.Title = "党政办管理";
Layout = "~/Views/Shared/_Index.cshtml";
}
<div class="lr-layout lr-layout-left-center" id="lr_layout" >
<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>
@@ -25,10 +25,11 @@
<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>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
<a id="lr_category" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;目录管理</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
</div>
</div>
</div>


+ 81
- 7
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/Index.js Voir le fichier

@@ -5,6 +5,8 @@
* 描 述:党政办管理
*/
var refreshGirdData;
var selectedId;
var CType = request('CType');
var bootstrap = function ($, learun) {
"use strict";
var startTime;
@@ -15,11 +17,15 @@ var bootstrap = function ($, learun) {
page.bind();
},
bind: function () {
if (!CType) {
CType = 1;
}
// 初始化左侧树形数据
$('#dataTree').lrtree({
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetTree?code=partycate&parentId=id&Id=id&showId=name',
url: top.$.rootUrl + '/PersonnelManagement/PartyCateList/GetTree?CType=' + CType,
nodeClick: function (item) {
page.search({ CateId: item.value });
selectedId = item.value;
page.search({ CId: item.value });
}
});
// 时间搜索框
@@ -46,19 +52,27 @@ var bootstrap = function ($, learun) {
selectfn: function (begin, end) {
startTime = begin;
endTime = end;
page.search();
if (selectedId) {
page.search({ CId: selectedId });
}
}
});
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
if (selectedId) {
queryJson.CId = selectedId;
page.search(queryJson);
}
}, 220, 400);
// 新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'form',
title: '新增',
url: top.$.rootUrl + '/PersonnelManagement/PartyManage/Form',
url: top.$.rootUrl + '/PersonnelManagement/PartyManage/Form?selectedId=' + selectedId + '&CType=' + CType,
width: 600,
height: 400,
callBack: function (id) {
@@ -73,7 +87,7 @@ var bootstrap = function ($, learun) {
learun.layerForm({
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/PersonnelManagement/PartyManage/Form?keyValue=' + keyValue,
url: top.$.rootUrl + '/PersonnelManagement/PartyManage/Form?keyValue=' + keyValue + '&selectedId=' + selectedId + '&CType=' + CType,
width: 600,
height: 400,
callBack: function (id) {
@@ -95,6 +109,37 @@ var bootstrap = function ($, learun) {
});
}
});
/*分类管理*/
$('#lr_category').on('click', function () {
learun.layerForm({
id: 'TypeIndex',
title: '分类管理',
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/Index?CType=' + CType,
width: 800,
height: 500,
maxmin: true,
btn: null,
end: function () {
learun.clientdata.update('dataItem');
location.reload();
}
});
});

//访问情况统计
$("#lr_statistics").on('click', function () {
var keyValue = $('#gridtable').jfGridValue('FFile');
if (learun.checkrow(keyValue)) {
learun.layerFormForPercent({
id: 'form',
title: '访问情况统计',
url: top.$.rootUrl + '/PersonnelManagement/MP_BrowseRecord/IndexFile?keyValue=' + keyValue,
width: '70%',
height: '70%',
btn: null
});
}
});
// 打印
$('#lr_print').on('click', function () {
$('#gridtable').jqprintTable();
@@ -117,7 +162,24 @@ var bootstrap = function ($, learun) {
});
}},
{ label: "标题", name: "Title", width: 100, align: "left"},
{ label: "附件上传", name: "Filepath", width: 100, align: "left"},
{
label: "附件上传", name: "Filepath", width: 100, align: "left"
, formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('custmerData',
{
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'FileInfo',
key: value,
keyId: 'f_folderid',
sync: true,
callback: function (_data) {
if (_data.f_filename) {

callback('<span onclick="downLoad(\'' + _data['f_id'] + '\',\'' + value + '\',\'' + $.lrToken + '\')" style="color:blue">' + _data['f_filename'] + '</span>');
}
}
});
}
},
],
mainId:'ID',
isPage: true
@@ -131,7 +193,19 @@ var bootstrap = function ($, learun) {
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
if (selectedId) {
page.search({ CId: selectedId });
}
//$('#gridtable').jfGridSet('reload');
};
page.init();
}
function downLoad(fileId, fileTwo, lrToken) {
if (fileTwo) {

top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddFileRecord', { fileId: fileTwo }, function () {

});
}
top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
}

+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj Voir le fichier

@@ -550,6 +550,7 @@
<Compile Include="PersonnelManagement\OvertimeApplication\OvertimeApplicationBLL.cs" />
<Compile Include="PersonnelManagement\OvertimeApplication\OvertimeApplicationIBLL.cs" />
<Compile Include="PersonnelManagement\OvertimeApplication\OvertimeApplicationService.cs" />
<Compile Include="PersonnelManagement\PartyCate\PartyCateEntity.cs" />
<Compile Include="PersonnelManagement\PMCadre\PMCadreBLL.cs" />
<Compile Include="PersonnelManagement\PMCadre\PMCadreEntity.cs" />
<Compile Include="PersonnelManagement\PMCadre\PMCadreIBLL.cs" />
@@ -2107,7 +2108,6 @@
<Compile Include="PersonnelManagement\PartyManage\PartyManageService.cs" />
<Compile Include="PersonnelManagement\PartyManage\PartyManageBLL.cs" />
<Compile Include="PersonnelManagement\PartyManage\PartyManageIBLL.cs" />
<Compile Include="PersonnelManagement\PartyCate\PartyCateEntity.cs" />
<Compile Include="PersonnelManagement\PartyCate\PartyCateService.cs" />
<Compile Include="PersonnelManagement\PartyCate\PartyCateIBLL.cs" />
<Compile Include="PersonnelManagement\PartyCate\PartyCateBLL.cs" />


+ 108
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateBLL.cs Voir le fichier

@@ -91,6 +91,114 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

/// <summary>
/// 获取左侧树形数据
/// <summary>
/// <returns></returns>
public List<TreeModel> GetTree(string CType)
{
try
{
DataTable list = partyCateService.GetSqlTree(CType);
List<TreeModel> treeList = new List<TreeModel>();
foreach (DataRow item in list.Rows)
{
TreeModel node = new TreeModel
{
id = item["cid"].ToString(),
text = item["cname"].ToString(),
value = item["cid"].ToString(),
showcheck = false,
checkstate = 0,
isexpand = true,
parentId = item["cparentid"].ToString()
};
treeList.Add(node);
}
return treeList.ToTree();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 分类列表
/// </summary>
/// <param name="keyword">关键词(名称/编码)</param>
/// <param name="enabledMark">是否只取有效</param>
/// <returns></returns>
public List<PartyCateEntity> GetClassifyList(string keyword, string CType)
{
try
{
List<PartyCateEntity> list = partyCateService.GetList(CType);
if (!string.IsNullOrEmpty(keyword))
{
list = list.FindAll(t => t.Name.Contains(keyword));
}

return list;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}


/// <summary>
/// 获取分类树形数据
/// </summary>
/// <returns></returns>
public List<TreeModel> GetClassifyTree(string CType)
{
try
{
List<PartyCateEntity> classifyList = partyCateService.GetList(CType);
List<TreeModel> treeList = new List<TreeModel>();
foreach (var item in classifyList)
{
TreeModel node = new TreeModel();
node.id = item.ID;
node.text = item.Name;
node.value = item.ID;
node.showcheck = false;
node.checkstate = 0;
node.isexpand = true;
node.parentId = item.CParentId;
treeList.Add(node);
}
return treeList.ToTree();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

#region 提交数据


+ 7
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateIBLL.cs Voir le fichier

@@ -20,7 +20,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<PartyCateEntity> GetList( string queryJson );
IEnumerable<PartyCateEntity> GetList(string queryJson);
/// <summary>
/// 获取列表分页数据
/// </summary>
@@ -34,6 +34,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// <param name="keyValue">主键</param>
/// <returns></returns>
PartyCateEntity GetEntity(string keyValue);

List<TreeModel> GetTree(string CType);

List<TreeModel> GetClassifyTree(string CType);
List<PartyCateEntity> GetClassifyList(string keyword, string CType);

#endregion

#region 提交数据


+ 35
- 44
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateService.cs Voir le fichier

@@ -5,6 +5,8 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Linq;


namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
@@ -17,47 +19,22 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// </summary>
public class PartyCateService : RepositoryFactory
{
#region 构造函数和属性

private string fieldSql;
/// <summary>
/// 构造方法
/// </summary>
public PartyCateService()
{
fieldSql=@"
t.ID,
t.Name,
t.CType,
t.CParentId,
t.COrder,
t.Creator,
t.Createtime
";
}
#endregion

#region 获取数据

/// <summary>
/// 获取列表数据
/// 获取列表分页数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">条件参数</param>
/// <returns></returns>
public IEnumerable<PartyCateEntity> GetList( string queryJson )
public IEnumerable<PartyCateEntity> GetPageList(Pagination pagination, 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(" t.* ");
strSql.Append(" FROM PartyCate t ");
return this.BaseRepository("CollegeMIS").FindList<PartyCateEntity>(strSql.ToString());
return this.BaseRepository("CollegeMIS").FindList<PartyCateEntity>(strSql.ToString(), pagination);
}
catch (Exception ex)
{
@@ -73,20 +50,15 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}

/// <summary>
/// 获取列表分页数据
/// 获取实体数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">条件参数</param>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public IEnumerable<PartyCateEntity> GetPageList(Pagination pagination, string queryJson)
public PartyCateEntity GetEntity(string keyValue)
{
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(fieldSql);
strSql.Append(" FROM PartyCate t ");
return this.BaseRepository("CollegeMIS").FindList<PartyCateEntity>(strSql.ToString(), pagination);
return this.BaseRepository("CollegeMIS").FindEntity<PartyCateEntity>(keyValue);
}
catch (Exception ex)
{
@@ -102,15 +74,14 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}

/// <summary>
/// 获取实体数据
/// 获取树形数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public PartyCateEntity GetEntity(string keyValue)
public DataTable GetSqlTree(string CType)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<PartyCateEntity>(keyValue);
return this.BaseRepository("CollegeMIS").FindTable($" SELECT * FROM dbo.PartyCate WHERE CType='{CType}' ");
}
catch (Exception ex)
{
@@ -125,6 +96,26 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

public List<PartyCateEntity> GetList(string CType)
{
var ctype = int.Parse(CType);
try
{
return this.BaseRepository("CollegeMIS").FindList<PartyCateEntity>(a => a.CType == ctype).ToList();

}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

#region 提交数据
@@ -137,7 +128,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
try
{
this.BaseRepository("CollegeMIS").Delete<PartyCateEntity>(t=>t.ID == keyValue);
this.BaseRepository("CollegeMIS").Delete<PartyCateEntity>(t => t.ID == keyValue);
}
catch (Exception ex)
{


Chargement…
Annuler
Enregistrer