/// <summary>
        /// Add period to search criteria.
        /// </summary>
        /// <param name="period">The period.</param>
        public void Add(IPeriod period)
        {
            if (Periods.IsNull())
            {
                Periods = new PeriodList();
            }

            Periods.Add(period);
        }
Example #2
0
        /// <summary>
        /// Get periods from web service.
        /// </summary>
        private static void LoadPeriods()
        {
            PeriodList periods;

            if (Periods.IsNull())
            {
                // Get data from web service.
                periods = new PeriodList();
                foreach (WebPeriod webPeriod in WebServiceClient.GetPeriods())
                {
                    periods.Add(new Period(webPeriod.Id,
                                           webPeriod.Year,
                                           webPeriod.Name,
                                           webPeriod.Information,
                                           webPeriod.StopUpdate,
                                           webPeriod.PeriodTypeId));
                }
                LoadPeriods(periods);
            }
        }