Ejemplo n.º 1
0
        void CreateHourlySegments()
        {
            int HourCounter = 0;
            int TotalHours  = Duration.Hours;

            DateTime Start = this.Start;
            DateTime End   = this.Start;

            while (HourCounter < TotalHours)
            {
                if (HourCounter > 0)
                {
                    Start = Start.AddHours(1);
                }
                End = End.AddHours(1);

                StartIntervalId = DailyTimeIntervals.GetTimeIntervalFromHourMinute(Start.Hour, Start.Minute).Id;
                EndIntervalId   = DailyTimeIntervals.GetTimeIntervalFromHourMinute(End.Hour, End.Minute).Id;

                Segments.Add(new TimeSegment(Start, End, StartIntervalId, EndIntervalId));
                HourCounter++;
            }
        }
Ejemplo n.º 2
0
        void CreateQuarterHourSegments()
        {
            int QuarterCounter    = 0;
            int TotalQuarterHours = Duration.Hours * 4;

            DateTime Start = this.Start;
            DateTime End   = this.Start;

            while (QuarterCounter < TotalQuarterHours)
            {
                if (QuarterCounter > 0)
                {
                    Start = Start.AddMinutes(FifteenMinutes);
                }

                End = End.AddMinutes(FifteenMinutes);

                StartIntervalId = DailyTimeIntervals.GetTimeIntervalFromHourMinute(Start.Hour, Start.Minute).Id;
                EndIntervalId   = DailyTimeIntervals.GetTimeIntervalFromHourMinute(End.Hour, End.Minute).Id;

                Segments.Add(new TimeSegment(Start, End, StartIntervalId, EndIntervalId));
                QuarterCounter++;
            }
        }