예제 #1
0
        private bool ValidarCampos()
        {
            bool ok = true;
            int  num;

            if (txtNombre.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtNombre, "Campo Vacio, Ingrese Nombre");
            }

            if (txtDescripcion.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtDescripcion, "Campo Vacio, Ingrese Descripcion");
            }


            //if (!txtPrecio.MaskFull)
            //{
            //    ok = false;
            //    ErrorCampos.SetError(txtPrecio, "Campo Vacio, Ingrese Precio");
            //}

            if (txtPrecio2.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtPrecio2, "Campo Vacio, Ingrese Precio.");
            }

            else if (!int.TryParse(txtPrecio2.Text, out num))
            {
                ok = false;
                ErrorCampos.SetError(txtPrecio2, "Formato incorrecto, Ingrese un numero");
            }


            if (txtCantidad.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtCantidad, "Campo Vacio, Ingrese una Cantidad");
            }


            else if (!int.TryParse(txtCantidad.Text, out num))
            {
                ok = false;
                ErrorCampos.SetError(txtCantidad, "Formato incorrecto, Ingrese un numero");
            }

            if (result != DialogResult.OK)
            {
                ok = false;
                ErrorCampos.SetError(pic1, "Seleccione Imagen");
            }



            return(ok);
        }
예제 #2
0
 //Metodo para borrar los mensajes cuando ya esten correctos
 private void BorrarMensajes()
 {
     ErrorCampos.SetError(txtNombre, "");
     ErrorCampos.SetError(txtDescripcion, "");
     ErrorCampos.SetError(txtPrecio, "");
     ErrorCampos.SetError(txtCantidad, "");
 }
예제 #3
0
파일: FromTC.cs 프로젝트: 1630273/JBGamesC-
        private bool ValidarCampos()
        {
            bool ok = true;

            if (txtNP.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtNP, "Campo Vacio, Ingrese Usuario");
            }

            if (txtFe.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtFe, "Campo Vacio, Ingrese Contraseña");
            }
            if (txtCod.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtCod, "Campo Vacio, Ingrese Contraseña");
            }



            return(ok);
        }
예제 #4
0
 //Metodo para borrar los mensajes cuando ya esten correctos
 private void BorrarMensajes()
 {
     ErrorCampos.SetError(txtUsuario, "");
     ErrorCampos.SetError(txtContraseña, "");
     ErrorCampos.SetError(txtContraseña2, "");
     ErrorCampos.SetError(txtNombre, "");
     ErrorCampos.SetError(txtApellidoPaterno, "");
     ErrorCampos.SetError(txtApellidoMaterno, "");
     ErrorCampos.SetError(rdoHombre, "");
     ErrorCampos.SetError(rdoMujer, "");
 }
예제 #5
0
 //Metodo para borrar los mensajes cuando ya esten correctos
 private void BorrarMensajes()
 {
     ErrorCampos.SetError(txtNombreUsuario, "");
     ErrorCampos.SetError(txtContraseña, "");
     ErrorCampos.SetError(txtContraseña2, "");
     ErrorCampos.SetError(txtNombre, "");
     ErrorCampos.SetError(txtApellidoPaterno, "");
     ErrorCampos.SetError(txtApellidoMaterno, "");
     ErrorCampos.SetError(txtCorreo, "");
     ErrorCampos.SetError(txtDireccion, "");
     ErrorCampos.SetError(txtCp, "");
     ErrorCampos.SetError(txtTelefono, "");
     ErrorCampos.SetError(rdoHombre, "");
     ErrorCampos.SetError(rdoMujer, "");
 }
예제 #6
0
        private bool ValidarCampos()
        {
            bool   ok = true;
            int    num;
            double num2;

            if (txtNombre.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtNombre, "Campo Vacio, Ingrese Nombre");
            }

            if (txtDescripcion.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtDescripcion, "Campo Vacio, Ingrese Descripcion");
            }


            if (txtPrecio.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtPrecio, "Campo Vacio, Ingrese Precio");
            }
            else if (!double.TryParse(txtPrecio.Text, out num2))
            {
                ok = false;
                ErrorCampos.SetError(txtPrecio, "Formato Incorrecto, Ingrese solo numeros");
            }

            if (txtCantidad.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtCantidad, "Campo Vacio, Ingrese una Cantidad");
            }


            else if (!int.TryParse(txtCantidad.Text, out num))
            {
                ok = false;
                ErrorCampos.SetError(txtCantidad, "Formato incorrecto, Ingrese solo numeros");
            }



            return(ok);
        }
예제 #7
0
        //Metodo para validar que los campos no esten vacios
        private bool ValidarCampos()
        {
            bool ok = true;

            if (txtUsuario.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtUsuario, "Campo Vacio, Ingrese Usuario");
            }

            if (txtContraseña.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtContraseña, "Campo Vacio, Ingrese Contraseña");
            }


            if (txtContraseña2.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtContraseña2, "Campo Vacio, Confirme Contraseña");
            }


            if (txtNombre.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtNombre, "Campo Vacio, Ingrese Nombre");
            }


            if (txtApellidoPaterno.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtApellidoPaterno, "Campo Vacio, Ingrese Apellido Paterno");
            }


            if (txtApellidoMaterno.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtApellidoMaterno, "Campo Vacio, Ingrese Apellido Materno");
            }



            if (!rdoHombre.Checked && !rdoMujer.Checked)
            {
                ok = false;
                ErrorCampos.SetError(rdoHombre, "Elija un Sexo");
                ErrorCampos.SetError(rdoMujer, "Elija un Sexo");
            }

            if (txtContraseña.Text != txtContraseña2.Text)
            {
                ok = false;
                ErrorCampos.SetError(txtContraseña2, "Las contraseñas no son Iguales.");
            }

            return(ok);
        }
예제 #8
0
        //Metodo para validar que los campos no esten vacios
        private bool ValidarCampos()
        {
            bool ok = true;

            if (txtNombreUsuario.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtNombreUsuario, "Campo Vacio, Ingrese Usuario");
            }

            if (txtContraseña.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtContraseña, "Campo Vacio, Ingrese Contraseña");
            }


            if (txtContraseña2.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtContraseña2, "Campo Vacio, Ingrese Contraseña2");
            }


            if (txtNombre.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtNombre, "Campo Vacio, Ingrese Nombre");
            }


            if (txtApellidoPaterno.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtApellidoPaterno, "Campo Vacio, Ingrese Apellido Paterno");
            }


            if (txtApellidoMaterno.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtApellidoMaterno, "Campo Vacio, Ingrese Apellido Materno");
            }


            if (txtCorreo.Text.Trim() == "" || !validarEmail(txtCorreo.Text))
            {
                ok = false;
                ErrorCampos.SetError(txtCorreo, "Formato Incorrecto, Utilize el siguiente formato: [email protected]");
            }


            if (txtDireccion.Text.Trim() == "")
            {
                ok = false;
                ErrorCampos.SetError(txtDireccion, "Campo Vacio, Ingrese Direccion");
            }


            if (txtCp.MaskFull == false)
            {
                ok = false;
                ErrorCampos.SetError(txtCp, "Campo Vacio, Ingrese Codigo Postal");
            }


            if (txtTelefono.MaskFull == false)
            {
                ok = false;
                ErrorCampos.SetError(txtTelefono, "Campo Vacio, Ingrese Telefono");
            }

            if (!rdoHombre.Checked && !rdoMujer.Checked)
            {
                ok = false;
                ErrorCampos.SetError(rdoHombre, "Ejija Solo una Opcion.");
                ErrorCampos.SetError(rdoMujer, "Elija sollo una Opcion");
            }

            if (txtContraseña.Text != txtContraseña2.Text)
            {
                ok = false;
                errorContraseña2.SetError(txtContraseña2, "Las contraseñas no son Iguales.");
            }

            return(ok);
        }
예제 #9
0
파일: FromTC.cs 프로젝트: 1630273/JBGamesC-
 private void BorrarMensajes()
 {
     ErrorCampos.SetError(txtNP, "");
     ErrorCampos.SetError(txtCod, "");
     ErrorCampos.SetError(txtFe, "");
 }