Пример #1
0
        public bool ValidProfile()
        {
            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, "driver", driver.Driver_Id);
            register             = tblMobile_Error.Text != "" ? false : register;

            if (txtMobile_Alternate.Text != "")
            {
                tblMobile_Alternate_Error.Text = RegexValidation.Check_Mobile(txtMobile_Alternate.Text, "driver", driver.Driver_Id);
            }
            register = tblMobile_Alternate_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;

            tbladrl1_Error.Text = RegexValidation.Check_Address(txtAdrl_1.Text);
            register            = tbladrl1_Error.Text != "" ? false : register;

            tbladrl2_Error.Text = RegexValidation.Check_Address(txtAdrl_2.Text);
            register            = tbladrl2_Error.Text != "" ? false : register;

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

            if (txtEmail.Text != "")
            {
                tblEmail_Error.Text = RegexValidation.Check_Email(txtEmail.Text, "driver", driver.Driver_Id);
            }
            register = tblEmail_Error.Text != "" ? false : register;

            return(register);
        }