private bool ValidaADV(Label lbl) { AdvogadoDB advDB = new AdvogadoDB(); ContatoDB conDB = new ContatoDB(); if (string.IsNullOrWhiteSpace(txtNome.Text)) { lbl.Text = "Insira o nome"; } else if (string.IsNullOrWhiteSpace(txtCelular.Text) && string.IsNullOrWhiteSpace(txtTelefone.Text)) { lbl.Text = "Insira ao menos um telefone"; } else if (string.IsNullOrWhiteSpace(txtCPF.Text) || ValidaDoc.ValidaCPF(txtCPF.Text) == false) { lbl.Text = "Insira um CPF Valido"; } else if (string.IsNullOrWhiteSpace(txtRg.Text) || txtRg.Text.Length < 12) { lbl.Text = "Insira um RG Valido"; } else if (string.IsNullOrWhiteSpace(txtOab.Text)) { lbl.Text = "Insira um numero da OAB"; } else if (Convert.ToDateTime(txtDataNascimento.Text) >= DateTime.Today) { lbl.Text = "Insira uma data de nascimento valida"; } else if (ddlSexo.SelectedItem.Text == "Selecione") { lbl.Text = "Selecione o Sexo"; } else if (ddlEstado.SelectedItem.Text == "Selecione") { lbl.Text = "Selecione um estado"; } else if (ddlCidade.SelectedItem.Text == "Selecione") { lbl.Text = "Selecione uma cidade"; } else if (ddlEstadoCivil.SelectedItem.Text == "Selecione") { lbl.Text = "Selecione um estado civil"; } else if (string.IsNullOrWhiteSpace(txtEmail.Text)) { lbl.Text = "Insira um Email"; } else if (string.IsNullOrWhiteSpace(txtLogin.Text)) { lbl.Text = "Insira um Nome de usuario"; } else if (string.IsNullOrWhiteSpace(txtSenha.Text) || string.IsNullOrWhiteSpace(txtConfirmaSenha.Text)) { lbl.Text = "Insira sua senha"; } else if (advDB.ValidaCPF(txtCPF.Text) != null) { lbl.Text = "CPF já cadastrado!"; } else if (advDB.ValidaRG(txtRg.Text) != null) { lbl.Text = "RG já cadastrado!"; } else if (advDB.ValidaOAB(txtOab.Text) != null) { lbl.Text = "OAB já cadastrado!"; } else if (conDB.ValidaEmail(txtEmail.Text) != null) { lbl.Text = "Email já cadastrado!"; } else if (advDB.ValidaLogin(txtLogin.Text) != null) { lbl.Text = "Login já cadastrado!"; } else { return(true); } divmensagem.Attributes["class"] = "alert alert-danger"; return(false); }