Guest User

Untitled

a guest
Mar 13th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 3.00 KB | None | 0 0
  1. Public Sub GetApplicantPayoffAmount(ByVal lb As LendingDto.Applications.Liability)
  2.             Dim tr As New Framework.Common.Tracer(String.Format("GetApplicantPayoffAmount-{0}", lb.AccountNumber))
  3.  
  4.             'create service reference vars and set credentials
  5.             Dim MonetaryEngine As New Monetary()
  6.             With MonetaryEngine.Service.ClientCredentials.UserName
  7.                 .UserName = _HostUserName
  8.                 .Password = _HostPassword
  9.             End With
  10.             Dim SavingAccountEngine As New SavingAccount()
  11.             With SavingAccountEngine.Service.ClientCredentials.UserName
  12.                 .UserName = _HostUserName
  13.                 .Password = _HostPassword
  14.             End With
  15.  
  16.             Dim TransactionInfo As New MonetaryEngine.wsTransactionInfo
  17.             Dim TransactionItemInfo As New MonetaryEngine.wsTransactionItemInfo
  18.  
  19.             Try
  20.                 'get account id for refi to be paid off
  21.                 Dim PortSuffix() As String = lb.AccountNumber.Split("-")
  22.                 Dim AccountInfo As New SavingAccountEngine.wsAccountInfo
  23.                 AccountInfo = SavingAccountEngine.Service.findAccountByAccountPortSuffix(SavingAccountEngine.getWebContext, Integer.Parse(PortSuffix(0)), Integer.Parse(PortSuffix(1)))
  24.  
  25.                 'payoff refi
  26.                 tr.StopStartTask(String.Format("GetApplicantPayoffAmount-Call-getLoanPaymentDetails - {0}", AccountInfo.accountId))
  27.                 TransactionInfo = MonetaryEngine.Service.getLoanPaymentDetails(MonetaryEngine.getWebContext, AccountInfo.accountId, 0, BusinessDate)
  28.                 TransactionInfo.transactionItemInfos(0).loanPaymentComponent.paymentType = "PAYOFF"
  29.                 tr.StopStartTask(String.Format("GetApplicantPayoffAmount-Call-processLoanPayments - {0}", AccountInfo.accountId))
  30.                 TransactionItemInfo = MonetaryEngine.Service.processLoanPayments(MonetaryEngine.getWebContext, TransactionInfo.transactionItemInfos(0), BusinessDate, False)
  31.  
  32.                 'set payoff amount
  33.                 lb.PayoffAmount = TransactionItemInfo.loanPaymentComponent.paymentTypeAmount / 100
  34.                 tr.StopStartTask(String.Format("GetApplicantPayoffAmount-GotPayOff-{0}", AccountInfo.accountId))
  35.                 Common.SerializeObjectToFile(lb, "GetApplicantPayoffAmount-GotPayOff-" + lb.AccountNumber.ToString + "-" + lb.PayoffAmount.ToString)
  36.                 'add the liability back
  37.                 _ApplicantLiabilities.Add(lb)
  38.  
  39.             Catch ex As Exception
  40.                 If Not ex.Message = "MONT0030" Then 'Acumen Specific Error - Loan Account not in Disbursed state for transaction
  41.                     Akcelerant.Core.Utility.LogError(ex)
  42.                 End If
  43.             Finally
  44.                 'Decrement the variable as the thread is complete
  45.                 If Interlocked.Decrement(_NumberOfThreadsNotYetCompleted) = 0 Then
  46.                     _ThreadDoneEvent.Set()
  47.                 End If
  48.                 tr.Dispose()
  49.             End Try
  50.  
  51.         End Sub
Add Comment
Please, Sign In to add comment