[Quantproject-developers] QuantProject/b2_DataAccess DataBase.cs,1.6,1.7
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2006-01-11 18:36:13
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20283/b2_DataAccess Modified Files: DataBase.cs Log Message: Code has been formatted: tab are used instead of blanks Index: DataBase.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBase.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DataBase.cs 26 May 2005 23:44:07 -0000 1.6 --- DataBase.cs 11 Jan 2006 18:36:02 -0000 1.7 *************** *** 37,41 **** public class DataBase { ! private static OleDbConnection oleDbConnection = ConnectionProvider.OleDbConnection; public DataBase() --- 37,41 ---- public class DataBase { ! private static OleDbConnection oleDbConnection = ConnectionProvider.OleDbConnection; public DataBase() *************** *** 46,68 **** } ! /// <summary> ! /// Returns the field name corresponding to the quote field ! /// </summary> ! /// <param name="quoteField">Discriminates among Open, High, Low and Closure</param> ! /// <returns>Field name corresponding to the quote field</returns> ! private static string getFieldName( QuoteField quoteField ) ! { ! string fieldName = ""; ! switch ( quoteField ) ! { ! case QuoteField.Open: ! fieldName = "quOpen"; ! break; ! case QuoteField.High: ! fieldName = "quHigh"; ! break; ! case QuoteField.Low: ! fieldName = "quLow"; ! break; case QuoteField.Close: fieldName = "quClose"; --- 46,68 ---- } ! /// <summary> ! /// Returns the field name corresponding to the quote field ! /// </summary> ! /// <param name="quoteField">Discriminates among Open, High, Low and Closure</param> ! /// <returns>Field name corresponding to the quote field</returns> ! private static string getFieldName( QuoteField quoteField ) ! { ! string fieldName = ""; ! switch ( quoteField ) ! { ! case QuoteField.Open: ! fieldName = "quOpen"; ! break; ! case QuoteField.High: ! fieldName = "quHigh"; ! break; ! case QuoteField.Low: ! fieldName = "quLow"; ! break; case QuoteField.Close: fieldName = "quClose"; *************** *** 78,101 **** break; default: ! break; ! } ! return fieldName; ! } #region "GetHistory" ! private static History getHistory_try( string instrumentKey , QuoteField quoteField , DateTime firstDate , DateTime lastDate ) ! { ! History history = new History(); ! string commandString = ! "select * from quotes where (quTicker='" + instrumentKey + "') " + "and (quDate>=" + SQLBuilder.GetDateConstant( firstDate ) + ") " + "and (quDate<=" + SQLBuilder.GetDateConstant( lastDate ) + ")"; ! OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter( commandString , oleDbConnection ); ! DataTable dataTable = new DataTable(); ! oleDbDataAdapter.Fill( dataTable ); ! history.Import( dataTable , "quDate" , getFieldName( quoteField ) ); ! return history; ! } private static History getHistory_common( string instrumentKey , QuoteField quoteField , DateTime firstDate , DateTime lastDate ) --- 78,101 ---- break; default: ! break; ! } ! return fieldName; ! } #region "GetHistory" ! private static History getHistory_try( string instrumentKey , QuoteField quoteField , DateTime firstDate , DateTime lastDate ) ! { ! History history = new History(); ! string commandString = ! "select * from quotes where (quTicker='" + instrumentKey + "') " + "and (quDate>=" + SQLBuilder.GetDateConstant( firstDate ) + ") " + "and (quDate<=" + SQLBuilder.GetDateConstant( lastDate ) + ")"; ! OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter( commandString , oleDbConnection ); ! DataTable dataTable = new DataTable(); ! oleDbDataAdapter.Fill( dataTable ); ! history.Import( dataTable , "quDate" , getFieldName( quoteField ) ); ! return history; ! } private static History getHistory_common( string instrumentKey , QuoteField quoteField , DateTime firstDate , DateTime lastDate ) *************** *** 140,143 **** } #endregion ! } } --- 140,143 ---- } #endregion ! } } |