Exemple #1
0
        public void CloseTable(Table table, CheckPaymentMethod payMethod)
        {
            table.Check.PaymentMethod = payMethod;
            table.Check.CheckDateAndTime = DateTime.Now;
            Report.ReportsFromTables.Add(table, this);

            this.CleanTable(table);
        }
 public void CancelReservation(Table table)
 {
     if (table.TableStatus != TableStatus.Reserved)
     {
         Console.WriteLine("Table is not reserved.");
     }
     else
     {
         table.TableStatus = TableStatus.Free;
         table.Client.ClientType = ClientType.Regular;
     }
 }
 public void ReserveTable(Table table, ClientType type)
 {
     if (table.TableStatus != TableStatus.Free)
     {
         Console.WriteLine("Table is not free.");
     }
     else
     {
         table.TableStatus = TableStatus.Reserved;
         table.Client.ClientType = type;
     }
 }
Exemple #4
0
 private void CleanTable(Table table)
 {
     // if the waiter doesnt have a Busser assigned to him, he will clean the table and set its status to free
     if (this.WaiterBusser == null)
     {
         table.TableStatus = TableStatus.Free;
     }
     else
     {
         this.WaiterBusser.CleanTable(table);
     }
 }
Exemple #5
0
        public void CalculateCheck(Table table)
        {
            foreach (var item in table.Order.OrderList)
            {
                table.Check.Amount += item.Price;
            }

            if (table.Client.ClientType == ClientType.Special)
            {
                table.Check.Discount = table.Check.Amount * Check.DiscountForSpecials;
                table.Check.Amount -= table.Check.Discount;
            }
        }
Exemple #6
0
        public void PrintCheck(Table table)
        {
            var sb = new StringBuilder();
            sb.AppendLine(string.Format("CHECK table {0}:", ServingArea.Tables.IndexOf(table) + 1));

            foreach (var item in table.Order.OrderList)
            {
                sb.AppendLine(string.Format("{0,-20} {1:C}", item.Name, item.Price));
            }

            sb.AppendLine(string.Format("{0,-20} {1:C}", "Total Amount: ", table.Check.Amount));

            if (table.Client.ClientType == ClientType.Special)
            {
                sb.AppendLine(string.Format("{0,-20} {1:C}", "Discount: ", table.Check.Discount));
            }

            Console.WriteLine(sb.ToString());
        }
Exemple #7
0
 public void CancelOrder(Table table)
 {
     table.Order.RemoveOrder();
 }
Exemple #8
0
 public void RemoveItemFromOrder(Table table, MenuItem item)
 {
     table.Order.RemoveItem(item);
 }
Exemple #9
0
 public void AddMenuItemToOrder(Table table, MenuItem item)
 {
     table.Order.AddItem(item);
     StartRestaurant.DishesToCook.AddMenuItem(item);
 }
Exemple #10
0
 public void CleanTable(Table table)
 {
     table.TableStatus = TableStatus.Free;
 }