} // SetLoanCount public void AddClient(LoansIssuedRow lir) { if (m_oClients.ContainsKey(lir.ClientID)) { m_oClients[lir.ClientID]++; } else { m_oClients[lir.ClientID] = 1; } } // AddClient
} // SetInterests public void AccumulateTotals(LoansIssuedRow row) { foreach (KeyValuePair <string, dynamic> pair in ms_oFieldNames) { if (ms_oTotalIgnored.ContainsKey(pair.Key)) { continue; } m_oData[pair.Key] += row.m_oData[pair.Key]; } // for each field name } // AccumulateTotals
} // class LoansIssuedRow private KeyValuePair <ReportQuery, DataTable> CreateLoansIssuedReport(Report report, DateTime today, DateTime tomorrow) { var rpt = new ReportQuery(report) { DateStart = today, DateEnd = tomorrow }; var ea = new EarnedInterest.EarnedInterest(DB, EarnedInterest.EarnedInterest.WorkingMode.ByIssuedLoans, false, today, tomorrow, this); SortedDictionary <int, decimal> earned = ea.Run(); var oRows = new List <LoansIssuedRow>(); var oTotal = new LoansIssuedRow(null); int nRowCount = 0; rpt.Execute(DB, (sr, bRowsetStart) => { nRowCount++; var lir = new LoansIssuedRow(sr); oRows.Add(lir); lir.SetInterests(earned); oTotal.AddClient(lir); oTotal.AccumulateTotals(lir); return(ActionResult.Continue); }); oTotal.SetLoanCount(nRowCount); DataTable oOutput = oTotal.ToTable(); oRows.ForEach(lir => lir.ToRow(oOutput)); return(new KeyValuePair <ReportQuery, DataTable>(rpt, oOutput)); } // CreateLoansIssuedReport