Example #1
0
 private DateTime LastPenaltyAccrualEventDate()
 {
     const string q = @"SELECT TOP 1 ce.event_date
                         FROM dbo.LoanPenaltyAccrualEvents AS pe
                         LEFT JOIN dbo.ContractEvents AS ce ON ce.id=pe.id
                         ORDER BY ce.id DESC";
     using (var connection = _loanManager.GetConnection())
     using (var r = new OpenCbsCommand(q, connection).ExecuteReader())
     {
         r.Read();
         return r.GetDateTime("event_date");
     }
 }
Example #2
0
 private DateTime LastLoanTransitionEventDate()
 {
     const string q = @"SELECT TOP 1 ce.event_date
                     FROM dbo.LoanTransitionEvents AS tr
                     LEFT JOIN dbo.ContractEvents AS ce ON ce.id=tr.id
                     ORDER BY ce.id DESC";
     using (var connection = _loanManager.GetConnection())
     using (var r = new OpenCbsCommand(q, connection).ExecuteReader())
     {
         return !r.Read() ? DateTime.Today : r.GetDateTime("event_date");
     }
 }