Example #1
0
        private bool ValidarCampos()
        {
            bool val = true;

            if (txt_Nombre.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_Nombre, "Debe Ingresar un Nombre!");
            }
            else if (!TextValidator.ValidarString(txt_Nombre.Text))
            {
                val = false;
                Validaciones.SetError(txt_Nombre, "El nombre debe contener unicamente letras!");
            }


            if (txt_Apellido.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_Apellido, "Debe Ingresar un Apellido!");
            }
            else if (!TextValidator.ValidarString(txt_Apellido.Text))
            {
                val = false;
                Validaciones.SetError(txt_Apellido, "El Apellido debe contener unicamente letras!");
            }

            if (txt_Telefono.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_Telefono, "Debe Ingresar un Telefono!");
            }
            else if (!TextValidator.ValidarTelefono(txt_Telefono.Text))
            {
                val = false;
                Validaciones.SetError(txt_Telefono, "Ingrese un telefono valido!");
            }


            if (txt_Domicilio.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_Domicilio, "Debe Ingresar un Domicilio!");
            }
            else if (!TextValidator.ValidarStringEntero(txt_Domicilio.Text))
            {
                val = false;
                Validaciones.SetError(txt_Domicilio, "Debe ingresar un domicilio valido!");
            }


            return(val);
        }
Example #2
0
        private bool ValidarCampos()
        {
            bool val = true;

            if (txt_name.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_name, "Debe Ingresar un Nombre!");
            }
            else if (!TextValidator.ValidarString(txt_name.Text))
            {
                val = false;
                Validaciones.SetError(txt_name, "El nombre debe contener unicamente letras!");
            }


            if (txt_ape.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_ape, "Debe Ingresar un Apellido!");
            }
            else if (!TextValidator.ValidarString(txt_ape.Text))
            {
                val = false;
                Validaciones.SetError(txt_ape, "El Apellido debe contener unicamente letras!");
            }

            if (txt_tel.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_tel, "Debe Ingresar un Telefono!");
            }
            else if (!TextValidator.ValidarTelefono(txt_tel.Text))
            {
                val = false;
                Validaciones.SetError(txt_tel, "Ingrese un telefono valido!");
            }


            if (txt_dom.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_dom, "Debe Ingresar un Domicilio!");
            }
            else if (!TextValidator.ValidarStringEntero(txt_dom.Text))
            {
                val = false;
                Validaciones.SetError(txt_dom, "Debe ingresar un domicilio valido!");
            }

            if (txt_doc.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_doc, "Debe Ingresar un documento!");
            }
            else if (!TextValidator.ValidarEntero(txt_doc.Text))
            {
                val = false;
                Validaciones.SetError(txt_doc, "Debe ingresar un documento valido!");
            }

            if (txt_mat.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_mat, "Debe Ingresar una matricula!");
            }
            else if (!TextValidator.ValidarEntero(txt_mat.Text))
            {
                val = false;
                Validaciones.SetError(txt_mat, "Debe ingresar una matricula valida!");
            }

            if (txt_mail.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_mail, "Debe Ingresar un mail!");
            }
            else if (!TextValidator.ValidarMail(txt_mail.Text))
            {
                val = false;
                Validaciones.SetError(txt_mail, "Debe ingresar un mail valido!");
            }

            return(val);
        }