public HugoDataSet.TradesRow[] GetAllAccountTrades(DateTime tradeDate) { try { // if tradeDate is today, use trades table maintained by asynchronous thread // otherwise, read it from Hugo if (tradeDate == DateTime.Today) { lock (m_tableLock) { if (m_trades != null) { return(m_trades.Select() as HugoDataSet.TradesRow[]); } else { return(new HugoDataSet.TradesRow[] { }); } } } else { return(GetAccountTrades(null, tradeDate)); } } catch (Exception e) { Error("Error in GetAllAccountPortfolios", e); return(null); } }
internal static HugoDataSet.TradesRow[] GetTradesForAccount(string acctName) { lock (s_tableLock) { if (s_trades != null) { return(s_trades.Select(String.Format("AcctName = '{0}'", acctName)) as HugoDataSet.TradesRow[]); } else { return new HugoDataSet.TradesRow[] { } }; } }