public override async Task <GetAllReservationsResponse> GetAllReservations(Empty request, ServerCallContext context) { GetAllReservationsResponse response = new GetAllReservationsResponse(); List <Reservation> data = await _reservationManager.GetAll(); response.Data.AddRange(data.ConvertToDtos()); return(await Task.FromResult(response)); }
public override async Task <ReservationenDto> GetAll(Empty request, ServerCallContext context) { ReservationManager manager = new ReservationManager(); List <Reservation> allReservations = await manager.GetAll(); List <ReservationDto> reservationDtos = allReservations.ConvertToDtos(); ReservationenDto reservationenDto = new ReservationenDto(); reservationDtos.ForEach(reservationDto => reservationenDto.Reservationen.Add(reservationDto)); return(reservationenDto); }
public override async Task <ReservationAllDto> GetAll(Empty request, ServerCallContext context) { List <ReservationDto> temp = await _reservationManager.GetAll().ConvertToDtos(); ReservationAllDto result = new ReservationAllDto(); foreach (ReservationDto reservationDto in temp) { result.Reservations.Add(reservationDto); } return(result); }
public override async Task <AllReservations> GetAll(Empty request, ServerCallContext context) { ReservationManager manager = new ReservationManager(); List <Reservation> reservationList = await manager.GetAll(); AllReservations allReservationDto = new AllReservations(); foreach (Reservation k in reservationList) { allReservationDto.Reservation.Add(k.ConvertToDto()); } return(allReservationDto); }
public override async Task <ReservationDtoList> GetReservationen(Empty request, ServerCallContext context) { try { var response = new ReservationDtoList(); response.Items.AddRange(await _manager.GetAll().ConvertToDtos()); return(response); } catch (Exception) { throw new RpcException(new Status(StatusCode.Internal, "Internal error occured.")); } }
public IEnumerable <ReservationDto> ReadAllReservationen() { WriteActualMethod(); return(_reservationManager.GetAll().ConvertToDtos()); }
//Handler qui gère le radioButton 'Soir' private void radioButtonSoir_CheckedChanged(object sender, EventArgs e) { //Remplit le grid avec les réservations du soir pour ce restaurant triées par date dataGridViewReservations.DataSource = ReservationManager.GetAll().Where(x => x.idRestaurant == this.idRestaurant).Where(x => x.typeService == true).OrderBy(x => x.date).ToList(); }
public List <Reservation> GetReservationsArchivees(int id) { return(ReservationManager.GetAll().Where(x => x.idRestaurant == id).Where(y => y.date < DateTime.Now).OrderByDescending(z => z.date).ToList()); }
public List <Reservation> GetReservationByRestaurant(int id) { return(ReservationManager.GetAll().Where(x => x.idRestaurant == id).Where(y => y.date >= DateTime.Now).OrderBy(z => z.date).ToList()); }
public Reservation GetReservation(int id) { return(ReservationManager.GetAll().Find(x => x.id == id)); }