#region
|
|
using System.Collections.Generic;
|
using System.Data;
|
using CSFrameworkV5.Common;
|
using CSFrameworkV5.Core;
|
using CSFrameworkV5.DataAccess;
|
using CSFrameworkV5.Interfaces;
|
using CSFrameworkV5.Interfaces.InterfaceModels;
|
using CSFrameworkV5.Models;
|
using CSFrameworkV5.WebRef.SystemModule;
|
|
#endregion
|
|
namespace CSFrameworkV5.Business.BLL_Permission
|
{
|
public class bllPermission
|
{
|
private IBridge_Permission _MyBridge;
|
|
public bllPermission()
|
{
|
_MyBridge = CreateBridge();
|
}
|
|
private IBridge_Permission CreateBridge()
|
{
|
if (BridgeFactory.IsADODirect)
|
return new dalPermission(Loginer.CurrentUser);
|
|
if (BridgeFactory.IsWCFBridge) return new WCF_Permission();
|
|
throw new CustomException(BridgeFactory.UNKNOW_BRIDGE_TYPE);
|
}
|
|
public int DeleteAllMenu()
|
{
|
return _MyBridge.DeleteAllMenu();
|
}
|
|
public DataTable GetActionData()
|
{
|
return _MyBridge.GetActionData();
|
}
|
|
public DataTable GetChildUser(string account)
|
{
|
return _MyBridge.GetChildUser(account);
|
}
|
|
public List<DataPermissionModel> GetDataPermissionConfig(string account)
|
{
|
return _MyBridge.GetDataPermissionConfig(account);
|
}
|
|
public DataTable GetDataPermissionConfigByGroup(string groupCode)
|
{
|
return _MyBridge.GetDataPermissionConfigByGroup(groupCode);
|
}
|
|
public DataTable GetDataPermissionConfigByUser(string account)
|
{
|
return _MyBridge.GetDataPermissionConfigByUser(account);
|
}
|
|
public DataTable GetFormTagCustomName()
|
{
|
return _MyBridge.GetFormTagCustomName();
|
}
|
|
public DataTable GetFormTagName()
|
{
|
return _MyBridge.GetFormTagName();
|
}
|
|
public DataTable GetGridPermission(string userID)
|
{
|
return _MyBridge.GetGridPermission(userID);
|
}
|
|
public string GetGridPermissionById(string userID, string viewId)
|
{
|
return _MyBridge.GetGridPermissionById(userID, viewId);
|
}
|
|
public DataTable GetGroupActions(string groupCode)
|
{
|
var b = BridgeFactory.CreateUserGroupBridge();
|
return b.GetGroupActions(groupCode);
|
}
|
|
public DataTable GetLookupMenu()
|
{
|
return _MyBridge.GetLookupMenu();
|
}
|
|
public DataTable GetMenuByUser(string account, string dataSetID)
|
{
|
return _MyBridge.GetMenuByUser(account, dataSetID);
|
}
|
|
public DataTable GetMenuData()
|
{
|
return _MyBridge.GetMenuData();
|
}
|
|
public DataTable GetMenuPicker(bool customFirstRow)
|
{
|
var dt = _MyBridge.GetMenuPicker();
|
|
if (customFirstRow)
|
{
|
var top = dt.NewRow();
|
top[tb_MyMenu.MenuName] = "";
|
top[tb_MyMenu.MenuCaption] = "<顶级菜单>";
|
dt.Rows.InsertAt(top, 0);
|
dt.AcceptChanges();
|
}
|
|
return dt;
|
}
|
|
public DataTable GetModuleData()
|
{
|
return _MyBridge.GetModuleData();
|
}
|
|
public DataSet GetOwnersByMenu(string menuID)
|
{
|
return _MyBridge.GetOwnersByMenu(menuID);
|
}
|
|
public DataTable GetRoleAction(string roleID)
|
{
|
return _MyBridge.GetRoleAction(roleID);
|
}
|
|
public DataTable GetRoleData()
|
{
|
return _MyBridge.GetRoleData();
|
}
|
|
public int GetUserActions(string account, string menuName)
|
{
|
return _MyBridge.GetUserActions(account, menuName);
|
}
|
|
public DataTable GetUserActionsList(string account)
|
{
|
return _MyBridge.GetUserActionsList(account);
|
}
|
|
public bool Init()
|
{
|
return _MyBridge.Init();
|
}
|
|
public bool IsExistsAction(int actionValue)
|
{
|
return _MyBridge.IsExistsAction(actionValue);
|
}
|
|
public bool IsExistsModule(int moduleID)
|
{
|
return _MyBridge.IsExistsModule(moduleID);
|
}
|
|
public bool IsExistsRole(string roleID)
|
{
|
return _MyBridge.IsExistsRole(roleID);
|
}
|
|
/// <summary>
|
/// </summary>
|
/// <param name="docUser"></param>
|
/// <param name="leader"></param>
|
/// <returns></returns>
|
public bool IsOwner(string docUser, string leader)
|
{
|
return _MyBridge.IsOwner(docUser, leader);
|
}
|
|
public bool IsUserBelongRole(string user, string roleID)
|
{
|
return _MyBridge.IsUserBelongRole(user, roleID);
|
}
|
|
public bool SaveDataPermission(DataTable data)
|
{
|
return _MyBridge.SaveDataPermission(data);
|
}
|
|
public bool SaveGridPermission(DataTable data)
|
{
|
return _MyBridge.SaveGridPermission(data);
|
}
|
}
|
}
|