Exemplo n.º 1
0
        private bool Validar()
        {
            bool realizado = true;

            errorProvider.Clear();

            if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text))
            {
                errorProvider.SetError(IDnumericUpDown, "EL CAMPO ID NO PUEDE ESTAR VACIO");
                IDnumericUpDown.Focus();
                realizado = false;
            }

            if (string.IsNullOrWhiteSpace(CantidadtextBox.Text))
            {
                errorProvider.SetError(IDnumericUpDown, "EL CAMPO CANTIDAD NO PUEDE ESTAR VACIO");
                CantidadtextBox.Focus();
                realizado = false;
            }

            if (this.DetalleEstudiantes.Count == 0)
            {
                errorProvider.SetError(dataGridView, "Debe agregar algun estudiante");
                EstudiantecomboBox.Focus();
                realizado = false;
            }

            return(realizado);
        }
Exemplo n.º 2
0
        private bool Validar()
        {
            bool   validado    = true;
            string obligatorio = "Campo obligatorio";

            if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text))
            {
                errorProvider.SetError(IDnumericUpDown, obligatorio);
                IDnumericUpDown.Focus();
                validado = false;
            }
            if (string.IsNullOrWhiteSpace(CantidadtextBox.Text))
            {
                errorProvider.SetError(CantidadtextBox, obligatorio);
                CantidadtextBox.Focus();
                validado = false;
            }
            if (string.IsNullOrWhiteSpace(PreciotextBox.Text))
            {
                errorProvider.SetError(PreciotextBox, "Seleccione un tipo de cacao");
                TipoCacaocomboBox.Focus();
                validado = false;
            }

            return(validado);
        }
Exemplo n.º 3
0
        private void MasButton_Click(object sender, RoutedEventArgs e)
        {
            orden.OrdenDetalle.Add(new OrdenDetalle(Convert.ToInt32(OrdenIdTextBox.Text), Convert.ToInt32(ProductoIdTextBox.Text), Convert.ToInt32(CantidadtextBox.Text)));
            Actualizar();
            OrdenDetalle ordenDetalle = new OrdenDetalle();
            int          cantidad     = ordenDetalle.Cantidad;
            int          id           = ordenDetalle.ProductoId;

            ProductoBLL.Calculo(id, cantidad);
            CantidadtextBox.Clear();
            ProductoIdTextBox.Clear();
            CantidadtextBox.Focus();
        }
Exemplo n.º 4
0
        private bool ValidarDetalle()
        {
            errorProvider1.Clear();
            bool paso = true;

            if (string.IsNullOrWhiteSpace(CantidadtextBox.Text))
            {
                errorProvider1.SetError(CantidadtextBox, "El campo cantidad no puede estar vacio");
                CantidadtextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(PreciotextBox.Text))
            {
                errorProvider1.SetError(PreciotextBox, "El campo precio no puede estar vacio");
                PreciotextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(ServiciocomboBox.Text))
            {
                errorProvider1.SetError(ServiciocomboBox, "El campo categoria no puede estar vacio, debe de seleccionar una categoria");
                ServiciocomboBox.Focus();
                paso = false;
            }

            if (Convert.ToInt32(CantidadtextBox.Text) < 0)
            {
                errorProvider1.SetError(CantidadtextBox, "El campo cantidad no puede ser menor a 0");
                CantidadtextBox.Focus();
                paso = false;
            }

            if (Convert.ToDouble(PreciotextBox.Text) < 0)
            {
                errorProvider1.SetError(PreciotextBox, "El campo precio no puede ser negativo");
                PreciotextBox.Focus();
                paso = false;
            }

            return(paso);
        }
Exemplo n.º 5
0
        private bool ValidarCantidad()
        {
            bool   validado    = true;
            string obligatorio = "Campo obligatorio";

            if (string.IsNullOrWhiteSpace(CantidadtextBox.Text))
            {
                errorProvider.SetError(CantidadtextBox, obligatorio);
                CantidadtextBox.Focus();
                validado = false;
            }
            if (ToDecimal(CantidadtextBox.Text) > ToDecimal(BalancetextBox.Text))
            {
                errorProvider.SetError(CantidadtextBox, "El monto a pagar no ha de ser mayor \n al balance del prestamo");
                CantidadtextBox.Focus();
                validado = false;
            }

            return(validado);
        }
Exemplo n.º 6
0
        private bool Validar()
        {
            bool   validado    = true;
            string obligatorio = "Campo obligatorio";

            if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text))
            {
                errorProvider.SetError(IDnumericUpDown, obligatorio);
                IDnumericUpDown.Focus();
                validado = false;
            }
            if (this.PagosDetalles.Count == 0)
            {
                errorProvider.SetError(dataGridView, obligatorio);
                CantidadtextBox.Focus();
                validado = false;
            }

            return(validado);
        }
Exemplo n.º 7
0
        private bool Validar()
        {
            bool paso = true;



            if (string.IsNullOrEmpty(DescripciontextBox.Text))
            {
                Myerror.SetError(DescripciontextBox, "El campo descripción no debe estar vacio");
                DescripciontextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrEmpty(CantidadtextBox.Text))
            {
                Myerror.SetError(CantidadtextBox, "El campo cantidad no debe estar vació");
                CantidadtextBox.Focus();
                paso = false;
            }

            return(paso);
        }