Example #1
0
        private void registerButton_Click(object sender, EventArgs e)
        {
            string name            = userNameTextBox.Text;
            string password        = passwordTextBox.Text;
            string confirmPassword = confirmPasswordTextBox.Text;
            string address         = addressTextBox.Text;
            int    id = SqlManage.queryMaxCustomerId() + 1;

            if (password == confirmPassword)
            {
                Customer customer = new Customer(id, name, password, address);
                SqlManage.insertCustomer(customer);
            }
            else
            {
                MessageBox.Show("两次密码不一致!");
            }
        }