예제 #1
0
        public async Task <JsonResult> CheckOut(Guid id)
        {
            //using (ApplicationDbContext db = new ApplicationDbContext())
            //{
            //    Models.Booking booking = new Models.Booking();

            //    string num = (from ac in db.Bookings
            //                  where ac.Id == id
            //                  select ac.PhoneNumber).FirstOrDefault();

            //    DateTime date = (from ac in db.Bookings
            //                     where ac.Id == id
            //                     select ac.Date).FirstOrDefault();

            //    Sms sms = new Sms();
            //    HttpCookie myCookie = new HttpCookie("MyCookie");
            //    myCookie = Request.Cookies["MyCookie"];
            //    int Id = Convert.ToInt16(myCookie);

            //    try
            //    {
            //        sms.Send_SMS(num, "Your car has been succesfully serviced.");
            //    }
            //    catch
            //    {
            //        ViewBag.Error = "Invalid network";
            //    }
            await _booking.CheckOut(id);

            return(Json("Checked out.", JsonRequestBehavior.AllowGet));
            //}
        }