예제 #1
0
        public List<V_RoleEntity> GetRoleEntityIDListInfosByRoleIDNewToUserRoleApp(string RoleID,ref List<T_SYS_ENTITYMENU> listmenu)
        {
            using (RoleEntityMenuBLL bll = new RoleEntityMenuBLL())
            {

                List<V_RoleEntity> ListmenuV = new List<V_RoleEntity>();
                List<V_RoleEntity> menuList;
                List<T_SYS_ENTITYMENU> tmpListmenu = new List<T_SYS_ENTITYMENU>();
                string keyString = "GetRoleEntityIDListInfosByRoleIDNewToUserRoleApp" + RoleID;
                string keyStringMenu = "GetRoleEntityIDListInfosByRoleIDNewToUserRoleAppMenu" + RoleID;
                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<V_RoleEntity> IList = bll.GetRoleEntityIDListInfosNewToUserRoleApp(RoleID, ref listmenu);
                    
                    menuList = IList != null ? IList.ToList() : null;
                    tmpListmenu = listmenu;
                    WCFCache.Current.Insert(keyString, menuList, DateTime.Now.AddMinutes(15));
                    WCFCache.Current.Insert(keyStringMenu, tmpListmenu, DateTime.Now.AddMinutes(15));
                }
                else
                {
                    menuList = (List<V_RoleEntity>)WCFCache.Current[keyString];
                    listmenu = (List<T_SYS_ENTITYMENU>)WCFCache.Current[keyStringMenu];
                }


                foreach (var q in menuList)
                {
                    V_RoleEntity temp = new V_RoleEntity();

                    if (string.IsNullOrEmpty(q.ENTITYMENUID))
                    {
                        continue;
                    }

                    ListmenuV.Add(temp);
                }

                return ListmenuV.Count() > 0 ? ListmenuV : null;
            }
        }
예제 #2
0
        public List<V_RoleEntity> GetRoleEntityIDListInfosByRoleIDNew(string RoleID)
        {
            using (RoleEntityMenuBLL bll = new RoleEntityMenuBLL())
            {
                
                List<V_RoleEntity> Listmenu = new List<V_RoleEntity>();
                List<V_RoleEntity> menuList;
                string keyString = "GetRoleEntityIDListInfosByRoleIDNew" + RoleID;
                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<V_RoleEntity> IList = bll.GetRoleEntityIDListInfosNew(RoleID);

                    menuList = IList != null ? IList.ToList() : null;
                    WCFCache.Current.Insert(keyString, menuList, DateTime.Now.AddMinutes(15));

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

                foreach (var q in menuList)
                {
                    V_RoleEntity temp = new V_RoleEntity();
                    
                    if (string.IsNullOrEmpty(q.ENTITYMENUID))
                    {
                       continue;
                    }
                    
                    Listmenu.Add(temp);
                }

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