Ejemplo n.º 1
0
        /// <summary>
        /// 根据权限ID获取权限定义
        /// </summary>
        /// <param name="ID">权限ID</param>
        /// <returns>权限定义列表</returns>
        public T_SYS_PERMISSION GetSysPermissionByID(string ID)
        {
            try
            {
                SysEntityMenuBLL menuBll = new SysEntityMenuBLL();
                var ent1 = from ent in dal.GetObjects()
                           where ent.PERMISSIONID == ID
                           select ent;
                if (ent1.Count() > 0)
                {
                    if (!string.IsNullOrEmpty(ent1.FirstOrDefault().PERMISSIONCODE)) //不是公共权限
                    {
                        var ents = from ent in dal.GetObjects().Include("T_SYS_ENTITYMENU")
                                   where ent.PERMISSIONID == ID
                                   select ent;
                        //ents.ToList();

                        //var ents = from ent in dal.GetObjects().Include("T_SYS_ENTITYMENU")
                        //           join e in menuBll.GetTable() on ent.T_SYS_ENTITYMENU.ENTITYMENUID equals e.ENTITYMENUID
                        //           where ent.PERMISSIONID == ID
                        //           select ent;
                        return(ents.Count() > 0 ? ents.FirstOrDefault() : null);
                    }
                }
                return(ent1.Count() > 0 ? ent1.FirstOrDefault() : null);
            }
            catch (Exception ex)
            {
                Tracer.Debug("权限SysPermissionBLL-GetSysPermissionByID" + System.DateTime.Now.ToString() + " " + ex.ToString());
                return(null);
            }
        }
Ejemplo n.º 2
0
        public List<V_UserMenuPermission> GetSysLeftMenuFilterPermissionToNewFrame(string userID)
        {

            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                List<V_UserMenuPermission> menuList = bll.GetSysLeftMenuFilterPermissionToNewFrame(userID);
                return menuList != null ? menuList.ToList() : null;
            }

        }
Ejemplo n.º 3
0
        public List<V_UserMenuPermission> GetSysLeftMenuFilterPermission(string sysType, string userID, ref List<string> menuids)
        {

            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                IQueryable<V_UserMenuPermission> menuList = bll.GetSysLeftMenuFilterPermission(sysType, userID, ref menuids);

                return menuList.Count() > 0 ? menuList.ToList() : null;
            }

        }
Ejemplo n.º 4
0
 public List<T_SYS_ENTITYMENU> GetSysLeftMenu(string sysType, string userID)
 {
     List<T_SYS_ENTITYMENU> menuList;
     string keyString = "GetSysLeftMenu" + sysType + userID;
     if (WCFCache.Current[keyString] == null)
     {
         using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
         {
             menuList = bll.GetSysLeftMenu(sysType, userID).ToList();
             WCFCache.Current.Insert(keyString, menuList, DateTime.Now.AddMinutes(15));
         }
     }
     else
     {
         menuList = (List<T_SYS_ENTITYMENU>)WCFCache.Current[keyString];
     }
     return menuList.Count() > 0 ? menuList : null;
 }
Ejemplo n.º 5
0
        public void SysMenuUpdate(T_SYS_ENTITYMENU obj)
        {
            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                string keyString = "GetSysMenuByID" + obj.ENTITYMENUID;
                string keyStringLookUp = "GetSysMenuByTypeToLookUp" + obj.SYSTEMTYPE;

                if (WCFCache.Current[keyString] != null)
                {
                    WCFCache.Current[keyString] = null;
                }
                if (WCFCache.Current[keyStringLookUp] != null)
                {
                    WCFCache.Current[keyStringLookUp] = null;
                }
                                
                bll.SysMenuUpdate(obj);
            }
        }
Ejemplo n.º 6
0
        public string SysMenuAdd(T_SYS_ENTITYMENU obj)
        {
            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                if (obj != null)
                {
                    string keyString = "GetSysMenuByType" + obj.SYSTEMTYPE;
                    string keyStringLookUp = "GetSysMenuByTypeToLookUp" + obj.SYSTEMTYPE;

                    if (WCFCache.Current[keyString] != null)
                    {
                        WCFCache.Current[keyString] = null;
                    }
                    if (WCFCache.Current[keyStringLookUp] != null)
                    {
                        WCFCache.Current[keyStringLookUp] = null;
                    }
                }
                return bll.SysMenuAdd(obj);
            }
        }
Ejemplo n.º 7
0
        public List<T_SYS_ENTITYMENU> GetSysMenuInfosListByParentID(string parentID)
        {
            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                #region 
                List<T_SYS_ENTITYMENU> menu;
                string keyString = "GetSysMenuInfosListByParentID" + parentID;
                if (WCFCache.Current[keyString] == null)
                {

                    menu = bll.GetSysMenuInfosByParentID(parentID);
                    WCFCache.Current.Insert(keyString, menu, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    menu = (List<T_SYS_ENTITYMENU>)WCFCache.Current[keyString];
                }
                return menu;
                #endregion
            }
        }
Ejemplo n.º 8
0
        public T_SYS_ENTITYMENU GetSysMenuByID(string menuID)
        {
            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {

                #region 
                T_SYS_ENTITYMENU menu;
                string keyString = "GetSysMenuByID" + menuID;
                if (WCFCache.Current[keyString] == null)
                {

                    menu = bll.GetSysMenuByID(menuID);
                    WCFCache.Current.Insert(keyString, menu, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    menu = (T_SYS_ENTITYMENU)WCFCache.Current[keyString];
                }
                return menu;
                #endregion
            }
        }
Ejemplo n.º 9
0
 public List<V_EntityMenu> GetEntityMenuAll()
 {
     using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
     {
         List<V_EntityMenu> menuList = bll.GetEntityMenuAll();
         return menuList.Count() > 0 ? menuList.ToList() : null;
     }
 }
Ejemplo n.º 10
0
        public List<V_UserMenuPermission> GetSysLeftMenuFilterPermissionToNewFrameAndPermission(string userID,string PermissionValue)
        {

            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                IQueryable<V_UserMenuPermission> menuList = bll.GetSysLeftMenuFilterPermissionToNewFrameAndPermision(userID, PermissionValue);

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

        }
Ejemplo n.º 11
0
        public T_SYS_ENTITYMENU GetEntityMenuByName(string EntityName)
        {
            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {

                T_SYS_ENTITYMENU menu;
                string keyString = "GetSysMenuByEntityCode" + EntityName;
                if (WCFCache.Current[keyString] == null)
                {

                    menu = bll.GetSysMenuByEntityName(EntityName);
                    WCFCache.Current.Insert(keyString, menu, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    menu = (T_SYS_ENTITYMENU)WCFCache.Current[keyString];
                }

                return menu;
            }

        }
Ejemplo n.º 12
0
        public List<T_SYS_ENTITYMENU> GetCustomerPermissionMenus(string employeeid)
        {
            using (SysEntityMenuBLL MenurBll = new SysEntityMenuBLL())
            {
                IQueryable<T_SYS_ENTITYMENU> ents = MenurBll.GetCustomerPermissionMenus(employeeid);
                return ents == null ? null : ents.ToList();

            }
        }
Ejemplo n.º 13
0
        public List<T_SYS_ENTITYMENU> GetSysMenuByTypePaging(int pageIndex, int pageSize, string sort, string filterString, object[] paras, ref int pageCount, LoginUserInfo loginUserInfo)
        {
            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                T_SYS_USER Userinfo = this.GetUserByEmployeeID(loginUserInfo.userID);
                T_SYS_FBADMIN UserFb = null;
                bool IsFbAdmin = false;//是否预算管理员
                if (Userinfo != null)
                {
                    UserFb = this.getFbAdmin(Userinfo.SYSUSERID);
                }
                if (UserFb != null)
                {
                    IsFbAdmin = true;
                }
                IQueryable<T_SYS_ENTITYMENU> menuList = bll.GetSysMenuByTypeWithPaging(pageIndex, pageSize, sort, filterString, paras, ref  pageCount, loginUserInfo.userID, IsFbAdmin);

                return menuList !=null ? menuList.ToList() : null;
            }
        }
Ejemplo n.º 14
0
        public List<T_SYS_ENTITYMENU> GetSysMenuByTypeToLookUpForFbAdmin(string systemType, string parentID,string EmployeeID)
        {
            //SysEntityMenuBLL bll = new SysEntityMenuBLL();
            //IQueryable<T_SYS_ENTITYMENU> menuList = bll.GetSysMenuByType(systemType, parentID);
            #region 
            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                List<T_SYS_ENTITYMENU> menuList;
                T_SYS_USER Userinfo = this.GetUserByEmployeeID(EmployeeID);
                string keyString = "GetSysMenuByTypeToLookUp" + systemType + parentID + EmployeeID;
                if (Userinfo == null)
                {
                    return null;
                }

                T_SYS_FBADMIN UserFb = null;
                
                if (WCFCache.Current[keyString] == null)
                {
                    if (!string.IsNullOrEmpty(EmployeeID))
                    {
                        UserFb = this.getFbAdmin(Userinfo.SYSUSERID);
                    }
                    IQueryable<T_SYS_ENTITYMENU> IQList = UserFb == null ? bll.GetSysMenuByTypeToLookUpForNoFbAdmin(systemType, parentID) : bll.GetSysMenuByTypeToLookUp(systemType, parentID);
                    menuList = IQList == null ? null : IQList.ToList();
                    WCFCache.Current.Insert(keyString, menuList, DateTime.Now.AddMinutes(15));
                }
                else
                {
                    menuList = (List<T_SYS_ENTITYMENU>)WCFCache.Current[keyString];
                }
            #endregion
                return menuList != null ? menuList : null;
            }
        }
Ejemplo n.º 15
0
 public List<T_SYS_ENTITYMENU> GetSysMenuByTypeToLookUp(string systemType, string parentID)
 {
     //SysEntityMenuBLL bll = new SysEntityMenuBLL();
     //IQueryable<T_SYS_ENTITYMENU> menuList = bll.GetSysMenuByType(systemType, parentID);
     #region 
     using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
     {
         List<T_SYS_ENTITYMENU> menuList;
         string keyString = "GetSysMenuByTypeToLookUp" + systemType + parentID;
         if (WCFCache.Current[keyString] == null)
         {
             IQueryable<T_SYS_ENTITYMENU> IQList = bll.GetSysMenuByTypeToLookUp(systemType, parentID);
             menuList = IQList == null ? null : IQList.ToList();
             WCFCache.Current.Insert(keyString, menuList, DateTime.Now.AddMinutes(15));
         }
         else
         {
             menuList = (List<T_SYS_ENTITYMENU>)WCFCache.Current[keyString];
         }
     #endregion
         return menuList != null ? menuList : null;
     }
 }
Ejemplo n.º 16
0
 public string SysMenuDelete(string menuID)
 {
     using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
     {
         return bll.SysMenuDelete(menuID);
     }
 }
Ejemplo n.º 17
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())
            {

                List<V_UserMenuPermission> menuList =  bll.GetSysLeftMenuFilterPermissionToNewFrame(userID);

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

        }
Ejemplo n.º 18
0
 public List<T_SYS_ENTITYMENU> GetEntityMenuByMenuIDs(string[] MenuIDs, string StrSysType)
 {
     using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
     {
         IQueryable<T_SYS_ENTITYMENU> Listmenus = bll.GetEntityMenuByMenuIDs(MenuIDs, StrSysType);
         return Listmenus != null ? Listmenus.ToList() : null;
     }
 }
Ejemplo n.º 19
0
        public List<V_MenuSetRole> GetEDMSysMenuByType(string systemType)
        {

            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                List<V_MenuSetRole> menuList;
                string keyString = "GetEDMSysMenuByType" + systemType;
                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<V_MenuSetRole> IQList = bll.GetSysMenuNameByTypeInfoNew(systemType);
                    menuList = IQList == null ? null : IQList.ToList();
                    WCFCache.Current.Insert(keyString, menuList, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    menuList = (List<V_MenuSetRole>)WCFCache.Current[keyString];
                }

                return menuList.Count() > 0 ? menuList : null;
            }

        }
Ejemplo n.º 20
0
        public List<V_MenuSetRole> GetFBSysMenuByType(string systemType,string employeeid)
        {
            using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
            {
                #region 
                List<V_MenuSetRole> menuList;
                string keyString = "";
                T_SYS_FBADMIN UserFb=null;
                if (!string.IsNullOrEmpty(employeeid))
                {
                    T_SYS_USER Userinfo = this.GetUserByEmployeeID(employeeid);
                    if (Userinfo != null)
                    {
                        UserFb = this.getFbAdmin(Userinfo.SYSUSERID);
                    }
                    if (UserFb == null)
                    {
                        keyString = "GetFBSysMenuByType" + systemType;
                    }
                    else
                    {
                        keyString = "GetFBSysMenuByType" + systemType + employeeid;
                    }
                }
                else
                {
                    keyString = "GetFBSysMenuByType" + systemType;
                }
                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<V_MenuSetRole> IQList = UserFb != null ? bll.GetSysMenuNameByTypeInfoNew(systemType) : bll.GetSysMenuNameByTypeInfoNewToFbAdmins(systemType);
                    menuList = IQList == null ? null : IQList.ToList();
                    WCFCache.Current.Insert(keyString, menuList, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    menuList = (List<V_MenuSetRole>)WCFCache.Current[keyString];
                }
                #endregion
                return menuList.Count() > 0 ? menuList : null;
            }
        }
Ejemplo n.º 21
0
 public List<V_EntityMenu> GetEntityMenuByUser(string sysType, string userID, ref string Flag)
 {
     using (SysEntityMenuBLL bll = new SysEntityMenuBLL())
     {
         List<V_EntityMenu> menuList = bll.GetEntityMenuByUser(sysType, userID, ref Flag);
         if (menuList == null) return null;
         return menuList.Count() > 0 ? menuList.ToList() : null;
     }
 }