Exemplo n.º 1
0
        public List<T_SYS_ENTITYMENU> GetSysMenuByTypeTOFbAdmin(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;
                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 = "GetSysMenuByType" + systemType + parentID;
                    }
                    else
                    {
                        keyString = "GetSysMenuByType" + systemType + parentID + employeeID;
                    }

                }
                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<T_SYS_ENTITYMENU> IQList = UserFb != null ? bll.GetSysMenuByType(systemType, parentID,UserFb):bll.GetSysMenuByTypeToFbAdmin(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.Count() > 0 ? menuList : null;
            }
        }
Exemplo n.º 2
0
        public List<T_SYS_ENTITYMENU> GetSysMenuByType(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 = "GetSysMenuByType" + systemType + parentID;
                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<T_SYS_ENTITYMENU> IQList = bll.GetSysMenuByType(systemType, parentID,null);

                    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.Count() > 0 ? menuList : null;
            }
        }