[Quantproject-developers] QuantDownloader/Downloader DataBaseImporter.cs,1.5,1.6 Downloader.csproj,1
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2004-04-17 14:16:38
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5867/Downloader Modified Files: DataBaseImporter.cs Downloader.csproj Main.cs Log Message: Modified DataBase importer Index: Main.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Main.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Main.cs 21 Mar 2004 16:39:58 -0000 1.7 --- Main.cs 17 Apr 2004 14:16:29 -0000 1.8 *************** *** 4,7 **** --- 4,8 ---- using System.ComponentModel; using System.Windows.Forms; + using QuantProject.Applications.Downloader.TickerSelectors; namespace QuantProject.Applications.Downloader Index: DataBaseImporter.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/DataBaseImporter.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DataBaseImporter.cs 21 Mar 2004 19:46:51 -0000 1.5 --- DataBaseImporter.cs 17 Apr 2004 14:16:29 -0000 1.6 *************** *** 3,6 **** --- 3,7 ---- using System.Data.OleDb; using System.IO; + using QuantProject.DataAccess.Tables; namespace QuantProject.Applications.Downloader *************** *** 40,43 **** --- 41,45 ---- } } + /* private void deleteExistingQuote(string tickerToDelete, DateTime dateOfQuoteToDelete) { *************** *** 46,63 **** if(this.overWriteExistingRecords == false) return; ! this.oleDbDataAdapter.DeleteCommand = new OleDbCommand("DELETE * FROM quotes " + ! "WHERE quTicker ='" + ! tickerToDelete + "' AND " + ! "quDate =#" + ! dateOfQuoteToDelete + "#"); ! this.oleDbDataAdapter.DeleteCommand.ExecuteNonQuery(); } catch(Exception ex) { - // no consequences if there are some lines that are not inserted (due to key violation) string notUsed = ex.ToString(); } } ! public void ImportTicker( string ticker ) --- 48,64 ---- if(this.overWriteExistingRecords == false) return; ! //this.oleDbDataAdapter.DeleteCommand = new OleDbCommand("DELETE * FROM quotes " + ! // "WHERE quTicker ='" + ! // tickerToDelete + "' AND " + ! // "quDate =#" + ! // dateOfQuoteToDelete + "#"); ! //this.oleDbDataAdapter.DeleteCommand.ExecuteNonQuery(); } catch(Exception ex) { string notUsed = ex.ToString(); } } ! */ public void ImportTicker( string ticker ) *************** *** 66,70 **** string[] LineIn; ! string strAccessSelect = "Select * from quotes where 1=2"; OleDbCommand myAccessCommand = new OleDbCommand( strAccessSelect , oleDbConnection ); --- 67,71 ---- string[] LineIn; ! /* string strAccessSelect = "Select * from quotes where 1=2"; OleDbCommand myAccessCommand = new OleDbCommand( strAccessSelect , oleDbConnection ); *************** *** 77,90 **** myDataAdapter.MissingSchemaAction = MissingSchemaAction.Add; myDataAdapter.MissingMappingAction = MissingMappingAction.Passthrough; ! myDataAdapter.Fill( myDataSet , "Data" ); Line = streamReader.ReadLine(); Line = streamReader.ReadLine(); ! while ( Line != null ) { LineIn=Line.Split(','); ! DataRow myRow=myDataSet.Tables["Data"].NewRow(); myRow[ "quTicker" ] = ticker; --- 78,91 ---- myDataAdapter.MissingSchemaAction = MissingSchemaAction.Add; myDataAdapter.MissingMappingAction = MissingMappingAction.Passthrough; ! myDataAdapter.Fill( myDataSet , "Data" );*/ Line = streamReader.ReadLine(); Line = streamReader.ReadLine(); ! while ( Line != null && ! Line.StartsWith("<")) { LineIn=Line.Split(','); ! /*DataRow myRow=myDataSet.Tables["Data"].NewRow(); myRow[ "quTicker" ] = ticker; *************** *** 96,131 **** myRow[ "quVolume" ]=Double.Parse( LineIn[5] ); myRow[ "quAdjustedClose" ]=Double.Parse( LineIn[6] ); - //myRow[ "quAdjustedOpen" ]=Convert.ToDouble(myRow[ "quOpen" ])* - // (Convert.ToDouble(myRow[ "quAdjustedClose" ])/Convert.ToDouble(myRow[ "quOpen" ])); - - // myRow["date"]=DateTime.Parse(LineIn[0]); - // myRow["time"]=DateTime.Parse(LineIn[1]); - // myRow["sv1485ri"]=Double.Parse(LineIn[2]); - // myRow["sv14856s"]=Double.Parse(LineIn[3]); - // myRow["d4461"]=Double.Parse(LineIn[4]); - // myRow["d6sf"]=Double.Parse(LineIn[5]); - // myRow["d6sdp"]=Double.Parse(LineIn[6]); - // myRow["oppai"]=Double.Parse(LineIn[7]); - // myRow["oppbi"]=Double.Parse(LineIn[8]); - // myRow["opps"]=Double.Parse(LineIn[9]); - // myRow["o24hrtf"]=Double.Parse(LineIn[10]); - // myRow["oif"]=Double.Parse(LineIn[11]); - // myRow["otct"]=Double.Parse(LineIn[12]); - // myRow["d1abt"]=Double.Parse(LineIn[13]); - // myRow["d1bbt"]=Double.Parse(LineIn[14]); - // myRow["d3bt"]=Double.Parse(LineIn[15]); - // myRow["d2bt"]=Double.Parse(LineIn[16]); - // myRow["d5bt"]=Double.Parse(LineIn[17]); - // myRow["d6bt"]=Double.Parse(LineIn[18]); - // myRow["cv1480cvpi"]=Double.Parse(LineIn[19]); - // myRow["cv1481cvpi"]=Double.Parse(LineIn[20]); ! myDataSet.Tables["Data"].Rows.Add(myRow); ! this.deleteExistingQuote(ticker, DateTime.Parse(LineIn[0])); //the corresponding record is deleted if in the web downloader form // the radio button "over Write existing record" is checked ! Line = this.streamReader.ReadLine(); } ! this.updateDataBase(myDataAdapter, myDataSet,"Data"); } --- 97,113 ---- myRow[ "quVolume" ]=Double.Parse( LineIn[5] ); myRow[ "quAdjustedClose" ]=Double.Parse( LineIn[6] ); ! myDataSet.Tables["Data"].Rows.Add(myRow);*/ ! //the corresponding record is deleted if in the web downloader form // the radio button "over Write existing record" is checked ! if(this.overWriteExistingRecords) ! Quotes.Delete(ticker, DateTime.Parse( LineIn[0] )); ! Quotes.Add(ticker,DateTime.Parse( LineIn[0] ), Double.Parse( LineIn[1] ), ! Double.Parse(LineIn[2]), Double.Parse(LineIn[3]), Double.Parse(LineIn[4]), ! Double.Parse(LineIn[5]), Double.Parse(LineIn[6])); ! Line = this.streamReader.ReadLine(); } ! //this.updateDataBase(myDataAdapter, myDataSet,"Data"); } Index: Downloader.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Downloader.csproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Downloader.csproj 28 Mar 2004 22:11:44 -0000 1.15 --- Downloader.csproj 17 Apr 2004 14:16:29 -0000 1.16 *************** *** 166,179 **** /> <File - RelPath = "GroupEditor.cs" - SubType = "Form" - BuildAction = "Compile" - /> - <File - RelPath = "GroupEditor.resx" - DependentUpon = "GroupEditor.cs" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "Main.cs" SubType = "Form" --- 166,169 ---- *************** *** 206,229 **** /> <File - RelPath = "TickerGroupsViewer.cs" - SubType = "Form" - BuildAction = "Compile" - /> - <File - RelPath = "TickerGroupsViewer.resx" - DependentUpon = "TickerGroupsViewer.cs" - BuildAction = "EmbeddedResource" - /> - <File - RelPath = "TickerViewer.cs" - SubType = "Form" - BuildAction = "Compile" - /> - <File - RelPath = "TickerViewer.resx" - DependentUpon = "TickerViewer.cs" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "WebDownloader.cs" SubType = "Form" --- 196,199 ---- *************** *** 351,354 **** --- 321,369 ---- /> <File + RelPath = "TickerSelectors\GroupEditor.cs" + SubType = "Form" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectors\ITickerReceiver.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectors\ITickerSelector.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectors\TickerGroupsListViewMenu.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectors\TickerGroupsListViewMenu.resx" + DependentUpon = "TickerGroupsListViewMenu.cs" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "TickerSelectors\TickerGroupsViewer.cs" + SubType = "Form" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectors\TickerViewer.cs" + SubType = "Form" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectors\TickerViewerMenu.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectors\TickerViewerMenu.resx" + DependentUpon = "TickerViewerMenu.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "Validate\IValidator.cs" SubType = "Code" |