Example #1
0
        public bool CheckValidate()
        {
            if (string.IsNullOrEmpty(txtUsername.Text))
            {
                depError.SetError(txtUsername, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtUsername.Focus();
                return(false);
            }
            if (txtUsername.Text.Contains(" "))
            {
                depError.SetError(txtUsername, LanguageEngine.GetMessageCaption("000004", ConfigEngine.Language));
                txtUsername.Focus();
                return(false);
            }
            if (CommonEngine.CheckExistsUnicodeChar(txtUsername.Text))
            {
                depError.SetError(txtUsername, LanguageEngine.GetMessageCaption("000021", ConfigEngine.Language));
                txtUsername.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtPassword.Text))
            {
                depError.SetError(txtPassword, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtPassword.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(gluGroupUser.EditValue + ""))
            {
                depError.SetError(gluGroupUser, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                gluGroupUser.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtFullName.Text) && !chkIsEmployee.Checked)
            {
                depError.SetError(txtFullName, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtFullName.Focus();
                return(false);
            }
            if (chkIsEmployee.Checked && string.IsNullOrEmpty(gluEmployee.EditValue + ""))
            {
                depError.SetError(gluEmployee, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                gluEmployee.Focus();
                return(false);
            }
            if (dteToDate.EditValue != null && !CommonEngine.CompareDateEdit(dteEffectiveDate, dteToDate, false))
            {
                depError.SetError(dteToDate, LanguageEngine.GetMessageCaption("000022", ConfigEngine.Language));
                dteToDate.Focus();
                return(false);
            }
            if (chkLocked.Checked && dteUnlockDate.EditValue != null && !CommonEngine.CompareDateEdit(dteLockDate, dteUnlockDate, false))
            {
                depError.SetError(dteUnlockDate, LanguageEngine.GetMessageCaption("000023", ConfigEngine.Language));
                dteUnlockDate.Focus();
                return(false);
            }
            if (!CommonEngine.CheckValidEmailAddress(txtEmail.Text.Trim()))
            {
                depError.SetError(txtEmail, LanguageEngine.GetMessageCaption("000013", ConfigEngine.Language));
                txtEmail.Focus();
                return(false);
            }

            return(true);
        }
Example #2
0
 private void txtEmail_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(txtEmail, !CommonEngine.CheckValidEmailAddress(txtEmail.Text) ? LanguageEngine.GetMessageCaption("000013", ConfigEngine.Language) : null);
 }