Beispiel #1
0
        private bool Validacion()
        {
            if (string.IsNullOrEmpty(totalTextBox.Text) && MedicinasdataGridView.Rows.Count == 0 && string.IsNullOrEmpty(subTotalTextBox.Text))
            {
                totalErrorProvider.SetError(totalTextBox, "Ingrese medicinas para generar el total del a venta");
                SubTotalerrorProvider.SetError(subTotalTextBox, "Ingrese medicinas para generar el precio de la venta");
                MedicinaserrorProvider.SetError(MedicinasdataGridView, "Ingrese medicinas");
                MessageBox.Show("Por favor llenar todos los campos");
                return(false);
            }

            if (MedicinasdataGridView.Rows.Count == 0)
            {
                MedicinaserrorProvider.SetError(MedicinasdataGridView, "Ingrese medicinas");
                return(false);
            }

            if (string.IsNullOrEmpty(totalTextBox.Text) && string.IsNullOrEmpty(subTotalTextBox.Text))
            {
                SubTotalerrorProvider.SetError(subTotalTextBox, "Ingrese medicinas para generar el precio de la venta");
                totalErrorProvider.SetError(totalTextBox, "Ingrese medicinas para generar el total de la venta");
                return(false);
            }

            if (DescuentoradioButton.Checked == true && string.IsNullOrEmpty(DescuentotextBox.Text))
            {
                DescuentoerrorProvider.SetError(DescuentotextBox, "Ingrese el descuento para el articulo");
            }

            return(true);
        }
Beispiel #2
0
 private void LimpiarErrores()
 {
     idErrorProvider.Clear();
     totalErrorProvider.Clear();
     SubTotalerrorProvider.Clear();
     MedicinaserrorProvider.Clear();
 }