public void PlaceCustomersAtTable(CustomersGroup customers, int tableNumber)
 {
     StartAction("Amène " + customers.Customers.Count + " clients à la table", 1);
     diningRoom.Tables.First(x => x.TableNumber == tableNumber).SeatedCustomers = customers.Customers;
     EndAction();
     GiveMenuToCustomer(tableNumber);
 }
示例#2
0
        public int FindTable(CustomersGroup customers)
        {
            StartAction("Cherche une table pour " + customers.Customers.Count, 1);
            Table firstMatchedTable;

            do
            {
                var listTableAvailable = diningRoom.Tables.Where(table => table.IsBooked = table.IsAvailable = true);
                var listMatchedTable   = listTableAvailable.Where(table => table.NumberOfPlaces >= customers.Customers.Count()).OrderBy(table => table.NumberOfPlaces);
                firstMatchedTable = listMatchedTable.FirstOrDefault();
            } while (firstMatchedTable == null);
            firstMatchedTable.IsAvailable = false;
            //headWaiter.PlaceCustomersAtTable(customers, firstMatchedTable.TableNumber);//TODO
            EndAction();
            return(firstMatchedTable.TableNumber);
        }
示例#3
0
        public int CreateBooking(CustomersGroup customers, DateTime bookingTime)
        {
            StartAction("Entre une réservation pour " + customers.Customers.Count, 1);
            Table firstMatchedTable;

            do
            {
                var listTableAvailable = diningRoom.Tables.Where(table => table.IsBooked == false && table.IsAvailable == true);
                var listMatchedTable   = listTableAvailable.Where(table => table.NumberOfPlaces >= customers.Customers.Count()).OrderBy(table => table.NumberOfPlaces);
                firstMatchedTable = listMatchedTable.FirstOrDefault();
            } while (firstMatchedTable == null);
            firstMatchedTable.IsBooked = true;
            diningRoom.Reception.BookedCustomersGroups.Add(customers, bookingTime);
            //headWaiter.PlaceCustomersAtTable(customers, firstMatchedTable.TableNumber);//TODO
            EndAction();
            return(firstMatchedTable.TableNumber);
        }
示例#4
0
        /*public void CreateBooking()
         * {
         *  throw new System.Exception("Not implemented");
         * }*/

        public void BookedCustomersArrive(CustomersGroup arrivingGroup)
        {
            WaitingCustomersGroups.Add(BookedCustomersGroups.First(x => x.Key == arrivingGroup).Key);
            BookedCustomersGroups.Remove(arrivingGroup);
        }