private void ConfirmBtn_Click(object sender, EventArgs e)
        {
            const string message = "Confirm assign route? ";
            const string caption = "Assign Route";
            var          result  = MessageBox.Show(message, caption,
                                                   MessageBoxButtons.YesNo,
                                                   MessageBoxIcon.Question);

            // If the no button was pressed ...
            if (result == DialogResult.No)
            {
                // cancel the closure of the form.
                this.Close();
            }
            else
            {
                string nextBranchId = dbroute.SelectedValue.ToString();
                bool   notAssigned  = false;
                if (dbroute.SelectedValue.ToString() == "NULL")
                {
                    nextBranchId = null;
                }
                else if (dbroute.SelectedValue.ToString() == "NA")
                {
                    nextBranchId = null;
                    notAssigned  = true;
                }
                ParcelController.ChangeRoute(trackingNum, nextBranchId, notAssigned);
                this.Close();
                admin.ViewParcelInBranch();
            }
        }
Exemple #2
0
        private void ConfirmBtn_Click(object sender, EventArgs e)
        {
            const string message = "Confirm start trip? ";
            const string caption = "Start Trip";
            var          result  = MessageBox.Show(message, caption,
                                                   MessageBoxButtons.YesNo,
                                                   MessageBoxIcon.Question);

            // If the no button was pressed ...
            if (result == DialogResult.No)
            {
                // cancel the closure of the form.
            }
            else
            {
                string carNumber = carNo.Text;
                ParcelController.StartTransit(branchId, nextBranch, carNumber, trackingNumList);
                this.Close();
                admin.ViewParcelInBranch();
            }
        }