Ejemplo n.º 1
0
 /// <summary>
 /// 获取用户没有权限的功能点列表 
 /// </summary>
 /// <param name="UserId">用户编码</param>
 /// <returns>用户无权限功能列表</returns>
 public static List<Sys_UserPermission> UserNotPermisionnList(string UserId)
 {
     ADOSys_UserPermission PermissionInstance = new ADOSys_UserPermission();
     List<Sys_UserPermission> ListPermission = PermissionInstance
         .GetUserPerimission(UserId).Where(o => (string.IsNullOrEmpty(o.PU_IsCheck) || o.PU_IsCheck != "1") && (!o.PU_FunCode.StartsWith("C")) ).ToList();
     return ListPermission;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 用户权限列表
 /// </summary>
 /// <param name="UserId">用户编码</param>
 /// <returns>用户权限List</returns>
 public static List<Sys_UserPermission> UserPermissionList(string UserId)
 {
     ADOSys_UserPermission PermissionInstance = new ADOSys_UserPermission();
     List<Sys_UserPermission> ListPermission = PermissionInstance
         .GetUserPerimission(UserId).Where(o => o.PU_IsCheck == "1" && (!o.PU_FunCode.StartsWith("C"))).ToList();
     return ListPermission;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// List中的Toolbar
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="custName">自定义命名前缀</param>
        /// <param name="ToolBarConfig">工具条配置 add:'0',addN:'增加',addFunJs:'ShowMsg('ssss')',addClass:''</param>
        /// <returns></returns>
        //public static string Common_ToolBarForListPage(this HtmlHelper helper, string custName, string ToolBarConfig)
        //{
        //    return Common_ToolBarForListPage(helper,null, custName,true, ToolBarConfig);
        //}
        public static bool IsHavePermission(this HtmlHelper helper, string funcode)
        {
            ADOSys_UserPermission instance = new ADOSys_UserPermission();
            Sys_UserPermission p = instance.GetListByWhere(string.Format("AND PU_UserCode='{0}' AND PU_FunCode='{1}'", QX.Config.SessionConfig.UserId(), funcode)).FirstOrDefault();
            if (p == null)
            {
                return false;
            }

            return true;
        }