Sets() public method

public Sets ( ) : List
return List
        public void DoWork(ContributionStatements statements, StatementSpecification cs, List <ContributorInfo> contributorInfos)
        {
            Db = CMSDataContext.Create(Host);

            var runningtotals = Db.ContributionsRuns.Where(mm => mm.UUId == UUId).Single();

            runningtotals.Count = contributorInfos.Count();
            Db.SubmitChanges();

            using (var stream = new FileStream(OutputFile, FileMode.Create))
            {
                statements.Run(stream, Db, contributorInfos, cs);
            }

            LastSet = statements.LastSet();
            var sets = statements.Sets();

            foreach (var set in sets)
            {
                using (var stream = new FileStream(Output(OutputFile, set), FileMode.Create))
                {
                    statements.Run(stream, Db, contributorInfos, cs, set);
                }
            }

            runningtotals.LastSet   = LastSet;
            runningtotals.Sets      = string.Join(",", sets);
            runningtotals.Completed = DateTime.Now;
            Db.SubmitChanges();
        }
        public void DoWork()
        {
            Db = DbUtil.Create(Host);
            Db.CommandTimeout = 1200;

            var noaddressok = Db.Setting("RequireAddressOnStatement", "true") == "false";
            showCheckNo = Db.Setting("RequireCheckNoOnStatement", "false").ToLower() == "true";
            showNotes = Db.Setting("RequireNotesOnStatement", "false").ToLower() == "true";
            const bool UseMinAmt = true;

            var qc = APIContribution.contributors(Db, fd, td, 0, 0, 0, noaddressok, UseMinAmt, StartsWith, Sort, tagid: TagId, excludeelectronic: ExcludeElectronic);
            var runningtotals = Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
            runningtotals.Count = qc.Count();
            Db.SubmitChanges();
            if (showCheckNo || showNotes)
            {
                var c = new ContributionStatementsExtra
                {
                    FromDate = fd,
                    ToDate = td,
                    typ = 3,
                    ShowCheckNo = showCheckNo,
                    ShowNotes = showNotes
                };
                using (var stream = new FileStream(OutputFile, FileMode.Create))
                    c.Run(stream, Db, qc);
                LastSet = c.LastSet();
                var sets = c.Sets();
                foreach (var set in sets)
                    using (var stream = new FileStream(Output(OutputFile, set), FileMode.Create))
                        c.Run(stream, Db, qc, set);
                runningtotals = Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
                runningtotals.LastSet = LastSet;
                runningtotals.Sets = string.Join(",", sets);
                runningtotals.Completed = DateTime.Now;
                Db.SubmitChanges();
            }
            else
            {
                var c = new ContributionStatements
                {
                    FromDate = fd,
                    ToDate = td,
                    typ = 3
                };
                using (var stream = new FileStream(OutputFile, FileMode.Create))
                    c.Run(stream, Db, qc);
                LastSet = c.LastSet();
                var sets = c.Sets();
                foreach (var set in sets)
                    using (var stream = new FileStream(Output(OutputFile, set), FileMode.Create))
                        c.Run(stream, Db, qc, set);
                runningtotals = Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
                runningtotals.LastSet = LastSet;
                runningtotals.Sets = string.Join(",", sets);
                runningtotals.Completed = DateTime.Now;
                Db.SubmitChanges();
            }
        }
Esempio n. 3
0
        public void DoWork()
        {
            Db                = new CMSDataContext(Util.GetConnectionString(Host));
            Db.Host           = Host;
            Db.CommandTimeout = 1200;

            var noaddressok   = Db.Setting("RequireAddressOnStatement", "true") == "false";
            var qc            = APIContribution.contributors(Db, fd, td, 0, 0, 0, noaddressok, useMinAmt: true, startswith: StartsWith);
            var runningtotals = Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();

            runningtotals.Count = qc.Count();
            Db.SubmitChanges();
            if (PDF)
            {
                var c = new ContributionStatements
                {
                    FromDate = fd,
                    ToDate   = td,
                    typ      = 3
                };
                using (var stream = new FileStream(OutputFile, FileMode.Create))
                    c.Run(stream, Db, qc);
                LastSet = c.LastSet();
                var sets = c.Sets();
                foreach (var set in sets)
                {
                    using (var stream = new FileStream(Output(OutputFile, set), FileMode.Create))
                        c.Run(stream, Db, qc, set);
                }
                runningtotals           = Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
                runningtotals.LastSet   = LastSet;
                runningtotals.Sets      = string.Join(",", sets);
                runningtotals.Completed = DateTime.Now;
                Db.SubmitChanges();
            }
            else
            {
                textStream = new StreamWriter(OutputFile);
                foreach (var c in qc)
                {
                    pageStatement = 1;
                    writeHeader(c);
                    writeContributions(c);
                    string hdrGift = "   Date        Fund Name          Description of Gift-in-Kind Given as of {0:d}\n\n".Fmt(td);
                    rWrite(hdrGift);
                    writeSummary(c);
                    runningtotals.Processed += 1;
                    Db.SubmitChanges();
                }
                textStream.Close();
                runningtotals           = Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
                runningtotals.Completed = DateTime.Now;
                Db.SubmitChanges();
            }
        }
        public void DoWork()
        {
            Db = new CMSDataContext(Util.GetConnectionString(Host));
            Db.Host = Host;
            Db.CommandTimeout = 1200;

            var noaddressok = Db.Setting("RequireAddressOnStatement", "true") == "false";
            showCheckNo = Db.Setting("RequireCheckNoOnStatement", "false").ToLower() == "true";
            showNotes = Db.Setting("RequireNotesOnStatement", "false").ToLower() == "true";

            var qc = APIContribution.contributors(Db, fd, td, 0, 0, 0, noaddressok, useMinAmt: true, startswith: StartsWith, sort: Sort);
            var runningtotals = Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
            runningtotals.Count = qc.Count();
            Db.SubmitChanges();
            if (PDF)
            {
                if (showCheckNo || showNotes)
                {
                    var c = new ContributionStatementsExtra
                    {
                        FromDate = fd,
                        ToDate = td,
                        typ = 3,
                        ShowCheckNo = showCheckNo,
                        ShowNotes = showNotes
                    };
                    using (var stream = new FileStream(OutputFile, FileMode.Create))
                        c.Run(stream, Db, qc);
                    LastSet = c.LastSet();
                    var sets = c.Sets();
                    foreach (var set in sets)
                        using (var stream = new FileStream(Output(OutputFile, set), FileMode.Create))
                            c.Run(stream, Db, qc, set);
                    runningtotals = Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
                    runningtotals.LastSet = LastSet;
                    runningtotals.Sets = string.Join(",", sets);
                    runningtotals.Completed = DateTime.Now;
                    Db.SubmitChanges();
                }
                else
                {
                    var c = new ContributionStatements
                    {
                        FromDate = fd,
                        ToDate = td,
                        typ = 3
                    };
                    using (var stream = new FileStream(OutputFile, FileMode.Create))
                        c.Run(stream, Db, qc);
                    LastSet = c.LastSet();
                    var sets = c.Sets();
                    foreach (var set in sets)
                        using (var stream = new FileStream(Output(OutputFile, set), FileMode.Create))
                            c.Run(stream, Db, qc, set);
                    runningtotals = Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
                    runningtotals.LastSet = LastSet;
                    runningtotals.Sets = string.Join(",", sets);
                    runningtotals.Completed = DateTime.Now;
                    Db.SubmitChanges();
                }
            }
            else
            {
                textStream = new StreamWriter(OutputFile);
                foreach (var c in qc)
                {
                    pageStatement = 1;
                    writeHeader(c);
                    writeContributions(c);
                    string hdrGift = "   Date        Fund Name          Description of Gift-in-Kind Given as of {0:d}\n\n".Fmt(td);
                    rWrite(hdrGift);
                    writeSummary(c);
                    runningtotals.Processed += 1;
                    Db.SubmitChanges();
                }
                textStream.Close();
                runningtotals = Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
                runningtotals.Completed = DateTime.Now;
                Db.SubmitChanges();
            }
        }
        public void DoWork(ContributionStatements.StatementSpecification cs)
        {
            Db = DbUtil.Create(Host);
            DbUtil.Db.CommandTimeout = 1200;

            var noaddressok = !DbUtil.Db.Setting("RequireAddressOnStatement", true);

            showCheckNo = DbUtil.Db.Setting("RequireCheckNoOnStatement");
            showNotes   = DbUtil.Db.Setting("RequireNotesOnStatement");
            const bool UseMinAmt = true;

            var qc            = APIContribution.Contributors(DbUtil.Db, fd, td, 0, 0, 0, cs.Funds, noaddressok, UseMinAmt, StartsWith, Sort, tagid: TagId, excludeelectronic: ExcludeElectronic);
            var runningtotals = DbUtil.Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();

            runningtotals.Count = qc.Count();
            DbUtil.Db.SubmitChanges();
            if (showCheckNo || showNotes)
            {
                var c = new ContributionStatementsExtra
                {
                    FromDate    = fd,
                    ToDate      = td,
                    typ         = 3,
                    ShowCheckNo = showCheckNo,
                    ShowNotes   = showNotes
                };
                using (var stream = new FileStream(OutputFile, FileMode.Create))
                {
                    c.Run(stream, Db, qc, cs);
                }

                LastSet = c.LastSet();
                var sets = c.Sets();
                foreach (var set in sets)
                {
                    using (var stream = new FileStream(Output(OutputFile, set), FileMode.Create))
                    {
                        c.Run(stream, Db, qc, cs, set);
                    }
                }

                runningtotals           = DbUtil.Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
                runningtotals.LastSet   = LastSet;
                runningtotals.Sets      = string.Join(",", sets);
                runningtotals.Completed = DateTime.Now;
                DbUtil.Db.SubmitChanges();
            }
            else
            {
                var c = new ContributionStatements
                {
                    FromDate = fd,
                    ToDate   = td,
                    typ      = 3
                };
                using (var stream = new FileStream(OutputFile, FileMode.Create))
                {
                    c.Run(stream, Db, qc, cs);
                }

                LastSet = c.LastSet();
                var sets = c.Sets();
                foreach (var set in sets)
                {
                    using (var stream = new FileStream(Output(OutputFile, set), FileMode.Create))
                    {
                        c.Run(stream, Db, qc, cs, set);
                    }
                }

                runningtotals           = DbUtil.Db.ContributionsRuns.OrderByDescending(mm => mm.Id).First();
                runningtotals.LastSet   = LastSet;
                runningtotals.Sets      = string.Join(",", sets);
                runningtotals.Completed = DateTime.Now;
                DbUtil.Db.SubmitChanges();
            }
        }