/// <summary> /// Método usado para verificar se já existe o CPF passado. /// </summary> /// <param name="source">The source of the event.</param> /// <param name="args">The <see cref="System.Web.UI.WebControls.ServerValidateEventArgs"/> instance containing the event data.</param> protected void CustomValidatorCPF_ServerValidate(object source, ServerValidateEventArgs args) { Adaptador adpt = new Adaptador(); if (adpt.existeCPF(args.Value)) { args.IsValid = false; } else { args.IsValid = true; } }
/// <summary> /// Método usado para verificar se já existe o CPF passado. /// </summary> /// <param name="source">The source of the event.</param> /// <param name="args">The <see cref="System.Web.UI.WebControls.ServerValidateEventArgs"/> instance containing the event data.</param> protected void CustomValidatorCPF_ServerValidate(object source, ServerValidateEventArgs args) { Adaptador adpt = new Adaptador(); if (adpt.existeCPF(args.Value)) { args.IsValid = false; } else { args.IsValid = true; } }