/// <summary> /// Update cached period information. /// </summary> /// <param name="periods">Updated periods.</param> private static void LoadPeriods(PeriodList periods) { Period currentPublicPeriod; PeriodList publicPeriods; if (periods.IsNotEmpty()) { currentPublicPeriod = null; publicPeriods = new PeriodList(); foreach (Period period in periods) { if (period.StopUpdate < DateTime.Today) { if (period.PeriodType.Id == (Int32)DEFAULT_PERIOD_TYPE) { currentPublicPeriod = period; } publicPeriods.Add(period); } } CurrentPublicPeriod = currentPublicPeriod; Periods = periods; PublicPeriods = publicPeriods; } }
/// <summary> /// Add periods to the data identifier list. /// </summary> /// <param name='periods'>Periods.</param> public void AddRange(PeriodList periods) { if (periods.IsNotEmpty()) { foreach (Period period in periods) { Add(period); } } }