public wnwFacturasIncompletas(string pAsociado)
        {
            InitializeComponent();

            DataClasses1DataContext dc = new DataClasses1DataContext();
            List<SIGEEA_spObtenerFacturasIncompletasAsocResult> listaFacturas = dc.SIGEEA_spObtenerFacturasIncompletasAsoc(pAsociado).ToList();

            if (listaFacturas.Count > 0)
            {
                bool color = true;
                foreach (SIGEEA_spObtenerFacturasIncompletasAsocResult f in listaFacturas)
                {
                    uc_FacturaEntrega factura = new uc_FacturaEntrega(false);
                    factura.FacturaId = f.PK_Id_FacAsociado;
                    factura.FacturaFecha = f.FECHA;

                    factura.btnDetalles.Click += BtnDetalles_Click;
                    factura.Color(color);
                    color = !color;
                    stpContenedor.Children.Add(factura);
                }
            }
            else
            {
                Label lblVacio = new Label();
                lblVacio.Foreground = Brushes.IndianRed;
                lblVacio.FontSize = 18;
                lblVacio.Width = 430;
                lblVacio.Content = "No hay registros.";
                lblVacio.FontWeight = FontWeights.ExtraBold;

                stpContenedor.Children.Add(lblVacio);
            }
        }
        private void Inicializar(bool pSolicitud, string pAsociado)
        {
            //pSolicitud = true : si se desean obtener facturas pendientes
            //pSolicitud = false : si se desean obtener facturas incompletas
            DataClasses1DataContext dc = new DataClasses1DataContext();
            List<SIGEEA_spObtenerFacturasPendientesAsocResult> listaFacturasPendientes = new List<SIGEEA_spObtenerFacturasPendientesAsocResult>();
            List<SIGEEA_spObtenerFacturasIncompletasAsocResult> listaFacturasIncompletas = new List<SIGEEA_spObtenerFacturasIncompletasAsocResult>();


            if (pSolicitud == false)
            {
                listaFacturasIncompletas = dc.SIGEEA_spObtenerFacturasIncompletasAsoc(pAsociado).ToList();

                if (listaFacturasIncompletas.Count > 0)
                {
                    bool color = true;
                    foreach (SIGEEA_spObtenerFacturasIncompletasAsocResult f in listaFacturasIncompletas)
                    {
                        uc_FacturaEntrega factura = new uc_FacturaEntrega(pSolicitud);
                        factura.FacturaId = f.PK_Id_FacAsociado;
                        factura.FacturaFecha = f.FECHA;

                        factura.btnDetalles.Click += BtnDetalles_Click; ;
                        factura.Color(color);
                        color = !color;
                        stpContenedor.Children.Add(factura);
                    }
                }
            }
            else
            {
                listaFacturasPendientes = dc.SIGEEA_spObtenerFacturasPendientesAsoc(pAsociado).ToList();

                if (listaFacturasPendientes.Count > 0)
                {
                    bool color = true;
                    foreach (SIGEEA_spObtenerFacturasPendientesAsocResult f in listaFacturasPendientes)
                    {
                        uc_FacturaEntrega factura = new uc_FacturaEntrega(pSolicitud);
                        factura.FacturaId = f.PK_Id_FacAsociado;
                        factura.FacturaFecha = f.FECHA;

                        factura.btnDetalles.Click += BtnDetalles_Click; ;
                        factura.Color(color);
                        color = !color;
                        stpContenedor.Children.Add(factura);
                    }
                }
            }
            if (listaFacturasIncompletas.Count == 0 && listaFacturasPendientes.Count == 0)
            {
                Label lblVacio = new Label();
                lblVacio.Foreground = Brushes.IndianRed;
                lblVacio.FontSize = 18;
                lblVacio.Width = 430;
                lblVacio.Content = "No hay registros.";
                lblVacio.FontWeight = FontWeights.ExtraBold;
                stpContenedor.Children.Add(lblVacio);
            }
        }
        private static void FechaFacturaAct(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            uc_FacturaEntrega nAsociado = (uc_FacturaEntrega)d;

            nAsociado.FacturaFecha = e.NewValue as string;
        }
        private static void NumFacturaAct(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            uc_FacturaEntrega nAsociado = (uc_FacturaEntrega)d;

            nAsociado.FacturaNum = Convert.ToInt32(e.NewValue);
        }
Example #5
0
        private static void PrecioAct(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            uc_FacturaEntrega nAsociado = (uc_FacturaEntrega)d;

            nAsociado.FacturaCantidad = e.NewValue as string;
        }