<%--
   asp code Generated by Basic Processor
   Original Page Name: C:\gmTestBed\FMStocks\src\FMSWeb\ASP\SellStockAction.asp
--%>

<%@ Page language="VB" explicit="true" CodeBehind="SellStockAction.aspx.vb" Inherits="FMSWeb._SellStockAction" %>

<%
   HttpContext.Current.Response.Buffer = True
%>

<html>
<head>
<% _t_head1.Author_Markup() %>

	<title>Sell Receipt</title>
</head>
<body>
<% _t_begin1.Author_Markup() %>

<p class="section">Sell Receipt</p><br>
<%
   On Error Resume Next
   shares = CInt(Strings.Trim(HttpContext.Current.Request("shares")))
   ticker = Strings.Trim(HttpContext.Current.Request("symbol"))
   TxID = objBroker.SellStock(CInt(_t_head1.g_AccountID),ticker,shares)
   If (TxID = 0) Then
      MainPrompt = "You tried to sell more shares than you own."
   ElseIf (Err.Number <> 0) Then
      MainPrompt = FMSWeb._strings.SELLSTOCK_FAILED
      _t_head1.BuildErrorMessage()
      TxID = 0
   End If
   If (TxID > 0) Then
   %>
   <p><b>Order summary</b><br>
   Symbol: <%=ticker%><br>
   Shares: <%=shares%><br>
   </p>
   <p>Your order number is <%=TxID%>.</p>
   <%
   Else
   %>
   <p>Unable to place order.</p>
   <p><%=MainPrompt%></p>
   <%
   End If
%>
<p><a href="SellStock.aspx">Sell another stock.</a></p>
<p><a href="Portfolio.aspx">View portfolio.</a></p>
<% _t_end1.Author_Markup() %>

</body>
</html>
