Esempio n. 1
0
		public DateTime GetFirstDayOfTimePeriod(TimePeriod timePeriod)
		{
			if (timePeriod == TimePeriod.CurrentDay)
			{
				return GetCurrentDate();
			}
			else if (timePeriod == TimePeriod.CurrentMonth)
			{
				return GetFirstDayOfCurrentMonth();
			}
			else if (timePeriod == TimePeriod.CurrentYear)
			{
				return GetFirstDayOfCurrentYear();
			}
			else
			{
				return SqlDateTime.MinValue.Value;
			}
		}
Esempio n. 2
0
		public string GetTimePeriodName(TimePeriod timePeriod)
		{
			DateTime date = GetFirstDayOfTimePeriod(timePeriod);

			if (timePeriod == TimePeriod.CurrentDay)
			{
				return "Today";
			}
			else if (timePeriod == TimePeriod.CurrentMonth)
			{
				return string.Format("{0}, {1}", date.ToString("MMMM"), date.Year);
			}
			else if (timePeriod == TimePeriod.CurrentYear)
			{
				return date.Year.ToString();
			}
			else
			{
				return "All Time";
			}
		}