Exemplo n.º 1
0
        public ActionResult Index(string area     = "New York", string locale = "",
                                  string category = "", string subcategory    = "")
        {
            if (!string.IsNullOrEmpty(category) || !string.IsNullOrEmpty(subcategory))
            {
                return(RedirectToAction("Index", "PostFilter",
                                        new { area, locale, category, subcategory }));
            }

            var areas = LocationOps.GetDistinctAreas()
                        .Select(a => a.Area)
                        .ToList();

            var locales          = new List <string>();
            var activeCategories = PostTypesOps.GetActivePostTypesList();

            if (!string.IsNullOrEmpty(area))
            {
                locales = LocationOps.GetLocalesByArea(area)
                          .Select(l => l.Locale)
                          .ToList();
            }

            locales.Sort();

            return(View(new HomePageViewModel(activeCategories)
            {
                Area = area,
                Areas = areas,
                Locales = locales,
                Locale = locale
            }));
        }
Exemplo n.º 2
0
 // GET: Locations
 public ActionResult Index()
 {
     return(View(LocationOps.GetDistinctAreas()));
 }