Esempio n. 1
0
        private void BackButton_Click(object sender, EventArgs e)
        {
            Hide();
            var RAMO = new RestAdminManageOrders(AdminId, RestaurantId);

            RAMO.ShowDialog();
        }
        private void CancelOrderButton_Click(object sender, EventArgs e)
        {
            var CancelOrder = StaticAccessor.DB.GetOrder(OrderNo);

            if (CancelOrder.Cancelled != true && OrderNo != 0)
            {
                CancelOrder.Cancelled = true;

                var cancelOrderCommand = new CancelOrderCommand(CancelOrder);
                StaticAccessor.Invoker.Command = cancelOrderCommand;
                StaticAccessor.Invoker.Invoke();

                //DatabaseHandler.UpdateOrder(CancelOrder);
                MessageBox.Show("Order No: " + CancelOrder.Id + " is now Cancelled");
                Hide();
                var RAMO = new RestAdminManageOrders(AdminId, RestaurantId);
                RAMO.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select an Order to Cancel. \nSelect an Order that hasn't been Cancelled");
            }
        }