Beispiel #1
0
        void createBasePeriod(QuarterPeriod Quarter, string Name, DateTime StratDate, DateTime EndDate, IObjectSpace objectSpace)
        {
            var period = objectSpace.CreateObject <BasePeriod>();

            period.QuarterPeriod = Quarter;
            period.PeriodName    = Name;
            period.StartDate     = StratDate;
            period.EndDate       = EndDate;
        }
Beispiel #2
0
        /// <summary>
        /// Gets the first date of the quarter.
        /// </summary>
        /// <param name="fiscalYear">Fiscal year.</param>
        /// <param name="startMonth">Start month of fiscal year.</param>
        /// <param name="period">Quarterly period.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentException">
        /// Year value is invalid.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// Month value is invalid.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// Period value is invalid.
        /// </exception>
        /// <exception cref="ArgumentOutOfRangeException">
        /// </exception>
        public static DateTime GetFirstDateOfQuarter(int fiscalYear, int startMonth, QuarterPeriod period)
        {
            AssertYear(fiscalYear);
            AssertMonth(startMonth);
            AssertPeriod(period);

            if (TryGetFirstDateOfQuarter(DateTimeKind.Unspecified, fiscalYear, startMonth, period, false, out DateTime result, out string errorMessage))
            {
                return(result);
            }