12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using Common.Wechat;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Text;
- using ZcPeng.PublicLibrary;
- namespace CoreEntity.DAL
- {
- public class PermissionDAL
- {
- /// <summary>
- ///
- /// ContactId
- /// </summary>
- /// <param name="PushAccountId"></param>
- /// <param name="BusinessId"></param>
- /// <returns></returns>
- public static Tuple<string, string> 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<List<Object>> parametersContact = new List<List<Object>>();
- DataTable dt = new DataTable();
- if (permUri != null && roleid != null)
- {
- parametersContact.Add(new List<Object>() { "RoleId", roleid });
- parametersContact.Add(new List<Object>() { "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<string, string>(rule, ruletype); ;
- }
- }
- }
|