90 lines
2.5 KiB
C#
90 lines
2.5 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using WMS.Model.SystemManage;
|
|||
|
|
using System.Data;
|
|||
|
|
using WMS.IData;
|
|||
|
|
using WMS.Common;
|
|||
|
|
|
|||
|
|
namespace WMS.Business.SystemManage
|
|||
|
|
{
|
|||
|
|
public class BussRoleMessage : IBussFactory
|
|||
|
|
{
|
|||
|
|
public List<RoleMessageModel> GetRoleMessageData(RoleMessageModel model)
|
|||
|
|
{
|
|||
|
|
DataTable dt = DataProvider.Instance.RoleMessage.GetRoleMessageData(model);
|
|||
|
|
List<RoleMessageModel> list = null;
|
|||
|
|
|
|||
|
|
if (DataLogErrWrite(dt, "根据角色获得消息权限"))
|
|||
|
|
{
|
|||
|
|
list = ConvertHelper<RoleMessageModel>.ConvertToList(dt);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
return list;
|
|||
|
|
}
|
|||
|
|
return list;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#region 增一条
|
|||
|
|
/// <summary>
|
|||
|
|
/// 新增一条数据
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
public string AddRoleDictionaryAndMessage(RoleDictionaryModel model, List<RoleMessageModel> list)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
foreach (RoleMessageModel item in list)
|
|||
|
|
{
|
|||
|
|
if (item.SELECTED == "1")
|
|||
|
|
{
|
|||
|
|
item.ROLE_ID = model.ROLE_ID;
|
|||
|
|
DataProvider.Instance.RoleMessage.AddRoleMessageData(item);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#region 改一条
|
|||
|
|
/// <summary>
|
|||
|
|
/// 修改一条数据
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="model"></param>
|
|||
|
|
public string UpdateRoleDictionaryAndMessage(RoleDictionaryModel model, List<RoleMessageModel> list)
|
|||
|
|
{
|
|||
|
|
Transaction = DataProvider.Instance.TranOracle;
|
|||
|
|
|
|||
|
|
//删消息权限
|
|||
|
|
DataProvider.Instance.RoleMessage.DeleteRoleMessageData(model.ROLE_ID);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
//增消息权限
|
|||
|
|
foreach (RoleMessageModel item in list)
|
|||
|
|
{
|
|||
|
|
if (item.SELECTED == "1")
|
|||
|
|
{
|
|||
|
|
item.ROLE_ID = model.ROLE_ID;
|
|||
|
|
DataProvider.Instance.RoleMessage.AddRoleMessageData(item);
|
|||
|
|
logList.Add(DataProvider.Instance.logData);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
TaCmtOrRak();
|
|||
|
|
return this.ErrText;
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|