Exemple #1
0
        public async Task <JsonResult> Approve(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, "Hi , your booking for the date, " + date + " has been approved. Thank You");
            //	}
            //	catch
            //	{
            //		ViewBag.Error = "Invalid network";
            //	}

            await _booking.Approve(id);

            return(Json(new object[] { new object() }, JsonRequestBehavior.AllowGet));
            //}
        }