[Quantproject-developers] QuantProject/b4_Business/a0_Validation Validator.cs,1.1,1.2
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2004-05-08 17:23:13
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a0_Validation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7845/b4_Business/a0_Validation Modified Files: Validator.cs Log Message: The IsValid method has been added Index: Validator.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a0_Validation/Validator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Validator.cs 26 Apr 2004 15:37:59 -0000 1.1 --- Validator.cs 8 May 2004 17:23:03 -0000 1.2 *************** *** 1,6 **** using System; using System.Data; using QuantProject.DataAccess; - using QuantProject.DataAccess.Tables; namespace QuantProject.Business.Validation --- 1,6 ---- using System; using System.Data; + using QuantProject.Data.DataTables; using QuantProject.DataAccess; namespace QuantProject.Business.Validation *************** *** 17,31 **** // } ! #region IsValid ! private static bool isValid_withoutNewBeguinningQuotes( string ticker , DataTable validatedTicker ) { ! bool returnValue = ( ( validatedTicker.Rows.Count > 0 ) && ! ( (string)validatedTicker.Rows[ 0 ][ ValidatedTickers.HashValue ] == ! ValidatedTickers.GetHashValue( ticker , (DateTime)validatedTicker.Rows[ 0 ][ ValidatedTickers.StartDate ] , ! (DateTime)validatedTicker.Rows[ 0 ][ ValidatedTickers.EndDate ] ) ) ); ! if ( returnValue ) ! // the validated period is st qui!!!! ! returnValue = returnValue; ! return returnValue; } /// <summary> --- 17,32 ---- // } ! /// <summary> ! /// Validates (if the case) the given ticker from startDate to endDate ! /// </summary> ! /// <param name="ticker"></param> ! /// <param name="startDate"></param> ! /// <param name="endDate"></param> ! /// <returns>True if and only if the ticker is validated for the given range</returns> ! private static bool Validate( string ticker , DateTime startDate , DateTime endDate ) { ! ValidateDataTable validateDataTable = new ValidateDataTable(); ! validateDataTable.AddRows( ticker , startDate , endDate ); ! return ( validateDataTable.Rows.Count == 0 ); } /// <summary> *************** *** 34,49 **** /// <param name="ticker">Instrument's ticker</param> /// <returns></returns> ! public static bool IsValid( string ticker ) { ! DataTable validatedTicker = ! SqlExecutor.GetDataTable( "select * from validatedTickers where vvTicker='" + ticker + "'" ); ! // if ( ( validatedTicker.Rows.Count > 0 ) && ! // ( (DateTime)validatedTicker.Rows[ 0 ][ ValidatedTickers.StartDate ] < ! // Quotes.GetStartDate( ticker ) ) ) ! // // new quotes have been added at the beguinning of the ticker quotes, since when it was validated ! // ValidatedTickers.RemoveValidation( ticker ); ! return isValid_withoutNewBeguinningQuotes( ticker , validatedTicker ); } - #endregion } } --- 35,46 ---- /// <param name="ticker">Instrument's ticker</param> /// <returns></returns> ! public static bool IsValid( string ticker , DateTime startDate , DateTime endDate ) { ! QuantProject.Data.DataTables.ValidatedTickers validatedTickers = ! new QuantProject.Data.DataTables.ValidatedTickers( ticker ); ! return ( ( validatedTickers.Rows.Count > 0 ) && ! ( (DateTime)validatedTickers.Rows[ 0 ][ ValidatedTickers.StartDate ] > startDate ) && ! ( (DateTime)validatedTickers.Rows[ 0 ][ ValidatedTickers.EndDate ] > endDate ) ); } } } |