Esempio n. 1
0
        public InformeHistoricoPreciosClientesRpt GetInformeHistoricoPreciosClientesReport(VentasList list)
        {
            InformeHistoricoPreciosClientesRpt doc = new InformeHistoricoPreciosClientesRpt();

            List <VentasInfo> pList = new List <VentasInfo>();

            if (list.Count == 0)
            {
                return(null);
            }

            foreach (VentasInfo item in list)
            {
                pList.Add(item);
            }

            doc.SetDataSource(pList);

            FormatHeader(doc);

            return(doc);
        }
Esempio n. 2
0
        protected override void PrintAction()
        {
            PgMng.Reset(4, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

            Library.Invoice.QueryConditions conditions = new Library.Invoice.QueryConditions();
            conditions.Cliente  = TodosCliente_CkB.Checked ? null : _cliente;
            conditions.Familia  = TodosFamilia_CkB.Checked ? null : _familia;
            conditions.Producto = TodosProducto_CkB.Checked ? null : _producto;;
            conditions.FechaIni = FInicial_DTP.Checked ? FInicial_DTP.Value : DateTime.MinValue;;
            conditions.FechaFin = FFinal_DTP.Checked ? FFinal_DTP.Value : DateTime.MaxValue;
            conditions.Order    = (Ascendente_RB.Checked) ? ListSortDirection.Ascending : ListSortDirection.Descending;

            string filtro = GetFilterValues();

            if (Cliente_RB.Checked)
            {
                VentasList ventas = VentasList.GetHistoricoPreciosClientesList(conditions);
                PgMng.Grow();

                CommonReportMng rptMng = new CommonReportMng(AppContext.ActiveSchema, this.Text, filtro);
                InformeHistoricoPreciosClientesRpt rpt = rptMng.GetInformeHistoricoPreciosClientesReport(ventas);
                PgMng.FillUp();

                ShowReport(rpt);
            }
            else
            {
                VentasList ventas = VentasList.GetHistoricoPreciosProductosList(conditions);
                PgMng.Grow();

                CommonReportMng rptMng = new CommonReportMng(AppContext.ActiveSchema, this.Text, filtro);
                InformeHistoricoPreciosProductosRpt rpt = rptMng.GetInformeHistoricoPreciosProductosReport(ventas);
                PgMng.FillUp();

                ShowReport(rpt);
            }

            _action_result = DialogResult.Ignore;
        }