//[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));
            return(PartialView(bim));
        }
Esempio n. 2
0
        public ActionResult ShowAllZips()
        {
            BizInfoModel   bim   = new BizInfoModel();
            List <BizInfo> lzips = BizInfoRepository.GetAllBizInfos(true);

            bim.ShowZipCodes = AllZopCodesView.ShowZipCodesView_Bootstarp(lzips, null, null);
            return(PartialView(bim));
        }
Esempio n. 3
0
        public ActionResult Index(ShoppingCart cart, BrowseHistory bh)
        {
            ViewBag.delivery = bh.IsDelivery;
            BizInfoModel bim = new BizInfoModel();

            bim.AllZips      = BizInfoRepository.GetAllZipCities(true);
            ViewBag.bagitems = GetCartItems(cart);
            return(View(bim));
        }
Esempio n. 4
0
        public ActionResult ShowAllCuisines()
        {
            BizInfoModel bim = new BizInfoModel();
            // bim.ShowCities = AllCitiesView.ShowAllCities(BizInfoRepository.GetAllBizInfos(true), 4);
            List <BizCuisine> lbc = BizCuisineRepository.GetAllBizCuisines(true);

            bim.ShowCuisines = AllCuisinesView.ShowCuisinesView_Bootatrap(lbc, null, null);
            return(PartialView(bim));
        }
Esempio n. 5
0
        public ActionResult Index(ShoppingCart cart, BrowseHistory bh)
        {
            ViewBag.bagitems = GetCartItems(cart);
            ViewBag.delivery = bh.IsDelivery;
            BizInfoModel bim = new BizInfoModel();
            // bim.ShowCities = AllCitiesView.ShowAllCities(BizInfoRepository.GetAllBizInfos(true), 4);
            List <BizCuisine> lbc = BizCuisineRepository.GetAllBizCuisines(true);

            bim.ShowCuisines = AllCuisinesView.ShowCuisinesView_Bootatrap(lbc, null, null);
            bim.AllCuisines  = BizCuisineRepository.GetAllCuisines(true);
            return(View(bim));
        }
Esempio n. 6
0
        //[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 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));
        }
Esempio n. 8
0
        //[OutputCache(Duration = 600, VaryByParam = "id")]
        public ActionResult Cuisine(string id, ShoppingCart cart, BrowseHistory bh)
        {
            string cuisine = string.IsNullOrEmpty(id) ? string.Empty : DecodeString(id);

            ViewBag.delivery = bh.IsDelivery;
            BizInfoModel bim = new BizInfoModel();

            bim.CuisineName = cuisine;
            // bim.ShowCities = AllCitiesView.ShowAllCities(BizInfoRepository.GetAllBizInfos(true), 4);
            List <BizInfo> lbc = BizInfoRepository.GetBizInfosByCuisineType(cuisine, true);
            int            n   = BizInfoRepository.GetNumberOfCityInBizInfos(lbc, true);

            bim.ShowCities      = AllCitiesView.ShowAllCities_Bootstrap(lbc, n, cuisine);
            bim.CitiesInCuisine = BizInfoRepository.GetCitiesInCuisine(cuisine);
            ViewBag.bagitems    = GetCartItems(cart);
            return(View(bim));
        }
Esempio n. 9
0
        public ActionResult Index(string city, string zip, ShoppingCart cart, BrowseHistory bh)
        {
            if (string.IsNullOrEmpty(city) && string.IsNullOrEmpty(zip))
            {
                return(RedirectToAction("Index", "AllCities"));
            }

            ViewBag.delivery = bh.IsDelivery;
            BizInfoModel bim = new BizInfoModel();
            string       ct  = string.IsNullOrEmpty(city)?string.Empty : DecodeString(city);

            bim.CityName = ct;
            bim.ZipCode  = zip;
            bim.BizInfos = BizInfoRepository.GetBizInfoByZip(zip, true);
            bim.YelpTops = new List <TopYelpModel>();
            if ((HttpContext.Cache["CityZip" + ct + zip] != null))
            {
                bim.YelpTops = (List <TopYelpModel>)HttpContext.Cache["CityZip" + ct + zip];
            }
            else
            {
                YelpReviewModel yrm = new YelpReviewModel();
                foreach (var b in bim.BizInfos)
                {
                    yrm = YelpBizDetails.GetYelpBiz(b);
                    if (string.IsNullOrEmpty(b.YelpBizId) == false)
                    {
                        bim.YelpTops.Add(new TopYelpModel()
                        {
                            Biz = b, Yelp = yrm
                        });
                    }
                }
                bim.YelpTops = bim.YelpTops.OrderByDescending(e => e.Yelp.Biz.rating).Take(3).ToList();
                HttpContext.Cache.Insert("CityZip" + ct + zip, bim.YelpTops);
            }
            // bim.TopRatedBizInfos = BizInfoRepository.GetTopnTopRatedBizInfosInzip(3, zip, true);
            bim.BizInfo      = bim.BizInfos.FirstOrDefault();
            bim.NewBiz       = BizInfoRepository.GetLastnNewBizInfosByZip(4, zip, true);
            bim.ShowCuisines = AllCuisinesView.ShowCuisinesView_Bootatrap(BizCuisineRepository.GetBizCuisinesByZip(true, zip), ct, zip);
            StringBuilder sb = new StringBuilder();

            sb.Append("[");
            foreach (var b in bim.YelpTops)
            {
                sb.Append("[");
                sb.Append("'" + b.Biz.BizTitle + "',");
                sb.Append("'" + b.Biz.Address.AddressLine + "',");
                sb.Append("'" + b.Biz.Address.City + "',");
                sb.Append("'" + b.Biz.Address.State + "',");
                sb.Append("'" + b.Biz.Address.ZipCode + "',");
                sb.Append("'" + b.Biz.Latitude + "',");
                sb.Append("'" + b.Biz.Longitude + "',");
                sb.Append("'" + b.Biz.BizInfoId + "',");
                sb.Append("'" + b.Biz.ImageUrl + "'],");
            }
            if (bim.YelpTops.Count > 0)
            {
                sb.Remove(sb.Length - 1, 1);
            }
            sb.Append("]");
            bim.MapMarkers    = sb.ToString();
            bim.CuisinesInZip = BizInfoRepository.GetCuisinesInZip(zip);
            ViewBag.bagitems  = GetCartItems(cart);
            return(View(bim));
        }