Ejemplo n.º 1
0
        public ItemsPerTable(IReservationData reservationData, IReservationItemData reservationItemData, ITableData tableData, IItemData itemData, bool prepared, bool delivered, int?stationId = null)
        {
            DateTime today = DateTime.Now;
            IEnumerable <Reservation> reservations = reservationData.GetAllOnDay(today.Year, today.Month, today.Day);
            List <ItemsOfReservation> newItems     = new List <ItemsOfReservation>();

            foreach (Reservation reservation in reservations)
            {
                ItemsOfReservation newItemsOfReservation = new ItemsOfReservation(reservationItemData, tableData, itemData, reservation, prepared, delivered, stationId);
                if (newItemsOfReservation.Items.Count() > 0)
                {
                    newItems.Add(newItemsOfReservation);
                }
            }
            Items = newItems;
        }
Ejemplo 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();
        }
Ejemplo n.º 3
0
 public ReservationsController(IReservationData db)
 {
     this.db = db;
 }
Ejemplo n.º 4
0
        public static TableOccupations GetActiveOccupations(IFillingData fillingData, IReservationData reservationData, ITableData tableData)
        {
            DateTime now       = DateTime.Now;
            int      nowMinute = now.Hour * minutesInHour + now.Minute;

            Func <Filling, Reservation, bool> isActive = (Filling filling, Reservation reservation) =>
            {
                int reservationStartMinute = reservation.StartTime.Hour * minutesInHour + reservation.StartTime.Minute;
                return(reservationStartMinute <= nowMinute && reservationStartMinute + filling.DurationMinutes + filling.BufferMinutes >= nowMinute);
            };
            IEnumerable <Reservation> reservations = reservationData.GetAllOnDay(now.Year, now.Month, now.Day).Where(o => isActive(fillingData.Get(o.FillingId), o));

            return(new TableOccupations(fillingData, tableData, reservations));
        }
Ejemplo n.º 5
0
        public TableOccupations(IFillingData fillingData, IReservationData reservationData, ITableData tableData)
        {
            IEnumerable <Reservation> reservations = reservationData.GetAllButOld();

            ConstructorHelper(fillingData, tableData, reservations);
        }
Ejemplo n.º 6
0
        public TableOccupations(IFillingData fillingData, IReservationData reservationData, ITableData tableData, int year, int month, int day)
        {
            IEnumerable <Reservation> reservations = reservationData.GetAllOnDay(year, month, day);

            ConstructorHelper(fillingData, tableData, reservations);
        }
Ejemplo n.º 7
0
 public RoomController(IReservationData reservationData)
 {
     _reservationData = reservationData;
 }
Ejemplo n.º 8
0
 public BusinessLogic(IRoomData roomData, ICustomerData customerData, IReservationData reservationData)
 {
     this.roomData        = roomData;
     this.customerData    = customerData;
     this.reservationData = reservationData;
 }