} // class LoanIntegrityRow private KeyValuePair <ReportQuery, DataTable> CreateLoanIntegrityReport(Report report) { var loanIntegrity = new LoanIntegrity(DB, this); SortedDictionary <int, decimal> diffs = loanIntegrity.Run(); var oRows = new List <LoanIntegrityRow>(); foreach (int loanId in diffs.Keys) { var oNewRow = new LoanIntegrityRow { LoanId = loanId, Diff = diffs[loanId] }; oRows.Add(oNewRow); } // foreach oRows.Sort(LoanIntegrityRow.Compare); var oOutput = new DataTable(); oOutput.Columns.Add("LoanID", typeof(int)); oOutput.Columns.Add("Diff", typeof(decimal)); oRows.ForEach(r => r.ToRow(oOutput)); return(new KeyValuePair <ReportQuery, DataTable>(new ReportQuery(report), oOutput)); // qqq - the new repoerQuery here is wrong } // CreateLoanIntegrityReport
public static int Compare(LoanIntegrityRow a, LoanIntegrityRow b) { if (a.Diff == b.Diff) { return(0); } if (a.Diff > b.Diff) { return(1); } return(-1); } // Compare