示例#1
0
        private void can_Submit_MouseDown(object sender, MouseButtonEventArgs e)
        {
            connect  = new CTUConnection();
            viewCust = new ViewCustomer();

            if (txt_BankNO.MaxLength != 18 || string.IsNullOrEmpty(txt_BankNO.Text))
            {
                MessageBox.Show("Make sure the bank account number is correct");
            }

            else if (string.IsNullOrEmpty(txt_firstname.Text))
            {
                MessageBox.Show("Please enter the firstname of the customer");
            }

            else if (txt_IDnumber.MaxLength != 13 || string.IsNullOrEmpty(txt_IDnumber.Text))
            {
                MessageBox.Show("Please enter the ID number of the customer");
            }

            else if (string.IsNullOrEmpty(txt_Surname.Text))
            {
                MessageBox.Show("Please enter the surname of the customer");
            }

            else if (string.IsNullOrEmpty(txt_Password.Text))
            {
                MessageBox.Show("Please enter the password of the customer");
            }

            else
            {
                connect.GetCustomer(txt_username.Text, txt_Password.Text, txt_firstname.Text, txt_Surname.Text, txt_IDnumber.Text, txt_BankNO.Text);
                connect.SelectCustomer();
                viewCust.DGV_Cust.ItemsSource = connect.table.DefaultView;
            }
        }