Public Function SaveDataFromTValue() As Boolean
'--first we save the individual payments
SavePayments()
'next we save the newly calculated values
Dim strCommand As String = "sp_research_DealSaveDataFromTValue" 'sp_p_deal_SaveDataFromTValue"
If DealType = CFDealType.Lottery Then
strCommand = "sp_lotto_DealSaveDataFromTValue"
End If
Dim oCon = GetDBConnection("ConnPortal")
Dim oCmd As New SqlCommand(strCommand, oCon)
oCmd.CommandType = CommandType.StoredProcedure
oCmd.Parameters.Clear()
oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@DealID", System.Data.SqlDbType.Int)).Value = DealID
oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@LoanDate", System.Data.SqlDbType.DateTime)).Value = SetDBDate(LoanDate)
oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@FirstPmtDate", System.Data.SqlDbType.DateTime)).Value = SetDBDate(FirstPmtDate)
oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@LastPmtDate", System.Data.SqlDbType.DateTime)).Value = SetDBDate(LastPmtDate)
oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@FedPV", System.Data.SqlDbType.Money)).Value = FedPV
oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@salesRate", System.Data.SqlDbType.Float)).Value = salesRate
oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SRAmt", System.Data.SqlDbType.Money)).Value = salesAmt
oCon.Open()
oCmd.ExecuteNonQuery()
oCmd.Dispose()
oCmd = Nothing
oCon.Close()
oCon = Nothing
Return True
End Function
|