Exemplo n.º 1
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;
            }
        }
Exemplo n.º 2
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;
     }
 }