127 lines
4.0 KiB
C#
127 lines
4.0 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Data;
|
|||
|
|
using WMS.IData;
|
|||
|
|
using WMS.Model.Base;
|
|||
|
|
using WMS.Common;
|
|||
|
|
|
|||
|
|
namespace WMS.Business.Base
|
|||
|
|
{
|
|||
|
|
public class BussRole : IBussFactory
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获取权限信息
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public DataTable GetRoleInfo()
|
|||
|
|
{
|
|||
|
|
return DataProvider.Instance.Role.GetRoleInfo();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 根据权限获取关联信息
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="RoleId">权限编号</param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public DataSet GetRoleRelevanceInfo(string RoleId)
|
|||
|
|
{
|
|||
|
|
return DataProvider.Instance.Role.GetRoleRelevanceInfo(RoleId);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
///// <summary>
|
|||
|
|
///// 角色权限新增方法
|
|||
|
|
///// </summary>
|
|||
|
|
///// <param name="list">SQL语句集合</param>
|
|||
|
|
///// <returns></returns>
|
|||
|
|
//public int InsertRole(string list, ref string msg)
|
|||
|
|
//{
|
|||
|
|
// return DataProvider.Instance.Role.InsertRole(list);
|
|||
|
|
//}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 角色权限新增方法
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="list">SQL语句集合</param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public int InsertRole(List<string> list, ref string msg)
|
|||
|
|
{
|
|||
|
|
return DataProvider.Instance.Role.InsertRole(list, ref msg);
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获取Role Name
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string GetRoleId()
|
|||
|
|
{
|
|||
|
|
return DataProvider.Instance.Role.GetRoleId();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 根据用户编号获取角色信息
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="strUserID">用户编号</param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public List<RoleModel> GetUserRole(string strUserID)
|
|||
|
|
{
|
|||
|
|
DataTable dt = DataProvider.Instance.Role.GetUserRole(strUserID);
|
|||
|
|
if (!DataLogErrWrite(dt, ""))
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
if (dt.Rows.Count == 0)
|
|||
|
|
{
|
|||
|
|
//ErrText = "用户名错误,请重新输入";
|
|||
|
|
return null;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
List<RoleModel> list = ConvertHelper<RoleModel>.ConvertToList(dt);
|
|||
|
|
return list;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
///// <summary>
|
|||
|
|
///// 通过用户名和部门编号获得部门下的 所有角色 及该用户具有的角色(选中Status)
|
|||
|
|
///// </summary>
|
|||
|
|
///// <param name="userid"></param>
|
|||
|
|
///// <param name="comid"></param>
|
|||
|
|
///// <returns></returns>
|
|||
|
|
//public List<RoleModel> GetRoleDataByComIDAndUserID(string userid)
|
|||
|
|
//{
|
|||
|
|
// DataTable dt = DataProvider.Instance.Role.GetRoleDataByComIDAndUserID(userid);
|
|||
|
|
|
|||
|
|
// List<RoleModel> list = null;
|
|||
|
|
// if (DataLogErrWrite(dt, "通过部门编号和用户编号查询当前部门下的角色"))
|
|||
|
|
// {
|
|||
|
|
// list = ConvertHelper<RoleModel>.ConvertToList(dt);
|
|||
|
|
// }
|
|||
|
|
// else
|
|||
|
|
// {
|
|||
|
|
// return list;
|
|||
|
|
// }
|
|||
|
|
// return list;
|
|||
|
|
//}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 通过用户名和部门编号获得部门下的 所有角色 及该用户具有的角色(选中状态)
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="userid"></param>
|
|||
|
|
/// <param name="comid"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public List<RoleModel> GetRoleDataByComIDAndUserID(string userid, string comid)
|
|||
|
|
{
|
|||
|
|
DataTable dt = DataProvider.Instance.Role.GetRoleDataByComIDAndUserID(userid, comid);
|
|||
|
|
|
|||
|
|
List<RoleModel> list = null;
|
|||
|
|
// if (DataLogErrWrite(dt, "通过部门编号和用户编号查询当前部门下的角色"))
|
|||
|
|
{
|
|||
|
|
list = ConvertHelper<RoleModel>.ConvertToList(dt);
|
|||
|
|
}
|
|||
|
|
// else
|
|||
|
|
{
|
|||
|
|
return list;
|
|||
|
|
}
|
|||
|
|
return list;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|