示例#1
0
        private bool ValidarNombre()
        {
            bool val = true;

            if (txt_name.Text.Trim() == "")
            {
                val = false;
                Validacion.SetError(txt_name, "Debe ingresar un tipo de hora.");
            }
            else if (!TextValidator.ValidarString(txt_name.Text))
            {
                val = false;
                Validacion.SetError(txt_name, "El tipo de hora solo debe contener letras");
            }

            if (txt_valor.Text.Trim() == "")
            {
                val = false;
                Validacion.SetError(txt_valor, "Debe ingresar el valor para el tipo de hora.");
            }
            else if (!TextValidator.ValidarFloat(txt_valor.Text))
            {
                val = false;
                Validacion.SetError(txt_valor, "El valor de la hora debe contener solo numeros");
            }

            return(val);
        }
        private bool ValidarCampos()
        {
            bool val = true;

            if (txt_place.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_place, "Debe Ingresar un Lugar!");
            }
            else if ((!TextValidator.ValidarStringEntero(txt_place.Text) && !TextValidator.ValidarString(txt_place.Text)))
            {
                val = false;
                Validaciones.SetError(txt_place, "Debe ingresar un lugar valido!");
            }


            if (txt_hrs.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_hrs, "Debe ingresar las horas trabajadas!");
            }
            else if (!TextValidator.ValidarFloat(txt_hrs.Text))
            {
                val = false;
                Validaciones.SetError(txt_hrs, "Las hora pueden ser unicamente numeros!");
            }

            return(val);
        }
示例#3
0
        private bool ValidarDatosPagos()
        {
            bool val = true;

            if (!TextValidator.ValidarFloat(text_AbonaCon.Text))
            {
                val = false;
                Validaciones.SetError(text_AbonaCon, "Debe ingresar un monto valida!");
            }
            return(val);
        }
示例#4
0
        private bool ValidarFormulario(string InputToValidate, string ReferName)
        {
            if (!TextValidator.ValidarFloat(InputToValidate))
            {
                MessageBox.Show(ReferName + ": Inserte valores numéricos del 0 al 9 y ','");
                return(false);
            }
            ;


            return(true);
        }
示例#5
0
        private bool ValidarCampos()
        {
            bool val = true;

            if (txt_Codigo.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_Codigo, "Debe ingresar un codigo!");
            }
            else if (!TextValidator.ValidarEntero(txt_Codigo.Text))
            {
                val = false;
                Validaciones.SetError(txt_Codigo, "El codigo es unicamente numerico");
            }

            if (txt_Producto.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_Producto, "Debe Ingresar un Producto!");
            }
            else if (!TextValidator.ValidarStringEntero(txt_Producto.Text) && (!TextValidator.ValidarString(txt_Producto.Text)))
            {
                val = false;
                Validaciones.SetError(txt_Producto, "Producto mal ingresado!");
            }

            if (txt_Precio.Text.Trim() == "")
            {
                val = false;
                Validaciones.SetError(txt_Precio, "Debe Ingresar un Precio para el producto!");
            }
            else if (!TextValidator.ValidarFloat(txt_Precio.Text))
            {
                val = false;
                Validaciones.SetError(txt_Precio, "El precio del producto debe ser numero y con 2 decimales");
            }

            return(val);
        }