private void btnOk_Click(object sender, EventArgs e) { try { if (txtEmail.Text == string.Empty) { txtEmail.Select(); MessageBox.Show("ÓʼþµØÖ·²»ÄÜΪ¿Õ£¡", Constants.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (txtPassword.Text == string.Empty) { txtPassword.Select(); MessageBox.Show("ÃÜÂë²»ÄÜΪ¿Õ£¡", Constants.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.Cursor = Cursors.WaitCursor; _account.Email = txtEmail.Text; _account.Password = txtPassword.Text; _account.UserName = txtUserName.Text; _account.UserId = txtUserId.Text; if (ValidationLogin()) { string ret = ConfigCtrl.EditAccount(_groupname, _account, _oldemail); if (ret != Constants.STATUS_SUCCESS) { MessageBox.Show(ret, Constants.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.DialogResult = DialogResult.OK; this.Close(); } else { //MessageBox.Show("µÇ¼ʧ°Ü£¬Çë¼ì²éEmailºÍÃÜÂëÊÇ·ñÕýÈ·£¡»òÕß´úÀí·þÎñÆ÷ÉèÖÃÊÇ·ñÕýÈ·£¡", Constants.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); //this.txtEmail.Select(); this.DialogResult = DialogResult.Cancel; this.Close(); } } catch (Exception ex) { ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex); } finally { this.Cursor = Cursors.Default; } }