public ReportsGrandGridTimeEntryView GroupByNone(string userName, RequestReportsGrid reportsGridData) { var reportsGridTimeEntry = new ReportsGrandGridTimeEntryView { ReportsGridView = new List <ReportGridTimeEntryView> { new ReportGridTimeEntryView { Items = new List <ReportsGridItemsView>() } } }; var timeEntriesForGrouping = GetTimeEntriesForGrouping(userName, reportsGridData); if (!timeEntriesForGrouping.Any()) { return(reportsGridTimeEntry); } var timeEntriesGroupByNone = timeEntriesForGrouping .GroupBy(x => x.Id) .ToDictionary(key => key.Key, key => key.Select(value => value)); var result = reportsGridTimeEntry.GetViewReportsGrandGridTimeEntries(timeEntriesGroupByNone, Mapper); return(result); }
public ReportsGrandGridTimeEntryView ReportsGridGroupByNone(ReportsGridView reportsGridData) { var reportsGridTimeEntry = new ReportsGrandGridTimeEntryView { ReportsGridView = new List <ReportGridTimeEntryView> { new ReportGridTimeEntryView { Items = new List <ReportsGridItemsView>() } } }; var timeEntriesForGrouping = GetTimeEntriesForGrouping(reportsGridData); if (!timeEntriesForGrouping.Any()) { return(reportsGridTimeEntry); } var timeEntriesGroupByNone = timeEntriesForGrouping.ToList() .GroupBy(x => x.Id) .ToDictionary(key => key.Key, key => key.OrderBy(value => value.Date).AsEnumerable()); var result = reportsGridTimeEntry.GetViewReportsGrandGridTimeEntries(timeEntriesGroupByNone, Mapper); return(result); }
public static ReportsGrandGridTimeEntryView GetViewReportsGrandGridTimeEntries(this ReportsGrandGridTimeEntryView reportsGridEntitiesTimeEntry, Dictionary <int, IEnumerable <TimeEntry> > timeEntries, IMapper _mapper) { var reportGridClientView = GetReportGridTimeEntryViewList(timeEntries, _mapper); foreach (var groupingTimeEntries in reportGridClientView) { reportsGridEntitiesTimeEntry.GrandActualTime += groupingTimeEntries.TotalActualTime; reportsGridEntitiesTimeEntry.GrandEstimatedTime += groupingTimeEntries.TotalEstimatedTime; } reportsGridEntitiesTimeEntry.ReportsGridView = reportGridClientView; return(reportsGridEntitiesTimeEntry); }