public ActionResult ShowAllZips() { BizInfoModel bim = new BizInfoModel(); List <BizInfo> lzips = BizInfoRepository.GetAllBizInfos(true); bim.ShowZipCodes = AllZopCodesView.ShowZipCodesView_Bootstarp(lzips, null, null); return(PartialView(bim)); }
public ActionResult ShowAllCities() { BizInfoModel bim = new BizInfoModel(); List <BizInfo> lbi = BizInfoRepository.GetAllBizInfos(true); int n = BizInfoRepository.GetNumberOfCityInBizInfos(lbi, true); // bim.ShowCities = AllCitiesView.ShowAllCities(lbi, n, null, 4); bim.ShowCities = AllCitiesView.ShowAllCities_Bootstrap(lbi, n, null); bim.ShowCuisines = AllCuisinesView.ShowCuisinesView(BizCuisineRepository.GetAllBizCuisines(true), null, null); bim.ShowMostPopularCities = AllCitiesView.ShowMostPopularCities(BizInfoRepository.GetBizInfoInMostPopularCities(true), 4); return(PartialView(bim)); }
//[OutputCache(Duration = 1000)] public ActionResult MainContent() { BizInfoModel bim = new BizInfoModel(); bim.ShowMostPopularCities = AllCitiesView.ShowMostPopularCities_bootatrap(BizInfoRepository.GetBizInfoInMostPopularLocalCities(true)); bim.ShowMostPopularCuisines = AllCuisinesView.ShowMostPopularCuisines_Bootstarp(BizCuisineRepository.GetBizCuisinesInMostPopularCuisines(true)); List <BizInfo> lzips = BizInfoRepository.GetAllBizInfos(true); bim.ShowZipCodes = AllZopCodesView.ShowZipCodesView_Bootstarp(lzips.Take(12).ToList(), null, null); bim.HotelTypes = HotelTypeRepository.GetAllHotelTypes(true).Take(4).ToList(); return(PartialView(bim)); }
public ActionResult Index(string dlv, string street, string address, string city, string zip, string cuisine, ShoppingCart cart, BrowseHistory bh) { ViewBag.result = "y"; string ct = string.IsNullOrEmpty(city) ? string.Empty : DecodeString(city); bh.City = ct; bh.Address = string.IsNullOrEmpty(street) ? "" : street; bh.AddressCityState = string.IsNullOrEmpty(address) ? "" : address; bh.Zip = zip; bh.Cuisine = string.IsNullOrEmpty(cuisine) ? string.Empty : DecodeString(cuisine); ViewBag.Address = bh.AddressCityState; ViewBag.Zipcode = bh.Zip; bh.IsDelivery = string.IsNullOrEmpty(dlv) ? bh.IsDelivery : (dlv == "true" ? true : false); ViewBag.delivery = bh.IsDelivery; FilterViewModels fvm = new FilterViewModels(); fvm.cuisine = bh.Cuisine; // string.IsNullOrEmpty(cuisine) ? fvm.cuisine : cuisine; List <CuisineType> lct = CuisineTypeRepository.GetAllCuisineTypes(true); fvm.CuisineAssistances = new List <SelectListItem>(); fvm.CuisineAssistances.Add(new SelectListItem { Text = "All Cuisines", Value = "All" }); foreach (var c in lct) { fvm.CuisineAssistances.Add(new SelectListItem { Text = c.Title, Value = c.Title }); } fvm.History = bh; fvm.city = ct; fvm.zip = zip; fvm.userFullAddress = bh.AddressCityState + " " + bh.Zip; fvm.BizInfos = BizInfoRepository.GetAllBizInfos(true) .Where(p => (string.IsNullOrEmpty(ct) ? true : p.Address.City.ToLower() == ct.ToLower()) && (string.IsNullOrEmpty(zip) ? true : p.Address.ZipCode == zip) && (string.IsNullOrEmpty(cuisine) ? true : p.BizCuisines.Where(e => e.CuisineTypeName == bh.Cuisine && e.BizInfoId == p.BizInfoId).Count() > 0)).ToList(); if (fvm.BizInfos == null || fvm.BizInfos.Count <= 0) { ViewBag.result = "n"; return(View(fvm)); } bh.FilterSet = fvm.BizInfos; fvm.BizOpenSet = fvm.BizInfos.Where(e => e.IsOpenNow == true).ToList(); fvm.BizCloseSet = fvm.BizInfos.Except(fvm.BizOpenSet).ToList(); fvm.BizHiddenSet = new List <BizInfo>(); bh.FilterOpenSet = fvm.BizOpenSet; bh.FilterCloseSet = fvm.BizCloseSet; bh.FilterHiddenSet = fvm.BizHiddenSet; StringBuilder sb = new StringBuilder(); sb.Append("["); foreach (var b in fvm.BizInfos) { sb.Append("["); sb.Append("'" + b.BizTitle + "',"); sb.Append("'" + b.Address.AddressLine + "',"); sb.Append("'" + b.Address.City + "',"); sb.Append("'" + b.Address.State + "',"); sb.Append("'" + b.Address.ZipCode + "',"); sb.Append("'" + b.Latitude + "',"); sb.Append("'" + b.Longitude + "',"); sb.Append("'" + b.BizInfoId + "',"); sb.Append("'" + b.ImageUrl + "',"); sb.Append("'" + "tr-" + b.BizInfoId + "'],"); } if (fvm.BizInfos.Count > 0) { sb.Remove(sb.Length - 1, 1); } sb.Append("]"); fvm.MapMarkers = sb.ToString(); ViewBag.bagitems = GetCartItems(cart); return(View(fvm)); }