Exemplo n.º 1
0
 private void buttonRegister_Click(object sender, EventArgs e)
 {
     if (_isUsernameValid && _isRealNameValid && _isPasswordValid && _isPhoneNumberValid && _isEmailAddressValid)
     {
         try
         {
             if (SupplierDataAccess.IsUsernameExisted(_username))
             {
                 MessageBox.Show("用户名已存在");
                 return;
             }
             SupplierDataAccess.InsertSupplier(_username, _realName, _password, _phoneNumber, _emailAddress);
             MessageBox.Show("注册成功!");
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
             return;
         }
         Close();
     }
     else
     {
         MessageBox.Show("请检查字符串是否匹配");
     }
 }