1
yhj
2024-07-24 5e5d945e91568b973faa27d8ab0bcef99fc4a6c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#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);
        }
    }
}