Ejemplo n.º 1
0
        private void btnFactura_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                SIGEEA_DiagramaDataContext dc      = new SIGEEA_DiagramaDataContext();
                SIGEEA_FacAsociado         factura = dc.SIGEEA_FacAsociados.First(c => c.PK_Id_FacAsociado == Convert.ToInt32(txbFactura.Text));

                if (solicitud == true && (factura == null || factura.Estado_FacAsociado == false || factura.Incompleta_FacAsociado == true))
                {
                    throw new ArgumentException("La factura digitada no existe, está pendiente de finalización o ya fue cancelada.");
                }


                if (solicitud == false && (factura == null || factura.Incompleta_FacAsociado == false || factura.Estado_FacAsociado == false))
                {
                    throw new ArgumentException("La factura digitada no existe o su entrega ya fue completada y/o cancelada.");
                }


                if (solicitud == false)
                {
                    wnwCompletaEntrega ventana = new wnwCompletaEntrega(factura.PK_Id_FacAsociado);
                    ventana.ShowDialog();
                }
                else
                {
                    wnwFacturasPendientesPago ventana = new wnwFacturasPendientesPago(factura.PK_Id_FacAsociado);
                    ventana.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "SIGEEA", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
 private void btnDetalles_Click(object sender, RoutedEventArgs e)
 {
     if (Solicitud == false)//Facturas incompletas
     {
         wnwCompletaEntrega ventana = new wnwCompletaEntrega(this.FacturaId);
         ventana.ShowDialog();
     }
     else//Facturas pendientes de pago
     {
         wnwFacturasPendientesPago ventana = new wnwFacturasPendientesPago(this.FacturaId);
         ventana.ShowDialog();
     }
 }
        private void btnFactura_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DataClasses1DataContext dc = new DataClasses1DataContext();
                SIGEEA_FacAsociado factura = dc.SIGEEA_FacAsociados.First(c => c.PK_Id_FacAsociado == Convert.ToInt32(txbFactura.Text));

                if(solicitud == true && (factura == null || factura.Estado_FacAsociado == false || factura.Incompleta_FacAsociado == true))
                    throw new ArgumentException("La factura digitada no existe, está pendiente de finalización o ya fue cancelada.");


                if (solicitud == false && (factura == null || factura.Incompleta_FacAsociado == false || factura.Estado_FacAsociado == false))
                    throw new ArgumentException("La factura digitada no existe o su entrega ya fue completada y/o cancelada.");


                if (solicitud == false)
                {
                    wnwCompletaEntrega ventana = new wnwCompletaEntrega(factura.PK_Id_FacAsociado);
                    ventana.ShowDialog();
                }
                else
                {
                    wnwFacturasPendientesPago ventana = new wnwFacturasPendientesPago(factura.PK_Id_FacAsociado);
                    ventana.ShowDialog();
                }
                
            }
            catch(Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "SIGEEA", MessageBoxButton.OK, MessageBoxImage.Error);
            }

        }