/// <summary> /// Get all period objects of a sertain period type. /// </summary> /// <param name="periodTypeId">Id enum of the period type.</param> /// <returns>All periods of the requested type.</returns> public static PeriodList GetPeriods(PeriodTypeId periodTypeId) { PeriodList periods = new PeriodList(); for (Int32 getAttempts = 0; (periods.IsNull()) && (getAttempts < 3); getAttempts++) { LoadPeriods(); } foreach (Period period in Periods) { if (period.PeriodType.Id == (Int32)periodTypeId) { periods.Add(period); } } return(periods); }
/// <summary> /// Get all periods of a certain period type. /// </summary> /// <param name="periodTypeId">Period type id.</param> /// <returns>All periods of a certain period type.</returns> public PeriodList GetPeriods(PeriodTypeId periodTypeId) { return(GetPeriods((Int32)periodTypeId)); }
/// <summary> /// Get all public periods for specified period type. /// </summary> /// <param name="userContext"> /// Information about the user that makes this method call. /// </param> /// <param name="periodTypeId">Period type id.</param> /// <returns>All public periods for specified period type.</returns> public virtual PeriodList GetPublicPeriods(IUserContext userContext, PeriodTypeId periodTypeId) { return(GetPublicPeriods(userContext, (Int32)periodTypeId)); }
/// <summary> /// Get period type with specified id. /// </summary> /// <param name="userContext"> /// Information about the user that makes this method call. /// </param> /// <param name="periodTypeId">Id for requested period type.</param> /// <returns>Period type with specified id.</returns> public virtual IPeriodType GetPeriodType(IUserContext userContext, PeriodTypeId periodTypeId) { return(GetPeriodType(userContext, (Int32)periodTypeId)); }
/// <summary> /// Get all periods of a certain period type. /// </summary> /// <param name="userContext"> /// Information about the user that makes this method call. /// </param> /// <param name="periodTypeId">Period type id.</param> /// <returns>All periods of a certain period type.</returns> public virtual PeriodList GetPeriods(IUserContext userContext, PeriodTypeId periodTypeId) { return(GetPeriods(userContext).GetPeriods(periodTypeId)); }
/// <summary> /// Get the requested period type object. /// </summary> /// <param name='periodTypeId'>Id of requested period type.</param> /// <returns>Requested period type.</returns> public static PeriodType GetPeriodType(PeriodTypeId periodTypeId) { return(GetPeriodTypes().Get((Int32)periodTypeId)); }