using Common.Wechat; using System; using System.Collections.Generic; using System.Data; using System.Text; using ZcPeng.PublicLibrary; namespace CoreEntity.DAL { public class PermissionDAL { /// /// /// ContactId /// /// /// /// public static Tuple getPermission(string permUri, string roleid) { string commandTextContact = "Select A.PermissionRule,PermissionRuleType From " + Config.TablePrefix+ "RoleRelatePermission A " + " left join " + Config.TablePrefix + "Permission B on A.PermissionId = B.Id " + "Where A.RoleId=@RoleId and B.PermissionUrl = @PermissionUrl"; string resultContact; string rule = ""; string ruletype = ""; List> parametersContact = new List>(); DataTable dt = new DataTable(); if (permUri != null && roleid != null) { parametersContact.Add(new List() { "RoleId", roleid }); parametersContact.Add(new List() { "PermissionUrl", permUri }); DataAccess.GetValues(commandTextContact, ref dt, DataAccess.ToParameters(parametersContact).ToArray(), out resultContact); } if (dt !=null && dt.Rows.Count > 0) { rule = DBNull.Value == dt.Rows[0]["PermissionRule"] ? "":(string)dt.Rows[0]["PermissionRule"]; ruletype = DBNull.Value == dt.Rows[0]["PermissionRuleType"] ? "" : (string)dt.Rows[0]["PermissionRuleType"]; } return new Tuple(rule, ruletype); ; } } }