// // GET: /Base/ protected override void Initialize(System.Web.Routing.RequestContext requestContext) { base.Initialize(requestContext); try { try { List<curtmfg.Models.Category> parentCatSession = (List<curtmfg.Models.Category>)HttpContext.Session["parentCategories"]; if (parentCatSession == null) { throw new Exception("No Categories"); } ViewBag.parentcategories = parentCatSession; } catch { List<curtmfg.Models.Category> parentcategories = curtmfg.Models.Category.GetParentCategories(); HttpContext.Session.Add("parentCategories", parentcategories); ViewBag.parentcategories = parentcategories; } SimpleMenu mainmenu = new MenuModel().GetPrimary(); ViewBag.mainmenu = mainmenu; List<SimpleMenu> sitemapmenus = new MenuModel().GetFooterSitemap(); ViewBag.sitemapmenus = sitemapmenus; //List<string> years = Hitch_API.getYears(); //ViewBag.years = years; // Get all the cookies HttpCookie vehicleYear = Request.Cookies.Get("vehicle_year"); ViewBag.year = (vehicleYear != null && vehicleYear.Value != null) ? vehicleYear.Value.ToString() : ""; HttpCookie vehicleMake = Request.Cookies.Get("vehicle_make"); ViewBag.make = (vehicleMake != null && vehicleMake.Value != null) ? vehicleMake.Value.ToString() : ""; HttpCookie vehicleModel = Request.Cookies.Get("vehicle_model"); ViewBag.model = (vehicleModel != null && vehicleModel.Value != null) ? vehicleModel.Value.ToString() : ""; HttpCookie vehicleStyle = Request.Cookies.Get("vehicle_style"); ViewBag.style = (vehicleStyle != null && vehicleStyle.Value != null) ? vehicleStyle.Value.ToString() : ""; HttpCookie vehicleID = Request.Cookies.Get("vehicle_id"); ViewBag.vehicleID = (vehicleID != null && vehicleID.Value != null) ? vehicleID.Value.ToString() : ""; HttpCookie curtCustomerID = Request.Cookies.Get("customerID"); ViewBag.curtCustomerID = (curtCustomerID != null && curtCustomerID.Value != null) ? curtCustomerID.Value.ToString() : ""; HttpCookie curtCustomerName = Request.Cookies.Get("customerName"); ViewBag.curtCustomerName = (curtCustomerName != null && curtCustomerName.Value != null) ? curtCustomerName.Value.ToString() : ""; HttpCookie lastCategory = Request.Cookies.Get("last_category"); ViewBag.lastVisitedCategory = (lastCategory != null && lastCategory.Value != null) ? Convert.ToInt32(lastCategory.Value.ToString()) : 0; } catch (Exception e) { ViewBag.error = e.Message; } }
// // GET: /FAQ/ public ActionResult Index() { List<menuWithContent> sitemap = new MenuModel().GetSitemap(); ViewBag.sitemap = sitemap; List<ContentPage> contents = new SiteContentModel().GetSitemap(); ViewBag.contents = contents; List<NewsItem> news = NewsModel.GetAll(); ViewBag.news = news; List<PostWithCategories> posts = PostModel.GetSitemap(); ViewBag.posts = posts; List<curtmfg.Models.Category> categories = curtmfg.Models.Category.GetAllCategories(); ViewBag.categories = UDF.generateCategorySitemap(categories); List<curtmfg.Models.Category> lifestyles = Hitch_API.GetLifestyles(); ViewBag.lifestyles = lifestyles; return View(); }
public ActionResult page(string name = "") { if (!AuthenticateModel.checkAuth(Request.Cookies.Get("customerID"))) { string message = "You are not logged in!"; return RedirectToAction("Login", new { message = message }); } ContentPage content = new SiteContentModel().Get(name); ViewBag.content = content; menuWithContent dealermenu = new MenuModel().Get("dealerarea"); ViewBag.dealermenu = dealermenu; return View("index"); }
// // GET: /Dealer/ public ActionResult Index() { if (!AuthenticateModel.checkAuth(Request.Cookies.Get("customerID"))) { string message = "Authentication is required to view that content. Please login using the form below."; return RedirectToAction("Login", new { message = message }); } menuWithContent dealermenu = new MenuModel().Get("dealerarea"); ViewBag.dealermenu = dealermenu; ContentPage content = new ContentPage(); foreach (menuItem item in dealermenu.getChildren()) { if (item.hasContent()) { content = item.content; break; } } ViewBag.content = content; return View(); }