private bool CheckValidate() { if (txtUsername.Text.Equals("")) { depError.SetError(txtUsername, Lang.GetMessageByLanguage("000003", Commons.Culture, Commons.ResourceMessage)); txtUsername.Focus(); return(false); } if (txtUsername.Text.Contains(" ")) { depError.SetError(txtUsername, Lang.GetMessageByLanguage("000004", Commons.Culture, Commons.ResourceMessage)); txtUsername.Focus(); return(false); } if (txtPassword.Text.Equals("")) { depError.SetError(txtPassword, Lang.GetMessageByLanguage("000003", Commons.Culture, Commons.ResourceMessage)); txtPassword.Focus(); return(false); } if (string.IsNullOrEmpty(gluGroupUser.EditValue + "")) { depError.SetError(gluGroupUser, Lang.GetMessageByLanguage("000003", Commons.Culture, Commons.ResourceMessage)); gluGroupUser.ShowPopup(); return(false); } if (!txtEmail.Text.Equals("") && !Commons.CheckEmailValid(txtEmail.Text)) { depError.SetError(txtEmail, Lang.GetMessageByLanguage("000013", Commons.Culture, Commons.ResourceMessage)); txtEmail.Focus(); return(false); } return(true); }
private void txtEmail_EditValueChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtEmail.Text)) { depError.SetError(txtEmail, !Commons.CheckEmailValid(txtEmail.Text) ? Lang.GetMessageByLanguage("000013", Commons.Culture, Commons.ResourceMessage) : null); } else { depError.SetError(txtEmail, null); } }