Example #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);
        }
Example #2
0
 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;
     }
 }
Example #3
0
 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;
     }
 }
Example #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);
     }
 }
Example #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;
            }
        }
Example #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());
        }
Example #7
0
 public void CancelOrder(Table table)
 {
     table.Order.RemoveOrder();
 }
Example #8
0
 public void RemoveItemFromOrder(Table table, MenuItem item)
 {
     table.Order.RemoveItem(item);
 }
Example #9
0
 public void AddMenuItemToOrder(Table table, MenuItem item)
 {
     table.Order.AddItem(item);
     StartRestaurant.DishesToCook.AddMenuItem(item);
 }
Example #10
0
 public void CleanTable(Table table)
 {
     table.TableStatus = TableStatus.Free;
 }