public ActionResult Details(bookingPatient m) { string dat = b.DateOfBooking(m.identification); if (b.GetBookingDetails(m.identification) == true) { //int id = Convert.ToInt16( System.Web.HttpContext.Current.Session["ide"] ); ViewBag.Error = "Can't book a patient twice in a day"; return(View(b.FindPatientDetails(m.PatientIdKey))); } b.SaveBooking(m); //int d = Convert.ToInt32(System.Web.HttpContext.Current.Session["ide"]); return(RedirectToAction("ScheduleDate", "Calendar", new { id = m.PatientIdKey })); }