public SiteModel(SiteContext context, string contentId) { Title = "ПЕНЕТРОН УКРАИНА"; Content = context.Content.Include("ContentItems").FirstOrDefault(c => c.Name == contentId) ?? context.Content.First(c => c.MainPage); SeoDescription = Content.SeoDescription; SeoKeywords = Content.SeoKeywords; Reasons = context.Reason.ToList(); Sliders = context.Slider.ToList(); }
public BuildingController(SiteContext context) { _context = context; }
public HomeController(SiteContext context) { _context = context; }
public BuildingModel(SiteContext context, string categoryId, string subCategoryId, int contentType, string articleId=null) : base(context, null) { _categoryId = categoryId; _subCategoryId = subCategoryId; _contentId = subCategoryId ?? categoryId; _buildings = context.Building.Include("Children").Include("BuildingItems").Where(b => b.ContentType == contentType).ToList(); if (categoryId != null) if (subCategoryId == null) ParentTitle = _buildings.Single(t => t.CategoryLevel == 0).Title; Building = _buildings.FirstOrDefault(t => t.Name == _contentId) ?? _buildings.First(t => t.CategoryLevel == 0); if (!HttpContext.Current.Request.IsAuthenticated) { if (Building.CategoryLevel == 0 && !Building.Active) { Building = _buildings.Where(t => t.Parent == null && t.CategoryLevel != 0).Where(t => t.SortOrder == _buildings.Min(c => (int?)c.SortOrder)).FirstOrDefault(); //Building = _buildings.FirstOrDefault(t => t.Parent == null && t.CategoryLevel != 0); if (Building != null) { ActiveCategoryNotFound = true; RedirectCategoryId = Building.Name; return; } } if (Building != null) { if (Building.CategoryLevel != 0 && !Building.Active && Building.Children.Any()) { ActiveCategoryNotFound = true; RedirectCategoryId = Building.Name; RedirectSubCategoryId = Building.Children.First().Name; return; } } } if (Building != null) { if (Building.Parent != null) { ParentTitle = Building.Parent.Title; } SeoDescription = Building.SeoDescription; SeoKeywords = Building.SeoKeywords; } GetMenu(); if (contentType == 1) { BuildingObjects = context.BuildingObj.ToList(); } if (articleId != null) Article = context.Article.First(a => a.Name == articleId); }
public TechnologyController(SiteContext context) { _context = context; }
public ContentController(SiteContext context) { _context = context; }
public ArticleController(SiteContext context) { _context = context; }
public SliderController(SiteContext context) { _context = context; }
public ReasonController(SiteContext context) { _context = context; }