public ActionResult BookNow(HireViewModel hrv) { // Session.Add("hireid", Request.QueryString["id"].ToString()); hrv.ScheduleId = Convert.ToInt32(Session["scheduleid"].ToString()); hrv.Tutorid = Convert.ToInt32(Session["teacherid"].ToString()); hrv.StudentId = Convert.ToInt32(Session["studentid"].ToString()); hrdb.InsertHire(hrv); ScheduleViewModel svm = new ScheduleViewModel(); svm.ScheduleId = Convert.ToInt32(Session["scheduleid"].ToString()); svm.Status = "Closed"; sdb.UpdateScheduleStatus(svm); ViewBag.Message = "Teacher Booked Successfully"; return(View()); }