// // GET: /FactoryCatalogue/Brand/Details/5 public ActionResult Details(string categoryId, string id) { using (var context = new SiteContainer()) { var model = new FactoryCatalogueModel(CurrentLang, context, categoryId, id); ViewBag.CurrentBramdName = model.Brand.Name; ViewBag.CurrentMenuItem = "factory-details"; return View(model); } }
public ActionResult Details(string id) { using (var context = new SiteContainer()) { var model = new FactoryCatalogueModel(CurrentLang, context, id,null); this.SetSeoContent(model); ViewBag.CurrentMenuItem = "factory-details"; if (model.Category.CategoryBrands.Any()) { var minSortOrder = model.Category.CategoryBrands.Min(c => (int?)c.SortOrder) ?? 0; return RedirectToAction("Details", "Brand", new {area = "FactoryCatalogue", categoryId=model.Category.Name,id=model.Category.CategoryBrands.First(c=>c.SortOrder==minSortOrder).Name}); } return View(model); } }
// // GET: /FactoryCatalogue/Category/ public ActionResult Index() { using (var context = new SiteContainer()) { var model = new FactoryCatalogueModel(CurrentLang, context, null,null); if (!User.Identity.IsAuthenticated) { return RedirectToAction("LogOn", "Customer"); } this.SetSeoContent(model); ViewBag.CurrentMenuItem = model.Content.Name; return View(model); } }