Esempio n. 1
0
        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
            SIGEEA_DiagramaDataContext dc = new SIGEEA_DiagramaDataContext();
            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.FacturaNum         = (int)f.Numero_FacAsociado;
                        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.FacturaNum         = (int)f.Numero_FacAsociado;
                        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);
            }
        }