Example #1
0
        public List <AggregateDTO> ProjectAggregateSearch(string userName, int projectId, bool onlyMine, Nullable <DateTime> startDate, Nullable <DateTime> endDate, int teamId, string activity)
        {
            List <AggregateDTO> aggregates = new List <AggregateDTO>();
            ObjectResult <p1p.Data.sp_Hours_Aggregates_By_Project_Result1> results;

            using (P1PContext ctx = new P1PContext())
            {
                results = ctx.sp_Hours_Aggregates_By_Project(userName, projectId, onlyMine, startDate, endDate, teamId, activity);
                foreach (sp_Hours_Aggregates_By_Project_Result1 a in results)
                {
                    if (a.ProjectAggregate != null && a.ProjectAggregate > 0)
                    {
                        aggregates.Add(new AggregateDTO()
                        {
                            Name      = a.Name,
                            Aggregate = (double)a.ProjectAggregate
                        });
                    }
                }
            }

            return(aggregates);
        }