public PartialViewResult SideBarNav(string activeMenu = "")
        {
            var model = new SideBarNavViewModel
            {
                MainMenu           = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("MainMenu", AbpSession.ToUserIdentifier())),
                ActiveMenuItemName = activeMenu
            };

            return(PartialView("_SideBarNav", model));
        }
Beispiel #2
0
        public ActionResult GetMenu(string menuName)
        {
            var model = new TopMenuViewModel
            {
                MainMenu           = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync(menuName, AbpSession.ToUserIdentifier())),
                ActiveMenuItemName = menuName
            };

            return(PartialView("_AsideMenu", model));
        }
Beispiel #3
0
        public PartialViewResult TopMenu(string activeMenu = "")
        {
            var model = new TopMenuViewModel
            {
                MainMenu           = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("MainMenu", AbpSession.UserId)),
                ActiveMenuItemName = activeMenu
            };

            return(PartialView("_TopMenu", model));
        }
Beispiel #4
0
        public PartialViewResult Sidebar(string currentPageName = "")
        {
            var sidebarModel = new SidebarViewModel
            {
                Menu            = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync(MpaNavigationProvider.MenuName, AbpSession.ToUserIdentifier())),
                CurrentPageName = currentPageName
            };

            return(PartialView("_Sidebar", sidebarModel));
        }
Beispiel #5
0
        public async Task <IViewComponentResult> InvokeAsync(string activeMenu = "")
        {
            var model = new SideBarNavViewModel
            {
                MainMenu           = await _userNavigationManager.GetMenuAsync(),
                ActiveMenuItemName = activeMenu
            };

            return(View(model));
        }
        public async Task <IViewComponentResult> InvokeAsync(string currentPageName = null)
        {
            var sidebarModel = new SidebarViewModel
            {
                Menu            = await _userNavigationManager.GetMenuAsync(AppAreaNameNavigationProvider.MenuName, _abpSession.ToUserIdentifier()),
                CurrentPageName = currentPageName
            };

            return(View(sidebarModel));
        }
Beispiel #7
0
        protected async Task <SideBarNavViewModel> GetUserMenu(string activeMenu = "")
        {
            var model = new SideBarNavViewModel
            {
                MainMenu           = await _userNavigationManager.GetMenuAsync("MainMenu", AbpSession.ToUserIdentifier()),
                ActiveMenuItemName = activeMenu
            };

            return(model);
        }
Beispiel #8
0
        public async Task <IViewComponentResult> InvokeAsync(string activeMenu = "")
        {
            var model = new TopMenuViewModel
            {
                MainMenu           = await _userNavigationManager.GetMenuAsync("MainMenu", _abpSession.ToUserIdentifier()),
                ActiveMenuItemName = activeMenu
            };

            return(View(model));
        }
        public PartialViewResult Nav(string activeMenu = "")
        {
            var loginInformations = AsyncHelper.RunSync(() => _sessionAppService.GetCurrentLoginInformations());
            var menu = new TopMenuViewModel
            {
                MainMenu           = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("MainMenu", AbpSession.ToUserIdentifier())),
                ActiveMenuItemName = activeMenu
            };

            return(PartialView("_Nav", Tuple.Create <TopMenuViewModel, GetCurrentLoginInformationsOutput>(menu, loginInformations)));
        }
        public PartialViewResult TopMenu(string activeMenu = "")
        {
            //shared中    @Html.Partial("_TopBar") 去加载部分视图   _TopBar.cshtml
            var model = new TopMenuViewModel
            {
                MainMenu           = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("MainMenu", AbpSession.ToUserIdentifier())),
                ActiveMenuItemName = activeMenu
            };

            return(PartialView("_TopMenu", model));
        }
Beispiel #11
0
        public PartialViewResult SideMenu(string currentPageName = "")
        {
            var isGrantedPermission = PermissionChecker.IsGranted(AbpSession.ToUserIdentifier(), UserPermissions.User);
            var model = new SideMenuViewModel
            {
                MainMenu        = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("Mpa", AbpSession.ToUserIdentifier())),
                CurrentPageName = currentPageName
            };

            return(PartialView("_SideMenu", model));
        }
Beispiel #12
0
        public PartialViewResult LeftMenu(string activeMenu = "")
        {
            var model = new TopMenuViewModel
            {
                MainMenu           = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("MainMenu", AbpSession.ToUserIdentifier())),
                ActiveMenuItemName = activeMenu
            };

            //计算出上级
            foreach (var item in model.MainMenu.Items)
            {
                var pitem = item.Items.FirstOrDefault(t => t.Name == model.ActiveMenuItemName);
                if (pitem != null)
                {
                    model.ActiveMenuItemParentName = item.Name;
                    break;
                }
            }

            return(PartialView("_LeftMenu", model));
        }
Beispiel #13
0
        public async Task <IViewComponentResult> InvokeAsync(string activeMenu = "")
        {
            var model = new TopBarViewModel
            {
                MainMenu              = await _userNavigationManager.GetMenuAsync("MainMenu", _abpSession.ToUserIdentifier()),
                ActiveMenuItemName    = activeMenu,
                LoginInformations     = await _sessionAppService.GetCurrentLoginInformations(),
                IsMultiTenancyEnabled = _multiTenancyConfig.IsEnabled,
            };

            return(View(model));
        }
        private void HeaderProcess(string currentPageName, HeaderViewModel headerModel)
        {
            if (AbpSession.UserId.HasValue)
            {
                headerModel.LoginInformations = AsyncHelper.RunSync(() => _sessionAppService.GetCurrentLoginInformations());
            }

            headerModel.Languages       = LocalizationManager.GetAllLanguages();
            headerModel.CurrentLanguage = LocalizationManager.CurrentLanguage;

            if (AbpSession.UserId.HasValue)
            {
                headerModel.Menu = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync(FrontEndNavigationProvider.MenuName, new Abp.UserIdentifier(AbpSession.TenantId, AbpSession.UserId.Value)));
            }
            else
            {
                headerModel.Menu            = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync(FrontEndNavigationProvider.MenuName, AbpSession.UserId, AbpSession.TenantId));
                headerModel.CurrentPageName = currentPageName;
            }
            headerModel.IsMultiTenancyEnabled     = _multiTenancyConfig.IsEnabled;
            headerModel.TenantRegistrationEnabled = SettingManager.GetSettingValue <bool>(AppSettings.TenantManagement.AllowSelfRegistration);
        }
Beispiel #15
0
        public ActionResult Index()
        {
            var model = new IndexViewModel
            {
                MainMenu        = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("MainMenu", AbpSession.UserId)),
                CurrentLanguage = _localizationManager.CurrentLanguage,
                Languages       = _localizationManager.GetAllLanguages()
            };

            if (AbpSession.UserId.HasValue)
            {
                model.LoginInformations = AsyncHelper.RunSync(() => _sessionAppService.GetCurrentLoginInformations());
            }
            return(View(model));
        }
        public async Task <IViewComponentResult> InvokeAsync(string FirstMenu = "", string SecondMenu = "")
        {
            var model = new SideBarNavViewModel
            {
                MainMenu = await _userNavigationManager.GetMenuAsync("MainMenu", _abpSession.ToUserIdentifier()),
                ActiveFisrtMenuItemName  = FirstMenu,
                ActiveSecondMenuItemName = SecondMenu
            };

            GetCurrentLoginInformationsOutput s = await _sessionAppService.GetCurrentLoginInformations();

            ViewBag.LoginInfo = s;
            ViewBag.Role      = _roleAppService.GetRole(s.User.Id);
            return(View(model));
        }
Beispiel #17
0
        public async Task <LoginResultDto> GetCurrentWebInfo()
        {
            var output = new LoginResultDto();


            output.Menu = (await _userNavigationManager.GetMenuAsync("MainMenu", AbpSession.ToUserIdentifier())).UserMenuToNgMenu();

            output.App = new AppConsts()
            {
                name = ParkConsts.AppName, description = ParkConsts.Description, year = AppVersionHelper.ReleaseDate
            };



            return(output);
        }
Beispiel #18
0
        public PartialViewResult Header(string currentPageName = "")
        {
            var headerModel = new HeaderViewModel();

            headerModel.AppSettings = HostSettingsAppService.GetAppSettings();

            if (InfrastructureSession.UserId.HasValue)
            {
                headerModel.LoginInformations = AsyncHelper.RunSync(() => _sessionAppService.GetCurrentLoginInformationsAsync());
            }
            headerModel.Menu            = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync(HomeNavigationProvider.MenuName, InfrastructureSession.ToUserIdentifier()));
            headerModel.CurrentPageName = currentPageName;

            headerModel.IsMultiTenancyEnabled     = _multiTenancyConfig.IsEnabled;
            headerModel.TenantRegistrationEnabled = SettingManager.GetSettingValue <bool>(AppSettings.TenantManagement.AllowSelfRegistration);

            return(PartialView(headerModel));
        }
Beispiel #19
0
        public PartialViewResult Header(string currentPageName = "")
        {
            var headerModel = new HeaderViewModel();

            if (AbpSession.UserId.HasValue)
            {
                headerModel.LoginInformations = AsyncHelper.RunSync(() => _sessionAppService.GetCurrentLoginInformations());
            }

            headerModel.Languages       = LocalizationManager.GetAllLanguages();
            headerModel.CurrentLanguage = LocalizationManager.CurrentLanguage;
            headerModel.Menu            = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync(FrontEndNavigationProvider.MenuName, AbpSession.UserId));
            headerModel.CurrentPageName = currentPageName;

            headerModel.IsMultiTenancyEnabled = _multiTenancyConfig.IsEnabled;

            return(PartialView("~/Views/Layout/_Header.cshtml", headerModel));
        }
Beispiel #20
0
        public PartialViewResult Header(string currentPageName = "")
        {
            var headerModel = new HeaderViewModel();

            if (AbpSession.UserId.HasValue)
            {
                headerModel.LoginInformations = AsyncHelper.RunSync(() => _sessionCache.GetCurrentLoginInformationsAsync());
            }

            headerModel.Languages       = _languageManager.GetLanguages();
            headerModel.CurrentLanguage = _languageManager.CurrentLanguage;

            headerModel.Menu            = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync(FrontEndNavigationProvider.MenuName, AbpSession.ToUserIdentifier()));
            headerModel.CurrentPageName = currentPageName;

            headerModel.IsMultiTenancyEnabled     = _multiTenancyConfig.IsEnabled;
            headerModel.TenantRegistrationEnabled = SettingManager.GetSettingValue <bool>(AppSettings.TenantManagement.AllowSelfRegistration);

            return(PartialView("~/Views/Layout/_Header.cshtml", headerModel));
        }
        public async Task <IViewComponentResult> InvokeAsync(string activeMenu = "") //convert activemenue strng to array
        {
            var result = activeMenu.Split('.');

            var first  = result[0];
            var second = "";

            if (result.Length > 1)
            {
                second = result[1];
            }

            var model = new SideBarNavViewModel
            {
                MainMenu = await _userNavigationManager.GetMenuAsync("MainMenu", _abpSession.ToUserIdentifier()),
                ActiveMenuItemNameFirst  = result[0],
                ActiveMenuItemNameSecond = second
            };

            return(View(model));
        }
        public async Task <IViewComponentResult> InvokeAsync(string currentPageName = null)
        {
            bool isAuth = User.Identity.IsAuthenticated;
            var  result = await _userService.GetUserByClaims(UserClaimsPrincipal);

            UserItemDto user = new UserItemDto();

            if (result.IsSuccessed)
            {
                user = result.Value;
            }
            var model = new MenuViewModel
            {
                Menu            = await _userNavigationManager.GetMenuAsync(ElectronicJournalNavigationProvider.MenuName, UserClaimsPrincipal),
                CurrentPageName = currentPageName,
                IsAuth          = isAuth,
                User            = user
            };

            return(View("Default", model));
        }
Beispiel #23
0
        public async Task <IViewComponentResult> InvokeAsync(string currentPageName = "")
        {
            var headerModel = new HeaderViewModel();

            if (_abpSession.UserId.HasValue)
            {
                headerModel.LoginInformations = await _sessionAppService.GetCurrentLoginInformations();
            }

            headerModel.Languages       = _languageManager.GetLanguages();
            headerModel.CurrentLanguage = _languageManager.CurrentLanguage;

            headerModel.Menu = await _userNavigationManager.GetMenuAsync(
                FrontEndNavigationProvider.MenuName,
                _abpSession.ToUserIdentifier()
                );

            headerModel.CurrentPageName = currentPageName;

            headerModel.IsMultiTenancyEnabled     = _multiTenancyConfig.IsEnabled;
            headerModel.TenantRegistrationEnabled = await _settingManager.GetSettingValueAsync <bool>(AppSettings.TenantManagement.AllowSelfRegistration);

            return(View(headerModel));
        }
Beispiel #24
0
        public async Task <IList <UserMenuItem> > GetUserMenus()
        {
            var menu = await _userNavigationManager.GetMenuAsync(DBNavigationProvider.MenuGroupName, AbpSession.ToUserIdentifier());

            return(menu.Items);
        }
Beispiel #25
0
 public async Task <AjaxResponse> GetMenus()
 {
     return(new AjaxResponse((await _userNavigationManager.GetMenuAsync("MainMenu", AbpSession.ToUserIdentifier())).Items));
 }