public ActionResult CreateSeatsRow(int roomId) { SeatsRow sr = new SeatsRow(); sr.RoomId = roomId; return(View(sr)); }
public ActionResult EditSeatsRow(SeatsRow model) { if (ModelState.IsValid) { repository.UpdateSeatsRow(model); repository.Save(); return(RedirectToAction("RoomSeats", new { id = model.RoomId })); } else { return(View(model)); } }
public ActionResult CreateSeatsRow(SeatsRow model) { if (repository.SeatsRowExists(model.RoomId, model.RowNumber)) { ModelState.AddModelError("RowNumber", "Rząd o podanym numerze już istnieje"); } if (ModelState.IsValid) { repository.AddSeatsRow(model); repository.Save(); return(RedirectToAction("RoomSeats", new { id = model.RoomId })); } else { return(View(model)); } }
public ActionResult DeleteSeatsRow(int roomId, int rowNr) { SeatsRow sr = repository.GetSeatsRow(roomId, rowNr); return(View(sr)); }