private void FilterRequests()
        {
            DateTime startDate = dteFilterStartDate.SelectedDate.Value;
            DateTime endDate   = DateTime.MaxValue;

            if (dteFilterEndDate.SelectedDate.HasValue)
            {
                endDate = dteFilterEndDate.SelectedDate.Value;
                endDate = endDate.Subtract(endDate.TimeOfDay);
                endDate = endDate.Add(new TimeSpan(0, 23, 59, 59));
            }

            int resourceId = 0;

            if (cboDrivers.SelectedValue != "")
            {
                resourceId = Convert.ToInt32(cboDrivers.SelectedValue);
            }

            Facade.IDriver facDriver  = new Facade.Resource();
            DataSet        dsRequests = facDriver.GetDriverRequests(startDate, endDate, resourceId, ((Entities.CustomPrincipal)Page.User).IdentityId);

            DataView dvRequests = new DataView(dsRequests.Tables[0]);

            dvRequests.Sort = (SortCriteria + " " + SortDirection).Trim();

            dgRequests.DataSource = dvRequests;
            dgRequests.DataBind();
        }
Esempio n. 2
0
 private void FilterRequests()
 {
     Facade.IDriver facDriver = new Facade.Resource();
     dgRequests.DataSource = facDriver.GetDriverRequests(m_startDate, DateTime.MaxValue, m_resourceId, ((Entities.CustomPrincipal)Page.User).IdentityId);
     dgRequests.DataBind();
 }