private DataSet GetReportData() { int identityId = 0; if (cboClient.SelectedValue != string.Empty) { identityId = Convert.ToInt32(cboClient.SelectedValue); } //DateTime start = dteStartDate.SelectedDate.Value; DateTime start = rdiStartDate.SelectedDate.Value; start = start.Subtract(start.TimeOfDay); //DateTime end = dteEndDate.SelectedDate.Value; DateTime end = rdiEndDate.SelectedDate.Value; end = end.Subtract(end.TimeOfDay).Add(new TimeSpan(23, 59, 59)); Facade.IJob facJob = new Facade.Job(); DataSet dsCallInSheet = null; dsCallInSheet = facJob.GetAllForIdentityAndLoadDate(identityId, start, end, chkUserPlannedTimes.Checked); return(dsCallInSheet); }
private void ActionReportData() { int identityId = 0; if (cboClient.SelectedValue != string.Empty) { identityId = Convert.ToInt32(cboClient.SelectedValue); } DateTime start = rdiStartDate.SelectedDate.Value; start = start.Subtract(start.TimeOfDay); DateTime end = rdiEndDate.SelectedDate.Value; end = end.Subtract(end.TimeOfDay).Add(new TimeSpan(23, 59, 59)); Facade.IJob facJob = new Facade.Job(); DataSet dsCallInSheet = facJob.GetAllForIdentityAndLoadDate(identityId, start, end, chkUserPlannedTimes.Checked); if (dsCallInSheet.Tables.Count > 0) { var returnedOrders = from row in dsCallInSheet.Tables[0].Rows.Cast <DataRow>() group row by new { Client = row["Client"], Description = row["Description"], PostTown = row["PostTown"] } into g orderby g.Key.Client, g.Key.Description select new { Destination = g.Key, Orders = g.Count(), Items = g }; lvReturnedOrders.DataSource = returnedOrders; lvReturnedOrders.DataBind(); } else { lvReturnedOrders.DataSource = dsCallInSheet; lvReturnedOrders.DataBind(); } }