コード例 #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));
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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."));
     }
 }
コード例 #6
0
 public IEnumerable <ReservationDto> ReadAllReservationen()
 {
     WriteActualMethod();
     return(_reservationManager.GetAll().ConvertToDtos());
 }
コード例 #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();
 }
コード例 #8
0
ファイル: OdawaService.svc.cs プロジェクト: boulledogue/Odawa
 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());
 }
コード例 #9
0
ファイル: OdawaService.svc.cs プロジェクト: boulledogue/Odawa
 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());
 }
コード例 #10
0
ファイル: OdawaService.svc.cs プロジェクト: boulledogue/Odawa
 public Reservation GetReservation(int id)
 {
     return(ReservationManager.GetAll().Find(x => x.id == id));
 }