// asp code Generated by Basic Processor
// Original Page Name: C:\gmTestBed\FMStocks\src\FMSWeb\ASP\TickerList.asp

namespace FMSWeb
{
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using VBNET=Microsoft.VisualBasic;

public partial class _TickerList : System.Web.UI.Page
{
   public FMSWeb._t_head _t_head1 = null;
   public FMSWeb._t_begin _t_begin1 = null;
   public FMSWeb._t_end _t_end1 = null;

   protected void Page_Load(object sender, EventArgs e)
   {
      _t_head1 = new FMSWeb._t_head();
      _t_begin1 = new FMSWeb._t_begin();
      _t_end1 = new FMSWeb._t_end();
      _t_begin1.Include_Load(_t_head1);
      _t_end1.Include_Load(_t_head1);
   }
   private FMStocks_Bus.Ticker objTickers = new FMStocks_Bus.Ticker();
   public string ticker = "";
   public string company = "";
   public void GetTickerList()
   {
      int count = 0;
      gmRTL.DataLib.SqlClient.Field fldTicker = null;
      gmRTL.DataLib.SqlClient.Field fldCompany = null;
      gmRTL.DataLib.SqlClient.Recordset rs = null;
      if (!String.IsNullOrEmpty(ticker) || !String.IsNullOrEmpty(company))
      {
         gmRTL.Core.ErrorHandling.ResumeNext(() =>
         {
            if (!String.IsNullOrEmpty(ticker))
            {
               rs = objTickers.ListByTicker(ticker);
            }
            else
            {
               rs = objTickers.ListByCompany(company);
            }
            if (gmRTL.Core.GlobalException.Instance.Number != 0)
            {
               _t_head1.BuildErrorMessage();
               HttpContext.Current.Response.Write("Unable to lookup company symbols at this time.");
               return;
            }
         });     //  Added On Error Goto 0 to Facilate Error Handling Upgrade
         if (!(rs == null))
         {
            if (!rs.EOF)
            {
               fldTicker = rs.Fields[0];
               fldCompany = rs.Fields[1];
               HttpContext.Current.Response.Write("<table cellpadding='2' cellspacing='2' bordercolor='Gray' bgcolor='White' border='2' cols='2' rules='ALL'>" + "\n");
               HttpContext.Current.Response.Write("<tr><td class='ColumnHeader' width='50'>Ticker" + "\n");
               HttpContext.Current.Response.Write("	<td class='ColumnHeader' width='300'>Company" + "\n");
               HttpContext.Current.Response.Write("</tr>" + "\n");
            }
            while (!(rs.EOF))
            {
               HttpContext.Current.Response.Write("<tr>" + "\n");
               HttpContext.Current.Response.Write("	<td><a href='" + "TickerDetail.aspx?ticker=" + fldTicker.Value + "'>" + fldTicker.Value + "</a>" + "\n");
               HttpContext.Current.Response.Write("	<td>" + fldCompany.Value);
               HttpContext.Current.Response.Write("</tr>" + "\n");
               rs.MoveNext();
            }
            count = rs.RecordCount;
            rs.Close();
            rs = null;
            if (count > 0)
            {
               HttpContext.Current.Response.Write("</table>");
            }
         }
         HttpContext.Current.Response.Write("<p>" + count + " matches found.<p>");
      }
   }
}
}
