Exemplo n.º 1
0
        public TableOccupation(IFillingData fillingData, ITableData tableData, Reservation reservation)
        {
            ReservationId = reservation.Id;
            TableId       = reservation.TableId;
            TableNumber   = tableData.Get(TableId).Number;
            StartTime     = reservation.StartTime;
            Filling filling = fillingData.Get(reservation.FillingId);

            Duration = filling.DurationMinutes + filling.BufferMinutes;
        }
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();
        }
Exemplo n.º 3
0
        public ItemsOfReservation(IReservationItemData reservationItemData, ITableData tableData, IItemData itemData, Reservation reservation, bool prepared, bool delivered, int?stationId = null)
        {
            TableNumber = tableData.Get(reservation.TableId).Number;

            List <ReservationItemDetail>  newItems         = new List <ReservationItemDetail>();
            IEnumerable <ReservationItem> reservationItems = reservationItemData.Get(reservation.Id).Where(o => o.Prepared == prepared && o.Delivered == delivered);

            foreach (ReservationItem reservationItem in reservationItems)
            {
                if (stationId != null)
                {
                    if (itemData.Get(reservationItem.ItemId).StationId == stationId)
                    {
                        newItems.Add(new ReservationItemDetail(itemData, reservationItemData, reservation.Id, reservationItem.ItemId));
                    }
                }
                else
                {
                    newItems.Add(new ReservationItemDetail(itemData, reservationItemData, reservation.Id, reservationItem.ItemId));
                }
            }
            Items = newItems;
        }