using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Data;
using VBNET = Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using System.Linq;
using System.Collections.Generic;

namespace FMStocks_DB
{
   public class TxNew : System.IDisposable
   {
      bool _disposed = false;
      private const string m_modName = "FMStocks_DB.TxNew";
      private DBHelper m_dbh = null;
      public TxNew() : base()
      {
         Class_Initialize();
      }
      private void Class_Initialize()
      {
         // must call CreateObject or COM+ will
         // not call IObjectConstructor inferface that DBHelper needs
         m_dbh = new FMStocks_DB.DBHelper();
      }
      public void Dispose()
      {
         Dispose(true);
         GC.SuppressFinalize(this);
      }
      protected virtual void Dispose(bool disposing)
      {
         if (_disposed)
         {
            return;
         }
         if (disposing)
         {
            Class_Terminate();
         }
         _disposed = true;
      }
      private void Class_Terminate()
      {
         m_dbh = null;
      }
      public void SetTxType(int TxID,int TxTypeId)
      {
         try
         {
            gmRTL.Core.GlobalException.Clear();

            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)},String.Empty);

            return;

         }
         catch(System.Exception exc)
         {
            gmRTL.Core.GlobalException.Initialize(exc);

            Helpers.RaiseError(m_modName,"SetTxType(" + TxID + "," + TxTypeId + ")","",0,false);
         }
      }
   }
}
