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

Imports System.Web
NameSpace FMSWeb
Public Partial class _SellStock : 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 obj As New FMStocks_Bus.Account
   Public MainPrompt As String = ""
   Public Sub EmitSellList()
      On Error Resume Next
      Dim rs As gmRTL.DataLib.SqlClient.Recordset = Nothing
      Dim i As Integer = 0
      If (Err.Number <> 0) Then
         HttpContext.Current.Response.Write("<span class=error>" & FMSWeb._strings.CREATE_OBJECT_FAILED & "</span>")
         _t_head1.BuildErrorMessage()
         Exit Sub
      End If
      rs = obj.ListPositionsForSale(CInt(_t_head1.g_AccountID))
      If (Err.Number <> 0) Then
         HttpContext.Current.Response.Write("<span class=error>" & FMSWeb._strings.DATABASE_ERROR & "</span>")
         _t_head1.BuildErrorMessage()
         Exit Sub
      End If
      If (Not (rs Is Nothing)) Then
         If (Not rs.EOF) Then
                                               ' don't emit the table header if there are no rows
            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='120'>Ticker" & vbCrLf)
            HttpContext.Current.Response.Write("	<td class='ColumnHeader' align='Right' width='80'>Total Shares" & vbCrLf)
            HttpContext.Current.Response.Write("	<td class='ColumnHeader' align='Right' width='80'>Current Price" & vbCrLf)
            HttpContext.Current.Response.Write("</tr>" & vbCrLf)
         End If
         i = 0
         Do Until rs.EOF
            i = i + 1
            HttpContext.Current.Response.Write("<tr>" & vbCrLf)
            HttpContext.Current.Response.Write("	<td>" & vbCrLf)
            HttpContext.Current.Response.Write("		<span style='cursor:hand'>" & vbCrLf)
            HttpContext.Current.Response.Write("		<input onclick='ticker_click()' type='radio' value='" & rs.Fields("ticker").Value & "' id='" & "symbol" & i & "' name='symbol'>" & vbCrLf)
            HttpContext.Current.Response.Write("		<label for='" & "symbol" & i & "'>" & vbCrLf)
            HttpContext.Current.Response.Write("		" & rs.Fields("ticker").Value)
            HttpContext.Current.Response.Write("		</label>" & vbCrLf)
            HttpContext.Current.Response.Write("		</span>" & vbCrLf)
            HttpContext.Current.Response.Write("	<td align='right'>" & rs.Fields("shares").Value)
            HttpContext.Current.Response.Write("	<td align='right'>$" & rs.Fields("price").Value)
            HttpContext.Current.Response.Write("</tr>" & vbCrLf)
            rs.MoveNext()
         Loop
         rs.Close()
      End If
      rs = Nothing
      HttpContext.Current.Response.Write("</table>" & vbCrLf)
   End Sub
End Class
End Namespace
