Beispiel #1
0
        private Sort[] ParseSortsByAssignee(Teams.Team team, Teams.Project project, params TaskInfo[] tasks)
        {
            var result = new List <Sort>();
            var sorts  = this.GetSorts(project, SORT_ASSIGNEE);

            var noAssignee = sorts.FirstOrDefault(o => o.Key == "0") ?? new Sort()
            {
                By = "assignee", Key = "0"
            };

            noAssignee.Name = this.Lang().noAssignee;
            this.RepairIndexs(noAssignee, this.Parse(tasks, o => (o as TeamTaskInfo).Assignee == null));
            result.Add(noAssignee);

            foreach (var m in team.Members)
            {
                var sort = sorts.FirstOrDefault(o =>
                                                o.Key == m.ID.ToString()) ?? new Sort()
                {
                    By = "assignee", Key = m.ID.ToString()
                };
                sort.Name = m.Name;
                this.RepairIndexs(sort, this.Parse(tasks
                                                   , o => (o as TeamTaskInfo).Assignee != null &&
                                                   (o as TeamTaskInfo).Assignee.id == m.ID.ToString()));
                result.Add(sort);
            }
            return(result.ToArray());
        }
Beispiel #2
0
 private TeamProjectInfo Parse(Teams.Project project)
 {
     return(new TeamProjectInfo()
     {
         id = project.ID.ToString(),
         name = project.Name,
         description = project.Description
     });
 }
Beispiel #3
0
 private Sort[] GetSorts(Teams.Project p, string by)
 {
     return(!string.IsNullOrWhiteSpace(p.Settings[by])
         ? _serializer.JsonDeserialize <Sort[]>(p.Settings[by])
         : _emptySorts);
 }
Beispiel #4
0
 private Sort[] ParseSortsByDueTime(Teams.Project project, params TaskInfo[] tasks)
 {
     return(this.ParseSortsByDueTime(this.GetSorts(project, SORT_DUETIME), tasks));
 }
Beispiel #5
0
 private Sort[] ParseSortsByPriority(Teams.Project project, params TaskInfo[] tasks)
 {
     return(this.ParseSortsByPriority(this.GetSorts(project, SORT_PRIORITY), tasks));
 }
Beispiel #6
0
 private IEnumerable <Teams.Task> GetIncompletedTasksByProject(Teams.Project p)
 {
     return(this._teamTaskService.GetIncompletedTasksByProject(p));
 }