private void CalculateDateRanges()
    {
        var range = DateRangeCalculator.Calculate(DateTime.Today, ddlDateRange.SelectedValue);

        if (range != null)
        {
            txtStartDate.Text = range.Begin.ToShortDateString();
            txtEndDate.Text   = range.End.ToShortDateString();
            return;
        }

        txtStartDate.Text = "";
        txtEndDate.Text   = "";
    }
Exemplo n.º 2
0
    private void CalculateDateRanges(string selectedValue)
    {
        if (selectedValue == DateRanges.Custom.ToString())
        {
            selectedValue = DateRanges.ThisWeek.ToString();
        }

        var range = DateRangeCalculator.Calculate(DateTime.Today, selectedValue);

        if (range != null)
        {
            txtFromDate.Text = range.Begin.ToShortDateString();
            txtToDate.Text   = range.End.ToShortDateString();
            ClearWeekendingDate();

            return;
        }

        ClearDateRangeValues();
    }