Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 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());
 }
Exemplo n.º 7
0
 //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();
 }
Exemplo n.º 8
0
 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());
 }
Exemplo n.º 9
0
 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());
 }
Exemplo n.º 10
0
 public Reservation GetReservation(int id)
 {
     return(ReservationManager.GetAll().Find(x => x.id == id));
 }