提交 | 用户 | 时间
|
e46d3b
|
1 |
using System; |
懒 |
2 |
using System.Collections.Generic; |
|
3 |
using System.Data; |
|
4 |
using System.Linq; |
|
5 |
using System.Text; |
|
6 |
using YX.DAL; |
|
7 |
using YX.Entity; |
|
8 |
namespace YX.BLL |
|
9 |
{ |
|
10 |
public class SystemRole_Bll |
|
11 |
{ |
|
12 |
SystemRole_Dal role_dal = new SystemRole_Dal(); |
|
13 |
/// <summary> |
|
14 |
/// 获取所有角色 |
|
15 |
/// </summary> |
|
16 |
/// <returns></returns> |
|
17 |
public List<Base_Roles> GetRoles() |
|
18 |
{ |
|
19 |
try |
|
20 |
{ |
|
21 |
return role_dal.GetRoles(); |
|
22 |
} |
|
23 |
catch (Exception ex) |
|
24 |
{ |
|
25 |
|
|
26 |
throw ex; |
|
27 |
} |
|
28 |
} |
|
29 |
/// <summary> |
|
30 |
/// 通过角色ID 获取角色 |
|
31 |
/// </summary> |
|
32 |
/// <param name="Roles_ID"></param> |
|
33 |
/// <returns></returns> |
|
34 |
public List<Base_Roles> GetRoleByRoleId(string Roles_ID) |
|
35 |
{ |
|
36 |
|
|
37 |
try |
|
38 |
{ |
|
39 |
return role_dal.GetRoleByRoleId(Roles_ID); |
|
40 |
} |
|
41 |
catch (Exception) |
|
42 |
{ |
|
43 |
|
|
44 |
throw; |
|
45 |
} |
|
46 |
|
|
47 |
} |
|
48 |
/// <summary> |
|
49 |
/// 获取角色节点 |
|
50 |
/// </summary> |
|
51 |
/// <returns></returns> |
|
52 |
public DataTable GetRoleParentId() |
|
53 |
{ |
|
54 |
DataTable dt = new DataTable(); |
|
55 |
try |
|
56 |
{ |
|
57 |
return role_dal.GetRoleParentId(); |
|
58 |
|
|
59 |
} |
|
60 |
catch (Exception ex) |
|
61 |
{ |
|
62 |
|
|
63 |
throw ex; |
|
64 |
} |
|
65 |
|
|
66 |
} |
|
67 |
public List<Base_UserRole> GetUserRoleByUserID(string UserID) |
|
68 |
{ |
|
69 |
try |
|
70 |
{ |
|
71 |
return role_dal.GetUserRoleByUserID(UserID); |
|
72 |
} |
|
73 |
catch (Exception ex) |
|
74 |
{ |
|
75 |
|
|
76 |
throw ex; |
|
77 |
} |
|
78 |
} |
|
79 |
public int AddRoles(Base_Roles info) |
|
80 |
{ |
|
81 |
try |
|
82 |
{ |
|
83 |
return role_dal.AddRoles(info); |
|
84 |
} |
|
85 |
catch (Exception ex) |
|
86 |
{ |
|
87 |
|
|
88 |
throw ex; |
|
89 |
} |
|
90 |
} |
|
91 |
public int UpdateRoles(Base_Roles info) |
|
92 |
{ |
|
93 |
try |
|
94 |
{ |
|
95 |
return role_dal.UpdateRoles(info); |
|
96 |
} |
|
97 |
catch (Exception ex) |
|
98 |
{ |
|
99 |
|
|
100 |
throw ex; |
|
101 |
} |
|
102 |
} |
|
103 |
public int DeleteRole(string RoleID) |
|
104 |
{ |
|
105 |
try |
|
106 |
{ |
|
107 |
return role_dal.DeleteRole(RoleID); |
|
108 |
} |
|
109 |
catch (Exception ex) |
|
110 |
{ |
|
111 |
|
|
112 |
throw ex; |
|
113 |
} |
|
114 |
} |
|
115 |
} |
|
116 |
} |