Example #1
0
        private void btnAddOrder_Click(object sender, EventArgs e)
        {
            _ValidationMethods.Reset();
            _ValidationMethods.ValidateDropDown(cbxClientID.Text, "Client ID");

            if (Order.productsToOrder.Count > 0)
            {
                if (_ValidationMethods.isValid)
                {
                    Client client = clients[cbxClientID.SelectedIndex];

                    Order        order        = new Order(client.ClientID, DateTime.Now, null);
                    Installation installation = new Installation();

                    order.ProductsOrdered += installation.OnProductsOrdered;
                    order.OrderProducts(client);

                    Order.productsToOrder.Clear();

                    frmManageOrders form = new frmManageOrders();
                    form.Show();

                    this.Hide();
                }
                else
                {
                    _ValidationMethods.ShowErrorMessage();
                }
            }
            else
            {
                MessageBox.Show("No products were chosen!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void btnAddOrder_Click(object sender, EventArgs e)
        {
            frmManageOrders form = new frmManageOrders();

            form.Show();

            this.Hide();
        }
Example #3
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            Order.productsToOrder.Clear();

            frmManageOrders form = new frmManageOrders();

            form.Show();

            this.Hide();
        }