public async Task <List <ReservationViewModel> > GetReservations() { try { List <ReservationViewModel> result = _rManager.GetReservations(); return(result); } catch (Exception ex) { throw ex; } }
public IActionResult Index(ReservationIndexViewModel vm) { if (vm == null) { return(NotFound()); } var indexVM = new ReservationIndexViewModel { Reservations = _reservationManager.GetReservations() }; return(View(indexVM)); }
public void UpdateTablesAvailability(int businessID) { foreach (Table table in GetTables(businessID).Data) { foreach (Reservation reservation in _reservationManager.GetReservations(table.ID).Data) { if (reservation.ReservationDateFrom.Value.CompareTo(DateTime.Now) <= 0 && reservation.ReservationDateTo.Value.CompareTo(DateTime.Now) >= 0) { if (table.Available) { table.Available = false; EditTable(table); } } } } }
public async Task <IActionResult> GetReservations(bool includeRemove) { var reservations = await _manager.GetReservations(includeRemove); return(Ok(new JsonMessageResult("Success", 1, reservations))); }