예제 #1
0
		public void UpdateLoanDBStateTest() {
			const long loanID = 10009;
			const int customerID = 59;
			UpdateLoanDBState reloadLoanDBState = new UpdateLoanDBState(customerID, loanID, 357);
			reloadLoanDBState.Context.UserID = 357;
			try {
				reloadLoanDBState.Execute();
			} catch (NL_ExceptionInputDataInvalid nlExceptionInputDataInvalid) {
				m_oLog.Debug(nlExceptionInputDataInvalid);
			}
		}
예제 #2
0
		public void UpdateLoanStates() {
			List<LoanTransactionModel> loansList = DB.Fill<LoanTransactionModel>("select nl.[LoanID], l.CustomerId from NL_Loans nl join Loan l on l.Id=nl.OldLoanID", CommandSpecies.Text);

			foreach (LoanTransactionModel transaction in loansList) {
				// recalculate state by calculator + save new state to DB
				UpdateLoanDBState reloadLoanDBState = new UpdateLoanDBState(transaction.CustomerId, transaction.LoanID, 1);
				try {
					reloadLoanDBState.Execute();

					// ReSharper disable once CatchAllClause
				} catch (Exception ex) {
					Error = ex.Message;
					Log.Error("Failed on UpdateLoanDBState {0}", Error);
					NL_AddLog(LogType.Error, "Failed", transaction.LoanID, reloadLoanDBState.Error + "\n" + Error, ex.ToString(), ex.StackTrace);
				}
			}
		}