Author: drewbai
Date: Thu Jun 4 03:55:08 2009
New Revision: 781647
URL: http://svn.apache.org/viewvc?rev=781647&view=rev
Log:
Stonehenge-51 added info messages to console window
Modified:
incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeService.cs
incubator/stonehenge/trunk/stocktrader/dotnet/order_processor/OrderProcessorImplementation/ProcessOrder.cs
Modified:
incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeService.cs
URL:
http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeService.cs?rev=781647&r1=781646&r2=781647&view=diff
==============================================================================
---
incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeService.cs
(original)
+++
incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeService.cs
Thu Jun 4 03:55:08 2009
@@ -110,7 +110,7 @@
/// <param name="password">Password for authentication</param>
public AccountDataModel login(string userid, string password)
{
- Console.WriteLine("Entering Login");
+ Console.WriteLine("Logging in for " + userid);
//Create instance of a DAL, which could be designed for any type
of DB backend.
dalCustomer = Trade.DALFactory.Customer.Create(Settings.DAL);
@@ -155,7 +155,7 @@
dalCustomer.Open(Settings.TRADEDB_SQL_CONN_STRING);
try
{
- Console.WriteLine("Leaving Login");
+ Console.WriteLine("Leaving login for " + userid);
return dalCustomer.login(userid, password);
}
catch
@@ -180,6 +180,7 @@
try
{
dalCustomer.logOutUser(userID);
+ Console.WriteLine("Logging out for " + userID);
return;
}
catch
@@ -389,6 +390,7 @@
AccountDataModel newCustomer =
addNewRegisteredUser(userID, password, fullname, address, email, creditcard,
openBalance);
//Scope complete, commit work.
tx.Complete();
+ Console.WriteLine("New user has been
registered with userid: " + userID);
return newCustomer;
}
catch
@@ -417,6 +419,7 @@
AccountDataModel newCustomer =
addNewRegisteredUser(userID, password, fullname, address, email, creditcard,
openBalance);
//done, commit.
dalCustomer.CommitADOTransaction();
+ Console.WriteLine("New user has been
registered with userid: " + userID);
return newCustomer;
}
catch
@@ -477,6 +480,7 @@
dalCustomer.Open(Settings.TRADEDB_SQL_CONN_STRING);;
try
{
+ Console.WriteLine("Account profile updated for " +
profileData.userID);
return dalCustomer.update(profileData);
}
catch
@@ -635,8 +639,8 @@
processOrderSync(order, holding);
}
- //Commit!
tx.Complete();
+ Console.WriteLine("Order placed of type " +
orderType + " for the user " + userID + " in the quantity of " + quantity);
return order;
}
//If per chance you are doing step-through
debugging through here and are getting a
@@ -817,7 +821,8 @@
order.completionDate = DateTime.Now;
order.holdingID = holdingid;
dalOrder.closeOrder(order);
- //Done!
+
+ Console.WriteLine("Order has been processed synchronously");
return;
}
Modified:
incubator/stonehenge/trunk/stocktrader/dotnet/order_processor/OrderProcessorImplementation/ProcessOrder.cs
URL:
http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/order_processor/OrderProcessorImplementation/ProcessOrder.cs?rev=781647&r1=781646&r2=781647&view=diff
==============================================================================
---
incubator/stonehenge/trunk/stocktrader/dotnet/order_processor/OrderProcessorImplementation/ProcessOrder.cs
(original)
+++
incubator/stonehenge/trunk/stocktrader/dotnet/order_processor/OrderProcessorImplementation/ProcessOrder.cs
Thu Jun 4 03:55:08 2009
@@ -70,6 +70,7 @@
//Calculate order total, and create/update the Holding. Whole
holding
//sells delete the holding, partials sells update the holding
with new amount
//(and potentially the order too), and buys create a new
holding.
+
if (order.orderType == StockTraderUtility.ORDER_TYPE_BUY)
{
holdingid = dalOrder.createHolding(order);
@@ -109,7 +110,7 @@
order.holdingID = holdingid;
dalOrder.closeOrder(order);
//Done!
-
+ Console.WriteLine("The order of type " + order.orderType + "
and quantity " + order.quantity + " has been processed");
return;
}
catch