public List <TradingDays> GetTradeingDays(DataTable dtTradingDays) { //================================================================================================== //Wind字段名 //trade_days //================================================================================================== try { List <TradingDays> tradingDayList = new List <TradingDays>(); if (dtTradingDays != null && dtTradingDays.Rows.Count > 0) { foreach (DataRow oRow in dtTradingDays.Rows) { TradingDays d = new TradingDays(); d.Trade_Days = Convert.ToDateTime(oRow[DBConsts.C_Mkt_ColumnName_Trade_Days]); tradingDayList.Add(d); } } //按时间倒序排列 tradingDayList.Sort(); return(tradingDayList); } catch (Exception ex) { throw ex; } }
public int CompareTo(object obj) { try { //Order by Trade_Days Desc TradingDays d = (TradingDays)obj; if (this.Trade_Days > d.Trade_Days) { return(-1); } else { return(1); } } catch (Exception ex) { throw ex; } }