Exemplo n.º 1
0
        public async Task <IEnumerable <Reservation> > GetReservations()
        {
            var result = await reservationData.Get();

            foreach (var res in result)
            {
                res.Customer = await customerData.GetById(res.CustomerId);

                res.Room = await roomData.GetById(res.RoomId);
            }

            return(result);
        }
Exemplo n.º 2
0
        public ReceiptDetails(IBtwTypeData btwTypeData, IItemData itemData, IReservationData reservationData, IReservationItemData reservationItemData, ITableData tableData, IWaiterData waiterData, int reservationId)
        {
            Reservation reservation = reservationData.Get(reservationId);

            Waitername = waiterData.Get(reservation.WaitorId).Name;

            StartTime = reservation.StartTime;

            TableNumber = tableData.Get(reservation.TableId).Number;

            List <ReservationItemDetail>  newReservationItems = new List <ReservationItemDetail>();
            IEnumerable <ReservationItem> reservationItems    = reservationItemData.Get(reservationId);

            foreach (ReservationItem reservationItem in reservationItems)
            {
                newReservationItems.Add(new ReservationItemDetail(itemData, reservationItemData, reservationItem.ReservationId, reservationItem.ItemId));
            }
            this.reservationItems = newReservationItems;

            BtwTypes = btwTypeData.GetAll();
        }