Hiblet/NewZopa01 — pull request #25 by Hiblet (2014-03-20 17:31:40+00:00)
Title: Order Handler in place; Accounts/ClOrdID on front end; More OrderHistory writes; Fixes;

FIXED: AsyncHttpHandlerOrders.cs
-- Was using the context in real time to get SessionID and Username,
-- now storing these details in BeginProcessRequest in the AOO.

FIXED: MarketManager.cs
-- Error in generateReport(), bad JSON format, now correct.

CHANGED: Prices.js
-- Market data dictionary field change: hfDictionary -> hfMarketDictionary.

CHANGED: Trading.aspx
-- Market data dictionary field change: hfDictionary -> hfMarketDictionary.
-- Hidden field hfAccounts added to store account data.
-- ddlAccount box added.
-- References to 'kawasu' in embedded function calls corrected.

CHANGED: Trading.aspx.cs
-- Market data dictionary field change: hfDictionary -> hfMarketDictionary.
-- Now writing list of valid accounts to hidden field on page_load, and
-- filling account box with data.
-- Increased logging in WebMethods for order book generation.
-- Fixed invalid cast error in getDefaultCutOffDate().
-- Added safety code around table mapping add to ensure no exception.
-- Removed commented out fn getTableToRender()

FIXED and CHANGED: Orders.js
-- Orders had no ClOrdID - now generated in getClOrdID().
-- Accounts now selectable via ddlAccount box.
-- Accounts scraped using new fn scrapeAccount().
-- Accounts selected from order data using setAccount() and resetAccount().
-- scrapeOrder() now populates tag11 with ClOrdID.
-- scrapeOrder() now calls scrapeAccount() to pull account into order.
-- Now always re-pulling history table after order submitted.
-- Drop Down List Box ddlAccount added.
-- References to sSubID changed to more correct sSymbol.
-- scrapeSymbol() changed to use .val() to scrape Symbol, not MarketName.
-- Added visibility code to new ddlAccount display.
-- Added validation to ddlAccount.
-- Added tag1Name for account
-- Changed console.log to console.error for errors.
-- Added setting of Timestamp at start to build ClOrdIDs.
-- Changed processing of order update message to use text value of
-- order status as well as numerical value to spot fills coming in.
-- Changed column name references when loading data into order ticket,
-- which were wrong because of column name changes in Trading.aspx.cs.
-- Removed commented out code.
-- Removed alert() on error, as this is blocked by browser anyway.

CHANGED: AsyncHttpHandlerOrders.cs
-- Changed the AOO to store sessionID and user as local members.
-- Stopped using _state for data, and now use _data.
-- Now logging the input stream that is pulled from the request.
-- Now no longer uses the user ID pulled from the message.
-- No longer rejecting if username is not present (using SessionUser).
-- Now logging session and user details on async task start.

CHANGED: AsyncHttpHandlerPrices.cs
-- Similar to AOO, using _data instead of _state.

CHANGED: OrderSubscriptionManager.cs
-- addOrdersToQueue()
-- -- records order in OrderHistory on creation.
-- -- sets the OrdStatus and SystemText
-- -- increased logging
-- -- triggers queue consumption on posting orders to queue
-- Subsribe() now uses member User and Session properties
-- Complies with AOO change, state -> data

CHANGED: PriceSubscriptionManager.cs
-- Complies with AOP change, state -> data

CHANGED: Order.cs;
-- Enum text change to comply with JavaScript to make life easier.
-- Added SystemText values.
-- Changed validation errors to use pipes, and then de-double pipe at end.

CHANGED: Market.cs; OrderQInDAL.cs; WorkingOrderDAL.cs
-- Comply with Enum OrdType change.

CHANGED: PositionLimit.cs
-- Uses delimiter hyphen instead of forward slash, as string.SqlSanitize()
-- was eating the slash.

CHANGED: FCUtils.js
-- Added getShortDateTimeString() to get compressed date string for ClOrdID

CHANGED: Web.Config
-- Added IIS handler entries for AsyncHttpHandlerOrders.

CHANGED: Trading.css
-- Added styling for ddlAccount box.

CHANGED: TableCreateScript.SQL ( both )
-- OrderHistory table now tolerant of nulls, to allow bad order writes.