Exemple #1
0
        private static void DoPrint(List <t_trade> trds)
        {
            var ps = new PrintingSystem();

            ps.Document.Pages.Clear();
            ps.ShowMarginsWarning = false;
            ps.ClearContent();

            var whr = trds.Select(k => k.Guid.ToString()).Aggregate((s1, s2) => s1 + "','" + s2);

            using (var db = new Database()) {
                var vtrds  = db.Fetch <t_trade>(string.Format(" where guid in ('{0}')", whr));
                var orders = db.Fetch <t_order>(string.Format(" where tradeguid in ('{0}')", whr));
                vtrds.ForEach(trd => {
                    var prtinfo    = new PrintInfo();
                    prtinfo.Trade  = trd;
                    prtinfo.Orders = orders.Where(odr => odr.TradeGuid == trd.Guid).ToList();
                    var rptfh      = new rptFH();
                    rptfh.BindPrintData(prtinfo);
                    rptfh.CreateDocument();

                    ps.Document.Pages.AddRange(rptfh.Pages);
                });
            }

            ps.Print();
        }
Exemple #2
0
        private static void DoPrint(List<t_trade> trds)
        {
            var ps = new PrintingSystem();
            ps.Document.Pages.Clear();
            ps.ShowMarginsWarning = false;
            ps.ClearContent();

            var whr = trds.Select(k => k.Guid.ToString()).Aggregate((s1, s2) => s1 + "','" + s2);
            using (var db = new Database()) {
                var vtrds = db.Fetch<t_trade>(string.Format(" where guid in ('{0}')", whr));
                var orders = db.Fetch<t_order>(string.Format(" where tradeguid in ('{0}')", whr));
                vtrds.ForEach(trd => {
                    var prtinfo = new PrintInfo();
                    prtinfo.Trade = trd;
                    prtinfo.Orders = orders.Where(odr => odr.TradeGuid == trd.Guid).ToList();
                    var rptfh = new rptFH();
                    rptfh.BindPrintData(prtinfo);
                    rptfh.CreateDocument();

                    ps.Document.Pages.AddRange(rptfh.Pages);
                });
            }

            ps.Print();
        }