示例#1
0
        /// <summary>
        /// Determines whether or not apportionment between provided dates can be accomplished using provided List[Chunk]
        /// </summary>
        /// <param name="dataIn"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns>true if apportionement can be accomplished</returns>
        private bool canApportion(List <Chunk> dataIn, DateTime startDate, DateTime endDate)
        {
            ///check if there are appropriate number of chunks to complete apportionment
            ///
            if (dataIn.Count < 2)
            {
                ///need at least two chunks to do any apportionment
                ///
                return(false);
            }

            ///get dateCoverate enum that tells us where the start and end dates of the requested data range fall in relation to the data in the dataIn list
            DateCoverage dateCoverage = getDateCoverage(startDate, endDate, dataIn.ElementAt(0).StartDate, dataIn.ElementAt(dataIn.Count - 1).EndDate);

            return(checkDateCoverage(dateCoverage));
        }
示例#2
0
 /// <summary>
 /// Determines whether the date coverage of a range of dates is suitable to allow apportionment from that range to between two provided dates
 /// </summary>
 /// <param name="coverage"></param>
 /// <returns>true if date coverage is suitable</returns>
 private bool checkDateCoverage(DateCoverage coverage)
 {
     return((int)coverage < (int)DateCoverage.neitherDateInRange);
 }
 /// <summary>
 /// Determines whether the date coverage of a range of dates is suitable to allow apportionment from that range to between two provided dates
 /// </summary>
 /// <param name="coverage"></param>
 /// <returns>true if date coverage is suitable</returns>
 private bool checkDateCoverage(DateCoverage coverage)
 {
     return (int)coverage < (int)DateCoverage.neitherDateInRange;
 }