bool CustChecking(string ID)
        {// check if the customer ID exist in the customers list
            bool      Cust     = true;
            DBConnect CusCheck = new DBConnect();
            bool      success  = CusCheck.CheckCustomer(ID);

            if (success == false)
            {
                Cust = false;
                DialogResult Cont;
                Cont = MessageBox.Show("This customer has not been registered before. Do you want to register a new customer?", "Invalid Customer's ID", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (Cont == DialogResult.Yes)
                {
                    RegisterCustomer Register = new RegisterCustomer();
                    Register.Show();
                }
            }
            return(Cust);
        }
示例#2
0
        private void registerToolStripMenuItem_Click(object sender, EventArgs e)
        { //Define new register form
            RegisterCustomer Register = new RegisterCustomer();

            Register.ShowDialog(this);
        }