private int GetQuarterValue(QuarterEnum quarter)
        {
            // zero-indexed for our matrix
            int q = 0;

            switch (quarter)
            {
            case QuarterEnum.First:
                q = 0;
                break;

            case QuarterEnum.Second:
                q = 1;
                break;

            case QuarterEnum.Third:
                q = 2;
                break;

            default:
                q = 3;
                break;
            }
            return(q);
        }
 public DayInQuarterTE(
     QuarterEnum quarter,
     QuarterlyIntervalEnum quarterInterval, 
     MonthlyIntervalEnum monthInterval, 
     DayOfWeekEnum dayOfWeek)
 {
     _quarter = GetQuarterValue(quarter);
     _dayOfWeek = TEHelpers.GetDayOfWeekValue(dayOfWeek);
     _monthInterval = TEHelpers.GetMonthlyIntervalValue(monthInterval);
     _quarterInterval = GetQuarterIntervalValue(quarterInterval);
 }
 public DayInQuarterTE(
     QuarterEnum quarter,
     QuarterlyIntervalEnum quarterInterval,
     MonthlyIntervalEnum monthInterval,
     DayOfWeekEnum dayOfWeek)
 {
     _quarter         = GetQuarterValue(quarter);
     _dayOfWeek       = TEHelpers.GetDayOfWeekValue(dayOfWeek);
     _monthInterval   = TEHelpers.GetMonthlyIntervalValue(monthInterval);
     _quarterInterval = GetQuarterIntervalValue(quarterInterval);
 }
Beispiel #4
0
 public QuarterInfo(QuarterEnum quarter, int year)
 {
     quarterID    = 0;
     this.quarter = quarter;
     startDate    = new DateTime(year, 1, 1).AddMonths(3 * (((int)quarter) - 1));
     endDate      = new MonthInfo(startDate.AddMonths(2)).EndDate;
     months       = new Dictionary <int, MonthInfo>();
     totals       = new Dictionary <int, float>();
     label        = "";
     theme        = "";
     performance  = 0;
 }
Beispiel #5
0
 public QuarterInfo(DateTime theDate)
 {
     quarterID   = 0;
     quarter     = (QuarterEnum)(int)((theDate.Month - 1) / 3 + 1);
     startDate   = new DateTime(theDate.Year, 1, 1).AddMonths(3 * (((int)quarter) - 1));
     endDate     = new MonthInfo(startDate.AddMonths(2)).EndDate;
     months      = new Dictionary <int, MonthInfo>();
     totals      = new Dictionary <int, float>();
     label       = "";
     theme       = "";
     performance = 0;
 }
Beispiel #6
0
 public QuarterInfo()
 {
     quarterID   = 0;
     quarter     = QuarterEnum.First;
     startDate   = DateTime.Today;
     endDate     = DateTime.Today;
     months      = new Dictionary <int, MonthInfo>();
     totals      = new Dictionary <int, float>();
     label       = "";
     theme       = "";
     performance = 0;
 }
 private int GetQuarterValue(QuarterEnum quarter)
 {
     // zero-indexed for our matrix
     int q = 0;
     switch (quarter)
     {
         case QuarterEnum.First:
             q = 0;
             break;
         case QuarterEnum.Second:
             q = 1;
             break;
         case QuarterEnum.Third:
             q = 2;
             break;
         default:
             q = 3;
             break;
     }
     return q;
 }