Example #1
0
        public ActionResult Gallery(string id)
        {
            using (var context = new SiteContainer())
            {
                SiteModel model = new SiteModel(context, "gallery");
                
                model.Categories = context.Category.Include("Products").ToList();

                if (model.Categories.Any())
                {
                    model.Category = !string.IsNullOrEmpty(id)
                                         ? model.Categories.First(c => c.Name == id)
                                         : model.Categories.First(c => !c.SpecialCategory);

                    model.Products = model.Products.Where(p => p.CategoryId == model.Category.Id).ToList();
                    model.Title += " » " + model.Category.Title;
                }



                //model.Products = model.Products.Where(p => p.CategoryId == id).ToList();
                //model.Category = context.Category.First(c => c.Id == id);
                this.SetSeoContent(model);
                return View(model);
            }
        }
Example #2
0
 public ActionResult Articles()
 {
     using (var context = new SiteContainer())
     {
         SiteModel model = new SiteModel(context, "articles", true);
         this.SetSeoContent(model);
         ViewBag.CurrentMenuItemName = model.Content.Name;
         return View(model);
     }
 }
Example #3
0
 public ActionResult Index(string id)
 {
     using (var context = new SiteContainer())
     {
         SiteModel model = new SiteModel(context, id);
         this.SetSeoContent(model);
         ViewBag.SpecialCategoryName = context.Category.First(c => c.SpecialCategory).Name;
         ViewBag.CurrentMenuItemName = model.Content.Name;
         ViewBag.isHomePage = model.IsHomePage;
         return View(model);
     }
 }
Example #4
0
 public ActionResult ArticleDetails(string id)
 {
     using (var context = new SiteContainer())
     {
         var model = new SiteModel(context, "articles", true);
         this.SetSeoContent(model);
         model.Article = context.Article.First(a => a.Name == id);
         ViewBag.PageTitle = model.Article.PageTitle;
         ViewBag.CurrentMenuItemName = model.Content.Name;
         return View(model);
     }
 }
Example #5
0
        public ActionResult Index(string id)
        {
            

            using (var context = new SiteContainer())
            {
                var model = new SiteModel(context, id);
                this.SetSeoContent(model);
                ViewBag.PageTitle = model.PageTitle;
                ViewBag.CurrentMenuItemName = model.Content.Name;
                ViewBag.isHomePage = model.IsHomePage;
                return View(model);
            }
        }
Example #6
0
 public ActionResult OurWorks()
 {
     using (var context = new SiteContainer())
     {
         var model = new SiteModel(context, "ourworks", false, true);
         this.SetSeoContent(model);
         ViewBag.CurrentMenuItemName = model.Content.Name;
         return View(model);
     }
 }
Example #7
0
 public ActionResult Tour(string id)
 {
     using (var context = new SiteContainer())
     {
         var model = new SiteModel(context, "tour");
         this.SetSeoContent(model);
         ViewBag.PageTitle = model.PageTitle;
         //ViewBag.SpecialCategoryName = context.Category.First(c => c.SpecialCategory).Name;
         ViewBag.CurrentMenuItemName = model.Content.Name;
         ViewBag.isHomePage = model.IsHomePage;
         ViewBag.FlashId = id;
         ViewBag.FlashName = id + ".html";
         return View(model);
     }
 }