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_Ext
{
   public class History
   {
      //  the name of this module - used if there is an error
      private const string g_modName = "FMStocks_Ext.History";
      public gmRTL.DataLib.SqlClient.Recordset GetHistory(string Ticker)
      {
         gmRTL.DataLib.SqlClient.Recordset GetHistory = default;

         //  the recordset that will be returned
         gmRTL.DataLib.SqlClient.Recordset rs = null;
         //  fmstocks database component
         FMStocks_DB.DBHelper db = null;
         try
         {
            gmRTL.Core.GlobalException.Clear();


            db = new FMStocks_DB.DBHelper();

            GetHistory = db.RunSQLReturnRS("select * from History where Ticker = ?",new object[]{FMStocks_DB.Helpers.mp("Ticker",System.Data.SqlDbType.VarChar,12,Ticker)},String.Empty);

            //  done using the fmstocks component
            db = null;

            return GetHistory;

         }
         catch(System.Exception exc)
         {
            gmRTL.Core.GlobalException.Initialize(exc);
            db = null;
            rs = null;

            //  display the error
            FMStocks_DB.Helpers.RaiseError(g_modName,"History",String.Empty,0,false);
         }
         return GetHistory;
      }
   }
}
