Exemple #1
0
        public bool ValidateUser()
        {
            bool register = true;

            tblFirst_Name_Error.Text = RegexValidation.Name_Check(txtFirst_Name.Text);
            register = tblFirst_Name_Error.Text != "" ? false : register;

            tblLast_Name_Error.Text = RegexValidation.Name_Check(txtLast_Name.Text);
            register = tblLast_Name_Error.Text != "" ? false : register;

            tblMobile_Error.Text = RegexValidation.Check_Mobile(txtMobile_Number.Text);
            register             = tblMobile_Error.Text != "" ? false : register;

            tblPassword_Error.Text = RegexValidation.Check_Password(txtPassword.Password);
            register = tblPassword_Error.Text != "" ? false : register;

            tblConfirmPassword_Error.Text = txtPassword.Password != txtConfirm_Password.Password ? "Passwords do not match" : "";
            register = tblConfirmPassword_Error.Text != "" ? false : register;

            tblState_Error.Text = cbState.SelectedIndex < 0 ? "State not selected" : "";
            register            = tblState_Error.Text != "" ? false : register;

            tblCity_Error.Text = cbCity.IsEnabled == false || cbCity.SelectedIndex < 0 ? "City not selected" : "";
            register           = tblCity_Error.Text != "" ? false : register;

            tblArea_Error.Text = cbArea.IsEnabled == false || cbArea.SelectedIndex < 0 ? "Area not selected" : "";
            register           = tblArea_Error.Text != "" ? false : register;

            tblEmail_Error.Text = RegexValidation.Check_Email(txtEmail.Text);
            register            = tblEmail_Error.Text != "" ? false : register;

            return(register);
        }