private SelectList GetModuls(int storeId = 0) { var moduls = GetDefaultModuls(); storeId = GetStoreId(storeId); var navigations = NavigationRepository.GetStoreNavigations(storeId); foreach (var navigation in navigations) { String value = navigation.ControllerName.ToLower() + "-" + navigation.ActionName.ToLower(); if (moduls.Any(r => value.Equals(r.Value.ToLower(), StringComparison.InvariantCultureIgnoreCase))) { moduls.Remove( moduls.FirstOrDefault( r => r.Value.ToLower().Equals(value, StringComparison.InvariantCultureIgnoreCase))); } } var m = new SelectListItem(); m.Value = "Pages-Pages"; m.Text = "Pages"; moduls.Add(m); var sList = new SelectList(moduls, "Value", "Text"); return(sList); }
/// <summary> /// 加载导航分类 /// </summary> /// <returns></returns> public string LoadNavigationClassify() { NavigationRepository repository = new NavigationRepository(); List <Mango.Models.NavigationClassifyModel> model = repository.GetClassifyList(); return(JsonConvert.SerializeObject(model)); }
public async Task <IViewComponentResult> InvokeAsync(string NavigationParentPath, string CurrentPage = null) { // Use ViewBag to set current Path if (!string.IsNullOrWhiteSpace(CurrentPage)) { if (CurrentPage == "/Home") { // Special case for Home since the Link is just "/" CurrentPage = "/"; } } else { if (DataRetriever.TryRetrieve(out IPageDataContext <TreeNode> Context)) { CurrentPage = UrlHelper.Content(DocumentURLProvider.GetUrl(Context.Page)); } } NavigationParentPath = !string.IsNullOrWhiteSpace(NavigationParentPath) ? NavigationParentPath : "/MasterPage/Navigation"; var NavItems = await NavigationRepository.GetNavItemsAsync(NavigationParentPath); var model = new NavigationViewModel() { NavItems = NavItems.ToList(), CurrentPagePath = CurrentPage }; return(View(model)); }
public ActionResult DeleteConfirmed(int id) { Navigation navigation = NavigationRepository.GetSingle(id); try { NavigationRepository.Delete(navigation); NavigationRepository.Save(); if (IsSuperAdmin) { return(RedirectToAction("Index", new { storeId = navigation.StoreId })); } else { return(RedirectToAction("Index")); } } catch (Exception ex) { Logger.Error(ex, "Unable to delete:" + ex.StackTrace, navigation); //Log the error (uncomment dex variable name and add a line here to write a log. ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator."); } return(View(navigation)); }
object GetData(int toSkip, int toTake) { switch (_data) { case "BrunvollView": { var temp = new NavigationRepository(db); object ab = temp.GetBrunvollViewData(c1Filter.filterString, toSkip, toTake); _recordCount = temp.RecordCount; return(ab); } case "Projekt": { var temp = new NavigationRepository(db); object ab = temp.GetProjektData(c1Filter.filterString, toSkip, toTake); _recordCount = temp.RecordCount; return(ab); } case "ProjektAnlagentyp": { var temp = new NavigationRepository(db); object ab = temp.GetProjektAnlagentypData(c1Filter.filterString, toSkip, toTake); _recordCount = temp.RecordCount; return(ab); } default: return(null); } }
public NavigationViewModel GetStoreActiveNavigations() { var r = new NavigationViewModel(); r.Navigations = NavigationRepository.GetStoreActiveNavigations(MyStore.Id); return(r); }
public async Task <IViewComponentResult> InvokeAsync(string NodeAliasPath, int Level, bool LevelIsRelative = true, int MinimumAbsoluteLevel = 2, string CurrentPage = null) { // Use ViewBag to set current Path if (!string.IsNullOrWhiteSpace(CurrentPage)) { if (CurrentPage == "/Home") { // Special case for Home since the Link is just "/" CurrentPage = "/"; } } else { if (PageDataContextRetriever.TryRetrieve(out IPageDataContext <TreeNode> Context)) { CurrentPage = UrlResolver.ResolveUrl(DocumentURLProvider.GetUrl(Context.Page)); } } var AncestorPath = await NavigationRepository.GetAncestorPathAsync(NodeAliasPath, Level, LevelIsRelative, MinimumAbsoluteLevel); var NavItems = await NavigationRepository.GetSecondaryNavItemsAsync(AncestorPath, Enums.PathSelectionEnum.ParentAndChildren); var model = new NavigationViewModel() { NavItems = NavItems.ToList(), CurrentPagePath = CurrentPage }; return(View(model)); }
public UnitOfWork(DefaultDBContext context) { _context = context; Items = new ItemRepository(_context); Categories = new CategoryRepository(_context); Navigations = new NavigationRepository(_context); ItemContents = new ItemContentRepository(_context); }
void MyPager_eventPageChanged(object sender, PageControl.PageChangedEventArgs e) { var temp = new NavigationRepository(db); var ab = temp.GetBrunvollViewData(c1Filter.filterString, e.toSkip, e.toTake); ProjekteViewSource.Source = ab; ProjekteView = (ListCollectionView)ProjekteViewSource.View; }
// GET: /<controller>/ public IActionResult Index() { NavigationRepository repository = new NavigationRepository(); ViewModels.NavigationViewModel model = new ViewModels.NavigationViewModel(); model.ClassifyListData = repository.GetClassifyList(); return(View(model)); }
public IActionResult Classify() { NavigationRepository repository = new NavigationRepository(); ViewModels.ManagerPageViewModel model = new ViewModels.ManagerPageViewModel(); model.ListData = repository.GetClassifyListByManager(); return(View(model)); }
public UnitOfWork(DtsContext context) { _context = context; Drones = new DroneRepository(_context); NavigationPoints = new NavigationRepository(_context); Scales = new ScaleRepository(_context); Street = new StreetRepository(_context); Statistics = new StatisticsRepository(_context); }
private static NavigationRepository GetRepository() { var pageUrlRetriever = new Mock <IPageUrlRetriever>().Object; var basePageRepository = new Mock <IPageRepository <BasePage, TreeNode> >().Object; var urlSlugPageRepository = new Mock <IPageRepository <BasicPageWithUrlSlug, TreeNode> >().Object; var cultureRepository = new Mock <ISiteCultureRepository>().Object; var repository = new NavigationRepository(pageUrlRetriever, basePageRepository, urlSlugPageRepository, cultureRepository); return(repository); }
public ProductsViewModel GetProductIndexPage(string search, string page) { var resultModel = new ProductsViewModel(); resultModel.SCategories = ProductCategoryRepository.GetProductCategoriesByStoreIdFromCache(MyStore.Id, StoreConstants.ProductType); resultModel.SStore = MyStore; resultModel.SNavigations = NavigationRepository.GetStoreActiveNavigations(this.MyStore.Id); resultModel.SSettings = this.GetStoreSettings(); return(resultModel); }
public void TestGetStoreActiveNavigationsAsync() { int storeId = 9; var nav = new NavigationRepository(new StoreContext(ConnectionString)); var pds = new PageDesignRepository(new StoreContext(ConnectionString)); var mainMenu = nav.GetStoreActiveNavigationsAsync(storeId); var pageDesignTask = pds.GetPageDesignByName(storeId, "MainLayout"); }
public PhotosViewModel GetPhotos(int page) { var resultModel = new PhotosViewModel(); resultModel.SStore = this.MyStore; var m = FileManagerRepository.GetImagesByStoreId(MyStore.Id, page, 24); resultModel.SFileManagers = new PagedList <FileManager>(m.items, m.page - 1, m.pageSize, m.totalItemCount); resultModel.SNavigations = NavigationRepository.GetStoreActiveNavigations(this.MyStore.Id); resultModel.SSettings = this.GetStoreSettings(); return(resultModel); }
public ProductDetailViewModel GetProductDetailPage(string id) { var resultModel = new ProductDetailViewModel(); int productId = id.Split("-".ToCharArray()).Last().ToInt(); resultModel.SProduct = ProductRepository.GetProductsById(productId); resultModel.SStore = MyStore; resultModel.SCategory = ProductCategoryRepository.GetProductCategory(resultModel.Product.ProductCategoryId); resultModel.SCategories = ProductCategoryRepository.GetProductCategoriesByStoreId(MyStore.Id, StoreConstants.ProductType); resultModel.SNavigations = NavigationRepository.GetStoreActiveNavigations(this.MyStore.Id); resultModel.SSettings = this.GetStoreSettings(); return(resultModel); }
public async Task <IViewComponentResult> InvokeAsync(string NavigationParentPath, string CssClass = "MainNav") { NavigationParentPath = !string.IsNullOrWhiteSpace(NavigationParentPath) ? NavigationParentPath : "/MasterPage/Navigation"; var NavItems = await NavigationRepository.GetNavItemsAsync(NavigationParentPath); var model = new NavigationViewModel() { NavItems = NavItems.ToList(), NavWrapperClass = CssClass }; return(View(model)); }
// // GET: /Navigations/ public ViewResult Index(int storeId = 0, String search = "") { storeId = GetStoreId(storeId); List <Navigation> resultList = new List <Navigation>(); if (storeId != 0) { resultList = NavigationRepository.GetNavigationsByStoreId(storeId, search); } ViewBag.Search = search; return(View(resultList)); }
public Navigation GetNavigationBySiteAndSection(string site, string section) { var navigation = NavigationRepository.GetSingle(x => x.MicroSiteId.Equals(site, StringComparison.CurrentCultureIgnoreCase) && x.Section.Equals(section, StringComparison.CurrentCultureIgnoreCase)); if (navigation == null) { return(null); } navigation.NavigationItems = NavigationItemRepository.GetList(x => x.NavigationId.Equals(navigation.Id)); return(navigation); }
public SitemapResult GetNavigationSiteMap(Controller sitemapsController) { var sitemapItems = new List <SitemapItem>(); var navigations = NavigationRepository.GetStoreActiveNavigations(this.MyStore.Id); foreach (var navigation in navigations) { var siteMap = new SitemapItem(sitemapsController.Url.QualifiedAction(navigation.ActionName, navigation.ControllerName), changeFrequency: SitemapChangeFrequency.Monthly, priority: 1.0); sitemapItems.Add(siteMap); } return(new SitemapResult(sitemapItems)); }
public ProductCategoryViewModel GetProductCategory(string id, int page) { var resultModel = new ProductCategoryViewModel(); int categoryId = id.Split("-".ToCharArray()).Last().ToInt(); resultModel.SCategories = ProductCategoryRepository.GetProductCategoriesByStoreId(MyStore.Id, StoreConstants.ProductType); resultModel.SStore = MyStore; resultModel.SCategory = ProductCategoryRepository.GetProductCategory(categoryId); var m = ProductRepository.GetProductsCategoryId(MyStore.Id, categoryId, StoreConstants.ProductType, true, page, 24); resultModel.SProducts = new PagedList <Product>(m.items, m.page - 1, m.pageSize, m.totalItemCount); resultModel.SNavigations = NavigationRepository.GetStoreActiveNavigations(this.MyStore.Id); resultModel.SSettings = this.GetStoreSettings(); return(resultModel); }
public ContentsViewModel GetContentIndexPage(int page, String contentType) { var resultModel = new ContentsViewModel(); resultModel.SStore = MyStore; var m = ContentRepository.GetContentsCategoryId(MyStore.Id, null, contentType, true, page, 24); resultModel.SContents = new PagedList <Content>(m.items, m.page - 1, m.pageSize, m.totalItemCount); resultModel.SCategories = CategoryRepository.GetCategoriesByStoreId(MyStore.Id, contentType, true); resultModel.Type = contentType; resultModel.SNavigations = NavigationRepository.GetStoreActiveNavigations(this.MyStore.Id); resultModel.SSettings = this.GetStoreSettings(); return(resultModel); }
public ActionResult StoreDetails(int id = 0) { try { Navigation item = NavigationRepository.GetSingle(id); Store s = StoreRepository.GetSingle(item.StoreId); var productDetailLink = LinkHelper.GetNavigationLink(item); String detailPage = String.Format("http://{0}{1}", s.Domain, productDetailLink); return(Redirect(detailPage)); } catch (Exception ex) { Logger.Error(ex); return(new EmptyResult()); } }
// GET: /<controller>/ public IActionResult Index() { int pageIndex = 1; if (Request.Query["p"].Count > 0) { pageIndex = Framework.Core.Transform.GetInt(Request.Query["p"], 1); } int pageSize = 10; string Where = string.Empty; NavigationRepository repository = new NavigationRepository(); var query = repository.GetNavigationPageList(); ViewModels.ManagerPageViewModel model = new ViewModels.ManagerPageViewModel(); model.ListData = query.Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToMangoDataList(); model.TotalCount = query.Count(); return(View(model)); }
public CategoryViewModel GetCategory(string id, int page, String categoryType) { var returnModel = new CategoryViewModel(); int categoryId = id.Split("-".ToCharArray()).Last().ToInt(); StorePagedList <Content> task2 = ContentRepository.GetContentsCategoryId(MyStore.Id, categoryId, categoryType, true, page, 600); returnModel.SCategories = CategoryRepository.GetCategoriesByStoreId(MyStore.Id, categoryType, true); returnModel.SStore = MyStore; returnModel.SCategory = CategoryRepository.GetCategory(categoryId); returnModel.Type = categoryType; returnModel.SNavigations = NavigationRepository.GetStoreActiveNavigations(this.MyStore.Id); returnModel.SContents = new PagedList <Content>(task2.items, task2.page - 1, task2.pageSize, task2.totalItemCount); return(returnModel); }
public async Task <IViewComponentResult> InvokeAsync(string NodeAliasPath, int Level, bool LevelIsRelative = true, int MinimumAbsoluteLevel = 2, string CssClass = null) { // Begin Cache Scope, this is 'ended' in the view CacheDependenciesScope.Begin(); var AncestorPath = await NavigationRepository.GetAncestorPathAsync(NodeAliasPath, Level, LevelIsRelative, MinimumAbsoluteLevel); var NavItems = await NavigationRepository.GetSecondaryNavItemsAsync(AncestorPath, Enums.PathSelectionEnum.ParentAndChildren); var model = new NavigationViewModel() { NavItems = NavItems.ToList(), NavWrapperClass = CssClass, StartingPath = AncestorPath }; return(View(model)); }
// // GET: /Navigations/Create public ActionResult SaveOrEdit(int id = 0, int selectedStoreId = 0) { var item = new Navigation(); item.StoreId = GetStoreId(selectedStoreId); if (id == 0) { item.ParentId = 0; item.CreatedDate = DateTime.Now; item.State = true; } else { item = NavigationRepository.GetSingle(id); item.UpdatedDate = DateTime.Now; } return(View(item)); }
public ContentDetailViewModel GetContentDetail(string id, string contentType) { var resultModel = new ContentDetailViewModel(); int newsId = id.Split("-".ToCharArray()).Last().ToInt(); resultModel.SContent = ContentRepository.GetContentsContentId(newsId); if (!CheckRequest(resultModel.SContent)) { throw new Exception("Not Found.Site content is wrong"); } resultModel.Type = contentType; resultModel.SStore = MyStore; resultModel.SCategory = CategoryRepository.GetCategory(resultModel.Content.CategoryId); resultModel.SCategories = CategoryRepository.GetCategoriesByStoreId(MyStore.Id, contentType); resultModel.SNavigations = NavigationRepository.GetStoreActiveNavigations(this.MyStore.Id); resultModel.SSettings = this.GetStoreSettings(); return(resultModel); }
private void btnFilter_Click(object sender, RoutedEventArgs e) { int rpp; c1Filter.ResetFilter(this.testListView, (bool)this.chkIncludePlatzhalter.IsChecked); var temp = new NavigationRepository(db); if (cboRecordsPerPage.Text == "alle") { rpp = temp.RecordCount; } else { rpp = int.Parse(cboRecordsPerPage.Text); } var ab = temp.GetBrunvollViewData(c1Filter.filterString, 0, rpp); ProjekteViewSource.Source = ab; ProjekteView = (ListCollectionView)ProjekteViewSource.View; this.MyPager.Reset(1, rpp, temp.RecordCount); }