Ejemplo n.º 1
0
        public OrderHomeUI(Employee employee, Table table, TableOverviewUI tableUI)
        {
            InitializeComponent();

            this.buttons = new List <Button>();
            buttons.Add(btnBack);
            buttons.Add(btnFree);
            buttons.Add(btnReserved);
            buttons.Add(btnTaken);
            buttons.Add(Btn_BeverageMenu);
            buttons.Add(btn_Checkout);
            buttons.Add(btn_DinnerMenu);
            buttons.Add(btn_LunchMenu);
            buttons.Add(btn_OrderOverview);
            buttons.Add(btn_RemoveOrder);

            this.order.Employee = employee;
            this.order.Table    = table;
            this.tableUI        = tableUI;
            this.table          = table;
            this.Text           = "Tafel " + table.ID + "- Order Menu";
            tableNumber.Text    = "Tafel " + table.ID + ":";

            try
            {
                try
                {
                    this.order = orderLogic.GetTableOrder(table);
                }
                catch
                {
                    orderLogic.AddNewOrder(order);
                    this.order = orderLogic.GetLatestOrder();
                }
            }
            catch
            {
                MessageBox.Show("Probleem met het laden van de database. Probeer opnieuw.");
            }

            try
            {
                InitTableStatusColors();
                tableLogic.AssignEmployeeToTable(employee, table);
                tableUI.Hide();
            }
            catch
            {
                MessageBox.Show("Probleem met het laden van de database. Probeer opnieuw.");
            }
        }