incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drew...@apache.org
Subject svn commit: r769572 [3/4] - in /incubator/stonehenge/trunk/stocktrader/dotnet: business_service/BusinessServiceConfigurationSettings/ business_service/BusinessServiceConsole/ business_service/OrderProcessorASyncClient/ common/ServiceConfigurationSettin...
Date Tue, 28 Apr 2009 22:20:52 GMT
Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Login.aspx
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Login.aspx?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Login.aspx (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Login.aspx Tue Apr 28 22:20:50 2009
@@ -1,6 +1,7 @@
-<%@Page Language="C#" AutoEventWireup="true" EnableViewState="false" EnableSessionState="True" EnableEventValidation="false" CodeFile="Login.aspx.cs" Inherits="Trade.Web.Login"  %>
- 
- <!--
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
+    CodeFile="Login.aspx.cs" Inherits="Trade.Web.Login" %>
+<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
+    <% /* 
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
@@ -15,162 +16,49 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
- -->
- 
-<!DOCTYPE html PUBLIC "-//W3C//DTD Xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" >
-<head>
-<meta http-equiv="Content-Style-Type" content="text/css"/>
-<title>.NET StockTrader Login</title>
-<link rel="stylesheet" href="StockTrader.css" type="text/css" />
-</head>
-<body class="StockTraderBodyStyle">
-<!--------------------------Begin Main Web Form Declaration--------------------------------->
-<div>
-<form runat="server" id="LoginForm" style="margin:0;">  
-<!-------------------------Begin Global Header Table Declaration---------------------------->
-<table class= "HeaderTableStyle">
-    <tr>
-		<td><img alt="" src="Images/dotnet_logo.jpg" height="63"/></td>
-        <td class="HeaderLeftStyle">.NET StockTrader
-            </td>
-        <td class="HeaderRightStyle">Apache Stonehenge Incubator Project</td>
-    </tr>
-</table>
-<table class="MenuTableStyle">
-    <tr>
-            <td class="Menu"><a href="Default.aspx">Welcome</a></td>
-            <td class="Menu"><a href="TradeHome.aspx">Home</a></td>
-            <td class="Menu"><a href="account.aspx">Account</a></td>
-            <td class="Menu"><a href="portfolio.aspx">Portfolio</a></td>
-            <td class="Menu"><a href="quotes.aspx?symbols=s:0,s:1,s:2,s:3,s:4">Quotes/Trade</a></td>
-               <!-- <td class="Menu"><a href="" id="configlink" runat="server" >ConfigWeb</a></td> -->
-            <td class="Menu"><a href="Glossary.aspx">Glossary</a></td>
-            <td class="Menu"><a href="logout.aspx">Login/Logout</a></td>
-            <td class="Menu"><a href="ReadMe.mht" target="_blank">Read Me</a></td>
-
+*/ %>
+</asp:Content>
+<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
-    </tr>
-</table>    
-<!--------------------------End Global Header Table Declaration ---------------------------->
-<table class="TradeHomeTableStyle">
-<tr>
-    <td colspan="2" class="OrderAlertControlStyle"></td>
-</tr>
-<tr>
-    <td colspan="2"> <br /></td>
-</tr>
-<tr>
-    <td>
-    <table class="SubHeaderTableStyle">
-        <tr>
-            <th class="SubHeaderStyle">Login</th>
-            <th class="TodaysDateStyle"><asp:Label ID="Date" runat="server"></asp:Label></th>
-        </tr>
-    </table>
-    </td>
-</tr>
-<tr>
-    <td><br /></td>
-</tr>
-<tr>
-    <td colspan="2" style="text-align:center">
-    <strong>Welcome to the .NET StockTrader Composite Web Application!
-    <br /><br /></strong>
-    <table class="LoginTableStyle" style="text-align:center; padding-left:30">
-        <tr style="vertical-align:bottom">
-            <td > <div class="InvalidLogin"></div>
-            </td>
-            <td ><div class="InvalidLogin"></div>
-            </td>
-            <td><div class="InvalidLogin"></div>
-            </td>
-            <td ><div class="InvalidLogin"></div>
-            </td>
-        </tr>
-        <tr>
-            <td>
-            </td>
-            <td style="vertical-align:middle">
-            <table>
-            <tr>
-            <td style="text-align:center; padding-bottom:80px">
-                <img alt="" src="Images/index.gif" /></td>
+        <div class="main-title">
+			<h1>Login</h1>
+			<script type="text/javascript">
+				var thisdate = new Date();
+				document.writeln(thisdate.toLocaleString());
+			</script>
+		</div>
+		
+		<div class="login">
+            <table border="0" cellspacing="0">
+                <tr>
+                    <td>Username</td>
+                    <td>
+                        <asp:TextBox ID="UserName" runat="server" Width="140px" />
+                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
+                            Text="*" />
+                    </td>
+                </tr>
+                <tr>
+                    <td>Password</td>
+                    <td>
+                        <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="140px" />
+                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
+                            Text="*" />
+                    </td>
                 </tr>
-                </table>
-                </td>
-            <td >
-            </td>
-            <td>
-            <br />
-                <table style="width: 500px">
-                    <tr>
-                        <td colspan="2"><div class="InvalidLogin">
-                        <asp:Label runat="server" ID="InValid" CssClass="InvalidLogin"></asp:Label><br />
-                            <br />
-                            <br />
-                            <br />
-                        </div></td>
-                    </tr>
-                    <tr>
-                        <td style="text-align:right;">User Name:</td>
-                        <td style="text-align:left;padding-left:5px">
-                        <asp:TextBox ID="uid" runat="server" Width="120" BackColor="#EBEBEB" BorderColor="#d4d8db" MaxLength="50" CausesValidation="True"></asp:TextBox></td>
-                    </tr>
-                    <tr>
-                        <td style="text-align:right;">Password:</td>
-                        <td style="text-align:left;padding-left:5px">
-                        <asp:TextBox ID="password" runat="server"  Width="120" BackColor="#EBEBEB" BorderColor="#d4d8db" MaxLength="100" Text="xxx" TextMode="Password"></asp:TextBox></td>                
-                    </tr>
-                     <tr>
-                        <td></td>
-                        <td style="text-align:left;padding-left:23px"><br />
-                        <div class="LinkButtonRegisterStyle">
-                        <asp:LinkButton ID="LinkLogin"  CssClass="Button" runat="server" PostBackUrl="~/Login.aspx">Login</asp:LinkButton>
-                        </div>
-                            <br />
-                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="List"
-                                ValidationGroup="Login" />
-                            <br />
-                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorUserID" runat="server" ControlToValidate="uid"
-                                Display="None" ErrorMessage="Please enter a user name!" ValidationGroup="Login"></asp:RequiredFieldValidator><br />
-                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorPassword" runat="server" ControlToValidate="password"
-                                Display="None" ErrorMessage="Please enter a password!" ValidationGroup="Login"></asp:RequiredFieldValidator></td>
-                   </tr>
-                    <tr>
-                        <td colspan="2" style="font-size:7pt; text-align: center;">
-                        Try password 'xxx' for user 'uid:0' to access the .NET StockTrader Web Application.
-                        </td>
-                    </tr>
-                   
-                </table>
-                <br />
-                <br />
-          </td>    
-      </tr>
-   </table>
-   <br />
-   <b>First time user? &nbsp;<a href="register.aspx">Please Register!</a></b>
-   <br /><br /><br />
-   </td>
-</tr>
-</table> 
-</form>
-</div>
-<!-------------------------------Start StockTrader Footer------------------------------>
-<table class="FooterTableStyle">
-    <tr>
-            <td class="FooterLeftStyle">
-            Apache Stonehenge Incubator Project</td>
-            <td class="FooterRightStyle">
-            .NET StockTrader</td>
-    </tr>
-    <tr>
-            <td colspan="2" class="FooterCopyRightStyle"><br />
-            Created with Visual Studio and the Microsoft .NET Framework 3.5 
-            </td>
-    </tr>
-</table> 
-</table>         
-</body>
-</html>erC
\ No newline at end of file
+                <tr>
+                    <td colspan="2">
+                        <asp:Button ID="LoginButton" runat="server" Text="Login" CssClass="button" 
+                            onclick="LoginButton_Click"  />
+                    </td>
+                </tr>
+            </table>
+            
+            <asp:Label runat="server" ID="InvalidLoginMessage" ForeColor="Red" />
+
+			<p>Try password "xxx" for user "uid:0" to access the stock trader web application.</p>
+			<p class="new-user">
+			    <a href="register.aspx">First time user?</a>
+			</p>
+		</div>	
+</asp:Content>
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Login.aspx.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Login.aspx.cs?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Login.aspx.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Login.aspx.cs Tue Apr 28 22:20:50 2009
@@ -36,13 +36,7 @@
     /// </summary>
     public partial class Login : System.Web.UI.Page
     {
-        protected override void OnLoad(EventArgs e)
-        {
-           Date.Text = DateTime.Now.ToString("f");
-           if (IsPostBack) processLogin();
-        }
-
-        protected void processLogin()
+        protected void LoginButton_Click(object sender, EventArgs e)
         {
             Page.Validate();
             if (Page.IsValid)
@@ -66,29 +60,30 @@
                 //
                 //               http://msdn2.microsoft.com/en-us/library/ms998310.aspx
 
-                string userID = Input.InputText(Request["uid"], StockTraderUtility.USERID_MAX_LENGTH);
-                string password = Input.InputText(Request["password"], StockTraderUtility.PASSWORD_MAX_LENGTH);
+                string userID = this.UserName.Text;
+                string password = this.Password.Text;
                 AccountDataUI customer = null;
                 try
                 {
                     BSLClient businessServicesClient = new BSLClient();
                     customer = businessServicesClient.login(userID, password);
                 }
-                catch (Exception e)
+                catch (Exception ex)
                 {
-                    if (e.Message.Contains(StockTraderUtility.EXCEPTION_WEBSPHERE_USERID_NOTFOUND))
+                    if (ex.Message.Contains(StockTraderUtility.EXCEPTION_WEBSPHERE_USERID_NOTFOUND))
                         customer = null;
                     else
                         throw;
                 }
+
                 if (customer == null)
                 {
-                    InValid.Text = StockTraderUtility.EXCEPTION_MESSAGE_INVALID_LOGIN;
+                    InvalidLoginMessage.Text = StockTraderUtility.EXCEPTION_MESSAGE_INVALID_LOGIN;
                 }
                 else
                 {
                     FormsAuthentication.SetAuthCookie(customer.profileID, false);
-                    Response.Redirect(Settings.PAGE_HOME,true);
+                    Response.Redirect(Settings.PAGE_HOME, true);
                 }
             }
         }

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Order.aspx
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Order.aspx?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Order.aspx (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Order.aspx Tue Apr 28 22:20:50 2009
@@ -1,5 +1,4 @@
-<%@ Register TagPrefix="controls" TagName="Header" Src = "Controls/Header.ascx"  %>
<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    EnableViewState="false" EnableEventValidation="false"
    CodeFile="Order.aspx.cs" Inherits="Trade.Web.Order" %>
<%@ Import Namespace="Trade.StockTraderWebApplicationModelClasses" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<% /* 
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
@@ -13,131 +12,4 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
- -->
- 
-<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" EnableEventValidation="false" CodeFile="Order.aspx.cs" Inherits="Trade.Web.Order" %>
-<%@ Import Namespace="Trade.StockTraderWebApplicationModelClasses" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD Xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" >
-<head>
-<meta http-equiv="Content-Style-Type" content="text/css"/>
-<title>.NET StockTrader New Order</title>
-<link rel="stylesheet" href="StockTrader.css" type="text/css" />
-</head>
-<body class="StockTraderBodyStyle">
-<!--------------------------Begin Main Web Form Declaration--------------------------------->
-<div>
-<form runat="server" id="OrderForm" style="margin:0;">  
-<!-------------------------Begin Global Header --------------------------------------------->
-<controls:Header id="HeaderControl" runat="server" ></controls:Header>
-<!--------------------------End Global Header Table Declaration ---------------------------->
-<table class="TradeHomeTableStyle">
-<tr>
-    <td colspan="2"> <br /></td>
-</tr>
-<tr>
-    <td>
-    <table class="SubHeaderTableStyle">
-        <tr>
-            <th class="SubHeaderStyle">New Order</th>
-            <th class="TodaysDateStyle"><asp:Label ID="Date" runat="server"></asp:Label></th>
-        </tr>
-    </table>
-</td>
-</tr>
-</table>
-<!------------------------------Start Core ASPX Page-Specific UI --------------------------->
-    <table class="TradeHomeTableStyle">
-        <tr>
-            <td><br /></td>
-        </tr>
-        <tr>
-            <td style="text-align:center">
-            <table class="OrderConfirmTableStyle">
-            <tr >
-                <td colspan="8" class="OrderConfirmMessageStyle"><asp:Label ID="ConfirmMessage" runat="server"></asp:Label></td>
-            </tr>
-<%if (!badQuantity){%>
-            <tr>
-                <th class="InnerHeading">
-                Order ID</th>
-                <th class="InnerHeading">
-                Order Status</th>
-                <th class="InnerHeading">
-                Creation Date</th>
-                <th class="InnerHeading">
-                Completion Date</th>
-               <th class="InnerHeading">
-                Txn Fee</th>
-               <th class="InnerHeading">
-                Type</th>
-                <th class="InnerHeading">
-                Symbol</th>
-                <th class="InnerHeading">
-                Quantity</th>
-            </tr>       
-            <tr>
-                <td class="InnerData">
-                <asp:Label ID="OrderID" runat="server"></asp:Label></td>
-                <td class="InnerData">
-                <asp:Label ID="OrderStatus" runat="server"></asp:Label></td>
-                <td class="InnerData">
-                <asp:Label ID="OpenDate" runat="server"></asp:Label></td>
-                <td class="InnerData">
-                <asp:Label ID="CompletionDate" runat="server"></asp:Label></td>
-                <td class="InnerData">
-                <asp:Label ID="OrderFee" runat="server"></asp:Label></td>
-                <td class="InnerData">
-                <asp:Label ID="OrderType" runat="server"></asp:Label></td>
-                <td class="InnerData">
-                <asp:Label ID="Symbol" runat="server"></asp:Label></td>
-                <td class="InnerData">
-                <asp:Label ID="Quantity" runat="server"></asp:Label></td>
-           </tr>      
-<%} %>
-<tr><td><br /><br /><br /></td></tr>
-       </table>
-    </td>
-</tr>
-<!-------------------------------Start Get Quote Input Form/Footer-------------------------->
-<tr>
-<td>
-<table class="GetQuotesTableStyle">
-<tr>
-<td colspan="3"> <hr style="vertical-align:bottom"/></td>
-</tr>
- <tr><td style="text-align:center;" >
- <table style="width:600">
-    <tr>
-        <td style="width:100px;height:30px;text-align:right">
-            <asp:TextBox ID="symbols" BackColor="#EBEBEB"    runat="server" Text="s:0;s:1;s:2;s:3"></asp:TextBox>
-        </td>
-        <td style="padding-left:6px;padding-bottom:4px;"><div class="LinkButtonQuoteStyle">
-            <asp:LinkButton ID="LinkButtonQuote" runat="server" CssClass="Button" PostBackUrl="~/Quotes.aspx">Get Quote</asp:LinkButton></div>
-        </td>
-    </tr>
-  </table>          
-</td></tr>
-</table>
-</td>
-</tr>
-</table>
-</form>
-</div>
-<!-------------------------------Start StockTrader Footer----------------------------------->
-<table class="FooterTableStyle">
-    <tr>
-            <td class="FooterLeftStyle">
-            Apache Stonehenge Incubator Project</td>
-            <td class="FooterRightStyle">
-            .NET StockTrader</td>
-    </tr>
-    <tr>
-            <td colspan="2" class="FooterCopyRightStyle"><br />
-            Created with Visual Studio and the Microsoft .NET Framework 3.5 
-            </td>
-    </tr>
-</table> 
-</table>         
-</body>
-</html>
\ No newline at end of file
+*/ %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class="main-title">
        <h1>New Order</h1>
        <script type="text/javascript">
            var thisdate = new Date();
    		document.writeln(thisdate.toLocaleString());
    	</script>
	</div> 
	
	<p style="text-align:center;">
        <asp:Label ID="ConfirmMessage" runat="server" />
    </p>
    
    <asp:Panel runat="server" ID="OrderSummaryPanel" Visible="false">
        <table class="table-outer" cellspacing="0" align="center">
            <thead>
                <tr>
                    <th>Order ID</th>
                    <th>Order Status</th>
                    <th>Creation Date</th>
                    <th>Completion Date</th>
                    <th>Txn Fee</th>
                    <th>Type</th>
                    <th>Symbol</th>
                    <th>Quantity</th>
                </tr>        
            </thead>
            <tbody>
            
     <tr>
                    <td>
                    <asp:Label ID="OrderID" runat="server"></asp:Label></td>
                    <td>
                    <asp:Label ID="OrderStatus" runat="server"></asp:Label></td>
                    <td>
                    <asp:Label ID="OpenDate" runat="server"></asp:Label></td>
                    <td>
                    <asp:Label ID="CompletionDate" runat="server"></asp:Label></td>
                    <td class="currency">
                    <asp:Label ID="OrderFee" runat="server"></asp:Label></td>
                    <td>
                    <asp:Label ID="OrderType" runat="server"></asp:Label></td>
                    <td>
                    <asp:Label ID="Symbol" runat="server"></asp:Label></td>
                    <td class="currency">
                    <asp:Label ID="Quantity" runat="server"></asp:Label></td>
                </tr>   
            </tbody>
        </table>   
    </asp:Panel>

    <div class="bottom">
      
   <asp:TextBox ID="symbols" runat="server" Text="s:0;s:1;s:2;s:3"></asp:TextBox>
        <asp:Button ID="GetQuoteButton" runat="server" PostBackUrl="~/Quotes.aspx" CssClass="button" Text="Get Quote" />
    </div>

</asp:Content>
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Order.aspx.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Order.aspx.cs?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Order.aspx.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Order.aspx.cs Tue Apr 28 22:20:50 2009
@@ -36,64 +36,61 @@
     /// </summary>
     public partial class Order : System.Web.UI.Page
     {
-        public bool badQuantity = false;
-
         protected void Page_Load(object sender, EventArgs e)
         {
-            Date.Text = DateTime.Now.ToString("f");
             BSLClient businessServicesClient = new BSLClient();
             OrderDataUI order = null;
+
             string userid = HttpContext.Current.User.Identity.Name;
-            string action = Input.InputText(Request["action"], 10);
+            string action = Input.InputText(Request["action"], 10) ?? string.Empty;
             double quantity = 0;
             string symbol = null;
             int holdingID = -1;
+            bool badQuantity = false;
+
+            /****************************
+             *  Buy a Stock
+             ****************************/
             if (action.Equals(StockTraderUtility.ORDER_TYPE_BUY))
             {
                 if (!Double.TryParse(Request["quantity"], out quantity))
-                  badQuantity = true;
-              symbol = Input.InputText(Request["symbol"], StockTraderUtility.SYMBOLSTRING_MAXLENGTH);
-               if (quantity > 0)
-                         order = businessServicesClient.buy(userid, symbol, quantity);
-                    else
-                        badQuantity = true;
-               
-           }
-           else if (action.Equals(StockTraderUtility.ORDER_TYPE_SELL))
-           {
-              bool hasQuantityParam=false;
-              holdingID = Convert.ToInt32(Request["holdingid"]);
+                    badQuantity = true;
+                symbol = Input.InputText(Request["symbol"], StockTraderUtility.SYMBOLSTRING_MAXLENGTH);
+                if (quantity > 0)
+                    order = businessServicesClient.buy(userid, symbol, quantity);
+                else
+                    badQuantity = true;
+            }
+            /****************************
+             *  Sell a Stock
+             ****************************/
+            else if (action.Equals(StockTraderUtility.ORDER_TYPE_SELL))
+            {
+                holdingID = Int32.Parse(Request["holdingid"]);
 
-              //WebSphere Trade 6.1 does not provide functionality for trading partial holdings.  
-              //.NET StockTrader does, but will default to Trade 6.1 behavior and sell and entire holding if no
-              //quantity parameter is detected on the query string.  Here we check if a quantity parameter actually
-              //exists on the query string.  This is a bit of extra overhead, but done so we can add functionality
-              // (selling part of a holding) yet not sacrifice interop with WebSphere Trade 6.1
-              int i = Request.Params.Count;
-              for (int index = 0; index < i; index++)
-              {
-                  string param = Request.Params.GetKey(index);
-                  if (param.Contains("quantity"))
-                  {
-                      hasQuantityParam = true;
-                      break;
-                  }
-              }
-              if (hasQuantityParam)
+                //WebSphere Trade 6.1 does not provide functionality for trading partial holdings.  
+                //.NET StockTrader does, but will default to Trade 6.1 behavior and sell and entire holding if no
+                //quantity parameter is detected on the query string.  Here we check if a quantity parameter actually
+                //exists on the query string.  This is a bit of extra overhead, but done so we can add functionality
+                // (selling part of a holding) yet not sacrifice interop with WebSphere Trade 6.1
+                string quantityParam = Request["quantity"];
+                if (quantityParam != null)
                 {
-                  quantity = Convert.ToDouble(Request["quantity"]);
-                  if (quantity <= 0)
-                    badQuantity = true;
+                    quantity = Double.Parse(Request["quantity"]);
+                    if (quantity <= 0)
+                        badQuantity = true;
                 }
                 else
-                    quantity = 0;  //Value of 0 indicates to sell entire holding.
+                    quantity = 0; //Value of 0 indicates to sell entire holding.
                 if (!badQuantity)
-                     order = businessServicesClient.sell(userid, holdingID, quantity);
+                    order = businessServicesClient.sell(userid, holdingID, quantity);
             }
             else
-                //Goodbye! Only valid ops are buy and sell. This is a harsh 
-                //penalty for trying to be tricky.
-                Response.Redirect(Settings.PAGE_LOGOUT);
+            {
+                ConfirmMessage.Text = StockTraderUtility.EXCEPTION_MESSAGE_BAD_ACTION;
+                return;
+            }
+
             if (!badQuantity)
             {
                 if (order != null)
@@ -121,12 +118,17 @@
                     strBuilder.Append(" has been submitted for processing.<br/><br/>");
                     strBuilder.Append("Order Details:");
                     ConfirmMessage.Text = (strBuilder.ToString());
+                    
+                    // only show the panel if it didn't fail
+                    this.OrderSummaryPanel.Visible = true;
                 }
                 else
                     ConfirmMessage.Text = StockTraderUtility.EXCEPTION_MESSAGE_BAD_ORDER_RETURN;
             }
-            else ConfirmMessage.Text = StockTraderUtility.EXCEPTION_MESSAGE_BAD_ORDER_PARMS;
-            return;
+            else
+            {
+                ConfirmMessage.Text = StockTraderUtility.EXCEPTION_MESSAGE_BAD_ORDER_PARMS;
+            }
         }
     }
 }
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Portfolio.aspx
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Portfolio.aspx?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Portfolio.aspx (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Portfolio.aspx Tue Apr 28 22:20:50 2009
@@ -1,5 +1,4 @@
-<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src = "Controls/ClosedOrders.ascx"  %>
<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    EnableViewState="false" EnableEventValidation="false"
    CodeFile="Portfolio.aspx.cs" Inherits="Trade.Web.Portfolio" %>
<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src="Controls/ClosedOrders.ascx"  %>
<%@ Import Namespace="System.Text" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<% /* 
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
@@ -13,162 +12,13 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
- -->
- 
-<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" EnableEventValidation="false" CodeFile="Portfolio.aspx.cs" Inherits="Trade.Web.Portfolio" %>
-<%@ Import Namespace="System.Text"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD Xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" >
-<head>
-<meta http-equiv="Content-Style-Type" content="text/css"/>
-<title>.NET StockTrader Portfolio</title>
-<link rel="stylesheet" href="StockTrader.css" type="text/css" />
-</head>
-<body class="StockTraderBodyStyle">
-<!--------------------------Begin Main Web Form Declaration--------------------------------->
-<div>
-<form runat="server" id="AccountForm" style="margin:0;">  
-<!-------------------------Begin Global Header + Order Alert Control------------------------>
-<controls:ClosedOrders id="ClosedOrdersControl" runat="server" ></controls:ClosedOrders>
-<!--------------------------End Global Header Table Declaration ---------------------------->
-<!-------------------- -----Start Portfolio Page-Specific Processing------------------------>
-<table class="TradeHomeTableStyle" style="padding-left:4px;padding-right:4px">
-    <tr>
-    <td colspan="2"> <br /></td>
-</tr>
-    <tr>
-        <td>
-        <table class="SubHeaderTableStyle">
-        <tr>
-            <th class="SubHeaderStyle">Portfolio Information</th>
-            <th class="TodaysDateStyle"><asp:Label ID="Date" runat="server"></asp:Label></th>
-        </tr>
-    </table>
-        </td>
-    </tr>
-    <tr>
-    <td> 
-    <br />
-    <br />
-        <table style="width:720px">
-            <tr>
-                <td style="text-align:left;width:360px;">Current Number of Holdings:&nbsp<b><asp:Label ID="numOfHoldings" runat="server"
-                Text="numOfHoldings"></asp:Label></b></td>
-                <td style="text-align:right;width:360px;font-weight:bold"><a href="PortfolioBySymbol.aspx">Sort and Subtotal By Stock</a>
-                </td>
-            </tr>
-        </table>
-    </td>
-    </tr>
-    <tr>
-        <td colspan="2" style="text-align:center">
+*/ %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <controls:ClosedOrders id="ClosedOrdersControl" runat="server" ></controls:ClosedOrders>
    
    <div class="main-title">
        <h1>Portfolio Information</h1>
        <script type="text/javascript">
            var thisdate = new Date();
    		document.writeln(thisdate.toLocaleString());
    	</script>
	</div> 
        
    <table class="table-outer" cellspacing="0" align="center">
         <thead>
            <tr>
+                <td colspan="5">
                    Current Number of Holdings:&nbsp
                    <b><asp:Label ID="numOfHoldings" runat="server" Text="numOfHoldings"></asp:Label></b>
               </td>
               <td colspan="5" style="text-align:right;">
                    <a href="PortfolioBySymbol.aspx">Sort and Subtotal By Stock</a>
               </td>
            </tr>
         <asp:Repeater id="PortfolioRepeater" runat="server">
         <HeaderTemplate>
-            <table class="PortfolioTableStyle">
-             <tr>
-                <th class="InnerHeading">
-                Holding ID</th>
-                <th class="InnerHeading">
-                Purchase<br />Date</th>
-                <th class="InnerHeading">
-                Symbol</th>
-                <th class="InnerHeading">
-                Quantity</th>
-                <th class="InnerHeading">
-                Purchase<br />Price</th>
-                <th class="InnerHeading">
-                Current<br />Price</th>
-                <th class="InnerHeading">
-                Purchase<br />Basis</th>
-                <th class="InnerHeading">
-                Market<br />Value</th>
-                <th class="InnerHeading">
-                Gain(Loss)</th>
-                <th class="InnerHeading">
-                Trade</th>
-             </tr>       
-       </HeaderTemplate>
+                 <tr>
                    <th>Holding ID</th>
                    <th>Purchase<br />Date</th>
                    <th>Symbol</th>
                    <th>Quantity</th>
                    <th>Purchase<br />Price</th>
                    <th>Current<br />Price</th>
                    <th>Purchase<br />Basis</th>
                    <th>Market<br />Value</th>
                    <th>Gain(Loss)</th>
                    <th>Trade</th>
                 </tr>
             </thead>
             <tbody>
       </HeaderTemplate>
        <ItemTemplate>
-          <tr>
-          <td class="InnerData">
-                <%# Eval("holdingID")%> </td>
-                <td class="InnerData">
-                <%# Eval("purchaseDate") %></td>
-                <td class="InnerData">
-                <%# Eval("quoteID") %></td>
-                 <td class="InnerData" style="text-align:right">
-                <%# Eval("quantity", "{0:0,0}") %></td>
-                 <td class="InnerData" style="text-align:right">
-                <%# Eval("purchasePrice", "{0:C}")%></td>
-                 <td class="InnerData" style="text-align:right">
-                <%# Eval("quotePrice", "{0:C}")%></td>
-                 <td class="InnerData" style="text-align:right">
-                <%# Eval("basis", "{0:C}")%></td>
-                 <td class="InnerData" style="text-align:right">
-                <%# Eval("marketValue","{0:C}")%>
-                </td>
-                 <td class="InnerData" style="text-align:right">
-                <%# Eval("gainWithArrow") %>
-                </td>
-                <td class="InnerData">
-                <%# Eval("sellLink") %>
-                </td>
-        </tr>      
-      </ItemTemplate>
-      <FooterTemplate>
-        <tr>
-                <th class="InnerHeading" style="text-align:right" colspan="6">Totals</th>
-                <th class="InnerHeading" style="text-align:right"><%=String.Format("{0:C}",totalHoldings.basis) %></th>
-                <th class="InnerHeading" style="text-align:right"><%=String.Format("{0:C}",totalHoldings.marketValue)%></th>
-                <th class="InnerHeading" style="text-align:right; padding-right:3px;"><%=String.Format("{0:C}",totalHoldings.gainWithArrow)%></th>
-                <th class="InnerHeading"></th>
-        </tr>
-        </table>
+               <tr>
                   <td>
                       <%# Eval("holdingID")%>
                   </td>
                   <td>
                       <%# Eval("purchaseDate") %>
                   </td>
                   <td>
                       <%# Eval("quoteID") %>
                   </td>
                   <td class="currency">
                       <%# Eval("quantity", "{0:0,0}") %>
                   </td>
                   <td class="currency">
                       <%# Eval("purchasePrice", "{0:C}")%>
                   </td>
                   <td class="currency">
                       <%# Eval("quotePrice", "{0:C}")%>
                   </td>
                   <td class="currency">
                       <%# Eval("basis", "{0:C}")%>
                   </td>
                   <td class="currency">
                       <%# Eval("marketValue","{0:C}")%>
                   </td>
                   <td class="currency">
                       
 <%# Eval("gainWithArrow") %>
                   </td>
                   <td>
                       <%# Eval("sellLink") %>
                   </td>
               </tr>
       </ItemTemplate>
      <FooterTemplate>
+            </tbody>
            <tfoot>
                <tr class="total">
                    <th style="text-align:right;" colspan="6">Totals</th>
                    <th class="currency"><%=String.Format("{0:C}",totalHoldings.basis) %></th>
                    <th class="currency"><%=String.Format("{0:C}",totalHoldings.marketValue)%></th>
                    <th class="currency nobr"><%=totalHoldings.gainWithArrow%></th>
                    <th>&nbsp;</th>
                </tr>
            </tfoot>
        </table>
       </FooterTemplate>
-      </asp:Repeater></td>
-   </tr>
-   <tr>
-      <td><br /></td>
-   </tr>
-<!-------------------------------Start Get Quote Input Form/Footer-------------------------->
-<tr>
-<td>
-<table class="GetQuotesTableStyle">
-<tr>
-<td colspan="3"> <hr style="vertical-align:bottom"/></td>
-</tr>
- <tr><td style="text-align:center;" >
- <table style="width:600">
-    <tr>
-        <td style="width:100px;height:30px;text-align:right">
-            <asp:TextBox ID="symbols" BackColor="#EBEBEB"    runat="server" Text="s:0;s:1;s:2;s:3"></asp:TextBox>
-        </td>
-        <td style="padding-left:6px;padding-bottom:4px;"><div class="LinkButtonQuoteStyle">
-            <asp:LinkButton ID="LinkButtonQuote" runat="server" CssClass="Button" PostBackUrl="~/Quotes.aspx">Get Quote</asp:LinkButton></div>
-        </td>
-    </tr>
-  </table>          
-</td></tr>
-</table>
-</td>
-</tr>
-</table>
-</form>
-</div>
-<!-------------------------------Start StockTrader Footer----------------------------------->
-<table class="FooterTableStyle">
-    <tr>
-            <td class="FooterLeftStyle">
-            Apache Stonehenge Incubator Project</td>
-            <td class="FooterRightStyle">
-            .NET StockTrader</td>
-    </tr>
-    <tr>
-            <td colspan="2" class="FooterCopyRightStyle"><br />
-            Created with Visual Studio and the Microsoft .NET Framework 3.5 
-            </td>
-    </tr>
-</table> 
-</table>         
-</body>
-</html>
\ No newline at end of file
+      </asp:Repeater>


    <div class="bottom">
        <asp:TextBox ID="symbols" runat="server" Text="s:0;s:1;s:2;s:3"></asp:TextBox>
        <asp:Button ID="GetQuoteButton" runat="server" PostBackUrl="~/Quotes.aspx" CssClass="button" Text="Get Quote" />
    </div>

</asp:Content>
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Portfolio.aspx.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Portfolio.aspx.cs?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Portfolio.aspx.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Portfolio.aspx.cs Tue Apr 28 22:20:50 2009
@@ -42,7 +42,6 @@
 
         protected void Page_Load(object sender, EventArgs e)
         {
-            Date.Text = DateTime.Now.ToString("f");
             BSLClient businessServicesClient = new BSLClient();
             string userid = HttpContext.Current.User.Identity.Name;
             totalHoldings = businessServicesClient.getHoldings(userid);

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/PortfolioBySymbol.aspx
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/PortfolioBySymbol.aspx?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/PortfolioBySymbol.aspx (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/PortfolioBySymbol.aspx Tue Apr 28 22:20:50 2009
@@ -1,5 +1,4 @@
-<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src = "Controls/ClosedOrders.ascx"  %>
<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    EnableViewState="false" EnableEventValidation="false"
    CodeFile="PortfolioBySymbol.aspx.cs" Inherits="Trade.Web.PortfolioBySymbol" %>
<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src="Controls/ClosedOrders.ascx"  %>
<%@ Import Namespace="System.Text" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<% /* 
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
@@ -13,148 +12,5 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
- -->
- 
-<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" EnableEventValidation="false" CodeFile="PortfolioBySymbol.aspx.cs" Inherits="Trade.Web.PortfolioBySymbol" %>
-<%@ Import Namespace="System.Text"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD Xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" >
-<head>
-<meta http-equiv="Content-Style-Type" content="text/css"/>
-<title>Portfolio Holdings By Stock</title>
-<link rel="stylesheet" href="StockTrader.css" type="text/css" />
-</head>
-<body class="StockTraderBodyStyle">
-<!--------------------------Begin Main Web Form Declaration--------------------------------->
-<div>
-<form runat="server" id="AccountForm" style="margin:0;">  
-<!-------------------------Begin Global Header + Order Alert Control------------------------>
-<controls:ClosedOrders id="ClosedOrdersControl" runat="server" ></controls:ClosedOrders>
-<!--------------------------End Global Header Table Declaration ---------------------------->
-<!-------------------- -----Start Portfolio Page-Specific Processing------------------------>
-<table class="TradeHomeTableStyle" style="padding-left:4px;padding-right:4px">
-    <tr>
-    <td colspan="2"> <br /></td>
-</tr>
-    <tr>
-        <td>
-        <table class="SubHeaderTableStyle">
-        <tr>
-            <th class="SubHeaderStyle">Portfolio By Symbol</th>
-            <th class="TodaysDateStyle"><asp:Label ID="Date" runat="server"></asp:Label></th>
-        </tr>
-    </table>
-        </td>
-    </tr>
-    <tr>
-    <td>
-    <br />
-    <br />
-    <table style="width:720px">
-            <tr>
-                <td style="text-align:left;width:360px;">Current Number of Unique Stocks Held:&nbsp<b><asp:Label ID="numOfUniqueStocks" runat="server"
-             Text="numOfHoldings"></asp:Label></b></td> <td style="text-align:right;width:360px;font-weight:bold;"><a href="Portfolio.aspx">Sort By Purchase Date</a></td>
-            </tr>
-        </table>
-        </td>
-    </tr>
-    <tr>
-        <td style="text-align:center">
-        <asp:Repeater id="PortfolioBySymbolRepeater" runat="server">
-        <HeaderTemplate>
-            <table class="PortfolioTableStyle">
-            
-             <tr>
-                <th class="InnerHeading">
-                Holding ID</th>
-                <th class="InnerHeading">
-                Purchase<br />Date</th>
-                <th class="InnerHeading">
-                Symbol</th>
-                <th class="InnerHeading">
-                Quantity</th>
-                <th class="InnerHeading">
-                Purchase<br />Price</th>
-                <th class="InnerHeading">
-                Current<br />Price</th>
-                <th class="InnerHeading">
-                Purchase<br />Basis</th>
-                <th class="InnerHeading">
-                Market<br />Value</th>
-                <th class="InnerHeading">
-                Gain(Loss)</th>
-                <th class="InnerHeading">
-                Trade</th>
-             </tr>       
-       </HeaderTemplate>
-       <ItemTemplate>
-          <tr>
-                <%# Eval("holdingID")%> 
-                <%# Eval("purchaseDate") %>
-                <%# Eval("quoteID")%>
-                <%# Eval("quantity", "{0:0,0}") %>
-                <%# Eval("purchasePrice", "{0:C}")%>
-                <%# Eval("quotePrice", "{0:C}")%>
-                <%# Eval("basis", "{0:C}")%>
-                <%# Eval("marketValue","{0:C}")%>
-                <%# Eval("gainWithArrow") %>
-                <%# Eval("sellLink") %>
-        </tr>      
-      </ItemTemplate>
-      <FooterTemplate>
-        <tr>
-                <th class="InnerHeading" style="text-align:right" colspan="6">Totals</th>
-                <th class="InnerHeading" style="text-align:right"><%=String.Format("{0:C}",totalHoldings.basis) %></th>
-                <th class="InnerHeading" style="text-align:right"><%=String.Format("{0:C}",totalHoldings.marketValue)%></th>
-                <th class="InnerHeading" style="text-align:right; padding-right:3px;"><%=String.Format("{0:C}",totalHoldings.gainWithArrow)%></th>
-                <th class="InnerHeading"></th>
-        </tr>
-        </table>
-      </FooterTemplate>
-      </asp:Repeater></td>
-   </tr>
-   <tr>
-      <td><br /></td>
-   </tr>
-<!-------------------------------Start Get Quote Input Form/Footer-------------------------->
-<tr>
-<td>
-<table class="GetQuotesTableStyle">
-<tr>
-<td colspan="3"> <hr style="vertical-align:bottom"/></td>
-</tr>
- <tr><td style="text-align:center;" >
- <table style="width:600">
-    <tr>
-        <td style="width:100px;height:30px;text-align:right">
-            <asp:TextBox ID="symbols" BackColor="#EBEBEB"    runat="server" Text="s:0;s:1;s:2;s:3"></asp:TextBox>
-        </td>
-        <td style="padding-left:6px;padding-bottom:4px;"><div class="LinkButtonQuoteStyle">
-            <asp:LinkButton ID="LinkButtonQuote" runat="server" CssClass="Button" PostBackUrl="~/Quotes.aspx">Get Quote</asp:LinkButton></div>
-        </td>
-    </tr>
-  </table>          
-</td></tr>
-</table>
-</td>
-</tr>
-</table>
-</form>
-</div>
-<!-------------------------------Start StockTrader Footer----------------------------------->
-<table class="FooterTableStyle">
-    <tr>
-            <td class="FooterLeftStyle">
-            Apache Stonehenge Incubator Project</td>
-            <td class="FooterRightStyle">
-            .NET StockTrader</td>
-    </tr>
-    <tr>
-            <td colspan="2" class="FooterCopyRightStyle"><br />
-            Created with Visual Studio and the Microsoft .NET Framework 3.5 
-            </td>
-    </tr>
-</table> 
-</table>         
-</body>
-</html>
\ No newline at end of file
+*/ %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <controls:ClosedOrders id="ClosedOrdersControl" runat="server" ></controls:ClosedOrders>

    <div class="main-title">
        <h1>Portfolio Information</h1>
        <script type="text/javascript">
            var thisdate = new Date();
    		document.writeln(thisdate.toLocaleString());
    	</script>
	</div> 
                        
    <asp:ListView id="PortfolioBySymbolList" runat="server" onDataBound="PortfolioBySymbolList_DataBound">
        <LayoutTemplate>
            <table class="table-outer" cellspacing="0" align="center">
             <thead>
                <tr>
                    <td colspan="5">
                        Current Number of Unique Stocks Held:&nbsp
                        <b><asp:Label ID="numOfUniqueStocks" runat="server"></asp:Label></b>
                   </td>
                   <td colspan="5" style="text-align:right;">
                   
      <a href="Portfolio.aspx">Sort by Purchase Date</a>
                   </td>
                </tr>
                 <tr>
                    <th>Holding ID</th>
                    <th>Purchase<br />Date</th>
                    <th>Symbol</th>
                    <th>Quantity</th>
                    <th>Purchase<br />Price</th>
                    <th>Current<br />Price</th>
                    <th>Purchase<br />Basis</th>
                    <th>Market<br />Value</th>
                    <th>Gain(Loss)</th>
                    <th>Trade</th>
                 </tr>
             </thead>
             <tbody>
                <asp:PlaceHolder runat="server" ID="itemPlaceholder" />
             </tbody>
            </table>
       </LayoutTemplate>
       <ItemTemplate>
+               <asp:ListView runat="server" ID="holdingList" DataSource='<%# Eval("holdings")%>'>
                   <LayoutTemplate>
                    <asp:PlaceHolder runat="server" ID="itemPlaceholder" />
                   </LayoutTemplate>
                   <ItemTemplate>
                   <tr>
                       <td>
                           <%# Eval("holdingID")%>
                       </td>
                       <td>
                           <%# Eval("purchaseDate") %>
                       </td>
                       <td>
                           <%# Eval("quoteID") %>
                       </td>
                       <td class="currency">
                           <%# Eval("quantity", "{0:0,0}") %>
                       </td>
                       <td class="currency">
                           <%# Eval("purchasePrice", "{0:C}")%>
                       </td>
                       <td class="currency">
                           <%# Eval("q
 uotePrice", "{0:C}")%>
                       </td>
                       <td class="currency">
                           <%# Eval("basis", "{0:C}")%>
                       </td>
                       <td class="currency">
                           <%# Eval("marketValue","{0:C}")%>
                       </td>
                       <td class="currency">
                           <%# Eval("gainWithArrow") %>
                       </td>
                       <td>
                           <%# Eval("sellLink") %>
                       </td>
                   </tr>
                   </ItemTemplate>
               </asp:ListView>
               <tr class="total">
                   <td>&nbsp;</td>
                   <td>&nbsp;</td>
                   <td><%# Eval("quoteID") %></td>
                   <td class="currency"><%# Eval("quantity", "{0:0,0}") %></td>
                   <td class="currency">&nbsp;</td>
                   <td class="currency"><%# Eval("quoteP
 rice", "{0:C}")%></td>
                   <td class="currency"><%# Eval("basis", "{0:C}")%></td>
                   <td class="currency"><%# Eval("marketValue","{0:C}")%></td>
                   <td class="currency"><%# Eval("gain")%></td>
                   <td>&nbsp;</td>
               </tr>
       </ItemTemplate>
    </asp:ListView>


    <div class="bottom">
        <asp:TextBox ID="symbols" runat="server" Text="s:0;s:1;s:2;s:3"></asp:TextBox>
        <asp:Button ID="GetQuoteButton" runat="server" PostBackUrl="~/Quotes.aspx" CssClass="button" Text="Get Quote" />
    </div>

</asp:Content>
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/PortfolioBySymbol.aspx.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/PortfolioBySymbol.aspx.cs?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/PortfolioBySymbol.aspx.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/PortfolioBySymbol.aspx.cs Tue Apr 28 22:20:50 2009
@@ -20,7 +20,9 @@
 using System.Data;
 using System.Collections.Generic;
 using System.Web;
+using System.Linq;
 using System.Web.UI;
+using System.Web.UI.WebControls;
 using Trade.StockTraderWebApplicationSettings;
 using Trade.StockTraderWebApplicationModelClasses;
 using Trade.StockTraderWebApplicationServiceClient;
@@ -38,14 +40,35 @@
 
         protected void Page_Load(object sender, EventArgs e)
         {
-            Date.Text = DateTime.Now.ToString("f");
             BSLClient businessServicesClient = new BSLClient();
             string userid = HttpContext.Current.User.Identity.Name;
-            totalHoldings = businessServicesClient.getHoldingsBySymbolSubTotaled(userid);
-           // List<HoldingDataUI> holdingList = totalHoldings.holdings;
-            numOfUniqueStocks.Text = totalHoldings.uniqueStockCount.ToString();
-            PortfolioBySymbolRepeater.DataSource = totalHoldings.holdings;
-            PortfolioBySymbolRepeater.DataBind();
+            totalHoldings = businessServicesClient.getHoldings(userid);
+
+            var holdingsSubtotaled = from holding in totalHoldings.holdings
+                                     orderby holding.quoteID
+                                     group holding by holding.quoteID
+                                         into holdings
+                                         select new
+                                         {
+                                             quoteID = holdings.Key,
+                                             quantity = holdings.Sum(h => h.quantityDouble),
+                                             quotePrice = holdings.First().quotePrice,
+                                             basis = holdings.Sum(h => h.basisDecimal),
+                                             marketValue = holdings.Sum(h => h.marketValueDecimal),
+                                             gain = DataFormatHelper.NumberWithStyledArrow(holdings.Sum(h => h.gainDecimal)),
+                                             holdings
+                                         };
+
+            PortfolioBySymbolList.DataSource = holdingsSubtotaled;
+            PortfolioBySymbolList.DataBind();
+        }
+        protected void PortfolioBySymbolList_DataBound(object sender, EventArgs e)
+        {
+            var uniqueLabel = PortfolioBySymbolList.FindControl("numOfUniqueStocks") as Label;
+            if (uniqueLabel != null)
+            {
+                uniqueLabel.Text = PortfolioBySymbolList.Items.Count.ToString();
+            }
         }
     }
 }

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Quotes.aspx
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Quotes.aspx?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Quotes.aspx (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Quotes.aspx Tue Apr 28 22:20:50 2009
@@ -1,5 +1,4 @@
-<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src = "Controls/ClosedOrders.ascx"  %>
<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    EnableViewState="false" EnableEventValidation="false"
    CodeFile="Quotes.aspx.cs" Inherits="Trade.Web.Quotes" %>
<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src="Controls/ClosedOrders.ascx"  %>
<%@ Import Namespace="Trade.StockTraderWebApplicationModelClasses" %>
<%@ Import Namespace="Trade.StockTraderWebApplicationSettings" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<% /* 
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
@@ -13,136 +12,14 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
- -->
- 
-<%@ Page Language="C#" AutoEventWireup="false" EnableViewState="false" EnableEventValidation="false" CodeFile="Quotes.aspx.cs" Inherits="Trade.Web.Quotes" %>
-<%@ Import Namespace="Trade.StockTraderWebApplicationModelClasses" %>
-<%@ Import Namespace="Trade.StockTraderWebApplicationSettings" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD Xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" >
-<head>
-<meta http-equiv="Content-Style-Type" content="text/css"/>
-<title>.NET StockTrader Quotes</title>
-<link rel="stylesheet" href="StockTrader.css" type="text/css" />
-</head>
-<body class="StockTraderBodyStyle">
-<!--------------------------Begin Main Web Form Declaration--------------------------------->
-<div>
-<form runat="server" id="AccountForm" style="margin:0;">  
-<!-------------------------Begin Global Header + Order Alert Control------------------------>
-<controls:ClosedOrders id="ClosedOrdersControl" runat="server" ></controls:ClosedOrders>
-<!--------------------------End Global Header Table Declaration ---------------------------->
-<!-------------------- -----Start Portfolio Page-Specific Processing------------------------>
-<table class="TradeHomeTableStyle" style="padding-left:4px;padding-right:4px">
-    <tr>
-    <td colspan="2"> <br /></td>
-</tr>
-    <tr>
-        <td>
-        <table class="SubHeaderTableStyle">
-        <tr>
-            <th class="SubHeaderStyle">Stock Quotes</th>
-            <th class="TodaysDateStyle"><asp:Label ID="Date" runat="server"></asp:Label></th>
-        </tr>
-    </table>
-        </td>
-    </tr>
-    <tr>
-        <td style="text-align:center">
-        <br />
-        <br />
-        <table class="QuotesTableStyle">
-             <tr>
-                <th class="InnerHeading">
-                Symbol</th>
-                <th class="InnerHeading">
-                Company</th>
-                <th class="InnerHeading">
-                Volume</th>
-                <th class="InnerHeading">
-                Price Range</th>
-                <th class="InnerHeading">
-                Open Price</th>
-                <th class="InnerHeading">
-                Current Price</th>
-                <th class="InnerHeading">
-                Gain(Loss)</th>
-                <th class="InnerHeading">
-                Trade</th>
-           </tr>       
-       
-       <% if (quoteList !=null)
-          {
-              for (int i = 0; i < quoteList.Count; i++)
-              {
-       %>
-          <tr>
-                <td class="InnerData">
-                <%=quoteList[i].quoteLink%></td>
-                <td class="InnerData">
-                <%=quoteList[i].companyName%> </td>
-                <td class="InnerData" style="text-align:right">
-                <%=quoteList[i].volume.ToString("N")%></td>
-                <td class="InnerData" style="text-align:right">
-                <%=quoteList[i].low.ToString("C")%> -  <%=quoteList[i].high.ToString("C")%> </td>
-                <td class="InnerData" style="text-align:right">
-                <%=quoteList[i].open.ToString("C")%></td>
-                <td class="InnerData" style="text-align:right">
-                <%=quoteList[i].price.ToString("C")%></td>
-                <td class="InnerData" style="text-align:right">
-                <%=quoteList[i].gainWithArrow%></td>
-                <td class="InnerData">
-                <a href="StockTrade.aspx?action=buy&symbol=<%=quoteList[i].symbol%>">Buy</a>
+*/ %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <controls:ClosedOrders id="ClosedOrdersControl" runat="server" ></controls:ClosedOrders>
    
    <div class="main-title">
        <h1>Stock Quotes</h1>
        <script type="text/javascript">
            var thisdate = new Date();
    		document.writeln(thisdate.toLocaleString());
    	</script>
	</div> 

    <table class="table-outer" cellspacing="0" align="center">
        <thead>
            <tr>
                <th>Symbol</th>
                <th>Company</th>
                <th>Volume</th>
                <th>Price Range</th>
                <th>Open Price</th>
                <th>Current Price</th>
                <th>Gain(Loss)</th>
                <th>Trade</th>
            </tr>       
        </thead>
        <tbody>
        <% if (quoteList !=null)
        {
            for (int i = 0; i < quoteList.Count; i++)
            {
            %>
            <tr>
    
             <td>
                <%=quoteList[i].quoteLink%></td>
+                <td>
                <%=quoteList[i].companyName%> </td>
+                <td class="currency">
                <%=quoteList[i].volume.ToString("N")%></td>
+                <td class="currency">
                <%=quoteList[i].low.ToString("C")%> -  <%=quoteList[i].high.ToString("C")%> </td>
+                <td class="currency">
                <%=quoteList[i].open.ToString("C")%></td>
+                <td class="currency">
                <%=quoteList[i].price.ToString("C")%></td>
+                <td class="currency">
                <%=quoteList[i].gainWithArrow%></td>
+                <td>
                <a href="StockTrade.aspx?action=buy&symbol=<%=quoteList[i].symbol%>">Buy</a>
                 </td>
-		 </tr>
-		 <%}
- }%>
-
-<tr>
-  <td><br/><br/><br /></td>
-</tr>
-</table>
-</td>
-</tr>
-<!-------------------------------Start Get Quote Input Form/Footer-------------------------->
-<tr>
-<td>
-<table class="GetQuotesTableStyle">
-<tr>
-<td colspan="3"> <hr style="vertical-align:bottom"/></td>
-</tr>
- <tr><td style="text-align:center;" >
- <table style="width:600">
-    <tr>
-        <td style="width:100px;height:30px;text-align:right">
-            <asp:TextBox ID="symbols" BackColor="#EBEBEB"    runat="server" Text="s:0;s:1;s:2;s:3"></asp:TextBox>
-        </td>
-        <td style="padding-left:6px;padding-bottom:4px;"><div class="LinkButtonQuoteStyle">
-            <asp:LinkButton ID="LinkButtonQuote" runat="server" CssClass="Button" PostBackUrl="~/Quotes.aspx">Get Quote</asp:LinkButton></div>
-        </td>
-    </tr>
-  </table>          
-</td></tr>
-</table>
-</td>
-</tr>
-</table>
-</form>
-</div>
-<!-------------------------------Start StockTrader Footer----------------------------------->
-<table class="FooterTableStyle">
-    <tr>
-            <td class="FooterLeftStyle">
-            Apache Stonehenge Incubator Project</td>
-            <td class="FooterRightStyle">
-            .NET StockTrader</td>
-    </tr>
-    <tr>
-            <td colspan="2" class="FooterCopyRightStyle"><br />
-            Created with Visual Studio and the Microsoft .NET Framework 3.5 
-            </td>
-    </tr>
-</table> 
-</table>         
-</body>
-</html>
\ No newline at end of file
+            </tr>
            <%}
        }%>
        </tbody>
    </table>
+    <div class="bottom">
        <asp:TextBox ID="symbols" runat="server" Text="s:0;s:1;s:2;s:3"></asp:TextBox>
        <asp:Button ID="GetQuoteButton" runat="server" CssClass="button" Text="Get Quote" />
    </div>
</asp:Content>
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Quotes.aspx.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Quotes.aspx.cs?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Quotes.aspx.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Quotes.aspx.cs Tue Apr 28 22:20:50 2009
@@ -28,6 +28,8 @@
 using System;
 using System.Collections.Generic;
 using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
 using System.Web.Security;
 using Trade.StockTraderWebApplicationSettings;
 using Trade.StockTraderWebApplicationModelClasses;
@@ -43,15 +45,40 @@
     {
         public List<QuoteDataUI> quoteList;
 
-        protected override void OnLoad(EventArgs e)
+        protected void Page_Load(object sender, EventArgs e)
         {
-            Date.Text = DateTime.Now.ToString("f");
             BSLClient businessServicesClient = new BSLClient();
-            string symbols = Input.InputText(Request["symbols"], StockTraderUtility.SYMBOLSTRING_MAXLENGTH);
-            if (symbols != null && symbols.Length > 0)
+            
+            string requestedSymbols = Input.InputText(Request["symbols"], StockTraderUtility.SYMBOLSTRING_MAXLENGTH);
+            if (string.IsNullOrEmpty(requestedSymbols) 
+                && PreviousPage != null)
             {
-                quoteList = businessServicesClient.getQuotes(symbols);
+                // Get the data posted from another page's PostBackUrl method
+                TextBox symbolsText = RecursivelyFindControl(PreviousPage.Controls, "symbols") as TextBox;
+                if (symbolsText != null)
+                    requestedSymbols = symbolsText.Text;
             }
+            if (string.IsNullOrEmpty(requestedSymbols))
+            {
+                // if its still null use the default
+                requestedSymbols = this.symbols.Text;
+            }
+            
+            quoteList = businessServicesClient.getQuotes(requestedSymbols);
+        }
+
+        public Control RecursivelyFindControl(ControlCollection controls, string name)
+        {
+            foreach(Control c in controls)
+            {
+                if (c.ID == name)
+                    return c;
+
+                Control resultFromChildren = RecursivelyFindControl(c.Controls, name);
+                if (resultFromChildren != null)
+                    return resultFromChildren;
+            }
+            return null;
         }
-   }
+    }
 }
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Register.aspx
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Register.aspx?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Register.aspx (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Register.aspx Tue Apr 28 22:20:50 2009
@@ -1,5 +1,4 @@
-<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" CodeFile="Register.aspx.cs" EnableEventValidation="false" Inherits="Trade.Web.Register" %>
<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    EnableViewState="false" EnableEventValidation="false"
    CodeFile="Register.aspx.cs" Inherits="Trade.Web.Register" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<% /* 
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
@@ -13,97 +12,24 @@
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
- -->
- 
-<!DOCTYPE html PUBLIC "-//W3C//DTD Xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" >
-<head>
-<meta http-equiv="Content-Style-Type" content="text/css"/>
-<title>.NET StockTrader Register</title>
-<link rel="stylesheet" href="StockTrader.css" type="text/css" />
-</head>
-<body class="StockTraderBodyStyle">
-<!--------------------------Begin Main Web Form Declaration--------------------------------->
-<div>
-<form runat="server" id="RegisterForm" style="margin:0;">  
-<!-------------------------Begin Global Header Table Declaration---------------------------->
-<table class= "HeaderTableStyle">
-    <tr>
-		<td><img alt="" src="Images/dotnet_logo.jpg" height="63"/></td>
-        <td class="HeaderLeftStyle">.NET StockTrader
-            </td>
-        <td class="HeaderRightStyle">Apache Stonehenge Incubator Project</td>
-    </tr>
-</table>
-<table class="MenuTableStyle">
-    <tr>
-            <td class="Menu"><a href="Default.aspx">Welcome</a></td>
-            <td class="Menu"><a href="TradeHome.aspx">Home</a></td>
-            <td class="Menu"><a href="account.aspx">Account</a></td>
-            <td class="Menu"><a href="portfolio.aspx">Portfolio</a></td>
-            <td class="Menu"><a href="quotes.aspx?symbols=s:0,s:1,s:2,s:3,s:4">Quotes/Trade</a></td>
-            <td class="Menu"><a href="Glossary.aspx">Glossary</a></td>
-            <td class="Menu"><a href="logout.aspx">Login/Logout</a></td>
-            <td class="Menu"><a href="ReadMe.mht" target="_blank">Read Me</a></td>
-    </tr>
-</table>    
-<!--------------------------End Global Header Table Declaration ---------------------------->
-<table class="TradeHomeTableStyle" style="padding-left:4px;padding-right:4px">
-    <tr>
-        <td colspan="2"> <br /></td>
-    </tr>
-    
-    <tr>
-        <td>
-        <table class="SubHeaderTableStyle">
-        <tr>
-            <th class="SubHeaderStyle">Register</th>
-            <th class="TodaysDateStyle"><asp:Label ID="Date" runat="server"></asp:Label></th>
-        </tr>
-    </table>
-        </td>
-    </tr>
-    <tr>
-        <td><br /></td>
-    </tr>
-    <tr>
-        <td style="text-align:center">
-        <table class="AccountTableStyle">
-    <tr >
-            <td colspan="4" style="height:20px;padding-top:5px"><b><asp:Label ID="RegisterMessage" runat="server" Text="Create Account Profile: " ForeColor="#003f5f"></asp:Label></b>
-            <br />
-            <hr style="vertical-align:top"/>
-            </td>
-    </tr>
-    <tr>
+*/ %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


    <div class="main-title">
        <h1>Register</h1>
        <script type="text/javascript">
            var thisdate = new Date();
    		document.writeln(thisdate.toLocaleString());
    	</script>
	</div>

<table class="profile" cellspacing="0" width="100%">
					<thead>
					<tr>
					<th colspan="4">
					Create Account Profile:
					</th>
					</tr>
					</thead>
					<tbody>
					<tr>
					<td colspan="4">
					<asp:Label ID="RegisterMessage" runat="server"></asp:Label>
					</td>
					</tr>
    <tr>
             <td style="text-align:right; padding-right:4px;padding-top:10px">Requested User ID:</td>
-            <td style="text-align:left;padding-left:4px; padding-top:10px;"><asp:TextBox ID="UserID" runat="server" MaxLength="50" BackColor="#EBEBEB" BorderColor="#d4d8db"></asp:TextBox></td>
-            <td style="text-align:right; padding-right:4px; padding-top:10px">Opening Balance:</td>
-            <td style="text-align:left;padding-left:4px; padding-top:10px;"><asp:TextBox ID="OpenBalance" runat="server" Text="100000" MaxLength="7" BackColor="#EBEBEB" BorderColor="#d4d8db"></asp:TextBox></td>
-    </tr>
+            <td style="text-align:left;padding-left:4px; padding-top:10px;"><asp:TextBox ID="UserID" runat="server" MaxLength="50" ></asp:TextBox></td>
            <td style="text-align:right; padding-right:4px; padding-top:10px">Opening Balance:</td>
+            <td style="text-align:left;padding-left:4px; padding-top:10px;"><asp:TextBox ID="OpenBalance" runat="server" Text="100000" MaxLength="7"></asp:TextBox></td>
    </tr>
     <tr>
             <td style="text-align:right; padding-right:4px;">Full Name:</td>
-            <td style="text-align:left;padding-left:4px;"><asp:TextBox ID="FullName" runat="server" MaxLength="100" BackColor="#EBEBEB" BorderColor="#d4d8db"></asp:TextBox></td>
-            <td style="text-align:right; padding-right:4px;">Email Address:</td>
-            <td style="text-align:left;padding-left:4px;"><asp:TextBox ID="Email" runat="server" MaxLength="100" BackColor="#EBEBEB" BorderColor="#d4d8db"></asp:TextBox></td>
-    </tr>
+            <td style="text-align:left;padding-left:4px;"><asp:TextBox ID="FullName" runat="server" MaxLength="100"></asp:TextBox></td>
            <td style="text-align:right; padding-right:4px;">Email Address:</td>
+            <td style="text-align:left;padding-left:4px;"><asp:TextBox ID="Email" runat="server" MaxLength="100"></asp:TextBox></td>
    </tr>
     <tr>
             <td style="text-align:right; padding-right:4px">Address:</td>
-            <td style="text-align:left;padding-left:4px"><asp:TextBox ID="Address" runat="server" MaxLength="100" BackColor="#EBEBEB" BorderColor="#d4d8db"></asp:TextBox></td>
-            <td style="text-align:right;padding-right:4px">Password:</td>
-            <td style="text-align:left;padding-left:4px"><asp:TextBox ID="Password" runat="server" TextMode="Password" MaxLength="100" BackColor="#EBEBEB" BorderColor="#d4d8db"></asp:TextBox></td>
-    </tr>
+            <td style="text-align:left;padding-left:4px"><asp:TextBox ID="Address" runat="server" MaxLength="100"></asp:TextBox></td>
            <td style="text-align:right;padding-right:4px">Password:</td>
+            <td style="text-align:left;padding-left:4px"><asp:TextBox ID="Password" runat="server" TextMode="Password" MaxLength="100"></asp:TextBox></td>
    </tr>
     <tr>
             <td style="text-align:right;padding-right:4px">Credit Card:</td>
-            <td style="text-align:left;padding-left:4px"><asp:TextBox ID="CreditCard" runat="server" MaxLength="100" BackColor="#EBEBEB" BorderColor="#d4d8db"></asp:TextBox></td>
-            <td style="text-align:right;padding-right:4px">Confirm Password:</td>
-            <td style="text-align:left;padding-left:4px"><asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" MaxLength="100" BackColor="#EBEBEB" BorderColor="#d4d8db"></asp:TextBox></td>
-    </tr>
+            <td style="text-align:left;padding-left:4px"><asp:TextBox ID="CreditCard" runat="server" MaxLength="100"></asp:TextBox></td>
            <td style="text-align:right;padding-right:4px">Confirm Password:</td>
+            <td style="text-align:left;padding-left:4px"><asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" MaxLength="100"></asp:TextBox></td>
    </tr>
     <tr>
-            <td colspan="4" style="padding-top:15px; padding-bottom:10px;">
-            <div class="LinkButtonRegStyle"><asp:LinkButton ID="LinkRegister" CssClass="Button" runat="server" PostBackUrl="~/Register.aspx">Register</asp:LinkButton></div>
-            <br />
-                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="Register" DisplayMode="List" />
+        <td colspan="4" style="text-align:center;">
            <asp:Button ID="RegisterButton" CssClass="button" runat="server" Text="Register" />
        </td>
    </tr>
    <tr>
            <td colspan="4" style="text-align:center;padding-top:15px; padding-bottom:10px;">
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="Register" DisplayMode="List" />
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="FullName"
                     ErrorMessage="Please Enter a Name" ValidationGroup="Register" Display="None"></asp:RequiredFieldValidator>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Address"
@@ -123,27 +49,5 @@
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ConfirmPassword"
                     Display="None" ErrorMessage="Please Confirm Your Password" ValidationGroup="Register"></asp:RequiredFieldValidator></td>
     </tr>
-  </table>
-  <br />
-  </td>
-</tr>
-</table>
-</form>
-</div>
-<!-------------------------------Start StockTrader Footer----------------------------------->
-<table class="FooterTableStyle">
-    <tr>
-            <td class="FooterLeftStyle">
-            Apache Stonehenge Incubator Project</td>
-            <td class="FooterRightStyle">
-            .NET StockTrader</td>
-    </tr>
-    <tr>
-            <td colspan="2" class="FooterCopyRightStyle"><br />
-            Created with Visual Studio and the Microsoft .NET Framework 3.5 
-            </td>
-    </tr>
-</table> 
-</table>         
-</body>
-</html>
\ No newline at end of file
+    </tbody>
  </table>
+
</asp:Content>
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Register.aspx.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Register.aspx.cs?rev=769572&r1=769571&r2=769572&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Register.aspx.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Register.aspx.cs Tue Apr 28 22:20:50 2009
@@ -35,18 +35,8 @@
     /// </summary>
     public partial class Register : System.Web.UI.Page
     {
-        string userID;
-        string fullName;
-        string address;
-        string emailAddress;
-        string creditCard;
-        string password;
-        decimal openBalance;
-
         protected void Page_Load(object sender, EventArgs e)
         {
-            Date.Text = DateTime.Now.ToString("f");
-            //configlink.HRef = "http://" + HttpContext.Current.Server.MachineName + "/" + Settings.PAGE_PATH_CONFIG;
             if (IsPostBack)
             {
                 submitData();
@@ -59,13 +49,13 @@
              if (Page.IsValid)
              {
                 RegisterMessage.ForeColor = System.Drawing.Color.Red;
-                fullName = Input.InputText(Request["FullName"], StockTraderUtility.FULLNAME_MAX_LENGTH);
-                address = Input.InputText(Request["Address"], StockTraderUtility.ADDRESS_MAX_LENGTH);
-                emailAddress = Input.InputText(Request["Email"], StockTraderUtility.EMAIL_MAX_LENGTH);
-                creditCard = Input.InputText(Request["CreditCard"], StockTraderUtility.CREDITCARD_MAX_LENGTH);
-                userID = Input.InputText(Request["UserID"], StockTraderUtility.USERID_MAX_LENGTH);
-                password = Input.InputText(Request["Password"], StockTraderUtility.PASSWORD_MAX_LENGTH);
-                openBalance = Decimal.Parse(Input.InputText(Request["OpenBalance"], StockTraderUtility.OPENBALANCE_MAX_LENGTH));
+                string fullName = Input.InputText(this.FullName.Text, StockTraderUtility.FULLNAME_MAX_LENGTH);
+                string address = Input.InputText(this.Address.Text, StockTraderUtility.ADDRESS_MAX_LENGTH);
+                string emailAddress = Input.InputText(this.Email.Text, StockTraderUtility.EMAIL_MAX_LENGTH);
+                string creditCard = Input.InputText(this.CreditCard.Text, StockTraderUtility.CREDITCARD_MAX_LENGTH);
+                string userID = Input.InputText(this.UserID.Text, StockTraderUtility.USERID_MAX_LENGTH);
+                string password = Input.InputText(this.Password.Text, StockTraderUtility.PASSWORD_MAX_LENGTH);
+                decimal openBalance = Decimal.Parse(Input.InputText(this.OpenBalance.Text, StockTraderUtility.OPENBALANCE_MAX_LENGTH));
                 AccountDataUI customer = null;
                 try
                 {

Added: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Site.master
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Site.master?rev=769572&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Site.master (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Site.master Tue Apr 28 22:20:50 2009
@@ -0,0 +1,79 @@
+<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="Site" %>
+<% /* 
+ 
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+ 
+       http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+*/ %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
+    <title>Apache Stonehenge StockTrader Welcome</title>
+    <link href="style.css" rel="stylesheet" type="text/css" media="all" />
+    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
+    </asp:ContentPlaceHolder>
+</head>
+<body>
+<form runat="server">
+    <div id="content">
+        <div id="header">
+            <div class="logo">
+                <img src="images/logo.png" alt="" /></div>
+        </div>
+        <div id="header-links">
+            <table>
+                <tr>
+                    <td>
+                        <a href="Default.aspx">Welcome</a>
+                    </td>
+                    <td>
+                        <a href="TradeHome.aspx">Home</a>
+                    </td>
+                    <td>
+                        <a href="Account.aspx">Account</a>
+                    </td>
+                    <td>
+                        <a href="Portfolio.aspx">Portfolio</a>
+                    </td>
+                    <td>
+                        <a href="Quotes.aspx">Quotes/Trade</a>
+                    </td>
+                    <td>
+                        <a href="Glossary.aspx">Glossary</a>
+                    </td>
+                    <td>
+                        <asp:LoginStatus runat="server" Id="LoginStatusLink"
+                            LogoutText="Login/Logout" LoginText="Login/Logout"
+                            OnLoggingOut="LoginStatusLink_LoggingOut" />
+                    </td>
+                </tr>
+            </table>
+        </div>
+        <div id="middle" class="clearfix">
+            <asp:ContentPlaceHolder ID="MainContent" runat="server">
+            </asp:ContentPlaceHolder>
+        </div>
+        <div id="footer">
+            <div style="float: right;">
+                Powered by <a href="http://www.microsoft.com/net/">
+                    <img align="top" src="images/powered-by-logo.png" alt="Powered by Microsoft .NET" style="margin-top: -3px; margin-right: 5px;" /></a></div>
+        </div>
+    </div>
+</form>
+</body>
+</html>
+

Added: incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Site.master.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Site.master.cs?rev=769572&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Site.master.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Site.master.cs Tue Apr 28 22:20:50 2009
@@ -0,0 +1,20 @@
+using System;
+using Trade.StockTraderWebApplicationServiceClient;
+
+public partial class Site : System.Web.UI.MasterPage
+{
+    protected void Page_Load(object sender, EventArgs e)
+    {
+
+    }
+
+    protected void LoginStatusLink_LoggingOut(object sender, System.Web.UI.WebControls.LoginCancelEventArgs e)
+    {
+        if (Page.User.Identity.IsAuthenticated)
+        {
+            string userid = Page.User.Identity.Name;
+            BSLClient businessServicesClient = new BSLClient();
+            businessServicesClient.logout(userid);
+        }
+    }
+}



Mime
View raw message