Exemplo n.º 1
0
 public void startTablesComboBox()
 {
     tables = listServer.getTables();
     foreach (var table in tables)
     {
         this.tablesComboBox.Items.Add(table.Id.ToString());
     }
 }
Exemplo n.º 2
0
        public Program()
        {
            RemotingConfiguration.Configure("Printer.exe.config", false);
            listServer             = (IListSingleton)RemoteNew.New(typeof(IListSingleton));
            evRepeater             = new AlterEventRepeater();
            evRepeater.alterEvent += new AlterDelegate(DoAlterations);
            listServer.alterEvent += new AlterDelegate(evRepeater.Repeater);
            tables = listServer.getTables();

            Console.ReadLine();
        }
Exemplo n.º 3
0
        public void printBill(int tableId)
        {
            float totalBill = 0;

            tables = listServer.getTables();

            Table table = tables.Find(t => t.Id.Equals(tableId));

            if (table != null && table.StateProperty.Equals(Table.State.CLOSED))
            {
                List <Order> tableOrders = listServer.getOrdersByTable(tableId, Order.State.DELIVERED);

                Console.WriteLine("Bill for Table: " + table.Id);
                for (int j = 0; j < tableOrders.Count; j++)
                {
                    listServer.changeOrderStatus(tableOrders[j].Id, Order.State.CLOSED);
                    Console.WriteLine(tableOrders[j].Id + " " + tableOrders[j].TableId + " " + tableOrders[j].Product.Name + " " + tableOrders[j].TotalPrice + "eur");
                    totalBill = totalBill + tableOrders[j].TotalPrice;
                }
                Console.WriteLine("Total: " + totalBill + "eur");
            }
        }