Exemplo n.º 1
0
        private void SetDateRange(object objectParameter)
        {
            string dateRange = objectParameter.ToString();

            switch (dateRange)
            {
            case "ThisWeek":
                StartDate = DateTimeExtensions.StartOfWeek(DateTime.Today, DayOfWeek.Monday);
                EndDate   = DateTimeExtensions.EndOfWeek(DateTime.Today, DayOfWeek.Monday);
                break;

            case "LastWeek":
                StartDate = DateTimeExtensions.StartOfLastWeek(DateTime.Today, DayOfWeek.Monday);
                EndDate   = DateTimeExtensions.EndOfLastWeek(DateTime.Today, DayOfWeek.Monday);
                break;

            case "CurrentMonth":
                StartDate = DateTimeExtensions.FirstDayOfMonth(DateTime.Today);
                EndDate   = DateTimeExtensions.LastDayOfMonth(DateTime.Today);
                break;

            default:
                break;
            }
        }