Exemplo n.º 1
0
        public bool Validar()
        {
            bool HayErrores = false;

            if (IdnumericUpDown.Value == 0)
            {
                ArticulosIderrorProvider.SetError(IdnumericUpDown, "Id:");
                HayErrores = true;
            }
            if (String.IsNullOrWhiteSpace(DescripciontextBox.Text))
            {
                DescripcionerrorProvider.SetError(DescripciontextBox, "Descripcion Vacio");
                HayErrores = true;
            }
            if (PreciotextBox.Text == String.Empty)
            {
                PrecioerrorProvider.SetError(PreciotextBox, "Precio Vacio");
                HayErrores = true;
            }
            if (ExistenciatextBox.Text == String.Empty)
            {
                ExistenciaerrorProvider.SetError(ExistenciatextBox, "Existencia Vacia");
                HayErrores = true;
            }
            if (CantidadCotizadatextBox.Text == String.Empty)
            {
                CantidadCotizadaerrorProvider.SetError(CantidadCotizadatextBox, "Cantidad Cotizada Vacia");
                HayErrores = true;
            }
            return(HayErrores);
        }
        private bool Validar()
        {
            bool interruptor = true;

            if (string.IsNullOrEmpty(descripcionTextBox.Text))
            {
                DescripcionerrorProvider.SetError(descripcionTextBox, "Por favor llenar el campo vacio.");
                interruptor = false;
            }
            if (cantidadNumericUpDown.Value == 0)
            {
                CantidaderrorProvider.SetError(cantidadNumericUpDown, "Por favor llenar el campo vacio.");
                interruptor = false;
            }
            if (string.IsNullOrEmpty(CostotextBox.Text))
            {
                CostoerrorProvider.SetError(CostotextBox, "Por favor llenar el campo vacio.");
                interruptor = false;
            }
            if (string.IsNullOrEmpty(PreciotextBox.Text))
            {
                PrecioerrorProvider.SetError(PreciotextBox, "Por favor llenar el campo vacio.");
                interruptor = false;
            }

            return(interruptor);
        }
        private void Limpiar()
        {
            productoIdMaskedTextBox.Clear();
            descripcionTextBox.Clear();
            cantidadNumericUpDown.Value = 0;
            CostotextBox.Clear();
            PreciotextBox.Clear();
            fechaIngresoDateTimePicker.Value = DateTime.Today;

            DescripcionerrorProvider.Clear();
            PrecioerrorProvider.Clear();
            CostoerrorProvider.Clear();
            CantidaderrorProvider.Clear();
        }
Exemplo n.º 4
0
        private bool SetProvider(int id)
        {
            bool paso = false;

            if (id == 1)
            {
                if (numericUpDown.Value == 0 || DescripcionrichTextBox.Text == string.Empty)
                {
                    PrecioerrorProvider.SetError(numericUpDown, "Campo debe de estar lleno");
                    DescripcionerrorProvider.SetError(DescripcionrichTextBox, "Debe de estar lleno");
                    paso = true;
                }
            }
            if (id == 2)
            {
                if (IDtextBox.Text == string.Empty)
                {
                    IDerrorProvider.SetError(IDtextBox, "Debe llenar este campo");
                    paso = true;
                }
            }
            return(paso);
        }
 private void PreciotextBox_TextChanged(object sender, EventArgs e)
 {
     PrecioerrorProvider.Clear();
 }
Exemplo n.º 6
0
 private void LimpiarProvider()
 {
     DescripcionerrorProvider.Clear();
     PrecioerrorProvider.Clear();
     IDerrorProvider.Clear();
 }