Index: common/ServiceConfigurationSettings/Settings.cs =================================================================== --- common/ServiceConfigurationSettings/Settings.cs (revision 768313) +++ common/ServiceConfigurationSettings/Settings.cs (working copy) @@ -60,8 +60,6 @@ /// public class Settings //db : ConfigurationSettingsBase //Inherit from base implementation!! { - - public static string BSL_DOTNET_ENDPOINT_CONFIG_HTTP; public static string BSL_DOTNET_ENDPOINT_CONFIG_WSHTTP; public static string BSL_PHP_ENDPOINT_CONFIG_HTTP; @@ -85,7 +83,7 @@ //Page Names for StockTrader application public static readonly string PAGE_HOME = "TradeHome.aspx"; public static readonly string PAGE_LOGIN = "Login.aspx"; - public static readonly string PAGE_LOGOUT = "Logout.aspx"; + //public static readonly string PAGE_LOGOUT = "Logout.aspx"; public static readonly string PAGE_QUOTES = "Quotes.aspx"; public static readonly string PAGE_ORDER = "Order.aspx"; public static readonly string PAGE_TRADE = "StockTrade.aspx"; @@ -93,10 +91,10 @@ //public static readonly string PAGE_PATH_CONFIG = "ConfigWeb/default.aspx"; //Trade HTML Fomatting Constants - public static readonly string GAINSTYLECSS = "GainTextStyle"; - public static readonly string LOSSSTYLECSS = "LossTextStyle"; - public static readonly string UPARROWLINK = "\"\""; - public static readonly string DOWNARROWLINK = "\"\""; + public static readonly string GAINSTYLECSS = "price-gain"; + public static readonly string LOSSSTYLECSS = "price-loss"; + //public static readonly string UPARROWLINK = "\"\""; + //public static readonly string DOWNARROWLINK = "\"\""; /// /// Settings (Constructor) - handles the config. Index: trader_client/StockTraderWebApplicationUIModelClasses/DataFormatHelper.cs =================================================================== --- trader_client/StockTraderWebApplicationUIModelClasses/DataFormatHelper.cs (revision 0) +++ trader_client/StockTraderWebApplicationUIModelClasses/DataFormatHelper.cs (revision 0) @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Trade.StockTraderWebApplicationSettings; + +namespace Trade.StockTraderWebApplicationModelClasses +{ + public static class DataFormatHelper + { + public static string NumberWithStyledArrow(double value) + { + if (value > 0) + return string.Format("{0:C}", value); + else if (value < 0) + return string.Format("{0:C}", value); + + return string.Format("{0:C}", value); + } + + public static string NumberWithStyledArrow(decimal value) + { + if (value > 0) + return string.Format("{0:C}", value); + else if (value < 0) + return string.Format("{0:C}", value); + + return string.Format("{0:C}", value); + } + + public static string GetQuoteLink(params string[] symbols) + { + var symbolsCsv = string.Join(",", symbols); + return "" + symbolsCsv + ""; + } + + } +} Index: trader_client/StockTraderWebApplicationUIModelClasses/HoldingDataUI.cs =================================================================== --- trader_client/StockTraderWebApplicationUIModelClasses/HoldingDataUI.cs (revision 768313) +++ trader_client/StockTraderWebApplicationUIModelClasses/HoldingDataUI.cs (working copy) @@ -57,7 +57,7 @@ this._quantity = string.Format("{0:0,0}", quantity); this._purchasePrice = string.Format("{0:C}", purchasePrice); this._purchaseDate = purchaseDate.ToString(); - this._quoteID = "" + quoteID + ""; + this._quoteID = DataFormatHelper.GetQuoteLink(quoteID); this._quotePrice = string.Format("{0:C}", quotePrice); } @@ -86,14 +86,8 @@ this._sellLink = tdOpenCenter + tdClose; this._purchasePrice = tdOpenCenter + tdClose; this._quantity = tdOpenRight + string.Format("{0:0,0}", quantity) + tdClose; - this._quoteID = tdOpenCenter + "" + quoteSymbol + "" + tdClose; - if (gain > 0) - _gainWithArrow = string.Format(tdOpenRight + "{0:C}" + Settings.UPARROWLINK + "" + tdClose, gain); - else - if (gain < 0) - _gainWithArrow = string.Format(tdOpenRight + "{0:C}" + Settings.DOWNARROWLINK + "" + tdClose, gain); - else - _gainWithArrow = string.Format(tdOpenRight + "{0:C}" + tdClose, gain); + this._quoteID = tdOpenCenter + DataFormatHelper.GetQuoteLink(quoteSymbol) + tdClose; + this._gainWithArrow = tdOpenRight + DataFormatHelper.NumberWithStyledArrow(gain) + tdClose; this._quotePrice = tdOpenRight + string.Format("{0:C}", quotePrice) + tdClose; this._marketValue = tdOpenRight + string.Format("{0:C}", marketvalue) + tdClose; this._basis = tdOpenRight + string.Format("{0:C}", basis) + tdClose; @@ -120,14 +114,8 @@ this._quantity = tdOpenRight + string.Format("{0:0,0}", this._quantityDouble) + tdClose; this._purchasePrice = tdOpenRight + string.Format("{0:C}", this._purchasePriceDecimal) + tdClose; this._purchaseDate = tdOpenCenter + this._purchaseDate + tdClose; - this._quoteID = tdOpenCenter + "" + this._quoteID + "" + tdClose; - if (_gainDecimal > 0) - _gainWithArrow = string.Format(tdOpenRight + "{0:C}" + Settings.UPARROWLINK + "" + tdClose, this._gainDecimal); - else - if (_gainDecimal < 0) - _gainWithArrow = string.Format(tdOpenRight + "{0:C}" + Settings.DOWNARROWLINK + "" + tdClose, this._gainDecimal); - else - _gainWithArrow = string.Format(tdOpenRight + "{0:C}" + tdClose, this._gainDecimal); + this._quoteID = tdOpenCenter + DataFormatHelper.GetQuoteLink(this._quoteID) + tdClose; + this._gainWithArrow = tdOpenRight + DataFormatHelper.NumberWithStyledArrow(_gainDecimal) + tdClose; this._marketValue = tdOpenRight + string.Format("{0:C}", this._marketValueDecimal) + tdClose; this._basis = tdOpenRight + string.Format("{0:C}", this._basisDecimal) + tdClose; } @@ -276,6 +264,14 @@ } } + public decimal purchasePriceDecimal + { + get + { + return _purchasePriceDecimal; + } + } + public string purchaseDate { get Index: trader_client/StockTraderWebApplicationUIModelClasses/QuoteDataUI.cs =================================================================== --- trader_client/StockTraderWebApplicationUIModelClasses/QuoteDataUI.cs (revision 768313) +++ trader_client/StockTraderWebApplicationUIModelClasses/QuoteDataUI.cs (working copy) @@ -19,7 +19,6 @@ using System; using System.Collections; -using Trade.StockTraderWebApplicationSettings; namespace Trade.StockTraderWebApplicationModelClasses { @@ -161,7 +160,7 @@ { get { - return "" + _symbol + ""; + return DataFormatHelper.GetQuoteLink(_symbol); } } @@ -169,13 +168,7 @@ { get { - if (this._change > 0) - return string.Format("
{0:C}"+Settings.UPARROWLINK+"
", this._change); - else if (this._change < 0) - return string.Format("
{0:C}" + Settings.DOWNARROWLINK + "
", this._change); - else - return - string.Format("{0:C}", this._change); + return DataFormatHelper.NumberWithStyledArrow(this._change); } } @@ -183,13 +176,7 @@ { get { - if (this._change > 0) - return string.Format("{0:C}" + Settings.UPARROWLINK + "", this._price); - else - if (this._change < 0) - return string.Format("{0:C}" + Settings.DOWNARROWLINK + "", this._price); - else - return string.Format("{0:C}", this._price); + return DataFormatHelper.NumberWithStyledArrow(this._price); } } } Index: trader_client/StockTraderWebApplicationUIModelClasses/StockTraderWebApplicationModelClasses.csproj =================================================================== --- trader_client/StockTraderWebApplicationUIModelClasses/StockTraderWebApplicationModelClasses.csproj (revision 768313) +++ trader_client/StockTraderWebApplicationUIModelClasses/StockTraderWebApplicationModelClasses.csproj (working copy) @@ -73,6 +73,7 @@ + Index: trader_client/StockTraderWebApplicationUIModelClasses/TotalHoldingsUI.cs =================================================================== --- trader_client/StockTraderWebApplicationUIModelClasses/TotalHoldingsUI.cs (revision 768313) +++ trader_client/StockTraderWebApplicationUIModelClasses/TotalHoldingsUI.cs (working copy) @@ -125,13 +125,7 @@ { get { - if (this._gain > 0) - return string.Format("
{0:C}" + Settings.UPARROWLINK + "
", this._gain); - else - if (this._gain <0) - return string.Format("
{0:C}" + Settings.DOWNARROWLINK + "
", this._gain); - else - return string.Format("{0:C}", this._gain); + return DataFormatHelper.NumberWithStyledArrow(this._gain); } } } Index: trader_client/StockTraderWebApplicationUIModelClasses/TotalOrdersUI.cs =================================================================== --- trader_client/StockTraderWebApplicationUIModelClasses/TotalOrdersUI.cs (revision 768313) +++ trader_client/StockTraderWebApplicationUIModelClasses/TotalOrdersUI.cs (working copy) @@ -83,13 +83,8 @@ { get { - if ((this._subtotalSell - this._subtotalBuy - this._txnFeesSubtotal) > 0) - return String.Format("
{0:C}" + Settings.UPARROWLINK, (this._subtotalSell - this._subtotalBuy - this._txnFeesSubtotal)); - else - if ((this._subtotalSell - this._subtotalBuy - this._txnFeesSubtotal) < 0) - return String.Format("
{0:C}" + Settings.DOWNARROWLINK, (this._subtotalSell - this._subtotalBuy - this._txnFeesSubtotal)); - else - return String.Format("{0:C}", (this._subtotalSell - this._subtotalBuy - this._txnFeesSubtotal)); + decimal netImpact = (this._subtotalSell - this._subtotalBuy - this._txnFeesSubtotal); + return DataFormatHelper.NumberWithStyledArrow(netImpact); } } } Index: trader_client/Trade/Account.aspx =================================================================== --- trader_client/Trade/Account.aspx (revision 768313) +++ trader_client/Trade/Account.aspx (working copy) @@ -1,5 +1,11 @@ -<%@ Register TagPrefix="controls" TagName="AccountOrders" Src = "Controls/AccountOrders.ascx" %> - - -<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src = "Controls/ClosedOrders.ascx" %> -<%@ Page Language="C#" AutoEventWireup="false" EnableViewState="false" EnableEventValidation="false" CodeFile="Account.aspx.cs" Inherits="Trade.Web.Account" %> -<%@Import Namespace="Trade.StockTraderWebApplicationModelClasses" %> - - - - -.NET StockTrader Account Information - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - +*/ %> + + + + + +
+

Account Information

+ +
+ +
Account Information
+ + + + + + + + + + + + + + + +
Subtotal BuysSubtotal SellsSubtotal FeesNet Impact Cash Balance
<%=string.Format("{0:C}", AccountOrdersControl.orderData.subtotalBuy)%><%=string.Format("{0:C}", AccountOrdersControl.orderData.subtotalSell)%><%=string.Format("{0:C}", AccountOrdersControl.orderData.txnFeesSubtotal)%><%=AccountOrdersControl.orderData.netImpactCashBalance%>
-


- - - - - - - - - -


-
Total Orders Shown: - - - - - - - - - - - - - -
Subtotal BuysSubtotal SellsSubtotal FeesNet Impact Cash Balance
<%=string.Format("{0:C}", AccountOrdersControl.orderData.subtotalBuy)%><%=string.Format("{0:C}", AccountOrdersControl.orderData.subtotalSell)%><%=string.Format("{0:C}", AccountOrdersControl.orderData.txnFeesSubtotal)%><%=AccountOrdersControl.orderData.netImpactCashBalance%>
-
-
-
-

- - - - - - - - - - - - - -
-
-
-
- + + + +

+ +

Total Orders Shown:

+ + + +
+ - - - - + + + - - - - + - - - - - - -
Full Name:Email Address: + +
Address:Password: + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Full Name: + + + + Email Address: + + +
+ Address: + + + + Password: + + +
+ Credit Card: + + + + Confirm Password: + + +
+ + + + + + + + +
+ +
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Account ID: + + + + Account Created + + +
+ User ID: + + + + Last Login: + + +
+ Opening Balance: + + + + Total Logins: + + +
+ Cash Balance: + + + + Total Logouts: + + +
+
Credit Card:Confirm Password:
-
Update
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- Account ID: - - Account Created: -
- User ID: - - Last Login: -
- Opening Balance: - - Total Logins: -
- Cash Balance: - - Total Logouts: -
-
-
- - - - - -
-
- - - - - -

- - - - - -
- -
- Get Quote
-
-
-
-
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - - \ No newline at end of file + + + + +
+ + +
+ + \ No newline at end of file Index: trader_client/Trade/Account.aspx.cs =================================================================== --- trader_client/Trade/Account.aspx.cs (revision 768313) +++ trader_client/Trade/Account.aspx.cs (working copy) @@ -38,22 +38,24 @@ // protected override void OnPreRender(EventArgs e) { - Date.Text = DateTime.Now.ToString("f"); - string action = Input.InputText(Request["action"], 20); - if (action == "showtoporders" + string userid = HttpContext.Current.User.Identity.Name; + string action = Request.QueryString["action"] ?? string.Empty; + + if (action.Equals("showtoporders", StringComparison.InvariantCultureIgnoreCase) && (Settings.interfaceMode == StockTraderUtility.ACCESS_PHP_Http_WebService || Settings.interfaceMode == StockTraderUtility.ACCESS_WSAS_Http_WebService)) { - NumOrdersShown.Text = AccountOrdersControl.totalOrders.ToString() ; + NumOrdersShown.Text = AccountOrdersControl.totalOrders.ToString(); WASLimit.Text = "
WebSphere Trade 6.1 Returns a Maximum of 5 Orders!
"; } else NumOrdersShown.Text = AccountOrdersControl.totalOrders.ToString(); - string userid = HttpContext.Current.User.Identity.Name; + if (AccountOrdersControl.ordersRequested==Settings.MAX_DISPLAY_ORDERS) orderLink.Text = "Show Top " + Settings.MAX_DISPLAY_TOP_ORDERS.ToString() + " Orders"; else orderLink.Text = "Show Top " + Settings.MAX_DISPLAY_ORDERS.ToString() + " Orders "; + AccountDataUI customer = null; AccountProfileDataUI customerprofile = businessServicesClient.getAccountProfileData(userid); if (IsPostBack) @@ -62,19 +64,20 @@ } else UpdateMessage.Text = UpdateMessage.Text + customerprofile.userID; + customer = businessServicesClient.getAccountData(userid); Name.Text = customer.profileID; AccountID.Text = customer.accountID.ToString(); - CreationDate.Text = customer.creationDate.ToString("f"); + CreationDate.Text = customer.creationDate.ToString("g"); LoginCount.Text = customer.loginCount.ToString(); OpenBalance.Text = string.Format("{0:C}", customer.openBalance); if (customer.balance > 0) - Balance.ForeColor = System.Drawing.Color.Green; + Balance.CssClass = Settings.GAINSTYLECSS; else - Balance.ForeColor = System.Drawing.Color.Red; + Balance.CssClass = Settings.LOSSSTYLECSS; Balance.Text = string.Format("{0:C}", customer.balance); TotalLogout.Text = customer.logoutCount.ToString(); - LastLogin.Text = customer.lastLogin.ToString("f"); + LastLogin.Text = customer.lastLogin.ToString("g"); Password.Attributes.Add("value", customerprofile.password); ConfirmPassword.Attributes.Add("value", customerprofile.password); Email.Text = customerprofile.email; Index: trader_client/Trade/App_Data/ASPNETDB.MDF =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/App_Data/aspnetdb_log.ldf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Controls/AccountOrders.ascx =================================================================== --- trader_client/Trade/Controls/AccountOrders.ascx (revision 768313) +++ trader_client/Trade/Controls/AccountOrders.ascx (working copy) @@ -1,5 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeFile="AccountOrders.ascx.cs" Inherits="Trade.Web.AccountOrders" %> - - - +*/ %> - - + +
+ - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - -
- Order ID - Order Status - Creation Date - Completion Date - Txn Fee - Type - Symbol - Quantity - Price - Total
Order IDOrder StatusCreation DateCompletion DateTxn FeeTypeSymbolQuantityPriceTotal
- <%# Eval("orderID")%> - <%# Eval("orderStatus") %> - <%# Eval("openDate") %> - <%# Eval("completionDate") %> - <%# Eval("orderFee", "{0:C}")%> - <%# Eval("orderType")%> - <%# Eval("quoteLink")%> - <%# Eval("quantity","{0:0,0}")%> - <%# Eval("price","{0:C}")%> - <%# Eval("total","{0:C}")%><%# Eval("orderID")%> <%# Eval("orderStatus") %><%# Eval("openDate") %><%# Eval("completionDate") %> <%# Eval("orderFee", "{0:C}")%><%# Eval("orderType")%><%# Eval("quoteLink")%><%# Eval("quantity","{0:0,0}")%><%# Eval("price","{0:C}")%><%# Eval("total","{0:C}")%>
- -
- \ No newline at end of file + + + + + + \ No newline at end of file Index: trader_client/Trade/Controls/AccountOrders.ascx.cs =================================================================== --- trader_client/Trade/Controls/AccountOrders.ascx.cs (revision 768313) +++ trader_client/Trade/Controls/AccountOrders.ascx.cs (working copy) @@ -40,10 +40,13 @@ protected override void OnLoad(EventArgs e) { BSLClient businessServicesClient = new BSLClient(); + string userid = HttpContext.Current.User.Identity.Name; - if (Input.InputText(Request["action"], 20) == "showtoporders" - && (Settings.interfaceMode != StockTraderUtility.ACCESS_WSAS_Http_WebService - || Settings.interfaceMode != StockTraderUtility.ACCESS_PHP_Http_WebService)) + string action = Request.QueryString["action"] ?? string.Empty; + + if (action.Equals("showtoporders", StringComparison.InvariantCultureIgnoreCase) + && Settings.interfaceMode != StockTraderUtility.ACCESS_WSAS_Http_WebService + && Settings.interfaceMode != StockTraderUtility.ACCESS_PHP_Http_WebService) { ordersRequested = Settings.MAX_DISPLAY_TOP_ORDERS; orderData = businessServicesClient.getTopOrders(userid); Index: trader_client/Trade/Controls/ClosedOrders.ascx =================================================================== --- trader_client/Trade/Controls/ClosedOrders.ascx (revision 768313) +++ trader_client/Trade/Controls/ClosedOrders.ascx (working copy) @@ -1,5 +1,6 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ClosedOrders.ascx.cs" Inherits="Trade.Web.ClosedOrders" %> - - -<%@ Import Namespace="Trade.StockTraderWebApplicationModelClasses" %> -<%@ Import Namespace="Trade.StockTraderWebApplicationSettings" %> - - - - - - - -
.NET StockTrader - Apache Stonehenge Incubator Project
- - - - - - - - - - - - - - - -<% if (closedOrderData!=null) - if (closedOrderData.Count>0) - {%> - - - - <% } %> -
- - - - - - - - - - - - - - - - <%for (int i=0; i - - - - - - - - - - - <%}%> -
Trade Alert: The following orders have completed.
- Order ID - Order Status - Creation Date - Completion Date - Txn Fee - Type - Symbol - Quantity
- <%=closedOrderData[i].orderID%> - <%=closedOrderData[i].orderStatus%> - <%=closedOrderData[i].openDate%> - <%=closedOrderData[i].completionDate%> - <%=closedOrderData[i].orderFee.ToString("C")%> - <%=closedOrderData[i].orderType%> - <%=closedOrderData[i].quoteLink%> - <%=closedOrderData[i].quantity.ToString("N")%>
-
- -
- \ No newline at end of file +*/ +if (closedOrderData != null && closedOrderData.Count > 0) + {%> + +

Trade Alert: The following orders have completed.

+ + + + + + + + + + + + + + + <%for (int i=0; i + + + + + + + + + + + <%}%> + +
Order IDOrder StatusCreation DateCompletion DateTxn FeeTypeSymbolQuantity
<%=closedOrderData[i].orderID%><%=closedOrderData[i].orderStatus%><%=closedOrderData[i].openDate%><%=closedOrderData[i].completionDate%> <%=closedOrderData[i].orderFee.ToString("C")%><%=closedOrderData[i].orderType%><%=closedOrderData[i].quoteLink%><%=closedOrderData[i].quantity.ToString("N")%>
+

+ +<% } %> Index: trader_client/Trade/Controls/ClosedOrders.ascx.cs =================================================================== --- trader_client/Trade/Controls/ClosedOrders.ascx.cs (revision 768313) +++ trader_client/Trade/Controls/ClosedOrders.ascx.cs (working copy) @@ -77,7 +77,7 @@ if (userid == "") { HttpCookie authcookie = Request.Cookies[FormsAuthentication.FormsCookieName]; - if (authcookie.Equals(null)) + if (authcookie == null) { FormsAuthentication.SignOut(); Response.Redirect(Settings.PAGE_LOGIN); Index: trader_client/Trade/Controls/Header.ascx =================================================================== --- trader_client/Trade/Controls/Header.ascx (revision 768313) +++ trader_client/Trade/Controls/Header.ascx (working copy) @@ -1,48 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="false" CodeFile="Header.ascx.cs" Inherits="Trade.Web.Header" %> - - -<%@ OutputCache Duration ="30" VaryByParam="none" %> - - - - - - - - -
.NET StockTrader - Apache Stonehenge Incubator Project
- - - - - - - - - - - - - - \ No newline at end of file Index: trader_client/Trade/Controls/Header.ascx.cs =================================================================== --- trader_client/Trade/Controls/Header.ascx.cs (revision 768313) +++ trader_client/Trade/Controls/Header.ascx.cs (working copy) @@ -1,33 +0,0 @@ -// -// 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. -// - -// .NET StockTrader Sample WCF Application for Benchmarking, Performance Analysis and Design Considerations for Service-Oriented Applications - -using System; -using System.Web; -using Trade.StockTraderWebApplicationSettings; - -namespace Trade.Web -{ - public partial class Header : System.Web.UI.UserControl - { - protected override void OnLoad(EventArgs e) - { - //configlink.HRef = "http://" + HttpContext.Current.Server.MachineName + "/" + Settings.PAGE_PATH_CONFIG; - } - } -} \ No newline at end of file Index: trader_client/Trade/Controls/MarketSummary.ascx =================================================================== --- trader_client/Trade/Controls/MarketSummary.ascx (revision 768313) +++ trader_client/Trade/Controls/MarketSummary.ascx (working copy) @@ -18,73 +18,81 @@ <%@OutputCache Duration="60" VaryByParam="none"%> <%@Import Namespace = "Trade.StockTraderWebApplicationSettings" %> - - - - + +

Market Summary

+
Market Summary
-
+ + - - - + + - - - + + - - - + + - - - + +
Trade Stock
Index (TSIA)
+
Trade Stock
Index (TSIA)
Trading
Volume
-
+
Trading
Volume
Top Gainers - +
Top Gainers - - - - +
Symbol Price Change
+ + + + + + + + - - - + + + +
SymbolPriceChange
<%# Eval("quoteLink")%><%# Eval("priceWithArrow")%><%# Eval("gainWithArrow")%><%# Eval("quoteLink")%><%# Eval("priceWithArrow")%><%# Eval("gainWithArrow")%>
-
Top Losers - +
Top Losers - - - - +
Symbol Price Change
+ + + + + + + + - - - + + + +
SymbolPriceChange
<%# Eval("quoteLink")%> <%# Eval("priceWithArrow")%><%# Eval("gainWithArrow")%><%# Eval("quoteLink")%> <%# Eval("priceWithArrow")%><%# Eval("gainWithArrow")%>
- +
- \ No newline at end of file + \ No newline at end of file Index: trader_client/Trade/Controls/MarketSummary.ascx.cs =================================================================== --- trader_client/Trade/Controls/MarketSummary.ascx.cs (revision 768313) +++ trader_client/Trade/Controls/MarketSummary.ascx.cs (working copy) @@ -51,21 +51,18 @@ List topLosers = marketSummaryData.topLosers; summaryDate.Text = DateTime.Now.ToString("f"); TSIA.Text = String.Format("{0:N}",marketSummaryData.TSIA); + decimal gainpercent = marketSummaryData.gainPercent; if (gainpercent > 0) { - GainPercent.ForeColor = System.Drawing.Color.DarkGreen; - GainPercent.Text = String.Format("{0:N}" + Settings.UPARROWLINK, gainpercent); + GainPercent.CssClass = Settings.GAINSTYLECSS; } - else if (gainpercent < 0) - { - GainPercent.ForeColor = System.Drawing.Color.DarkRed; - GainPercent.Text = String.Format("{0:N}" + Settings.DOWNARROWLINK, gainpercent); - } - else - { - GainPercent.Text = String.Format("{0:N}", gainpercent); - } + else if (gainpercent < 0) + { + GainPercent.CssClass = Settings.LOSSSTYLECSS; + } + GainPercent.Text = String.Format("{0:N}", gainpercent); + Volume.Text = String.Format("{0:N}", marketSummaryData.volume); TopGainers.DataSource = marketSummaryData.topGainers; TopLosers.DataSource = marketSummaryData.topLosers; Index: trader_client/Trade/Default.aspx =================================================================== --- trader_client/Trade/Default.aspx (revision 768313) +++ trader_client/Trade/Default.aspx (working copy) @@ -1,5 +1,7 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Trade.Web.Default" %> - - - - - - -.NET StockTrader Welcome - - - - - -
-
- - - - - - - -
.NET StockTrader - Apache Stonehenge Incubator Project
- - - - - - - - - - - - - - - - - - - - - - - + --> +
+

+ Welcome!

-
- - - - - - - - - -

- - - - - -
Welcome!
-
+ + + +

-

-
-

- This application is an end-to-end sample application for .NET Enterprise Application Server technologies. - It is a service-oriented application based on .Net 3.5 utilizing Windows Communication Foundation - (WCF) and ASP.NET, and illustrates - many of the .NET 3.5 enterprise development technologies that can be used for building "enterprise-connected" applications. -

-

- The application also offers a rich set of interoperability options with non-Microsoft platforms. This includes - interoperability with Java-based application servers and IBM WebSphere's Trade 6.1 sample application, and open-source based front-ends and services from - WSO2 and other vendors. The .NET services also include a data access layer for both Microsoft SQL Server and Oracle 11G databases. The application offers an excellent opportunity for developers to learn about .NET and building interoperable, service-oriented applications. -

-
-
-
- - - - - - - -
- Sample of Technologies Demonstrated

-
    -
  • - Service-oriented, n-tier design with ASP.NET and WCF -
  • -
  • - Clean separation of UI, business services and DB access -
  • -
  • - .NET 3.5 with WCF
  • -
  • - Interoperability with J2EE/WebSphere Trade 6.1 -
  • -
  • Interoperability with Java and PHP services over -
    - WS-* Advanced Web Service standards
  • -
  • - Loosely-coupled, message-oriented design with WCF -
  • -
  • - Self-hosting WCF Services -
  • -
  • - Custom WCF Behaviors -
  • -
  • - .NET Enterprise Application Server Technologies -
  • -
  • - ASP.NET 2.0 and 3.5 -
  • -
  • - ADO.NET 2.0 -
  • -
-
-
-
-
-
-
-
-
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - - - -
-
- - \ No newline at end of file + This application is an end-to-end sample application for .NET Enterprise Application + Server technologies. It is a service-oriented application based on .Net 3.5 utilizing + Windows Communication Foundation (WCF) and ASP.NET, and illustrates many of the + .NET 3.5 enterprise development technologies that can be used for building "enterprise-connected" + applications. +

+

+ The application also offers a rich set of interoperability options with non-Microsoft + platforms. This includes interoperability with Java-based application servers and + IBM + WebSphere's Trade 6.1 sample application, and open-source based front-ends + and services from WSO2 and other + vendors. The .NET services also include a data access layer for both Microsoft SQL + Server and Oracle 11G databases. The application offers an excellent opportunity + for developers to learn about .NET and building interoperable, service-oriented + applications. +

+

+ For more details, check Apache Stonehenge + home page. +

+
+
+

+ Sample of Technologies Demonstrated

+
    +
  • Service-oriented, n-tier design with ASP.NET and WCF
  • +
  • Clean separation of UI, business services and DB access
  • +
  • .NET 3.5 with WCF
  • +
  • Interoperability with J2EE/WebSphere Trade 6.1
  • +
  • Interoperability with Java and PHP services over +
    + WS-* Advanced Web Service standards
  • +
  • Loosely-coupled, message-oriented design with WCF
  • +
  • Self-hosting WCF Services
  • +
  • Custom WCF Behaviors
  • +
  • .NET Enterprise Application Server Technologies
  • +
  • ASP.NET 2.0 and 3.5
  • +
  • ADO.NET 2.0
  • +
+
+ Index: trader_client/Trade/Default.aspx.cs =================================================================== --- trader_client/Trade/Default.aspx.cs (revision 768313) +++ trader_client/Trade/Default.aspx.cs (working copy) @@ -16,22 +16,14 @@ // using System; -using System.Web; -using System.Web.UI; -using Trade.StockTraderWebApplicationSettings; namespace Trade.Web { - public partial class Default : System.Web.UI.Page + public partial class Default : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) { - protected void Page_Load(object sender, EventArgs e) - { - Date.Text = DateTime.Now.ToString("f"); - //Settings Settings = new Settings(); - //configlink.HRef = "http://" + HttpContext.Current.Server.MachineName + "/" + - Settings settings = new Settings(); - - } } + } } Index: trader_client/Trade/Glossary.aspx =================================================================== --- trader_client/Trade/Glossary.aspx (revision 768313) +++ trader_client/Trade/Glossary.aspx (working copy) @@ -1,19 +1,7 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Glossary.aspx.cs" Inherits="Trade.Web.Glossary" %> - - - - -.NET StockTrader Glossary - - - - -
-
- - - - - - - - - -
.NET StockTrader - Apache Stonehenge Incubator Project
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - -
Glossary
-


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TermDescription
Account IDA unique Integer based key. Each user is assigned an account ID at account creation time.
Account CreatedThe time and date the users account was first created.
Cash Balance The current cash balance in the users account. This does not include current stock holdings.
CompanyThe full company name for an individual stock.
Current Gain/LossThe total gain or loss of this account, computed by substracting the current sum of cash/holdings minus the opening account balance.
Current PriceThe current trading price for a given stock symbol.
Gain/LossThe current gain or loss of an individual stock holding, computed as (current market value - holding basis).
Last LoginThe date and time this user last logged in to Trade.
Market ValueThe current total value of a stock holding, computed as (quantity * current price).
Number of HoldingsThe total number of stocks currently owned by this account.
Open PriceThe price of a given stock at the open of the trading session.
Order IdA unique Integer based key. Each order is assigned an order ID at order creation time.
Opening BalanceThe initial cash balance in this account when it was opened.
Order Statusorders are opened, processed, closed and completed. Order status shows the current stat for this order.
Price RangeThe low and high prices for this stock during the current trading session
Purchase DateThe date and time the a stock was purchased.
Purchase PriceThe price used when purchasing the stock.
Purchase BasisThe total cost to purchase this holding. This is computed as (quantity * purchase price).
QuantityThe number of stock shares in the order or user holding.
Session CreatedAn HTTP session is created for each user at during login. Session created shows the time and day when the session was created.
Sum of Cash/HoldingsThe total current value of this account. This is the sum of the cash balance along with the value of current stock holdings.
SymbolThe symbol for a Trade stock.
Total LoginsThe total number of logins performed by this user.
Total LogoutsThe total number of logouts performed by this user.
Total of HoldingsThe current total value of all stock holdings in this account given the current valuation of each stock held.
Top GainersThe list of stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) gaining the most in price during the current trading session.
Top LosersThe list of stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) falling the most in price during the current trading session.
Trade Stock Index (TSIA)A computed index of the top 20 stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) in Trade.
Trading VolumeThe total number of shares traded for stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) during this trading session.
Txn FeeThe fee charged by the brokerage to process this order.
TypeThe order type (buy or sell).
User IDThe unique user ID for the account chosen by the user at account registration.
VolumeThe total number of shares traded for this stock.
-
-
-
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - - - - -
-
- - \ No newline at end of file +*/ %> + + +
+

Glossary

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TermDescription
Account IDA unique Integer based key. Each user is assigned an account ID at account creation time.
Account CreatedThe time and date the users account was first created.
Cash BalanceThe current cash balance in the users account. This does not include current stock holdings.
CompanyThe full company name for an individual stock.
Current Gain/LossThe total gain or loss of this account, computed by substracting the current sum of cash/holdings minus the opening account balance.
Current PriceThe current trading price for a given stock symbol.
Gain/LossThe current gain or loss of an individual stock holding, computed as (current market value - holding basis).
Last LoginThe date and time this user last logged in to Trade.
Market ValueThe current total value of a stock holding, computed as (quantity * current price).
Number of HoldingsThe total number of stocks currently owned by this account.
Open PriceThe price of a given stock at the open of the trading session.
Order IDA unique Integer based key. Each order is assigned an order ID at order creation time.
Opening BalanceThe initial cash balance in this account when it was opened.
Order Statusorders are opened, processed, closed and completed. Order status shows the current stat for this order.
Price RangeThe low and high prices for this stock during the current trading session
Purchase DateThe date and time the a stock was purchased.
Purchase PriceThe price used when purchasing the stock.
Purchase BasisThe total cost to purchase this holding. This is computed as (quantity * purchase price).
QuantityThe number of stock shares in the order or user holding.
Session CreatedAn HTTP session is created for each user at during login. Session created shows the time and day when the session was created.
Sum of Cash/HoldingsThe total current value of this account. This is the sum of the cash balance along with the value of current stock holdings.
SymbolThe symbol for a Trade stock.
Total LoginsThe total number of logins performed by this user.
Total LogoutsThe total number of logouts performed by this user.
Total of HoldingsThe current total value of all stock holdings in this account given the current valuation of each stock held.
Top gainersThe list of stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) gaining the most in price during the current trading session.
Top LosersThe list of stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) falling the most in price during the current trading session.
Trader Stock Index (TSIA)A computed index of the top 20 stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) in Trade.
Trading VolumeThe total number of shares traded for stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) during this trading session.
Txn FeeThe fee charged by the brokerage to process this order.
TypeThe order type (buy or sell).
User IDThe unique user ID for the account chosen by the user at account registration.
VolumeThe total number of shares traded for this stock.
+
\ No newline at end of file Index: trader_client/Trade/Glossary.aspx.cs =================================================================== --- trader_client/Trade/Glossary.aspx.cs (revision 768313) +++ trader_client/Trade/Glossary.aspx.cs (working copy) @@ -26,10 +26,7 @@ public partial class Glossary : System.Web.UI.Page { 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; - + { } } } \ No newline at end of file Index: trader_client/Trade/Images/arrowdown.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/arrowup.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/bg.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\bg.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/button-bg.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\button-bg.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/button_bg.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/dotnet_logo.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/dotnetlogo.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/footer-bg.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\footer-bg.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/footer_left.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/footer_main.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/footer_right.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/green-arrow.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\green-arrow.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/header-bg.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\header-bg.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/header-link-bg-hover.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\header-link-bg-hover.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/header-link-bg-on.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\header-link-bg-on.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/header-link-bg.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\header-link-bg.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/header-links-bg.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\header-links-bg.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/header_main.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/header_right.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/index.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/logo.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/middle-bg.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\middle-bg.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/powered-by-logo.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\powered-by-logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/red-arrow.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: trader_client\Trade\Images\red-arrow.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: trader_client/Trade/Images/table_bg.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Images/trade.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trader_client/Trade/Login.aspx =================================================================== --- trader_client/Trade/Login.aspx (revision 768313) +++ trader_client/Trade/Login.aspx (working copy) @@ -1,6 +1,7 @@ -<%@Page Language="C#" AutoEventWireup="true" EnableViewState="false" EnableSessionState="True" EnableEventValidation="false" CodeFile="Login.aspx.cs" Inherits="Trade.Web.Login" %> - - - - - - - -.NET StockTrader Login - - - - -
-
- - - - - - - -
.NET StockTrader - Apache Stonehenge Incubator Project
- - - - - - - - - - - +*/ %> + + - - - - - - - - - - - - - - - - - - - - -

- - - - - -
Login
-

- Welcome to the .NET StockTrader Composite Web Application! -

- - - - - - - - - - - - - -
-
-
-
-
- - - - +
+

Login

+ +
+ +
-
+ + + -
Username + + +
-
- -
- - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
User Name: -
Password: -

-
- Login -
-
- -
-
-
- Try password 'xxx' for user 'uid:0' to access the .NET StockTrader Web Application. -
-
-
-
-
- First time user?  Please Register! -


-
-
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - -erC \ No newline at end of file + + Password + + + + + + + + + + + + + + +

Try password "xxx" for user "uid:0" to access the stock trader web application.

+

+ First time user? +

+
+ \ No newline at end of file Index: trader_client/Trade/Login.aspx.cs =================================================================== --- trader_client/Trade/Login.aspx.cs (revision 768313) +++ trader_client/Trade/Login.aspx.cs (working copy) @@ -36,14 +36,8 @@ ///
public partial class Login : System.Web.UI.Page { - protected override void OnLoad(EventArgs e) + protected void LoginButton_Click(object sender, EventArgs e) { - Date.Text = DateTime.Now.ToString("f"); - if (IsPostBack) processLogin(); - } - - protected void processLogin() - { 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); } } } Index: trader_client/Trade/Logout.aspx =================================================================== --- trader_client/Trade/Logout.aspx (revision 768313) +++ trader_client/Trade/Logout.aspx (working copy) @@ -1,31 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="false" EnableSessionState="True" EnableViewState="false" EnableEventValidation="false" CodeFile="Logout.aspx.cs" Inherits="Trade.Web.Logout" %> - - - - - - .NET StockTrader Logout - - -
-
- Thank you for using the .NET Stock Trader! -
-
- - Index: trader_client/Trade/Logout.aspx.cs =================================================================== --- trader_client/Trade/Logout.aspx.cs (revision 768313) +++ trader_client/Trade/Logout.aspx.cs (working copy) @@ -1,51 +0,0 @@ -// -// 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. -// - -// .NET StockTrader Sample WCF Application for Benchmarking, Performance Analysis and Design Considerations for Service-Oriented Applications - -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.WebControls; -using Trade.StockTraderWebApplicationSettings; -using Trade.StockTraderWebApplicationServiceClient; - -namespace Trade.Web -{ - /// - /// Performs logout. - /// - public partial class Logout : System.Web.UI.Page - { - protected override void OnLoad(EventArgs e) - { - HttpCookie authcookie = Request.Cookies[FormsAuthentication.FormsCookieName]; - FormsAuthenticationTicket ticket = (FormsAuthenticationTicket)FormsAuthentication.Decrypt(authcookie.Value); - if (User.Identity.IsAuthenticated) - { - string userid = User.Identity.Name; - BSLClient businessServicesClient = new BSLClient(); - businessServicesClient.logout(userid); - Response.Cookies.Remove(FormsAuthentication.FormsCookieName); - FormsAuthentication.SignOut(); - } - Response.Redirect(Settings.PAGE_LOGIN, true); - } - } -} \ No newline at end of file Index: trader_client/Trade/Order.aspx =================================================================== --- trader_client/Trade/Order.aspx (revision 768313) +++ trader_client/Trade/Order.aspx (working copy) @@ -1,5 +1,9 @@ -<%@ Register TagPrefix="controls" TagName="Header" Src = "Controls/Header.ascx" %> - - -<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" EnableEventValidation="false" CodeFile="Order.aspx.cs" Inherits="Trade.Web.Order" %> -<%@ Import Namespace="Trade.StockTraderWebApplicationModelClasses" %> - - - - -.NET StockTrader New Order - - - - -
-
- - - - - - - - - - -

- - - - - -
New Order
-
- - - - - - - - - - - - -

- - - - -<%if (!badQuantity){%> - - - - - - - - - - - - - - - - - - - - -<%} %> - -
- Order ID - Order Status - Creation Date - Completion Date - Txn Fee - Type - Symbol - Quantity
- - - - - - - -



-
- - - - - -

- - - - - -
- -
- Get Quote
-
-
-
-
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - - \ No newline at end of file +*/ %> + + + +
+

New Order

+ +
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Order IDOrder StatusCreation DateCompletion DateTxn FeeTypeSymbolQuantity
+ + + + + + + +
+
+ +
+ + +
+ +
\ No newline at end of file Index: trader_client/Trade/Order.aspx.cs =================================================================== --- trader_client/Trade/Order.aspx.cs (revision 768313) +++ trader_client/Trade/Order.aspx.cs (working copy) @@ -36,64 +36,61 @@ /// 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.

"); 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 Index: trader_client/Trade/Portfolio.aspx =================================================================== --- trader_client/Trade/Portfolio.aspx (revision 768313) +++ trader_client/Trade/Portfolio.aspx (working copy) @@ -1,5 +1,10 @@ -<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src = "Controls/ClosedOrders.ascx" %> - - -<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" EnableEventValidation="false" CodeFile="Portfolio.aspx.cs" Inherits="Trade.Web.Portfolio" %> -<%@ Import Namespace="System.Text"%> - - - - -.NET StockTrader Portfolio - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - -
Portfolio Information
-
-
-
- +*/ %> + + + + + +
+

Portfolio Information

+ +
+ +
+ - - + + -
Current Number of Holdings: Sort and Subtotal By Stock - + Current Number of Holdings:  + + + Sort and Subtotal By Stock +
-
- - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + + + +
- Holding ID - Purchase
Date
- Symbol - Quantity - Purchase
Price
- Current
Price
- Purchase
Basis
- Market
Value
- Gain(Loss) - Trade
Holding IDPurchase
Date
SymbolQuantityPurchase
Price
Current
Price
Purchase
Basis
Market
Value
Gain(Loss)Trade
- <%# 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") %> -
+ <%# 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") %> +
Totals<%=String.Format("{0:C}",totalHoldings.basis) %><%=String.Format("{0:C}",totalHoldings.marketValue)%><%=String.Format("{0:C}",totalHoldings.gainWithArrow)%>
Totals<%=String.Format("{0:C}",totalHoldings.basis) %><%=String.Format("{0:C}",totalHoldings.marketValue)%><%=totalHoldings.gainWithArrow%> 
-

- - - - - -

- - - - - -
- -
- Get Quote
-
-
-
-
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - - \ No newline at end of file + + + +
+ + +
+ + \ No newline at end of file Index: trader_client/Trade/Portfolio.aspx.cs =================================================================== --- trader_client/Trade/Portfolio.aspx.cs (revision 768313) +++ trader_client/Trade/Portfolio.aspx.cs (working copy) @@ -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); Index: trader_client/Trade/PortfolioBySymbol.aspx =================================================================== --- trader_client/Trade/PortfolioBySymbol.aspx (revision 768313) +++ trader_client/Trade/PortfolioBySymbol.aspx (working copy) @@ -1,5 +1,10 @@ -<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src = "Controls/ClosedOrders.ascx" %> - - -<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" EnableEventValidation="false" CodeFile="PortfolioBySymbol.aspx.cs" Inherits="Trade.Web.PortfolioBySymbol" %> -<%@ Import Namespace="System.Text"%> - - - - -Portfolio Holdings By Stock - - - - -
-
- - - - - - - - - - - - - - - - - <%# 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") %> - - - - - - - - - - -

- - - - - -
Portfolio By Symbol
-
-
-
- - - - -
Current Number of Unique Stocks Held:  Sort By Purchase Date
-
- - - - - - - - - - - - - - - - - +*/ %> + + + + + +
+

Portfolio Information

+ +
+ + + +
- Holding ID - Purchase
Date
- Symbol - Quantity - Purchase
Price
- Current
Price
- Purchase
Basis
- Market
Value
- Gain(Loss) - Trade
+ + + + + + + + + + + + + + + + + + + + + +
+ Current Number of Unique Stocks Held:  + + + Sort by Purchase Date +
Holding IDPurchase
Date
SymbolQuantityPurchase
Price
Current
Price
Purchase
Basis
Market
Value
Gain(Loss)Trade
+ -
Totals<%=String.Format("{0:C}",totalHoldings.basis) %><%=String.Format("{0:C}",totalHoldings.marketValue)%><%=String.Format("{0:C}",totalHoldings.gainWithArrow)%>
- - - - -
- - - - - - - - - -

- - - - - -
- -
- Get Quote
-
-
- - - -
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - - \ No newline at end of file + + + + + + + + <%# 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") %> + + + + + +   +   + <%# Eval("quoteID") %> + <%# Eval("quantity", "{0:0,0}") %> +   + <%# Eval("quotePrice", "{0:C}")%> + <%# Eval("basis", "{0:C}")%> + <%# Eval("marketValue","{0:C}")%> + <%# Eval("gain")%> +   + + + + + +
+ + +
+ + \ No newline at end of file Index: trader_client/Trade/PortfolioBySymbol.aspx.cs =================================================================== --- trader_client/Trade/PortfolioBySymbol.aspx.cs (revision 768313) +++ trader_client/Trade/PortfolioBySymbol.aspx.cs (working copy) @@ -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 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(); + } + } } } Index: trader_client/Trade/Quotes.aspx =================================================================== --- trader_client/Trade/Quotes.aspx (revision 768313) +++ trader_client/Trade/Quotes.aspx (working copy) @@ -1,5 +1,11 @@ -<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src = "Controls/ClosedOrders.ascx" %> - - -<%@ 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" %> - - - - -.NET StockTrader Quotes - - - - -
-
- - - - - - - - - - - - - - - - - - -

- - - - - -
Stock Quotes
-
-
-
- - - - - - - - - - - - - <% if (quoteList !=null) - { - for (int i = 0; i < quoteList.Count; i++) - { - %> - - - - -
- Symbol - Company - Volume - Price Range - Open Price - Current Price - Gain(Loss) - Trade
+*/ %> + + + + + +
+

Stock Quotes

+ +
+ + + + + + + + + + + + + + + + <% if (quoteList !=null) + { + for (int i = 0; i < quoteList.Count; i++) + { + %> + + - - - - - - - - - <%} - }%> + + <%} + }%> + +
SymbolCompanyVolumePrice RangeOpen PriceCurrent PriceGain(Loss)Trade
<%=quoteList[i].quoteLink%> + <%=quoteList[i].companyName%> + <%=quoteList[i].volume.ToString("N")%> + <%=quoteList[i].low.ToString("C")%> - <%=quoteList[i].high.ToString("C")%> + <%=quoteList[i].open.ToString("C")%> + <%=quoteList[i].price.ToString("C")%> + <%=quoteList[i].gainWithArrow%> + Buy
-



-
- - - - - -

- - - - - -
- -
- Get Quote
-
-
-
-
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - - \ No newline at end of file +
+ + +
+ \ No newline at end of file Index: trader_client/Trade/Quotes.aspx.cs =================================================================== --- trader_client/Trade/Quotes.aspx.cs (revision 768313) +++ trader_client/Trade/Quotes.aspx.cs (working copy) @@ -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 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 Index: trader_client/Trade/ReadMe.mht =================================================================== --- trader_client/Trade/ReadMe.mht (revision 768313) +++ trader_client/Trade/ReadMe.mht (working copy) @@ -1,2475 +0,0 @@ -MIME-Version: 1.0 -Content-Type: multipart/related; boundary="----=_NextPart_01C9B796.6A9EA8D0" - -This document is a Single File Web Page, also known as a Web Archive file. If you are seeing this message, your browser or editor doesn't support Web Archive files. Please download a browser that supports Web Archive, such as Windows® Internet Explorer®. - -------=_NextPart_01C9B796.6A9EA8D0 -Content-Location: file:///C:/EA821A05/ReadMe.htm -Content-Transfer-Encoding: quoted-printable -Content-Type: text/html; charset="us-ascii" - - - - - - - - - - - - - - - - - - - - -
- -
- -

Stonehenge/Apache .Net ReadMe

- -
- -

Getting Started

- -

Stonehenge .Net StockTrader for -Apache is a subset and fork of Microsoft's .NET= - StockTrader Sample Application on MSDN. The or= -iginal -StockTrader can be used as a reference. It is l= -ocated -at h= -ttp://msdn.microsoft.com/en-us/netframework/bb499684.aspx. - A main difference is that this -version does NOT include the configuration management features of the MSDN = -.Net -StockTrader. Configuration is done manually. The -expected audience is an experienced developer with knowledge of C# and SOA = -with -WCF.

- -

Install instructions for Stonehenge/Apache .Net <= -span -class=3DSpellE>StockTrader.

- -

1.= -      = - Get -software from https://svn.apache.org/repos/asf/incubator/stonehenge/trunk/s= -tocktrader/dotnet/

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -a.   &nb= -sp;  -I recommend you use ank= -hSVN -and open project from VisualStudio

- -

2.= -      = - As -a prerequisite you should

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -a.   &nb= -sp;  -Install .net 3.5 SP1

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -b.   &nb= -sp;  -IIS - Web Service Role with Static Content -feature enabled

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -c.   &nb= -sp;  -Install SQL Server 2008 with mixed mode -authentication

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -d.   &nb= -sp;  -Enable the sa -account with a password.

- -

i.= -      = -   -You will need to edit the SetupActions.exe.config -file to add that password later

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -e.   &nb= -sp;  -Install asp.net 3.5 

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;           -f.   &nb= -sp;  -If you setup IIS before this you may need to= - run -setup\util\servicemodelreg64.cmd (or servicemod= -el.cmd -if you run 32 bit)

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -g.   &nb= -sp;  -Optional: You may want to enable network -discovery so you can browse to shares with code. this -may not be needed for a single server install but if you are going to use m= -ore -than one machine then this is a good option.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -h.   &nb= -sp;  -Install Visual Studio 2008

- -

3.= -      = - Seed -the database and create accounts

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -a.   &nb= -sp;  -In the directory: -C:\StockTraderDemo\setup_utilities\SetupActions

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -b.   &nb= -sp;  -Edit the .config= - file -to set the right "dbPassword" for the sa account.  This is App.c= -onfig -in your solution. When you build it is renamed to [program name].exe.config.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -c.   &nb= -sp;  -Set the dbserver -variable to point to your MSSQL instance. You might be able to set it to &q= -uot;." for the simplest -case. If you use SQLExpress or a named instance= - it -will be different (eg. “.\SQLExpress<= -/span>”).

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -d.   &nb= -sp;  -Compile the project

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -e.   &nb= -sp;  -From a console run SetupActions.exe (with -elevated privilege - i.e. run as admin)

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;           -f.   &nb= -sp;  -Open ports 8000 and 9000 on your firewall. - -

i.= -      = -   -Control Panel->Windows -Firewall->"Allow a program through the fire wall"

- -

ii= -.      = - You -will get to a dialog, choose exceptions Tab

- -

ii= -i.      Click -Add Port

- -

iv= -.     Name -it "8000" and put 8000 in the port Number field

- -

v.= -      = - Ok

- -

vi= -.     Repeat -for 9000

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -g.   &nb= -sp;  -Refresh the password in the trade account s/= -b 'yyy'

- -

i.= -      = -   -In Microsoft SQL Server Management Studio - -

ii= -.      = - Security->Logins->Trade

- -

ii= -i.      Right -click on trade->properties

- -

iv= -.     Edit -password

- -

4.= -      = - In -IIS manager , Under Default Website, Add a Virtual Application  for TRADE and point it to -C:\StockTraderDemo\trader_client\trade

- -

5.= -      = - Installing -a Test Certificate per Documentation\Configuration.pdf page 49.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -a.   &nb= -sp;  -Install three certificates: \\[stocktrader -installation dir]\setup utilities\util\stocktra= -derpfxfile.pfx, -BSLClient.pfx, OPSHost.pfx

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -b.   &nb= -sp;  -Use mmc -->Certificates and choose Computer account (to access the computer accou= -nt -you will need to start mmc as an administrator)= -

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -c.   &nb= -sp;  -Now, open the Certificates Folder, and then = -open -the Trusted People folder.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -d.   &nb= -sp;  -Right click on the Trusted People folder, and -choose All Tasks, Import.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -e.   &nb= -sp;  -This brings up the Import wizard.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;           -f.   &nb= -sp;  -Choose Next, then= - click -Browse.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -g.   &nb= -sp;  -Make sure to change the displayed file types= - to -“Personal Information Exchange (*.pfx; *p12) file types.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -h.   &nb= -sp;  -Browse to and select the \[stocktrader -installation dir]\setup_utilities\util\stocktraderpfxfile.pfx -file.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;            -i.   &nb= -sp;  -Click Next.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;           -j.   &nb= -sp;  -You will be prompted for a password.  The password is ‘yyy’. This is the StockTra= -der -db password NOT the sa -password.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -k.   &nb= -sp;  -Click Next, Next and Finish to -import the certificate to the \local computer\Trusted People certifi= -cate -store.

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;            -l.   &nb= -sp;  -Repeat for BSLClient.pfx, OPSHost.pfx -certificates

- -

6.= -      = - Build -The solutions - It is expected that you have Visual Studio 2008 installed - -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -a.   &nb= -sp;  -It is strongly recommended you use this tree -structure or else you will have to change the post build commands

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -b.   &nb= -sp;  -Build in order

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -c.   &nb= -sp;  -OrderProcessorSolution.sln

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -d.   &nb= -sp;  -BusinessServiceSolution.sln

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -e.   &nb= -sp;  -StockTraderWebAppSolution.sln

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;           -f.   &nb= -sp;  -Binaries are copied by build to order_processor\bin\Debug, busin= -ess_service\bin\Debug, -trade_client\bin\Debug respectively

- -

7.= -      = - To -run 

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -a.   &nb= -sp;  -You will need to create a virtual application -directory for our web app. (Step 4 above)

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -b.   &nb= -sp;  -Default setup will be M= -sec_http -(all config files will be in sync for this)

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;          -c.   &nb= -sp;  -In a console (with elevated privilege - i.e.= - run -as admin), In the ..\order_= -processor\bin\Debug -directory run  Trade.OrderProcessorConsoleHost.exe

- -

i.&n= -bsp;       -Con= -sole -App should remain open and active (do not exit application!)

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -d.   &nb= -sp;  -In a console(with -elevated privilege - i.e. run as admin), in the   ..\business_service\bin\Debug directory run - Trade.BusinessServiceConsole.exe

- -

i.&n= -bsp;       -Con= -sole -App should remain open and active (do not exit application!)

- -

&nbs= -p;            &= -nbsp;           &nbs= -p;            &= -nbsp;         -e.   &nb= -sp;  -In a browser, run the Web app http://localhost/trade/

- -

II= -.      Configuration: -

- -

You must have a configuration setup to use StockTr= -ader

- -

As built this StockTrader = -version -supports four modes of operation. These are configurable via the config files in the C directories listed below

- -

·         -"Http_WebService_MSecurity= -": -This is WS* with security and is the Default Configuration

- -

·         -"Http_WebService&qu= -ot;: -This is normal HTTP.

- -

·         -InProcess": In -this mode all the processes run inside the web application process.

- -

·         -"Http_WSO= -2_WebService_MSecurity": -This is a hook left for various connections with WSO2 components. [Is this -deprecated since the WSO2 implementation is WS-* compliant now isn’t = -it? -If so shouldn’t the document state that this is deprecated and should= - not -be used?]

- -

 

- -

To change a configuration:

- -

In general you edit the configurations, save them and -restart the applications

- -
Http_WebService_MSecurity: This is the defa= -ult -configuration and the config files are setup ou= -t of -the box to use this.
- -

·         -Edit the \trader_client= -\Trade\Web.config   

- -

<add key=3D"ACCESS_MODE" value= -=3D"Http_WebService_MSecurity"/>

- -

<add key=3D"ORDER_PROCESSING_MODE&quo= -t; -value=3D"ASync_Http_MSecurity"/> - -

·         -Edit the -\business_service\bin\debug\Trade.BusinessServiceConsole.exe.config

- -

<add key=3D"ORDER_PROCESSING_MODE" value= -=3D"ASync_Http_MSecurity" />

- -

·         -Edit the -\order_processor\bin\debug\Trade.OrderProcessorConsoleHost.exe.config

- -

<add key=3D"ORDER_PROCESSING_MODE" value= -=3D"ASync_Http_MSecurity" />

- -
Http_WebService:
- -

·         -Edit the \trader_client= -\Trade\Web.config   

- -

<add key=3D"ACCESS_MODE" value= -=3D"Http_WebService"/>

- -

<add key=3D"ORDER_PROCESSING_MODE&quo= -t; -value=3D"ASync_Http"/>

- -

·         -Edit the \business_service\bin\debug\Trade.B= -usinessServiceConsole.exe.config

- -

<add key=3D"ORDER_PROCESSING_MODE" value= -=3D"ASync_Http" />

- -

·         -Edit the \order_processor\bin\debug\Trade.Or= -derProcessorConsoleHost.exe.config

- -

<add key=3D"ORDER_PROCESSING_MODE" value= -=3D"ASync_Http" />

- -

 

- -
InProcess:  In this mode all the proce= -sses -run inside the web application process. (Note you can have alternate -combinations of configuration modes between Business Service Layer and Order -Processing Service in these modes)
- -

·         -Edit the \trader_client= -\Trade\Web.config   

- -

<add key=3D"ACCESS_MODE" value= -=3D"Http_InProcess"/>

- -

<add key=3D"ORDER_PROCESSING_MODE&quo= -t; -value=3D"Sync_Inprocess"/>

- -

·         -Edit the\business_service\bin\debug\Trade.Bu= -sinessServiceConsole.exe.config

- -

<add key=3D"ORDER_PROCESSING_MODE" value= -=3D" Sync_Inprocess" />

- -

·         -Edit the \order_processor\bin\debug\Trade.Or= -derProcessorConsoleHost.exe.config

- -

<add key=3D"ORDER_PROCESSING_MODE" value= -=3D" Sync_Inprocess" />

- -

 

- -
Http_WSO2_WebService_MSecurity: This is left for hooks into various -connections with WSO2 components.
- -

These are place holders f= -or -any WSO2 configuration desired.

- -

·         -Edit the \trader_client= -\Trade\Web.config   

- -

<add key=3D"ACCESS_MODE" -value=3D"Http_WebService_WSO2_MSecurity"/>

- -

<add key=3D"ORDER_PROCESSING_MODE&quo= -t; -value=3D"ASync_WSO2_Http_MSecurity"/>

- -

·         -Edit the \business_service\bin\debug\Trade.B= -usinessServiceConsole.exe.config

- -

<add key=3D"ORDER_PROCESSING_MODE" -value=3D"ASync_WSO2_Http_MSecurity" />

- -

·         -Edit the \order_processor\bin\debug\Trade.Or= -derProcessorConsoleHost.exe.config

- -

<add key=3D"ORDER_PROCESSING_MODE" -value=3D"ASync_WSO2_Http_MSecurity" />

- -

 

- -
- - - - - -------=_NextPart_01C9B796.6A9EA8D0 -Content-Location: file:///C:/EA821A05/ReadMe_files/item0001.xml -Content-Transfer-Encoding: quoted-printable -Content-Type: text/xml - - -------=_NextPart_01C9B796.6A9EA8D0 -Content-Location: file:///C:/EA821A05/ReadMe_files/props0002.xml -Content-Transfer-Encoding: quoted-printable -Content-Type: text/xml - - - -------=_NextPart_01C9B796.6A9EA8D0 -Content-Location: file:///C:/EA821A05/ReadMe_files/themedata.thmx -Content-Transfer-Encoding: base64 -Content-Type: application/vnd.ms-officetheme - -UEsDBBQABgAIAAAAIQCCirwT+gAAABwCAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKyRy2rDMBBF -94X+g9C22HK6KKXYzqJJd30s0g8Y5LEtao+ENAnJ33fsuFC6CC10IxBizpl7Va6P46AOGJPzVOlV -XmiFZH3jqKv0++4pu9cqMVADgyes9AmTXtfXV+XuFDApmaZU6Z45PBiTbI8jpNwHJHlpfRyB5Ro7 -E8B+QIfmtijujPXESJzxxNB1+SoLRNegeoPILzCKx7Cg8Pv5DCSAmAtYq8czYVqi0hDC4CywRDAH -an7oM9+2zmLj7X4UaT6DF9jNBDO/XGD1P+ov5wZb2A+stkfp4lx/xCH9LdtSay6Tc/7Uu5AuGC6X -t7Rh5r+tPwEAAP//AwBQSwMEFAAGAAgAAAAhAKXWp+fAAAAANgEAAAsAAABfcmVscy8ucmVsc4SP -z2rDMAyH74W9g9F9UdLDGCV2L6WQQy+jfQDhKH9oIhvbG+vbT8cGCrsIhKTv96k9/q6L+eGU5yAW -mqoGw+JDP8to4XY9v3+CyYWkpyUIW3hwhqN727VfvFDRozzNMRulSLYwlRIPiNlPvFKuQmTRyRDS -SkXbNGIkf6eRcV/XH5ieGeA2TNP1FlLXN2Cuj6jJ/7PDMMyeT8F/ryzlRQRuN5RMaeRioagv41O9 -kKhlqtQe0LW4+db9AQAA//8DAFBLAwQUAAYACAAAACEAa3mWFoMAAACKAAAAHAAAAHRoZW1lL3Ro -ZW1lL3RoZW1lTWFuYWdlci54bWwMzE0KwyAQQOF9oXeQ2TdjuyhFYrLLrrv2AEOcGkHHoNKf29fl -44M3zt8U1ZtLDVksnAcNimXNLoi38Hwspxuo2kgcxSxs4ccV5ul4GMm0jRPfSchzUX0j1ZCFrbXd -INa1K9Uh7yzdXrkkaj2LR1fo0/cp4kXrKyYKAjj9AQAA//8DAFBLAwQUAAYACAAAACEAlrWt4pYG -AABQGwAAFgAAAHRoZW1lL3RoZW1lL3RoZW1lMS54bWzsWU9v2zYUvw/YdyB0b2MndhoHdYrYsZst -TRvEboceaYmW2FCiQNJJfRva44ABw7phhxXYbYdhW4EW2KX7NNk6bB3Qr7BHUpLFWF6SNtiKrT4k -Evnj+/8eH6mr1+7HDB0SISlP2l79cs1DJPF5QJOw7d0e9i+teUgqnASY8YS0vSmR3rWN99+7itdV -RGKCYH0i13Hbi5RK15eWpA/DWF7mKUlgbsxFjBW8inApEPgI6MZsablWW12KMU08lOAYyN4aj6lP -0FCT9DZy4j0Gr4mSesBnYqBJE2eFwQYHdY2QU9llAh1i1vaAT8CPhuS+8hDDUsFE26uZn7e0cXUJ -r2eLmFqwtrSub37ZumxBcLBseIpwVDCt9xutK1sFfQNgah7X6/W6vXpBzwCw74OmVpYyzUZ/rd7J -aZZA9nGedrfWrDVcfIn+ypzMrU6n02xlsliiBmQfG3P4tdpqY3PZwRuQxTfn8I3OZre76uANyOJX -5/D9K63Vhos3oIjR5GAOrR3a72fUC8iYs+1K+BrA12oZfIaCaCiiS7MY80QtirUY3+OiDwANZFjR -BKlpSsbYhyju4ngkKNYM8DrBpRk75Mu5Ic0LSV/QVLW9D1MMGTGj9+r596+eP0XHD54dP/jp+OHD -4wc/WkLOqm2chOVVL7/97M/HH6M/nn7z8tEX1XhZxv/6wye//Px5NRDSZybOiy+f/PbsyYuvPv39 -u0cV8E2BR2X4kMZEopvkCO3zGBQzVnElJyNxvhXDCNPyis0klDjBmksF/Z6KHPTNKWaZdxw5OsS1 -4B0B5aMKeH1yzxF4EImJohWcd6LYAe5yzjpcVFphR/MqmXk4ScJq5mJSxu1jfFjFu4sTx7+9SQp1 -Mw9LR/FuRBwx9xhOFA5JQhTSc/yAkArt7lLq2HWX+oJLPlboLkUdTCtNMqQjJ5pmi7ZpDH6ZVukM -/nZss3sHdTir0nqLHLpIyArMKoQfEuaY8TqeKBxXkRzimJUNfgOrqErIwVT4ZVxPKvB0SBhHvYBI -WbXmlgB9S07fwVCxKt2+y6axixSKHlTRvIE5LyO3+EE3wnFahR3QJCpjP5AHEKIY7XFVBd/lbobo -d/ADTha6+w4ljrtPrwa3aeiINAsQPTMR2pdQqp0KHNPk78oxo1CPbQxcXDmGAvji68cVkfW2FuJN -2JOqMmH7RPldhDtZdLtcBPTtr7lbeJLsEQjz+Y3nXcl9V3K9/3zJXZTPZy20s9oKZVf3DbYpNi1y -vLBDHlPGBmrKyA1pmmQJ+0TQh0G9zpwOSXFiSiN4zOq6gwsFNmuQ4OojqqJBhFNosOueJhLKjHQo -UcolHOzMcCVtjYcmXdljYVMfGGw9kFjt8sAOr+jh/FxQkDG7TWgOnzmjFU3grMxWrmREQe3XYVbX -Qp2ZW92IZkqdw61QGXw4rxoMFtaEBgRB2wJWXoXzuWYNBxPMSKDtbvfe3C3GCxfpIhnhgGQ+0nrP -+6hunJTHirkJgNip8JE+5J1itRK3lib7BtzO4qQyu8YCdrn33sRLeQTPvKTz9kQ6sqScnCxBR22v -1VxuesjHadsbw5kWHuMUvC51z4dZCBdDvhI27E9NZpPlM2+2csXcJKjDNYW1+5zCTh1IhVRbWEY2 -NMxUFgIs0Zys/MtNMOtFKWAj/TWkWFmDYPjXpAA7uq4l4zHxVdnZpRFtO/ualVI+UUQMouAIjdhE -7GNwvw5V0CegEq4mTEXQL3CPpq1tptzinCVd+fbK4Ow4ZmmEs3KrUzTPZAs3eVzIYN5K4oFulbIb -5c6vikn5C1KlHMb/M1X0fgI3BSuB9oAP17gCI52vbY8LFXGoQmlE/b6AxsHUDogWuIuFaQgquEw2 -/wU51P9tzlkaJq3hwKf2aYgEhf1IRYKQPShLJvpOIVbP9i5LkmWETESVxJWpFXtEDgkb6hq4qvd2 -D0UQ6qaaZGXA4E7Gn/ueZdAo1E1OOd+cGlLsvTYH/unOxyYzKOXWYdPQ5PYvRKzYVe16szzfe8uK -6IlZm9XIswKYlbaCVpb2rynCObdaW7HmNF5u5sKBF+c1hsGiIUrhvgfpP7D/UeEz+2VCb6hDvg+1 -FcGHBk0Mwgai+pJtPJAukHZwBI2THbTBpElZ02atk7ZavllfcKdb8D1hbC3ZWfx9TmMXzZnLzsnF -izR2ZmHH1nZsoanBsydTFIbG+UHGOMZ80ip/deKje+DoLbjfnzAlTTDBNyWBofUcmDyA5LcczdKN -vwAAAP//AwBQSwMEFAAGAAgAAAAhAA3RkJ+2AAAAGwEAACcAAAB0aGVtZS90aGVtZS9fcmVscy90 -aGVtZU1hbmFnZXIueG1sLnJlbHOEj00KwjAUhPeCdwhvb9O6EJEm3YjQrdQDhOQ1DTY/JFHs7Q2u -LAguh2G+mWm7l53JE2My3jFoqhoIOumVcZrBbbjsjkBSFk6J2TtksGCCjm837RVnkUsoTSYkUigu -MZhyDidKk5zQilT5gK44o49W5CKjpkHIu9BI93V9oPGbAXzFJL1iEHvVABmWUJr/s/04GolnLx8W -Xf5RQXPZhQUoosbM4CObqkwEylu6usTfAAAA//8DAFBLAQItABQABgAIAAAAIQCCirwT+gAAABwC -AAATAAAAAAAAAAAAAAAAAAAAAABbQ29udGVudF9UeXBlc10ueG1sUEsBAi0AFAAGAAgAAAAhAKXW -p+fAAAAANgEAAAsAAAAAAAAAAAAAAAAAKwEAAF9yZWxzLy5yZWxzUEsBAi0AFAAGAAgAAAAhAGt5 -lhaDAAAAigAAABwAAAAAAAAAAAAAAAAAFAIAAHRoZW1lL3RoZW1lL3RoZW1lTWFuYWdlci54bWxQ -SwECLQAUAAYACAAAACEAlrWt4pYGAABQGwAAFgAAAAAAAAAAAAAAAADRAgAAdGhlbWUvdGhlbWUv -dGhlbWUxLnhtbFBLAQItABQABgAIAAAAIQAN0ZCftgAAABsBAAAnAAAAAAAAAAAAAAAAAJsJAAB0 -aGVtZS90aGVtZS9fcmVscy90aGVtZU1hbmFnZXIueG1sLnJlbHNQSwUGAAAAAAUABQBdAQAAlgoA -AAAA - -------=_NextPart_01C9B796.6A9EA8D0 -Content-Location: file:///C:/EA821A05/ReadMe_files/colorschememapping.xml -Content-Transfer-Encoding: quoted-printable -Content-Type: text/xml - - - -------=_NextPart_01C9B796.6A9EA8D0 -Content-Location: file:///C:/EA821A05/ReadMe_files/filelist.xml -Content-Transfer-Encoding: quoted-printable -Content-Type: text/xml; charset="utf-8" - - - - - - - - - -------=_NextPart_01C9B796.6A9EA8D0-- Index: trader_client/Trade/Register.aspx =================================================================== --- trader_client/Trade/Register.aspx (revision 768313) +++ trader_client/Trade/Register.aspx (working copy) @@ -1,5 +1,8 @@ -<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" CodeFile="Register.aspx.cs" EnableEventValidation="false" Inherits="Trade.Web.Register" %> - - - - - - -.NET StockTrader Register - - - - -
-
- - +*/ %> + + + + +
+

Register

+ +
+ +
+ + + + + + + + + - - - - -
+ Create Account Profile: +
+ +
.NET StockTrader - Apache Stonehenge Incubator Project
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - -
Register
-

- - - - - - + - + - + - + - + - + - + - + - + + + +
-
-
-
Requested User ID: Opening Balance:
Full Name: Email Address:
Address: Password:
Credit Card: Confirm Password:
-
Register
-
+
+ +
@@ -124,27 +95,7 @@
-
-
-
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - - \ No newline at end of file + + \ No newline at end of file Index: trader_client/Trade/Register.aspx.cs =================================================================== --- trader_client/Trade/Register.aspx.cs (revision 768313) +++ trader_client/Trade/Register.aspx.cs (working copy) @@ -35,18 +35,8 @@ /// 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 { Index: trader_client/Trade/Site.master =================================================================== --- trader_client/Trade/Site.master (revision 0) +++ trader_client/Trade/Site.master (revision 0) @@ -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. + +*/ %> + + + + + + Apache Stonehenge StockTrader Welcome + + + + + +
+
+ + +
+ + +
+ +
+
+ + + Index: trader_client/Trade/Site.master.cs =================================================================== --- trader_client/Trade/Site.master.cs (revision 0) +++ trader_client/Trade/Site.master.cs (revision 0) @@ -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); + } + } +} Index: trader_client/Trade/StockTrade.aspx =================================================================== --- trader_client/Trade/StockTrade.aspx (revision 768313) +++ trader_client/Trade/StockTrade.aspx (working copy) @@ -1,5 +1,9 @@ -<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src = "Controls/ClosedOrders.ascx" %> - - -<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" EnableEventValidation="false" CodeFile="StockTrade.aspx.cs" Inherits="Trade.Web.StockTrade" %> - - - - -.NET StockTrader Trade - - - - -
-
- - - - - - - - - - - - - - - - - - -

- - - - - -
Trade
-
-





-
Trade Confirmation
-
- - - - - - - - - - -
- -
- Number of Shares: - - 100 - -
Buy
-
-
Cancel
-
- + + + + + +
+

Trade

+ +
+ +
+

Trade Confirmation

+
+ + +

You have requested to buy shares of + which is currently trading at .

+ +
Number of Shares: + + +
+ + +






-
- - - - - -

- - - - - -
- -
- Get Quote
-
-
-
-
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - - \ No newline at end of file + Type="Integer"> + + + + +

You have requested to sell all or part of your holding . + This holding has a total of shares of stock + . + Please indicate how many shares to sell.

+ +
Number of Shares: + + +
+ + + +
+ + + +

You performed an invalid action please return to the previous page and try again.

+ + +
+ + + + +
+ + +
+ + \ No newline at end of file Index: trader_client/Trade/StockTrade.aspx.cs =================================================================== --- trader_client/Trade/StockTrade.aspx.cs (revision 768313) +++ trader_client/Trade/StockTrade.aspx.cs (working copy) @@ -34,54 +34,78 @@ protected void Page_Load(object sender, EventArgs e) { - Date.Text = DateTime.Now.ToString("f"); string userid = HttpContext.Current.User.Identity.Name; BSLClient businessServicesClient = new BSLClient(); - string action = Input.InputText(Request["action"], 5); - string returnUrl = Input.InputText(Request["return"], 25); - if (action == StockTraderUtility.ORDER_TYPE_BUY) + string action = Input.InputText(Request["action"], 5) ?? string.Empty; + + if (action.Equals(StockTraderUtility.ORDER_TYPE_BUY, StringComparison.InvariantCultureIgnoreCase)) { + this.InvalidActionPanel.Visible = false; + this.BuyPanel.Visible = true; + string quoteSymbol = Input.InputText(Request["symbol"], StockTraderUtility.QUOTESYMBOL_MAX_LENGTH); QuoteDataUI quote = businessServicesClient.getQuote(quoteSymbol); - LinkButtonBuy.PostBackUrl = Settings.PAGE_ORDER + "?action=buy" + "&symbol=" + quote.symbol; - LinkButtonCancel.PostBackUrl = LinkButtonCancel.PostBackUrl + "?symbols=" + quoteSymbol; - TradeOperation.Text = "You have requested to buy shares of " + quote.quoteLink + " which is currently trading at " + quote.priceWithArrow; + + this.Symbol.Value = quoteSymbol; + this.BuySymbol.Text = quote.quoteLink; + this.BuyCurrentPrice.Text = quote.price.ToString("C"); + + this.CancelBuy.PostBackUrl = Settings.PAGE_QUOTES + "?symbols=" + quoteSymbol; } - else + else if (action.Equals(StockTraderUtility.ORDER_TYPE_SELL, StringComparison.InvariantCultureIgnoreCase)) { - LinkButtonCancel.PostBackUrl = returnUrl; - string holdingID = Request["holdingid"]; - int holdingid = Convert.ToInt32(holdingID); - if (action == StockTraderUtility.ORDER_TYPE_SELL) + this.InvalidActionPanel.Visible = false; + this.SellPanel.Visible = true; + + this.CancelSell.PostBackUrl = GetReturnUrl(); + + string holdingIdString = Request["holdingid"]; + this.HoldingId.Text = holdingIdString; + int holdingId; + if (Int32.TryParse(holdingIdString, out holdingId)) { - if (Settings.interfaceMode == StockTraderUtility.ACCESS_WSAS_Http_WebService - || Settings.interfaceMode == StockTraderUtility.ACCESS_PHP_Http_WebService) - { - TradeOperation.Text = "You have requested to sell your holding " + holdingID + ". Please confirm this request."; - //indicate for postback we are running against WebSphere Trade 6.1 which does not implement the functionality/business logic - //to sell a portion of a holding--only the entire holding can be sold at once. - quantity.Text = "-1"; - quantity.Visible = false; - LinkButtonBuy.Text = "Sell"; - LinkButtonBuy.PostBackUrl = Settings.PAGE_ORDER + "?action=sell" + "&holdingid=" + holdingID; - } - else - { - HoldingDataUI holding = businessServicesClient.getHolding(userid, holdingid); - StringBuilder strBldr = new StringBuilder("You have requested to sell all or part of your holding "); - strBldr.Append(holdingID); - strBldr.Append(". This holding has a total of "); - strBldr.Append(holding.quantity); - strBldr.Append(" shares of stock "); - strBldr.Append(holding.quoteID); - strBldr.Append(". Please indicate how many shares to sell."); - TradeOperation.Text = strBldr.ToString(); - quantity.Text = holding.quantity; - LinkButtonBuy.Text = "Sell"; - LinkButtonBuy.PostBackUrl = Settings.PAGE_ORDER + "?action=sell" + "&holdingid=" + holdingID; - } + HoldingDataUI holding = businessServicesClient.getHolding(userid, holdingId); + + this.HoldingQuantity.Text = holding.quantity; + this.HoldingSymbol.Text = holding.quoteID; + + SellQuantityRangeValidator.MaximumValue = holding.quantity; + SellQuantity.Text = holding.quantity; } } + else + { + this.InvalidActionButton.PostBackUrl = GetReturnUrl(); + } } + + protected void Buy_Click(object sender, EventArgs e) + { + Response.Redirect(Settings.PAGE_ORDER + "?action=" + StockTraderUtility.ORDER_TYPE_BUY + + "&symbol=" + this.Symbol.Value + + "&quantity=" + this.BuyQuantity.Text); + } + + protected void Sell_Click(object sender, EventArgs e) + { + Response.Redirect(Settings.PAGE_ORDER + "?action=" + StockTraderUtility.ORDER_TYPE_SELL + + "&holdingid=" + this.HoldingId.Text + + "&quantity=" + this.SellQuantity.Text); + } + + private string GetReturnUrl() + { + string returnUrl = Input.InputText(Request["return"], 25) ?? string.Empty; + if (!string.IsNullOrEmpty(returnUrl)) + { + return returnUrl; + } + + if (Request.UrlReferrer != null) + { + return Request.UrlReferrer.ToString(); + } + return Settings.PAGE_QUOTES; + } } } \ No newline at end of file Index: trader_client/Trade/StockTrader.css =================================================================== --- trader_client/Trade/StockTrader.css (revision 768313) +++ trader_client/Trade/StockTrader.css (working copy) @@ -1,1045 +0,0 @@ -Body.StockTraderBodyStyle -{ -font-family: Arial; -font-size:10pt; -vertical-align:middle; -text-align:center; -} - -FORM -{ - margin:0; -} - -A -{ - color: #336699; - text-decoration: none; -} - -A:hover -{ - color: #222b62; - text-decoration: underline; -} - -A.MktSummary -{ - color: #222b62; - text-decoration: none; -} - -A.Config:hover -{ - color: #314154; - text-decoration: underline; -} - -A.Config -{ - color: #000000; - text-decoration: underline; -} - -A.Config2:hover -{ - color: #FFFFFF; - text-decoration: underline; - font-size:12px; -} - -A.Config2 -{ - color: #000000; - text-decoration: underline; - font-size:12px; -} - -A.Config1:hover -{ - color: #FFFFFF; - text-decoration: none; - font-size:12px; -} - -A.Config1 -{ - color: #000000; - text-decoration: none; - font-size:12px; -} - -A.MktSummary:hover -{ - color: #336699; - text-decoration: none; -} - -A.Button -{ - color:Black; -} - -A.Button:hover -{ - color:White; - text-decoration:none; -} - -LI.Mainline -{ - padding-left: 5px; - font-weight: bold; - padding-right:4px; - font-size:12px; -} - -LI.Subline -{ - list-style-position: outside; - margin-left: 10px; - list-style-type: circle; - padding-right:8px; -} - -Table.HeaderTableStyle -{ - height:63px; - background-image:url(Images/header_main.jpg); - background-repeat:no-repeat; - border-collapse: collapse; - border:none; - width: 800px; - color: #000000; - font-size: large; - margin:0; -} - -DIV.InvalidLogin -{ - color: #990000; - text-align:center; -} - -Table.MenuTableStyle -{ - font-family: Arial; - background-image:url(Images/button_bg.jpg); - background-position:top-left; - background-repeat:no-repeat; - text-align: center; - border-collapse: collapse; - width: 800px; -} - -TD.Menu -{ -width:92px; -height: 30px; -padding-top:15px; -text-align: center; -vertical-align:top; -font-weight:bold; -font-size:9pt; -} - -Table.TradeHomeTableStyle -{ - border: none; - border-collapse: collapse; - background-image:url(Images/table_bg.jpg); - background-position:top-center; - background-repeat:repeat; - width: 800px; -} - -TD.NameStyle -{ -text-align:center; -font-size:15px; -color:#003f5f; -} - -DIV.ConfirmStyle -{ -text-align:center; -font-size:16px; -color:#003f5f; -font-weight:bold; -} - -Table.StockTradeTableStyle -{ - border-collapse:collapse; - width:350px; - background-color:#c7c4af; - border-right: #949493 4px outset; - border-top: #949493 4px outset; - border-left: #949493 4px outset; - border-bottom: #949493 4px outset; -} - -TD.AccountSubHeadStyle -{ -font-size:14px; -color:#003f5f; -width:350; -} - -Table.AccountTableStyle -{ - border-collapse: collapse; - width: 720px; - background-color: #c7c4af; - border-right: #949493 4px outset; - border-top: #949493 4px outset; - border-left: #949493 4px outset; - border-bottom: #949493 4px outset; -} - -Table.LoginTableStyle -{ - border-collapse: collapse; - width: 720px; - background-color: #c7c4af; - border-right: #949493 4px outset; - border-top: #949493 4px outset; - border-left: #949493 4px outset; - border-bottom: #949493 4px outset; -} - -Table.SubHeaderTableStyle -{ - border:none; - background-color: #112e58; - border-collapse: collapse; - width: 790px; - color: #000000; - margin: 0; -} - -TH.TodaysDateStyle -{ -font-family:Arial; -text-align:right; -font-size:12px; -color:#ffffff; -padding-right:10px; -} - -TH.SubHeaderStyle -{ - text-align:left; - padding-left:10px; - vertical-align:top; - font-size:20px; - height:20px; - border-collapse: collapse; - margin:0; - color:#ffffff; -} - -TH.InnerHeading -{ - background-color: #818287; - font-size: 12px; - text-align: center; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; -} - -TH.InnerHeading2 -{ - background-color: #000000; - color:#d4d8db; - font-size: 8pt; - text-align: center; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; -} - -TH.InnerHeading3 -{ - background-color: #000000; - color:#d4d8db; - font-size: 14pt; - text-align: center; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; -} - -TD.InnerData -{ - font-size: 12px; - background-color: #c7c4af; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; - padding-right: 3px; -} - -TH.InnerDataTotal -{ - background-color: #dddccf; - font-size: 12px; - text-align: right; - padding-right: 3px; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; -} - -TH.InnerDataSubtotal -{ - font-size: 12px; - background-color: #1c1c1a; - color:#d4d8db; - padding-right: 3px; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; -} - -TD.SubHeaderStyle2 -{ - text-align:left; - vertical-align:top; - color: #000000; - font-size:16px; - padding-left:55px; - padding-right:4px; - width: 320px; -} - -TD.DataHeadersStyle -{ - text-align:right; - padding-left: 5px; - font-weight: normal; - font-size: 14px; - color: #000000; - width:170px; -} - -TD.DataLabelsStyle -{ - text-align:left; - padding-left: 5px; - font-size: 14px; - font-weight: normal; - color: #000000; - width:160px; -} - -TD.DataLabelsStyle1 -{ - width: 140px; - font-size: 12px; - text-align: left; - font-weight: normal; - color: #000000; - border-bottom: #b0b7b8 1px solid; - border-top: #b0b7b8 1px solid; - padding-left: 6px; -} - -TD.AccountDataHeaderStyle1 -{ - padding-right:3px; - border-bottom:solid 1px black; - border-top:solid 1px black; - border-left:solid 1px black; - border-right:solid 1px black; - width: 136px; - text-align:right; -} - -TD.AccountDataLabelStyle1 -{ - padding-left:3px; - border-bottom:solid 1px black; - border-top:solid 1px black; - border-left:solid 1px black; - border-right:solid 1px black; - text-align:left; -} -TD.AccountDataHeaderStyle2 -{ - padding-right:3px; - border-bottom:solid 1px black; - border-top:solid 1px black; - border-left:solid 1px black; - border-right:solid 1px black; - text-align:right; - width: 236px; -} - -TD.AccountDataLabelStyle2 -{ - border-bottom:solid 1px black; - border-top:solid 1px black; - border-left:solid 1px black; - border-right:solid 1px black; - text-align:left; - padding-left:3px; -} - -Table.TechnologiesTableStyle -{ - font-family: Arial; - font-size: 10px; - border-collapse:collapse; - border-style:solid; - border-width: medium; - border-color: #112e58; - background-color: #ffffff; - text-align:left; - vertical-align:middle; -} - -Table.GetQuotesTableStyle -{ - border-collapse: collapse; - width:800px; - border:0px; - border-collapse:collapse; -} - -Table.FooterTableStyle -{ - border-collapse: collapse; - background-image:url(Images/footer_main.jpg); - background-position:top; - background-repeat:no-repeat; - width: 800px; - -} - -Table.QuotesTableStyle -{ - - width: 670px; - color: #000000; - font-size: small; - border-collapse:collapse; -} - -Table.PortfolioTableStyle -{ - background-color: #e1dfc7; - width: 720px; - color: #000000; - font-size: small; - border-collapse:collapse; -} - -Table.ConfigTableStyle -{ - - width: 650px; - color: #000000; - font-size: small; - border-right: #000000 2px solid; - border-left: #000000 2px solid; - border-top: #000000 2px solid; - border-bottom: #000000 2px solid; - border-collapse: collapse; -} - -Table.TermsTableStyle -{ - - width: 650px; - color: #000000; - font-size: small; - border-right: #000000 2px solid; - border-left: #000000 2px solid; - border-top: #000000 2px solid; - border-bottom: #000000 2px solid; - border-collapse: collapse; -} - -Table.ConfigUpdateTableStyle -{ - - width: 700px; - color: #000000; - font-size: small; - border-right: #000000 1px solid; - border-left: #000000 1px solid; - border-top: #000000 1px solid; - border-bottom: #000000 1px solid; - border-collapse: collapse; -} - -Table.HostUpdateTableStyle -{ - - width: 650px; - color: #000000; - border-right: #000000 2px solid; - border-left: #000000 2px solid; - border-top: #000000 2px solid; - border-bottom: #000000 2px solid; - border-collapse: collapse; -} - -Table.ConnectionPointTableStyle -{ - - width: 700px; - color: #000000; - font-size: 12px; - border-right: #000000 1px solid; - border-left: #000000 1px solid; - border-top: #000000 1px solid; - border-bottom: #000000 1px solid; - border-collapse: collapse; -} - -Table.ServiceTableStyle -{ - - width: 760px; - color: #000000; - font-size: small; - border-right: #000000 2px solid; - border-left: #000000 2px solid; - border-top: #000000 2px solid; - border-bottom: #000000 2px solid; - border-collapse: collapse; -} - -Table.ConfigServiceTableStyle -{ - width: 100px; - color: #000000; - text-align:center; - font-size: small; - border-right: #000000 2px solid; - border-left: #000000 2px solid; - border-top: #000000 2px solid; - border-bottom: #000000 2px solid; - border-collapse: collapse; -} - -Table.NodeServiceTableStyle -{ - width: 600px; - color: #000000; - text-align:center; - font-size: small; - border-right: #000000 2px solid; - border-left: #000000 2px solid; - border-top: #000000 2px solid; - border-bottom: #000000 2px solid; - border-collapse: collapse; -} - -TD.TradeServiceTDStyle -{ - border-top: #000000 1px solid; - border-left: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right: #000000 1px solid; - padding-bottom: 3px; - padding-right: 6px; - padding-left: 6px; - vertical-align: middle; - text-align: left; - font-size: 12px; - background-color: #c6d4cc; -} - -TD.TradeServiceTDStyle3 -{ - border-top: #000000 1px solid; - border-left: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right: #000000 1px solid; - padding-bottom: 3px; - padding-right: 6px; - padding-left: 6px; - vertical-align: middle; - text-align: left; - font-size: 12px; - background-color: #959ba2; -} - -TD.TradeHostServiceTDStyle -{ - border-top: #000000 1px solid; - border-left: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right: #000000 1px solid; - padding-bottom: 3px; - padding-right: 6px; - padding-left: 6px; - vertical-align: middle; - text-align: right; - font-size: 12px; - background-color: #959ba2; -} - -TD.TradeHostServiceTDStyle2 -{ - border-top: #000000 1px solid; - border-left: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right: #000000 1px solid; - padding-bottom: 3px; - padding-right: 6px; - padding-left: 6px; - vertical-align: middle; - text-align: left; - font-size: 12px; - background-color: #959ba2; -} - - -TD.TradeConfigTDStyle -{ - - border-top: #000000 1px solid; - border-left: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right : #000000 1px solid; - padding-bottom:3px; - padding-right:3px; - padding-left:3px; - vertical-align:middle; - text-align:left; - font-size:9px; - -} - -TD.TradeConfigTDNameStyle -{ - border-top: #000000 1px solid; - border-left: #000000 1px solid; - border-right: #000000 1px solid; - padding-bottom: 3px; - padding-right: 3px; - padding-left: 3px; - vertical-align: middle; - text-align: center; - font-size: 15px; - color: #000000; -} - -TD.TradeConfigTDStyle2 -{ - border-top: #000000 1px solid; - border-left: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right : #000000 1px solid; - padding-bottom:3px; - padding-right:6px; - padding-left:6px; - vertical-align:middle; - text-align:left; - font-size:11px; - width:300px; -} - -TH.TradeConfigTHStyle -{ - border-top: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right: #a0a1a2 1px solid; - border-left: #414141 1px solid; - border-collapse: collapse; - background-color: #72768e; - color: #d4d8db; - font-size: 9pt; - text-align: center; - padding-bottom: 10px; - padding-top: 10px; - padding-right: 3px; - vertical-align: middle; -} - -TH.TradeConfigTHStyle2 -{ - border-top: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right: #a0a1a2 1px solid; - border-left: #414141 1px solid; - border-collapse: collapse; - background-color: #000000; - color: white; - font-size: 9pt; - text-align: center; - padding-bottom: 10px; - padding-top: 10px; - padding-right: 6px; - padding-left: 6px; - vertical-align: middle; -} - -TH.TradeConfigTHStyle3 -{ - border-top: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right: #a0a1a2 1px solid; - border-left: #414141 1px solid; - border-collapse: collapse; - background-color: #000000; - color: white; - font-size: 10px; - text-align: center; - padding-bottom: 10px; - padding-top: 10px; - padding-right: 6px; - padding-left: 6px; - vertical-align: middle; -} - - -TD.TradeConfigNotesTDStyle -{ - width:670px; - text-align:center; - font-size:8pt; - padding-left: 60pt; - padding-right: 60pt; -} - -TD.OrderAlertControlStyle -{ - width:770px; - text-align:center; -} - -Table.OrderAlertTableStyle -{ - - width: 720px; - font-size: small; - border-collapse:collapse; -} - -Table.OrderConfirmTableStyle -{ - - width: 700px; - font-size: small; - border-collapse:collapse; - - -} - -TD.OrderAlertMessageStyle -{ - color: #cc0000; - text-align: center; - padding-top: 12px; - padding-bottom: 12px; -} - -TD.OrderConfirmMessageStyle -{ - color: #003f5f; - text-align: center; - padding-top: 12px; - padding-bottom: 12px; -} - -TD.TradeTermsTDStyleLeft -{ - border-top: #000000 1px solid; - border-left: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right: #000000 1px solid; - padding-bottom:3px; - padding-right:3px; - padding-left:6px; - vertical-align:middle; - text-align:right; - font-size:10pt; - width:150px; - font-weight:bold; -} - -TD.TradeTermsTDStyleRight -{ - border-top: #000000 1px solid; - border-left: #000000 1px solid; - border-bottom: #000000 1px solid; - border-right: #000000 1px solid; - padding-bottom:3px; - padding-right:6px; - padding-left:6px; - text-align:left; - vertical-align:middle; - text-align:left; - font-size:10pt; - width:550px; -} - -TD.HeaderLeftStyle -{ -width: 470px; -vertical-align:middle; -text-align:left; -font-size:larger; -color:#d4d8db; -padding-left:4px; -font-weight:bold; -} - -TD.HeaderRightStyle -{ - width: 226px; - padding-right: 4px; - text-align: center; - vertical-align: middle; - font-size: small; - color: #e9eaea; - font-weight: bold; -} - -TD.FooterLeftStyle -{ - width:579px; - height:60px; - padding-top:10px; - padding-left:10px; - vertical-align:top; - text-align:left; - font-size:medium; - color:#d4d8db; - font-weight:bold; -} - -TD.FooterRightStyle -{ - text-align:center; - padding-top:10px; - vertical-align:top; - color: #d4d8db; - font-size:small; - width: 211px; - font-weight: bold; -} -TD.FooterCopyRightStyle -{ - text-align:center; - font-size:x-small; -} - - - -Table.MarketSummaryControlTableStyle -{ - border-collapse:collapse; -} - -Table.MarketSummaryControlGainersLosersTableStyle -{ - font-family: Arial; - border-collapse: collapse; - border-right: gainsboro thick outset; - border-top: gainsboro thick outset; - border-left: gainsboro thick outset; - border-bottom: gainsboro thick outset; - background-color: #bbc6e4; - width: 190px; -} - -TH.MarketSummaryInnerHeading -{ - background-color: #23254d; - font-size: 11px; - text-align: center; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; - padding-left: 4px; - font-weight:lighter; - padding-right: 4px; - color: #e1e1d9; -} - -TD.MarketSummaryInnerData -{ - font-size: 11px; - text-align: center; - background-color: #c1c1bf; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; - padding-left: 6px; - padding-right: 6px; -} - -TH.MarketSummaryHeader -{ - background-color: #a8a79d; - font-size: 12px; - text-align: center; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; - padding-left: 6px; - padding-right: 6px; -} - -TD.MarketSummaryMasterHeader -{ -background-color:#000000; -font-size: 10pt; -color:#d4d8db; -font-weight:bolder; -text-align:center; -} - -TD.MarketSummaryLeftSubHeader -{ - font-size: 9pt; - text-align: center; - vertical-align: middle; - background-color: #c7c4af; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; - padding-left: 16px; - padding-right: 16px; -} - -TD.MarketSummaryGainerLoserHeader -{ - font-size: 9pt; - text-align: center; - vertical-align: middle; - background-color: #c7c4af; - padding-left: 16px; - padding-right: 16px; - border-right: #50525b 1px solid; - border-top: #50525b 1px solid; - border-left: #50525b 1px solid; - border-bottom: #50525b 1px solid; - padding-top: 8px; -} - -TD.ConfigText -{ - text-align:left; - font-size:11px; - padding-left:85px; - padding-right:85px -} - -DIV.LinkButtonStyle -{ - height: 18px; - width: 60px; - font-size: 9pt; - padding-top: 4px; - margin: top 4px; - font-weight: bolder; - padding-left: 6px; - margin: bottom 4px; - vertical-align: middle; - background-color: #b3c2cc; - text-align: left; - color: #d4d8db; - border-right: black 1px groove; - border-top: black 1px groove; - border-left: black 1px groove; - border-bottom: black 1px groove; -} - -DIV.LinkButtonQuoteStyle -{ - height: 18px; - width: 60px; - font-size: 9pt; - padding-top: 4px; - margin: top 4px; - font-weight: bolder; - padding-left: 6px; - margin: bottom 4px; - vertical-align: middle; - background-color: #b3c2cc; - text-align: left; - color: #d4d8db; - border-right: black 1px groove; - border-top: black 1px groove; - border-left: black 1px groove; - border-bottom: black 1px groove; -} - -DIV.LinkButtonTradeStyle -{ - height: 18px; - width: 50px; - font-size: 9pt; - padding-top: 4px; - margin: top 4px; - font-weight: bolder; - padding-left: 6px; - margin: bottom 4px; - vertical-align: middle; - background-color: #b3c2cc; - text-align: left; - color: #d4d8db; - border-right: black 1px groove; - border-top: black 1px groove; - border-left: black 1px groove; - border-bottom: black 1px groove; -} - -DIV.LinkButtonRegStyle -{ - height: 20px; - width: 55px; - font-size: 9pt; - padding-top: 4px; - margin: top 4px; - font-weight: bolder; - padding-left: 7px; - margin: bottom 4px; - vertical-align: middle; - background-color: #b3c2cc; - text-align: left; - color: #d4d8db; - border-right: black 1px groove; - border-top: black 1px groove; - border-left: black 1px groove; - border-bottom: black 1px groove; -} - -DIV.LinkButtonRegisterStyle -{ - height: 18px; - width: 60px; - font-size: 9pt; - padding-top: 4px; - margin: top 4px; - font-weight: bolder; - padding-left: 30px; - margin: bottom 4px; - vertical-align: middle; - background-color: #b3c2cc; - text-align: left; - color: #d4d8db; - border-right: black 1px groove; - border-top: black 1px groove; - border-left: black 1px groove; - border-bottom: black 1px groove; -} - Index: trader_client/Trade/style.css =================================================================== --- trader_client/Trade/style.css (revision 0) +++ trader_client/Trade/style.css (revision 0) @@ -0,0 +1,436 @@ +/* + * 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. + */ +body { + background-image: url(images/bg.png); + background-repeat: repeat-x; + background-position: left top; + background-attachment: scroll; + font-size: 11px; + font-family: Verdana, Arial, Helvetica, san-serif; + padding: 0px; + margin: 0px auto; +} + +p { } + +h3 { + margin-top:5px; + font-size: 16px; + font-weight: normal; + color: #F47B20; +} + +td { } + +a:link { + color: #0054A6; + text-decoration: none; +} + +a:visited { + +} + +a:hover { + text-decoration: underline; +} + +a:active { } + +input { + border-left: solid 1px #999; + border-bottom: solid 1px #333; + border-right: solid 1px #333; + border-top: solid 1px #999; + margin-right: 7px; +} +input.button { + background-image: url(images/button-bg.gif); + background-repeat: repeat-x; + background-position: left top; + background-attachment: scroll; + border-left: solid 1px #FDBB30; + border-bottom: solid 2px #F47B20; + border-right: solid 2px #F47B20; + border-top: solid 1px #FDBB30; + height: 22px; + font-weight: bold; + padding-left: 10px; + padding-right: 10px; + cursor: pointer; +} + +input[type="password"], input[type="textbox"], textarea { + font-family:sans-serif; +} + +td { + vertical-align: top; +} + +div#content { + width: 902px; + margin: 0px auto; + margin-top: 15px; +} +div#header { + background-image: url(images/header-bg.png); + background-repeat: no-repeat; + background-position: left top; + background-attachment: scroll; + background-color: #fff; + height: 57px; +} +div#header div.logo { + float: left; + margin-top: 0px; + margin-left: 20px; +} +div#header div.powered { + float: right; + margin-top: 10px; + margin-right: 20px; +} +div#header-links { + border-left: solid 2px #1D4774; + border-right: solid 2px #1D4774; + height: 35px; + padding-left: 70px; + padding-right: 20px; + padding-top: 0px; + background-color: #fff; + background-image: url(images/header-links-bg.png); + background-repeat: no-repeat; + background-position: left top; +} +div#header-links table { + height: 30px; + width: 765px; +} +div#header-links table td { +} +div#header-links table td a { + display: block; + text-align:center; + text-decoration: none; + color: #fff; + padding-left: 15px; + padding-right: 15px; + padding-top: 7px; + background-image: url(images/header-link-bg.png); + background-repeat: repeat-x; + background-position: 0px 0px; + height: 23px; + font-size: 12px; + font-weight: bold; +} +div#header-links table td a:hover { + background-position: 0px -30px; +} +div#middle { + background-image: url(images/middle-bg.png); + background-repeat: repeat-y; + background-position: left top; + background-attachment: scroll; + background-color: #fff; + min-height: 300px; + padding-left: 40px; + padding-right: 40px; + padding-top: 20px; + padding-bottom: 20px; +} +div#middle div.main-title { + border-bottom: solid 1px #1D4774; + text-align: right; + vertical-align: bottom; + height: 30px; + margin-bottom: 20px; +} +div#middle div.main-title h1{ + margin-top: 0px; + padding-top: 0px; + font-size: 22px; + color: #1D4774; + float: left; +} +div#middle div.main-title span.time { +} +div.left { + width: 400px; + float: left; +} +div.right { + border: solid 1px #1D4774; + margin-left: 40px; + width: 373px; + float: right; +} +div.right p { + padding-left: 10px; + padding-right: 10px; +} +div.right h3{ + margin: 0px; + background-color: #1D4774; + color: #fff; + padding: 5px; + font-size: 12px; +} + +div.login { + text-align: center; +} +div.login table { + margin: auto; + font-size: 12px; +} +div.login table td { + padding:4px; +} +div.login p.new-user { + font-size: 12px; + font-weight: bold; +} +div.quotes { + text-align: center; + width: auto; + margin: auto; +} + + +div#middle table.normal { + margin-bottom: 20px; +} +div#middle table.normal tr{ + text-align: left; + font-size: 12px; +} +div#middle table.normal tr th { + font-size: 12px; + border-bottom: solid 1px #333; + border-left: 0px; + border-right: 0px; + border-top: 0px; + padding-bottom: 3px; + color: #1D4774; + text-align:left; +} +div#middle table.normal tr td.special { + text-align: right; + padding-top: 3px; + vertical-align: top; +} + +div#middle table.normal tr td.special a { + color: #1D4774; +} + + +table.table-inner { + border: solid 1px #999; + width: 100%; +} +table.table-inner tr td,th{ + border: solid 1px #333; + padding: 5px; +} +table.table-inner tr th { + background-color: #999; + color: #fff; +} +table.table-inner tbody tr td { + background-color: #ccc; + text-align: right; +} + +table.table-outer { + border: solid 0px #333; + width: auto; +} +table.table-outer tr td,th{ + border: solid 1px #fff; + padding: 5px; +} +table.table-outer thead tr th { + background-color: #999; + border: solid 1px #fff; + color: #fff; + padding: 3px; +} +table.table-outer tbody tr td { + background-color: #ededed; + text-align: center; +} +table.table-outer tbody tr td.special { + background-color: #ccc; + font-weight: bold; + text-align: left; +} +table.table-outer tbody tr td.currency { + text-align: right; +} +table.table-outer tbody tr td.nobr { + white-space:nowrap; +} + +table.table-outer tbody tr.total td, table.table-outer tfoot tr.total th { + background-color: #BCBEC0; + font-weight: bold; + text-align: right; +} + +span.price { + color: #1D4774; +} +span.price-gain { + color: #1D4774; + background-image: url(images/green-arrow.gif); + background-repeat: no-repeat; + background-position: right top; + background-attachment: scroll; + padding-right: 17px; +} +span.price-loss { + color: #C0272D; + background-image: url(images/red-arrow.gif); + background-repeat: no-repeat; + background-position: right bottom; + background-attachment: scroll; + padding-right: 17px; +} +table.profile { + border: solid 1px #1D4774; + width: 100%; + margin-top: 15px; + background-color: #ededed; +} +table.profile tr td,th{ + padding: 2px; +} +table.profile thead tr th { + color: #1D4774; + border-bottom: solid 1px #1D4774; + font-size: 12px; + padding: 5px; +} +table.profile tbody tr td { + background-color: #ededed; + text-align: right; +} +table.profile tbody tr td.button { + text-align: center; + padding: 7px; +} +table.profile-content { + width: auto; + margin-bottom: 10px; +} +table.profile-content tbody tr td { + padding: 5px; + border: solid 1px #999; +} +table.profile-content tbody tr td.left { + color: #1D4774; +} + +table.glossary { + width: 80%; + background-color: #ccc; +} +table.glossary thead tr th { + background-color: #666; + color: #fff; + border: 0px; + padding: 5px; +} +table.glossary tbody tr td { + background-color: #fff; + padding: 5px; +} +table.glossary td.left { + font-weight: bold; +} +div#confirm { + margin-top: 7%; + margin-bottom: 7%; + width: 60%; + margin-left: auto; + margin-right: auto; +} +div#confirm h2 { + color: #1D4774; + text-align: center; + font-size: 18px; +} +div#confirm div.confirm-content { + background-color: #B9C3CD; + border-top: solid 1px #1D4774; + border-left: solid 1px #1D4774; + border-right: solid 2px #1D4774; + border-bottom: solid 2px #1D4774; + padding-top: 10px; + padding-bottom: 20px; + padding-left: 20px; + padding-right: 20px; + text-align: center; +} +div.bottom { + margin-top: 10px; + border-top: solid 1px #1D4774; + padding-top: 10px; + padding-bottom: 0px; + text-align: center; + vertical-align: middle; +} +div#footer { + background-image: url(images/footer-bg.png); + background-repeat: no-repeat; + background-position: left top; + background-attachment: scroll; + background-color: #fff; + height: 30px; + padding-top: 25px; + padding-left: 20px; + color: #1D4774; +} +a img { + border: none; +} + + +/* ClearFix +------------------*/ +.clearfix:after { + content: "."; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; +} + +.clearfix { + display: inline-block; +} + +html[xmlns] .clearfix { + display: block; +} + +* html .clearfix { + height: 1%; +} \ No newline at end of file Index: trader_client/Trade/TradeHome.aspx =================================================================== --- trader_client/Trade/TradeHome.aspx (revision 768313) +++ trader_client/Trade/TradeHome.aspx (working copy) @@ -1,5 +1,10 @@ -<%@ Register TagPrefix="controls" TagName="MarketSummary" Src = "Controls/MarketSummary.ascx" %> - - -<%@ Register TagPrefix="controls" TagName="ClosedOrders" Src = "Controls/ClosedOrders.ascx" %> -<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" CodeFile="TradeHome.aspx.cs" EnableEventValidation="false" Inherits="Trade.Web.TradeHome" %> - - - - -.NET StockTrader Home - - - - -
-
- - - - - - - - - - - - - - -

- - - - - -
Home
- - - - - - - - - - - - - - -
-
-
Welcome, -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
User Statistics -
- Account ID: -
- Account Created: -
- Total Logins: -
- Session Created: - -

- Account Summary
- Cash Balance: -
- Number of Holdings: -
- Total of Holdings: -
- Sum of Cash & Holdings -
- Opening Balance: -
- Current Gain/(Loss): -
- % Gain/(Loss): -
- - - -

-
- - - - - -

- - - - - -
- -
- Get Quote
-
-
-
-
-
- - - - - - - - - -
- Apache Stonehenge Incubator Project - .NET StockTrader

- Created with Visual Studio and the Microsoft .NET Framework 3.5 -
- - - \ No newline at end of file +*/ %> + + + + + +
+

Home

+ +
+
+
+

Welcome

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Statistics
Account ID: + +
Account Created: + +
Total Logins: + +
Session Created: + +
Account Summary
Cash Balance: + +
Number of Holdings: + +
Total of Holdings: + +
Sum of Cash & Holdings + +
Opening Balance: + +
Current Gain/(Loss): + +
% Gain/(Loss): + +
+
+
+ +
+
+ + +
+ + +
+
\ No newline at end of file Index: trader_client/Trade/TradeHome.aspx.cs =================================================================== --- trader_client/Trade/TradeHome.aspx.cs (revision 768313) +++ trader_client/Trade/TradeHome.aspx.cs (working copy) @@ -35,7 +35,6 @@ { protected void Page_Load(object sender, EventArgs e) { - Date.Text = DateTime.Now.ToString("t"); decimal gain = (decimal)0.00; decimal percentGain = (decimal)0.00; TotalHoldingsUI totalHoldings; @@ -71,31 +70,25 @@ HoldingsTotal.Text = string.Format("{0:C}", totalHoldings.marketValue); decimal totalcashandholdings = totalHoldings.marketValue + customer.balance; SumOfCashHoldings.Text = string.Format("{0:C}", totalcashandholdings); + gain = totalcashandholdings - customer.openBalance; - string percentGainString = ""; if (customer.openBalance != 0) percentGain = gain / customer.openBalance * 100; else percentGain = 0; if (gain > 0) { - percentGainString = string.Format("{0:N}%" + Settings.UPARROWLINK, percentGain); - Gain.ForeColor = System.Drawing.Color.DarkGreen; - PercentGain.ForeColor = System.Drawing.Color.DarkGreen; + Gain.CssClass = Settings.GAINSTYLECSS; + PercentGain.CssClass = Settings.GAINSTYLECSS; } else if (gain < 0) { - percentGainString = string.Format("{0:N}%" + Settings.DOWNARROWLINK, percentGain); - Gain.ForeColor = System.Drawing.Color.DarkRed; - PercentGain.ForeColor = System.Drawing.Color.DarkRed; + Gain.CssClass = Settings.LOSSSTYLECSS; + PercentGain.CssClass = Settings.LOSSSTYLECSS; } - else - { - percentGainString = string.Format("{0:N}%", percentGain); - } Gain.Text = string.Format("{0:C}", gain); - PercentGain.Text = percentGainString; + PercentGain.Text = string.Format("{0:N}%", percentGain); ; } } } Index: trader_client/Trade/Web.config =================================================================== --- trader_client/Trade/Web.config (revision 768313) +++ trader_client/Trade/Web.config (working copy) @@ -1,5 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -