Exemplo n.º 1
0
        public ActionResult _Nav()
        {
            ModuleShared lstModel = new ModuleShared();


            //Get from cookie
            //List<ModuleApplication> model = CookieStore.Get<List<ModuleApplication>>(APIConstant.COOKIE_MODULE + APIConstant.MODULE_CMS, HttpContext.ApplicationInstance.Context);
            //if (model != null)
            //{
            //    lstModel.lstModuleParent = model.Where(x => x.ParentId == 0).ToList();
            //    lstModel.lstModuleItem = model.Where(x => x.ParentId != 0).ToList();
            //}

            string strUrl = APIProvider.APIGenerator("Module", "Initial", new List <string> {
                "group"
            }, true, APIConstant.MODULE_CMS);
            var lstModule = APIProvider.Authorize_GetNonAsync <List <ModuleApplication> >(_userSession.BearerToken, strUrl, APIConstant.API_Resource_CORE, ARS.IgnoredARS);

            if (lstModule != null)
            {
                lstModel.lstModuleParent = lstModule.Where(x => x.ParentId == 0).ToList();
                lstModel.lstModuleItem   = lstModule.Where(x => x.ParentId != 0).ToList();
            }

            return(PartialView("_Nav", lstModel));
        }
Exemplo n.º 2
0
        public ActionResult _Nav()
        {
            ModuleShared lstModel = new ModuleShared();


            string strUrl = APIProvider.APIGenerator("Module", "Initial", new List <string> {
                "group"
            }, true, APIConstant.MODULE_INTERNAL);
            var lstModule = APIProvider.Authorize_GetNonAsync <List <ModuleApplication> >(_userSession.BearerToken, strUrl, APIConstant.API_Resource_CORE, ARS.IgnoredARS);

            if (lstModule != null)
            {
                lstModel.lstModuleParent = lstModule.Where(x => x.ParentId == 0).ToList();
                lstModel.lstModuleItem   = lstModule.Where(x => x.ParentId != 0).ToList();
            }

            return(PartialView("_Nav", lstModel));
        }