yantian yue
2023-12-28 74222333166387c1e0508f8ccaf8347b861649a5
提交 | 用户 | 时间
e46d3b 1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using YX.DAL;
6 using System.Data;
7 using YX.Entity;
8 using System.Data.Entity;
9 using System.Linq.Expressions;
10 namespace YX.BLL
11 {
12     public class SystemMenu_Bll
13     {
14         SystemMenu_Dal menu_dal = new SystemMenu_Dal();
15         public List<Base_SysMenu> GetMenusByCondition(Expression<Func<Base_SysMenu,bool>>lambda)
16         {
17
18             try
19             {
20                 return menu_dal.GetMenusByCondition(lambda);
21             }
22             catch (Exception ex)
23             {
24                 
25                 throw ex;
26             }
27         }
28         /// <summary>
29         /// 用户权限查询
30         /// </summary>
31         /// <param name="lambda"></param>
32         /// <returns></returns>
33         public List<Base_UserRight> GetUserRightByCondition(Expression<Func<Base_UserRight,bool>>lambda)
34         {
35             try
36             {
37
38                 return menu_dal.GetUserRightByCondition(lambda);
39             }
40             catch (Exception EX)
41             {
42
43                 throw EX;
44             }
45         }
46         /// <summary>
47         /// 角色权限查询
48         /// </summary>
49         /// <param name="lambda"></param>
50         /// <returns></returns>
51         public List<Base_RoleRight> GetRoleRightByCondition(Expression<Func<Base_RoleRight, bool>> lambda)
52         {
53             try
54             {
55
56                 return menu_dal.GetRoleRightByCondition(lambda);
57             }
58             catch (Exception EX)
59             {
60
61                 throw EX;
62             }
63         }
64         /// <summary>
65         /// 获取全部菜单
66         /// </summary>
67         /// <returns></returns>
68         public List<Base_SysMenu>  GetSysMenus()
69         {
70           
71             try
72             {
73
74                 return menu_dal.GetSysMenus();
75             }
76             catch (Exception ex)
77             {
78                 
79                 throw ex;
80             }
81      
82         }
83         /// <summary>
84         /// 获取菜单根节点
85         /// </summary>
86         /// <returns></returns>
87         public List<Base_SysMenu> GetSysMenusParent(string UserID)
88         {
89             try
90             {
91
92                 return menu_dal.GetSysMenusParent(UserID);
93             }
94             catch (Exception ex)
95             {
96                 
97                 throw ex;
98             }
99         }
100         /// <summary>
101         /// 获取菜单子节点
102         /// </summary>
103         /// <param name="ParentId"></param>
104         /// <returns></returns>
105         public List<Base_SysMenu> GetSysMenuChilds(string ParentId,string UserID)
106         {
107             try
108             {
109
110                 return menu_dal.GetSysMenuChilds(ParentId,UserID);
111             }
112             catch (Exception ex)
113             {
114                 
115                 throw ex;
116             }
117             
118         }
119         /// <summary>
120         /// 获取菜单子节点
121         /// </summary>
122         /// <param name="ParentId"></param>
123         /// <returns></returns>
124         public List<Base_SysMenu> GetSysMenuChilds(string ParentId)
125         {
126             try
127             {
128
129                 return menu_dal.GetSysMenuChilds(ParentId);
130             }
131             catch (Exception ex)
132             {
133
134                 throw ex;
135             }
136
137         }
138         /// <summary>
139         /// 添加菜单
140         /// </summary>
141         /// <param name="info"></param>
142         public int  AddSysMenu(Base_SysMenu info)
143         {
144             try
145             {
146
147                 return menu_dal.AddSysMenu(info);
148             }
149             catch (Exception)
150             {
151                 
152                 throw;
153             }
154         }
155         /// <summary>
156         /// 修改菜单
157         /// </summary>
158         /// <param name="info"></param>
159         /// <returns></returns>
160         public int UpdateSysMenu(Base_SysMenu info)
161         {
162             try
163             {
164                 return menu_dal.UpdateSysMenu(info);
165             }
166             catch (Exception)
167             {
168                 
169                 throw;
170             }
171         }
172         /// <summary>
173         /// 删除菜单
174         /// </summary>
175         /// <param name="key"></param>
176         /// <returns></returns>
177         public int DeleteSysMenu(string key)
178         {
179             try
180             {
181
182                 return menu_dal.DeleteSysMenu(key);
183             }
184             catch (Exception)
185             {
186                 
187                 throw;
188             }
189         }
190         //获取按钮
191         public List<Base_SysMenu>GetButtonList(string ParentId, string UserID)
192         {
193             try
194             {
195                 return menu_dal.GetButtonList(ParentId, UserID);
196             }
197             catch (Exception)
198             {
199
200                 throw;
201             }
202         }
203     }
204 }