示例#1
0
        }         // LoadCashRequests

        private LoanStatsDataEntry CreateEntry(SafeReader sr)
        {
            var lse = new LoanStatsDataEntry(sr);

            if (!Data.ContainsKey(lse.CustomerID))
            {
                Data[lse.CustomerID] = new List <LoanStatsDataEntry>();
            }

            Data[lse.CustomerID].Add(lse);

            return(lse);
        }         // CreateEntry
示例#2
0
        }         // FillTitle

        private void LoadCashRequests()
        {
            Msg("Loan Stats: loading cash requests...");

            Data = new SortedDictionary <int, List <LoanStatsDataEntry> >();

            Debug("Loan Stats: processing raw data...");

            var oCounter = new ProgressCounter("Loan Stats: {0} rows processed", this);

            LoanStatsDataEntry oCurrent = null;

            m_oDB.ForEachRowSafe(
                (sr, bRowsetStart) => {
                if (oCurrent == null)
                {
                    oCurrent = CreateEntry(sr);
                }
                else
                {
                    int nCustomerID = sr["CustomerID"];

                    if (oCurrent.CustomerID == nCustomerID)
                    {
                        oCurrent.Update(sr);
                    }
                    else
                    {
                        oCurrent = CreateEntry(sr);
                    }
                }                         // if

                if (oCurrent.LoanID != 0)
                {
                    oCurrent = null;
                }

                ++oCounter;

                return(ActionResult.Continue);
            },
                "RptLoanStats_CashRequests",
                CommandSpecies.StoredProcedure
                );

            oCounter.Log();

            Debug("Loan Stats: processing raw data complete.");

            foreach (KeyValuePair <int, List <LoanStatsDataEntry> > pair in Data)
            {
                int num = 1;

                foreach (LoanStatsDataEntry lse in pair.Value)
                {
                    lse.LoanSeqNo = num;
                    ++num;
                }         // for
            }             // for

            Msg("Loan Stats: loading cash requests complete.");
        }         // LoadCashRequests