コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }