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

Imports System.Web
NameSpace FMSWeb
Public Partial class _TickerList : Inherits System.Web.UI.Page
   Public _t_head1 As FMSWeb._t_head
   Public _t_begin1 As FMSWeb._t_begin
   Public _t_end1 As FMSWeb._t_end

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      _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)
   End Sub
   Dim objTickers As New FMStocks_Bus.Ticker
   Public ticker As String = ""
   Public company As String = ""
   Public Sub GetTickerList()
      Dim count As Integer = 0
      Dim fldTicker As gmRTL.DataLib.SqlClient.Field = Nothing
      Dim fldCompany As gmRTL.DataLib.SqlClient.Field = Nothing
      Dim rs As gmRTL.DataLib.SqlClient.Recordset = Nothing
      If (Not String.IsNullOrEmpty(ticker) Or Not String.IsNullOrEmpty(company)) Then
         On Error Resume Next
         If (Not String.IsNullOrEmpty(ticker)) Then
            rs = objTickers.ListByTicker(ticker)
         Else
            rs = objTickers.ListByCompany(company)
         End If
         If (Err.Number <> 0) Then
            _t_head1.BuildErrorMessage()
            HttpContext.Current.Response.Write("Unable to lookup company symbols at this time.")
            Exit Sub
         End If
         On Error Goto 0                    ' Added On Error Goto 0 to Facilate Error Handling Upgrade
         If (Not (rs Is Nothing)) Then
            If (Not rs.EOF) Then
               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'>" & vbCrLf)
               HttpContext.Current.Response.Write("<tr><td class='ColumnHeader' width='50'>Ticker" & vbCrLf)
               HttpContext.Current.Response.Write("	<td class='ColumnHeader' width='300'>Company" & vbCrLf)
               HttpContext.Current.Response.Write("</tr>" & vbCrLf)
            End If
            Do Until rs.EOF
               HttpContext.Current.Response.Write("<tr>" & vbCrLf)
               HttpContext.Current.Response.Write("	<td><a href='" & "TickerDetail.aspx?ticker=" & fldTicker.Value & "'>" & fldTicker.Value & "</a>" & vbCrLf)
               HttpContext.Current.Response.Write("	<td>" & fldCompany.Value)
               HttpContext.Current.Response.Write("</tr>" & vbCrLf)
               rs.MoveNext()
            Loop
            count = rs.RecordCount
            rs.Close()
            rs = Nothing
            If (count > 0) Then
               HttpContext.Current.Response.Write("</table>")
            End If
         End If
         HttpContext.Current.Response.Write("<p>" & count & " matches found.<p>")
      End If
   End Sub
End Class
End Namespace
