/// <summary>
        /// Metodo encargado de validar los campos del formulario
        /// </summary>
        /// <returns></returns>
        public bool Validar()
        {
            bool paso = true;

            ErrorProvider.Clear();
            if (string.IsNullOrWhiteSpace(CodigoTextBox.Text))
            {
                ErrorProvider.SetError(CodigoTextBox, "El codigo no puede estar vacio");
                CodigoTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(PrecioTextBox.Text))
            {
                ErrorProvider.SetError(PrecioTextBox, "El codigo no puede estar vacio");
                PrecioTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(ItebisTextBox.Text))
            {
                ErrorProvider.SetError(ItebisTextBox, "El codigo no puede estar vacio");
                ItebisTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(TotalTextBox.Text))
            {
                ErrorProvider.SetError(TotalTextBox, "El codigo no puede estar vacio");
                TotalTextBox.Focus();
                paso = false;
            }
            return(paso);
        }
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrEmpty(FechaDatePicker.Text))
            {
                MessageBox.Show("EL campo Fecha orden no puede estar vacio", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                FechaDatePicker.Focus();
                paso = false;
            }
            if (string.IsNullOrEmpty(TotalTextBox.Text))
            {
                MessageBox.Show("EL campo total no puede estar vacio", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                TotalTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrEmpty(DescripcionTextBox.Text))
            {
                MessageBox.Show("EL campo almacen no puede estar vacio", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                DescripcionTextBox.Focus();
                paso = false;
            }
            if (this.Detalles.Count == 0)
            {
                MessageBox.Show("Debe agregar un Telefono", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                ProductoIdTexBox.Focus();
                CantidadTextBox.Focus();
                paso = false;
            }
            return(paso);
        }
Exemple #3
0
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrEmpty(FechaOrdenDateTimePicker.Text))
            {
                MessageBox.Show("Debe Ingresar una Fecha", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                FechaOrdenDateTimePicker.Focus();
                paso = false;
            }
            if (string.IsNullOrEmpty(TotalTextBox.Text))
            {
                MessageBox.Show("Debe Ingresae un Total", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                TotalTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrEmpty(AlmacenIdTextBox.Text))
            {
                MessageBox.Show("Debe Ingresar un Almacen", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                AlmacenIdTextBox.Focus();
                paso = false;
            }
            if (this.Detalle.Count == 0)
            {
                MessageBox.Show("Debe Ingresar un telefono", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                ProductoIdTextBox.Focus();
                CantidadTextBox.Focus();
                paso = false;
            }
            return(paso);
        }
Exemple #4
0
        private bool Validar()
        {
            bool paso = true;

            if (SalidaIdTextBox.Text == string.Empty)
            {
                MessageBox.Show("SalidaId Vacio");
                SalidaIdTextBox.Focus();
                paso = false;
            }
            else if (ProveedorIdTextBox.Text == string.Empty || ProveedorIdTextBox.Text == "0")
            {
                MessageBox.Show("ProveedorId no Valido");
                ProveedorIdTextBox.Focus();
                paso = false;
            }
            else if (UsuarioIdTextBox.Text == string.Empty || UsuarioIdTextBox.Text == "0")
            {
                MessageBox.Show("UsuarioId no Valido");
                UsuarioIdTextBox.Focus();
                paso = false;
            }
            else if (FechaCompraDateTimePicker.Text == string.Empty)
            {
                MessageBox.Show("Fecha Vacia");
                FechaCompraDateTimePicker.Focus();
                paso = false;
            }
            else if (TotalTextBox.Text == string.Empty)
            {
                MessageBox.Show("No hay Productos Registrados");
                TotalTextBox.Focus();
                paso = false;
            }
            else if (SDetalleDataGrid.DataContext == null)
            {
                MessageBox.Show("Debe Agregar un Producto");
                paso = false;
            }

            return(paso);
        }
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrEmpty(UsuarioIdTextBox.Text))
            {
                paso = false;
                UsuarioIdTextBox.Focus();
            }

            if (string.IsNullOrEmpty(TotalTextBox.Text))
            {
                paso = false;
                TotalTextBox.Focus();
            }

            if (string.IsNullOrEmpty(SubTotalTextBox.Text))
            {
                paso = false;
                SubTotalTextBox.Focus();
            }


            if (string.IsNullOrEmpty(DescuentoTextBox.Text))
            {
                paso = false;
                DescuentoTextBox.Focus();
            }

            if (string.IsNullOrEmpty(ITBISTextBox.Text))
            {
                paso = false;
                ITBISTextBox.Focus();
            }

            if (string.IsNullOrEmpty(SubTotalTextBox.Text))
            {
                paso = false;
                SubTotalTextBox.Focus();
            }

            if (string.IsNullOrEmpty(FechaDeCompraTimePicker.Text))
            {
                paso = false;
                FechaDeCompraTimePicker.Focus();
            }


            if (string.IsNullOrEmpty(SuplidorIdTextbox.Text))
            {
                paso = false;
                SuplidorIdTextbox.Focus();
            }

            if (string.IsNullOrEmpty(CompraIDTextBox.Text))
            {
                paso = false;
                CompraIDTextBox.Focus();
            }

            if (this.Detalle.Count == 0)
            {
                MessageBox.Show("La Compra debe tener un producto", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                paso = false;
            }
            return(paso);
        }
Exemple #6
0
        private bool Validar()
        {
            bool paso = true;

            MyErrorProvider.Clear();
            if (string.IsNullOrWhiteSpace(PacienteComboBox.Text))
            {
                MyErrorProvider.SetError(PacienteComboBox, "El campo Paciente no puede estar vacio");
                PacienteComboBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(OdontologoComboBox.Text))
            {
                MyErrorProvider.SetError(OdontologoComboBox, "El campo Odontologo no puede estar vacio");
                OdontologoComboBox.Focus();
                paso = false;
            }
            if (FechaConsultaProximaDateTimePicker.Value < FechaActualDateTimePicker.Value)
            {
                MyErrorProvider.SetError(FechaConsultaProximaDateTimePicker, "El campo FechaConsultaProxima no puede tener una fecha anterior a fecha actual");
                FechaConsultaProximaDateTimePicker.Focus();
                paso = false;
            }
            if (SubTotalTextBox.Text == string.Empty)
            {
                MyErrorProvider.SetError(SubTotalTextBox, "El Subtotal no puede estar vacio");
                SubTotalTextBox.Focus();
                paso = false;
            }
            if (ItibisTextBox.Text == string.Empty)
            {
                MyErrorProvider.SetError(ItibisTextBox, "El Itbis no puede estar vacio");
                ItibisTextBox.Focus();
                paso = false;
            }
            if (TotalTextBox.Text == string.Empty)
            {
                MyErrorProvider.SetError(TotalTextBox, "El Total no puede estar vacio");
                TotalTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(DiagnosticoTextBox.Text))
            {
                MyErrorProvider.SetError(DiagnosticoTextBox, "El Diagnostico no puede estar vacio");
                TotalTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(ObservacionTextBox.Text))
            {
                MyErrorProvider.SetError(ObservacionTextBox, "La Observacion no puede estar vacio");
                ObservacionTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(TratamientoTextBox.Text))
            {
                MyErrorProvider.SetError(TratamientoTextBox, "El Tratamiento no puede estar vacio");
                TratamientoTextBox.Focus();
                paso = false;
            }
            return(paso);
        }