More date range options in Order Manager

This forum is where we'll mirror posts that are of value to the community so they may be more easily found.
Post Reply
Will
Captain (CAPT)
Captain (CAPT)
Posts: 263
Joined: Fri Oct 05, 2007 8:02 am

More date range options in Order Manager

Post by Will » Thu Mar 20, 2008 12:30 pm

We really need to be able to filter by more date ranges in the order manager. Finding the need for a "yesterday" option as well. "Today" and "Past Week" is to big of a jump.

User avatar
m_plugables
Commander (CMDR)
Commander (CMDR)
Posts: 149
Joined: Tue Mar 11, 2008 12:44 am
Contact:

Yesterday option for order manager

Post by m_plugables » Sat Mar 22, 2008 3:56 am

edit Admin/Orders/Default.aspx.cs file and following method to it

Code: Select all

private void ApplyLastDateFilter() 
    {
        
        _isCustomDateTime = false;
        DateTime tempDate = DateTime.Now.AddDays(-1);
        DateTime startDate = (new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, 0, 0, 0));
        DateTime endDate = (new DateTime(tempDate.Year, tempDate.Month, tempDate.Day,23, 59, 59));
        HiddenStartDate.Value = startDate.ToString();
        HiddenEndDate.Value = endDate.ToString();
    }
Now search the follwoing line in the file

Code: Select all

DateFilter.Items.Add(new ListItem("Today","0"));
when found then put the following line of code just below it

Code: Select all

DateFilter.Items.Add(new ListItem("Yesterday", "12"));
after this modification your code should look like

Code: Select all

 
...
...
DateFilter.Items.Add(new ListItem("Today","0"));
DateFilter.Items.Add(new ListItem("Yesterday", "12"));
...
...
Now search the follwoing function

Code: Select all

protected void UpdateDateFilter()
and put the following line of code just after the case 11: in that function.

Code: Select all

case 12:
//Last Day
ApplyLastDateFilter();
break;
After this modification your code should look like

Code: Select all

...
...
case 11:
                //Custom Date
                ApplyCustomDateFilter();
                break;
            case 12:
                //Last Day
                ApplyLastDateFilter();
                break;
...
...
Above code will make an extra option available "Yesterday" in the date filter.

Post Reply