Example #1
0
 public ActionResult Update(Reservation item)
 {
     if (ModelState.IsValid && repo.Update(item))
     {
         return RedirectToAction("Index");
     }
     else
     {
         return View("Index");
     }
 }
Example #2
0
 public ActionResult Add(Reservation item)
 {
     if (ModelState.IsValid)
     {
         repo.Add(item);
         return RedirectToAction("Index");
     }
     else
     {
         return View("Index");
     }
 }
 public bool Update(Reservation item)
 {
     Reservation storedItem = Get(item.ReservationId);
     if (storedItem != null)
     {
         storedItem.ClientName = item.ClientName;
         storedItem.Location = item.Location;
         return true;
     }
     else
     {
         return false;
     }
 }
 public Reservation Add(Reservation item)
 {
     item.ReservationId = data.Count + 1;
     data.Add(item);
     return item;
 }
Example #5
0
 public bool UpdateReservation(Reservation item)
 {
     return repo.Update(item);
 }
Example #6
0
 public Reservation CreateReservation(Reservation item)
 {
     return repo.Add(item);
 }