Option Strict Off
Option Explicit On
Imports System.Linq
Imports System.Collections.Generic
Namespace FMStocks_DB
   Public Class TxNew : Implements System.IDisposable
   Dim _disposed As Boolean = False
   Private Const m_modName As String = "FMStocks_DB.TxNew"
   Private m_dbh As DBHelper = Nothing
   Public Sub New()
      MyBase.New()
      Class_Initialize()
   End Sub
   Private Sub Class_Initialize()
      'must call CreateObject or COM+ will
      'not call IObjectConstructor inferface that DBHelper needs
      m_dbh = New FMStocks_DB.DBHelper
   End Sub
   Public Sub Dispose() Implements System.IDisposable.Dispose
      Dispose(True)
      GC.SuppressFinalize(Me)
   End Sub
   Protected Overridable Sub Dispose(disposing As Boolean)
      If _disposed Then
         Return
      End If
      If (disposing) Then
         Class_Terminate()
      End If
      _disposed = True
   End Sub
   Private Sub Class_Terminate()
      m_dbh = Nothing
   End Sub
   Public Sub SetTxType(ByVal TxID As Integer,ByVal TxTypeId As Integer)
      Try
         gmRTL.Core.GlobalException.ClearErrorObject()

         m_dbh.RunSP("Tx_SetTxType",New Object(){Helpers.mp("@TxID",System.Data.SqlDbType.Int,4,TxID),Helpers.mp("@TxTypeID",System.Data.SqlDbType.Int,4,TxTypeId)})

         Exit Sub

      Catch exc As System.Exception
         gmRTL.Core.GlobalException.SetErrorObject(exc)

         Helpers.RaiseError(m_modName,"SetTxType(" & TxID & "," & TxTypeId & ")")
      End Try
   End Sub
   End Class
End Namespace
