Пример #1
0
        public List<V_UserMenuPermission> GetSysLeftMenuFilterPermissionToNewFrame(string userID)
        {
            //using (SysUserBLL bll = new SysUserBLL())
            //{
            //    List<V_BllCommonUserPermission> plist;
            //    string menuCode = "T_HR_COMPANY";
            //    userID = "f89fb1ce-460f-4f53-8c45-04d8b5d45aca";
            //    string keyString = "BllCommonUserMenuPermsstring" + menuCode + userID;
            //    string Companykey = "BllOwnerCompanyIDs" + menuCode + userID;
            //    string Departmentkey = "BllOwnerDepartmentIDs" + menuCode + userID;
            //    string Positionkey = "BllOwnerPositionIDs" + menuCode + userID;
            //    string OwnerCompanyIDs = "";
            //    string OwnerDepartmentIDs = "";
            //    string OwnerPositionIDs = "";
            //    //if (WCFCache.Current[keyString] == null)
            //    //{

            //        IQueryable<V_BllCommonUserPermission> IQlist = bll.GetUserMenuPermsByUserPermisionBllCommon(menuCode, userID, ref OwnerCompanyIDs, ref OwnerDepartmentIDs, ref OwnerPositionIDs);
            //        //if(IQlist != null)
            //        plist = IQlist != null ? IQlist.ToList() : null;
            //        WCFCache.Current.Insert(keyString, plist, DateTime.Now.AddMinutes(1));
            //        WCFCache.Current.Insert(Companykey, OwnerCompanyIDs, DateTime.Now.AddMinutes(1));
            //        WCFCache.Current.Insert(Departmentkey, OwnerDepartmentIDs, DateTime.Now.AddMinutes(1));
            //        WCFCache.Current.Insert(Positionkey, OwnerPositionIDs, DateTime.Now.AddMinutes(1));


            //    //}
            //    //else
            //    //{
            //    //    plist = (List<V_BllCommonUserPermission>)WCFCache.Current[keyString];
            //    //    OwnerCompanyIDs = (string)WCFCache.Current[Companykey];
            //    //    OwnerDepartmentIDs = (string)WCFCache.Current[Departmentkey];
            //    //    OwnerPositionIDs = (string)WCFCache.Current[Positionkey];

            //    //}

            //    return null;
            //}

            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                Tracer.Debug("系统用户SysUserBLL-GetSysLeftMenuFilterPermissionToNewFrame");
                T_SYS_FBADMIN UserFb = null;

                T_SYS_USER Userinfo = this.GetUserByID(userID);
                if (Userinfo != null)
                {
                    UserFb = this.getFbAdmin(Userinfo.SYSUSERID);
                }

                IQueryable<V_UserMenuPermission> menuList = UserFb != null ? bll.GetSysLeftMenuFilterPermissionToNewFrame(userID, UserFb) : bll.GetSysLeftMenuFilterPermissionToNewFrameForNotFbAdmin(userID, UserFb);

                return menuList != null ? menuList.ToList() : null;
            }

        }