' ------------------------------------------------------------
' Code generated automatically by Code Architects' VB Migration Partner
' ------------------------------------------------------------

Option Strict Off      ' Code migrated from VB6 has Option Strict disabled by default

<System.Runtime.InteropServices.ProgID("FMStocks_DB.TxNew")> _ 
<Transaction(TransactionOption.RequiresNew)> _
Public Class TxNew
	Inherits ServicedComponent

	#Region "Constructor"
	
	'A public default constructor
	Public Sub New()
		Class_Initialize_VB6()
		' Add initialization code here
	End Sub
	
	#End Region
	
	#Region "Static constructor"
	
	' This static constructor ensures that the VB6 support library be initialized before using current class.
	Shared Sub New()
		EnsureVB6LibraryInitialization()
	End Sub
	
	#End Region
	
	Private Const m_modName As String = "FMStocks_DB.TxNew"
	Private m_dbh As DBHelper
	
	Private Sub Class_Initialize_VB6()
		'must call CreateObject or COM+ will
		'not call IObjectConstructor inferface that DBHelper needs
		m_dbh = CreateObject6("FMStocks_DB.DBHelper")
	End Sub

	Private Sub Class_Terminate_VB6()
		m_dbh = Nothing
	End Sub

	Public Sub SetTxType(ByVal TxID As Integer, ByVal TxTypeId As Integer)
		On Error GoTo errorHandler 
		
		m_dbh.RunSP("Tx_SetTxType", Array6(mp("@TxID", ADODB.DataTypeEnum.adInteger, 4, TxID), mp("@TxTypeID", ADODB.DataTypeEnum.adInteger, 4, TxTypeId)))
		VB6MtsMethods.GetObjectContext().SetComplete
		Exit Sub
		
errorHandler:
		VB6MtsMethods.GetObjectContext().SetAbort
		RaiseError(m_modName, "SetTxType(" & TxID & "," & TxTypeId & ")")
	End Sub

	Protected Overrides Sub Dispose(ByVal disposing As Boolean)
		Try
				Class_Terminate_VB6()
		Finally
			MyBase.Dispose(disposing)
		End Try
	End Sub

End Class
