Ejemplo n.º 1
0
        public ReportsGrandGridClients GroupByClients(string userName, RequestReportsGrid reportsGridData)
        {
            var reportsGridClients = new ReportsGrandGridClients
            {
                ReportsGridView = new List <ReportGridClientView>
                {
                    new ReportGridClientView
                    {
                        Items = new List <ReportsGridItemsView>()
                    }
                }
            };

            var timeEntriesForGrouping = GetTimeEntriesForGrouping(userName, reportsGridData);

            if (!timeEntriesForGrouping.Any())
            {
                return(reportsGridClients);
            }

            var timeEntriesGroupByClients = timeEntriesForGrouping
                                            .GroupBy(i => i.Project.Client)
                                            .OrderBy(x => x.Key.Name)
                                            .ToDictionary(key => key.Key ?? CreateWithOutClientInstance(), key => key.Select(value => value));

            var result = reportsGridClients.GetViewReportsGrandGridClients(timeEntriesGroupByClients, Mapper);

            return(result);
        }
Ejemplo n.º 2
0
        public ReportsGrandGridClients ReportsGridGroupByClients(ReportsGridView reportsGridData)
        {
            var reportsGridClients = new ReportsGrandGridClients
            {
                ReportsGridView = new List <ReportGridClientView>
                {
                    new ReportGridClientView
                    {
                        Items = new List <ReportsGridItemsView>()
                    }
                }
            };

            var timeEntriesForGrouping = GetTimeEntriesForGrouping(reportsGridData);

            if (!timeEntriesForGrouping.Any())
            {
                return(reportsGridClients);
            }

            var timeEntriesGroupByClients = timeEntriesForGrouping.ToList()
                                            .GroupBy(i => i.Project.Client == null ? CreateWithOutClientInstance() : i.Project.Client)
                                            .OrderBy(x => x.Key.Name)
                                            .ToDictionary(key => key.Key, key => key.OrderBy(value => value.Date).AsEnumerable());

            var result = reportsGridClients.GetViewReportsGrandGridClients(timeEntriesGroupByClients, Mapper);

            return(result);
        }