public ActionResult InformationCollection(FormCollection collection) { string firstName = collection["firstName"]; string lastName = collection["lastName"]; string phone = collection["phone"]; string description = collection["description"]; var bookingFullVM = TempData["booking"] as BookingFullVM; bookingFullVM.FirstName = firstName; bookingFullVM.LastName = lastName; bookingFullVM.Phone = Convert.ToInt32(phone); bookingFullVM.Description = description; SupportBooking supportBooking = new SupportBooking(); supportBooking.User_Id = bookingFullVM.UserId; supportBooking.Calendar_Id = bookingFullVM.CalendarId; supportBooking.FirstName = bookingFullVM.FirstName; supportBooking.LastName = bookingFullVM.LastName; supportBooking.Phone = bookingFullVM.Phone; supportBooking.Description = bookingFullVM.Description; supportBooking.BookingType = "SupportBooking"; supportBooking.StartDate = bookingFullVM.StartDate; supportBooking.EndDate = bookingFullVM.StartDate.AddMinutes(30.0); try { bookingControllerBL.CreateSupportBooking(supportBooking); } catch (Exception) { return(RedirectToAction("BookingException")); } TempData["booking"] = new BookingFullVM() { UserId = supportBooking.User_Id, CalendarId = supportBooking.Calendar_Id, FirstName = supportBooking.FirstName, LastName = supportBooking.LastName, Phone = supportBooking.Phone, Description = supportBooking.Description, BookingType = supportBooking.BookingType, StartDate = supportBooking.StartDate, EndDate = supportBooking.EndDate }; return(RedirectToAction("BookingSuccess")); }
public ActionResult FinalizeBooking() { string hour = TempData["hour"].ToString(); string minut = TempData["minut"].ToString(); string calendar_Id = TempData["calendar_Id"].ToString(); string userId = TempData["userId"].ToString(); string date = TempData["date"].ToString(); // den "gamle" date med 00 timer bliver lavet om til kundens valgte timer DateTime PickedDate = Convert.ToDateTime(date); TimeSpan ts = new TimeSpan(Convert.ToInt32(hour), Convert.ToInt32(minut), 0); PickedDate = PickedDate.Date + ts; // ny og opdateret date sættes ind i booking sammen med resten af variablerne TempData["booking"] = new BookingFullVM() { UserId = Convert.ToInt32(userId), CalendarId = Convert.ToInt32(calendar_Id), StartDate = PickedDate }; return(View()); }