コード例 #1
0
 public ToyOrder(string orderString)
 {
     string[] orderComponents = orderString.Split(',');
     this._id              = Convert.ToInt32(orderComponents [0]);
     this._arrivalTime     = DateParser.ParseDateFromLine(orderString);
     this._durationMinutes = Convert.ToInt32(orderComponents [2]);
     this.elfId            = 0;
 }
コード例 #2
0
        private static bool IsWithinNumberOfDays(DateTime currentDate, int numberOfDaysAhead)
        {
            bool     isWithinNumberOfDays = false;
            string   nextLine             = PeekNextLine();
            DateTime dateNextLine         = DateParser.ParseDateFromLine(nextLine);
            TimeSpan timeBetween          = dateNextLine - currentDate;

            if (timeBetween.TotalDays < numberOfDaysAhead)
            {
                isWithinNumberOfDays = true;
            }
            else
            {
                isWithinNumberOfDays = false;
            }

            return(isWithinNumberOfDays);
        }