public IActionResult RemoveTable(ReservationDeteailsViewModel model)
 {
     if (ModelState.IsValid)
     {
         //check if a table were choose and if the reservation has any table
         if (model.TableID != 0 && model.NumberOfTables > 0)
         {
             try
             {
                 _services.RemoveTable(model.ReservationID, model.TableID);
                 _services.UpdateReservation(model);
                 model.Errormessage = "The table was Removed";
             }
             catch (Exception)
             {
                 model.Errormessage = "You cannot delete a table that has not been assigned";
                 return(RedirectToAction("Detail", new { id = model.ReservationID, errormessage = model.Errormessage }));
             }
         }
         //(if NOT) return details page with an error message
         model.Errormessage = "There have been no tables selected.";
         return(RedirectToAction("Detail", new { id = model.ReservationID, errormessage = model.Errormessage }));
     }
     return(RedirectToAction("Detail", new { id = model.ReservationID }));
 }