[Quantproject-developers] QuantProject/b3_Data/Selectors SelectorByGroup.cs,1.1,1.2
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-08-27 19:20:44
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/Selectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3761/b3_Data/Selectors Modified Files: SelectorByGroup.cs Log Message: Modified database's structure. New fields added to tickers_tickerGroups table. GetTableOfSelectedTickers in SelectorByGroup now selects tickers belonging to the specified group at a given date, when SelectorByGroup has been instantiated with a particular date. Index: SelectorByGroup.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/Selectors/SelectorByGroup.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SelectorByGroup.cs 29 Jul 2005 13:27:40 -0000 1.1 --- SelectorByGroup.cs 27 Aug 2005 19:20:26 -0000 1.2 *************** *** 31,48 **** { /// <summary> ! /// Class for selection on tickers by groupId /// </summary> public class SelectorByGroup : ITickerSelector { private string groupID; ! public SelectorByGroup( string groupID ) { this.groupID = groupID; ! } public DataTable GetTableOfSelectedTickers() { ! return QuantProject.DataAccess.Tables.Tickers_tickerGroups.GetTickers( this.groupID ); } public void SelectAllTickers() --- 31,71 ---- { /// <summary> ! /// Class for selection on tickers by groupId only or groupId and date /// </summary> public class SelectorByGroup : ITickerSelector { private string groupID; ! private DateTime date = new DateTime(1900,1,1); ! ! /// <summary> ! /// Creates an new instance of SelectorByGroup, in order ! /// to get tickers contained in the given group ! /// </summary> ! /// <param name="groupID">Group's code for which tickers are to be selected</param> public SelectorByGroup( string groupID ) { this.groupID = groupID; ! } ! ! /// <summary> ! /// Creates an new instance of SelectorByGroup, in order ! /// to get tickers contained in the given group ! /// </summary> ! /// <param name="groupID">Group's code for which tickers are to be selected</param> ! /// <param name="date">The date at which tickers to be selected belong effectively ! /// to the given group</param> ! public SelectorByGroup( string groupID, DateTime date ) ! { ! this.groupID = groupID; ! this.date = date; ! } public DataTable GetTableOfSelectedTickers() { ! if(this.date.CompareTo(new DateTime(1900,1,1)) == 0) ! //date has not be set by the user because it is still equal to default value ! return QuantProject.DataAccess.Tables.Tickers_tickerGroups.GetTickers( this.groupID ); ! else ! return QuantProject.DataAccess.Tables.Tickers_tickerGroups.GetTickers( this.groupID, this.date ); } public void SelectAllTickers() |