Ejemplo n.º 1
0
        public ActionResult EditSpecials(int Id)
        {
            LocalAPICall   localAPICall    = new LocalAPICall();
            List <Special> ListSpecials    = localAPICall.GetLocal().Result;
            var            selectedSpecial = ListSpecials.Where(l => l.Id == Id);

            return(View(selectedSpecial));
        }
Ejemplo n.º 2
0
        public ActionResult EditSpecials(Special selectedSpecial)
        {
            LocalAPICall localAPICall = new LocalAPICall();

            localAPICall.PutLocal(selectedSpecial);

            return(RedirectToAction("MapAsync"));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> AddSpecials(Special special)
        {
            YelpAPICall yelpAPICall = new YelpAPICall();
            Special     result      = yelpAPICall.GetReviewAndPrice(special.City, special.Restaurant);

            special.Rating = result.Rating;
            special.Price  = result.Price;

            LocalAPICall localAPICall = new LocalAPICall();
            await localAPICall.PostLocal(special);

            return(RedirectToAction("MapAsync"));
        }