public StartupViewModel PrepareStartupViewData()
        {
            var setupConfig        = SetupHelper.LoadSetup();
            var model              = new StartupViewModel();
            var moduleSiteMenuList = new List <SiteMenuItem>();
            var roleList           = _nccPermissionService.LoadAll().Select(x => new { Name = x.Name, Value = x.Id }).ToList();

            model.Url         = setupConfig.StartupUrl;
            model.StartupType = setupConfig.StartupType;

            //original was Slug , Title
            model.Pages      = new SelectList(_pageService.LoadAll(true), "Id", "Name", setupConfig.StartupData);
            model.Posts      = new SelectList(_postService.Load(0, 100, true, true), "Id", "Name", setupConfig.StartupData);
            model.Categories = new SelectList(_categoryService.LoadAll(true), "Id", "Name", setupConfig.StartupData);
            NccMenuHelper.GetModulesSiteMenus().Select(x => x.Value).ToList().ForEach(x => moduleSiteMenuList.AddRange(x));
            model.ModuleSiteMenus = new SelectList(moduleSiteMenuList, "Url", "Url", setupConfig.StartupData);
            model.Roles           = new SelectList(roleList, "Value", "Name");

            ViewBag.RoleStartups = _startupService.LoadAll(true, 0, "", false);

            ViewBag.DefaultChecked  = "";
            ViewBag.PageChecked     = "";
            ViewBag.CategoryChecked = "";
            ViewBag.PostChecked     = "";
            ViewBag.ModuleChecked   = "";

            if (setupConfig.StartupType == StartupTypeText.Page)
            {
                ViewBag.PageChecked = "checked";
            }
            else if (setupConfig.StartupType == StartupTypeText.Post)
            {
                ViewBag.PostChecked = "checked";
            }
            else if (setupConfig.StartupType == StartupTypeText.Category)
            {
                ViewBag.CategoryChecked = "checked";
            }
            else if (setupConfig.StartupType == StartupTypeText.Module)
            {
                ViewBag.ModuleChecked = "checked";
            }
            else
            {
                ViewBag.DefaultChecked = "checked";
            }

            return(model);
        }
        private void AddCmsMenuViewData()
        {
            string lang = GlobalContext.WebSite.IsMultiLangual ? "" : GlobalContext.WebSite.Language;

            ViewBag.RecentPages           = _pageDetailsService.LoadRecentPageDetails(10, lang);
            ViewBag.RecentPostDetails     = _nccPostDetailsService.LoadRecentPostDetails(10, lang);
            ViewBag.RecentCategoryDetails = _nccCategoryDetailsService.LoadRecentCategoryDetails(10, lang);
            ViewBag.RecentTags            = _nccTagService.LoadRecentTag(10);

            ViewBag.ModuleSiteMenus = NccMenuHelper.GetModulesSiteMenus();

            ViewBag.MenuList      = _menuService.LoadAll();
            ViewBag.MenuLocations = ThemeHelper.ActiveTheme.MenuLocations.ToList();

            ViewBag.CurrentMenu      = new NccMenu();
            ViewBag.CurrentMenuItems = "";
        }
        public JsonResult LoadModules(string name)
        {
            List <NccModuleMenuViewModel> moduleMenuList = new List <NccModuleMenuViewModel>();
            var response = new ApiResponse();

            response.IsSuccess = false;
            response.Message   = "No data found";
            if (!string.IsNullOrEmpty(name))
            {
                name = name.ToLower();
                foreach (KeyValuePair <SiteMenu, List <SiteMenuItem> > item in NccMenuHelper.GetModulesSiteMenus())
                {
                    foreach (SiteMenuItem subItem in item.Value)
                    {
                        moduleMenuList.Add(new NccModuleMenuViewModel()
                        {
                            ModuleName = subItem.Module, MenuName = item.Key.Name, Area = subItem.Area, MenuItemName = subItem.Name, MenuUrl = subItem.Url
                        });
                    }
                }
                var details = moduleMenuList.Where(x => x.ModuleName.ToLower().Contains(name) || x.MenuItemName.ToLower().Contains(name)).OrderBy(x => x.ModuleName).ThenBy(x => x.MenuItemName).ToList();
                if (details != null)
                {
                    if (details.Count > 0)
                    {
                        response.Data      = details.Select(x => new { moduleName = x.ModuleName, menuName = x.MenuName, menuItemName = x.MenuItemName, menuUrl = x.MenuUrl });
                        response.IsSuccess = true;
                        response.Message   = "successfull";
                    }
                    else
                    {
                        response.IsSuccess = false;
                        response.Message   = "Empty name";
                    }
                }
            }
            else
            {
                response.IsSuccess = false;
                response.Message   = "Empty name";
            }

            return(Json(response));
        }