public ReportsGrandGridMembersView GroupByUsers(string userName, RequestReportsGrid reportsGridData) { var reportsGridUsers = new ReportsGrandGridMembersView { ReportsGridView = new List <ReportGridMemberView> { new ReportGridMemberView { Items = new List <ReportsGridItemsView>() } } }; var timeEntriesForGrouping = GetTimeEntriesForGrouping(userName, reportsGridData); if (!timeEntriesForGrouping.Any()) { return(reportsGridUsers); } var timeEntriesGroupByUsers = timeEntriesForGrouping .GroupBy(i => i.Member) .OrderBy(x => x.Key.FullName) .ToDictionary(key => key.Key, key => key.Select(value => value)); var result = reportsGridUsers.GetViewReportsGrandGridClients(timeEntriesGroupByUsers, Mapper); return(result); }
public ReportsGrandGridMembersView ReportsGridGroupByUsers(ReportsGridView reportsGridData) { var reportsGridUsers = new ReportsGrandGridMembersView { ReportsGridView = new List <ReportGridMemberView> { new ReportGridMemberView { Items = new List <ReportsGridItemsView>() } } }; var timeEntriesForGrouping = GetTimeEntriesForGrouping(reportsGridData); if (!timeEntriesForGrouping.Any()) { return(reportsGridUsers); } var timeEntriesGroupByUsers = timeEntriesForGrouping.ToList() .GroupBy(i => i.Member) .OrderBy(x => x.Key.FullName) .ToDictionary(key => key.Key, key => key.OrderBy(value => value.Date).AsEnumerable()); var result = reportsGridUsers.GetViewReportsGrandGridClients(timeEntriesGroupByUsers, Mapper); return(result); }