コード例 #1
0
        /// <summary>
        /// Write Client Order and Exchange Slices to database.
        /// </summary>
        public void writeOrderToDb()
        {
            foreach (string day in paras.getTradingDays())
            {
                fileMgr.setTradingDay(day);
                fileMgr.parseClientOrderFileAddress();
                ReportSenderMgr.SENDER.getExecReportSender().addDateToMail(day);

                foreach (string instanceId in fileMgr.getIntanceIds())
                {
                    Console.Out.Write("Handling Instance " + instanceId + " ");
                    logger.Info("Handling Instance " + instanceId + " of date " + day);
                    List <Order> instanceOrders = fileMgr.getInstanceOrders(instanceId);
                    foreach (Order order in instanceOrders)
                    {
                        order.computeMarketVariables();
                        order.validateOrderParas();
                    }

                    UpdatedCount updatedCount = StoredProcMgr.MANAGER.insUpdTrades(instanceOrders, instanceId);
                    ReportSenderMgr.SENDER.getExecReportSender().addInstanceToMail(
                        instanceId, updatedCount.getClientOrderCount(), updatedCount.getExchangeOrderCount());
                    Console.Out.WriteLine(updatedCount.getClientOrderCount() + " " + updatedCount.getExchangeOrderCount());
                }
                fileMgr.clear();
                Console.Out.WriteLine();
            }
        }