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; }
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(); }
public ReservationsController(IReservationData db) { this.db = db; }
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)); }
public TableOccupations(IFillingData fillingData, IReservationData reservationData, ITableData tableData) { IEnumerable <Reservation> reservations = reservationData.GetAllButOld(); ConstructorHelper(fillingData, tableData, reservations); }
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); }
public RoomController(IReservationData reservationData) { _reservationData = reservationData; }
public BusinessLogic(IRoomData roomData, ICustomerData customerData, IReservationData reservationData) { this.roomData = roomData; this.customerData = customerData; this.reservationData = reservationData; }