コード例 #1
0
        public ActionResult CreateSeatsRow(int roomId)
        {
            SeatsRow sr = new SeatsRow();

            sr.RoomId = roomId;
            return(View(sr));
        }
コード例 #2
0
 public ActionResult EditSeatsRow(SeatsRow model)
 {
     if (ModelState.IsValid)
     {
         repository.UpdateSeatsRow(model);
         repository.Save();
         return(RedirectToAction("RoomSeats", new { id = model.RoomId }));
     }
     else
     {
         return(View(model));
     }
 }
コード例 #3
0
 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));
     }
 }
コード例 #4
0
        public ActionResult DeleteSeatsRow(int roomId, int rowNr)
        {
            SeatsRow sr = repository.GetSeatsRow(roomId, rowNr);

            return(View(sr));
        }