public ViewResult CreateSeat() { SeatModelUI seatData = new SeatModelUI { NumberSeat = SeatsData.Count() + 1 }; return(View(seatData)); }
public ViewResult Edit(SeatModel seatdata) { SeatModelUI seatData = new SeatModelUI { NumberSeat = seatdata.NumberSeat, IsReserve = seatdata.PersonId != null }; return(View(seatData)); }
public ViewResult Details(SeatModel seatdata) { PersonModel personModel = new PersonModel(); if (seatdata.PersonId != null) { personModel = DataProcessor.FindPerson(seatdata.PersonId); } SeatModelUI seatData = new SeatModelUI { NumberSeat = seatdata.NumberSeat, IsReserve = seatdata.PersonId != null, FirstName = personModel.FirstName, LastName = personModel.LastName }; return(View(seatData)); }
public ActionResult CreateSeat(SeatModelUI seatModelUI) { if (ModelState.IsValid) { SeatModel seatModel = new SeatModel { PersonId = null, MovieNumber = NumberMovie, NumberSeat = seatModelUI.NumberSeat }; DataProcessor.InsertSeatModelElement(seatModel.NumberSeat, default(int), NumberMovie); return(RedirectToAction("Manage_Seats")); } else { return(View(seatModelUI)); } }
public ActionResult Edit(SeatModelUI seatModelUI) { if (ModelState.IsValid) { if (seatModelUI.IsReserve) { DataProcessor.UpdateSeatData(seatModelUI.FirstName, seatModelUI.LastName, seatModelUI.IsReserve , seatModelUI.NumberSeat, NumberMovie); } else { DataProcessor.UpdateSeatData("", "", seatModelUI.IsReserve , seatModelUI.NumberSeat, NumberMovie); } return(RedirectToAction("Manage_Seats")); } else { return(View(seatModelUI)); } }