Exemplo n.º 1
0
 /// <summary>
 /// Método usado para verificar se já existe o Login 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 CustomValidatorLogin_ServerValidate(object source, ServerValidateEventArgs args)
 {
     //fazer acesso ao adaptador pra verificar se ja existe um login desse.
     Adaptador adpt = new Adaptador();
     if (adpt.existeLogin(args.Value))
     {
         args.IsValid = false;
     }
     else
     {
         args.IsValid = true;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Método usado para verificar se já existe o Login 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 CustomValidatorLogin_ServerValidate(object source, ServerValidateEventArgs args)
        {
            //fazer acesso ao adaptador pra verificar se ja existe um login desse.
            Adaptador adpt = new Adaptador();

            if (adpt.existeLogin(args.Value))
            {
                args.IsValid = false;
            }
            else
            {
                args.IsValid = true;
            }
        }