示例#1
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();
            }
        }
        // Takes the user to the update order form.
        private void button5_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmUpdateOrder frmUpdateOrder = new frmUpdateOrder(admin);

            frmUpdateOrder.Show();
        }
示例#3
0
        // Removes the order fro mthe database.
        private void btnCancelOrder_Click(object sender, EventArgs e)
        {
            int orderID = int.Parse(cmbOrder.SelectedValue.ToString());

            Order.CancelOrder(orderID);

            frmUpdateOrder frmUpdateOrder = new frmUpdateOrder(admin);

            this.Hide();
            frmUpdateOrder.Show();
        }