// Takes the user to the AssignTechnicians form.
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmAddInstallation frmAssignTechnicians = new frmAddInstallation(admin, false, 0);

            frmAssignTechnicians.Show();
        }
Beispiel #2
0
        // Finished the order. Setting it to delivered in the database.
        private void btnFinishOrder_Click(object sender, EventArgs e)
        {
            int orderID = int.Parse(cmbOrder.SelectedValue.ToString());

            frmUpdateOrder     frmUpdateOrder       = new frmUpdateOrder(admin);
            frmAddInstallation frmAssignTechnicians = new frmAddInstallation(admin, true, orderID);

            if (MessageBox.Show("Mark Order Number: " + orderID + " as Delivered? ", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                Order.FinishOrder(orderID);

                if (MessageBox.Show("Assign a technician to install the ordered products for Order: " + orderID + "? ", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    this.Hide();
                    frmAssignTechnicians.Show();
                }
                else
                {
                    this.Hide();
                    frmUpdateOrder.Show();
                }
            }
            else
            {
                this.Hide();
                frmUpdateOrder.Show();
            }
        }