using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Data; using CoreEntity.Entity; using System.Data.SqlClient; using ZcPeng.PublicLibrary; using Common.Model; using Newtonsoft.Json.Converters; using Newtonsoft.Json; using Common.Wechat; using CoreEntity.DAL; namespace SupplierWeb.Codes.Auth { public class PermissionHelper { public static Dictionary Permissions(int roleId,string filter = " and A.AuthType ='O'") { #region 获取角色的权限 IList perms = (List)RoleDAL.GetPermissions(roleId, filter); #endregion Dictionary permsd = new Dictionary(perms.Count); foreach (Permission perm in perms) { if (perm.PermissionUrl!=null&&!permsd.ContainsKey(perm.PermissionUrl)) { perm.Roleids = null; permsd.Add(perm.PermissionUrl,perm); } } //IsoDateTimeConverter timejson = new IsoDateTimeConverter //{ // DateTimeFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss" //}; //var jsonData = JsonConvert.SerializeObject(users, timejson); return permsd; } } }