Ejemplo n.º 1
0
 public TaskWrapper(Task task, Milestone milestone) : this(task)
 {
     if (task.Milestone != 0)
     {
         Milestone = new SimpleMilestoneWrapper(milestone);
     }
 }
Ejemplo n.º 2
0
        public TaskWrapper(Task task)
        {
            if (task.SubTasks != null)
                Subtasks = task.SubTasks.Select(x => new SubtaskWrapper(x, task)).ToList();

            CreatedBy = EmployeeWraper.Get(task.CreateBy);
            if (task.CreateBy != task.LastModifiedBy)
                UpdatedBy = EmployeeWraper.Get(task.LastModifiedBy);

            if (task.Responsible!=Guid.Empty)
                Responsible = EmployeeWraper.Get(task.Responsible);

            Id = task.ID;

            Updated = (ApiDateTime)task.LastModifiedOn;
            Created = (ApiDateTime)task.CreateOn;
            Deadline = (task.Deadline == DateTime.MinValue ? null : (ApiDateTime)task.Deadline);
            Priority = task.Priority;
            
            Title = task.Title;
            Status = (int)task.Status;
            Description = task.Description;
            MilestoneId = task.Milestone;
            ProjectOwner = new SimpleProjectWrapper(task.Project);
            CanEdit = ProjectSecurity.CanEdit(task);
            CanWork = ProjectSecurity.CanWork(task);

            if (task.Milestone != 0 && task.MilestoneDesc != null)
                Milestone = new SimpleMilestoneWrapper(task.MilestoneDesc);

            if (task.Responsibles != null)
                Responsibles = task.Responsibles.Select(x => EmployeeWraper.Get(x)).ToList();
        }
Ejemplo n.º 3
0
 public TaskWrapper(ProjectApiBase projectApiBase, Task task, Milestone milestone)
     : this(projectApiBase, task)
 {
     if (milestone != null && task.Milestone != 0)
     {
         Milestone = new SimpleMilestoneWrapper(milestone);
     }
 }
Ejemplo n.º 4
0
        public TaskWrapper(Task task)
        {
            Id          = task.ID;
            Title       = task.Title;
            Description = task.Description;
            Status      = (int)task.Status;

            if (Status > 2)
            {
                Status = 1;
            }

            if (task.Responsibles != null)
            {
                Responsibles = task.Responsibles.Select(EmployeeWraper.Get).OrderBy(r => r.DisplayName).ToList();
            }


            Deadline     = (task.Deadline == DateTime.MinValue ? null : new ApiDateTime(task.Deadline, TimeZoneInfo.Local));
            Priority     = task.Priority;
            ProjectOwner = new SimpleProjectWrapper(task.Project);
            MilestoneId  = task.Milestone;
            Created      = (ApiDateTime)task.CreateOn;
            CreatedBy    = EmployeeWraper.Get(task.CreateBy);
            Updated      = (ApiDateTime)task.LastModifiedOn;
            StartDate    = task.StartDate.Equals(DateTime.MinValue) ? null : (ApiDateTime)task.StartDate;

            if (task.CreateBy != task.LastModifiedBy)
            {
                UpdatedBy = EmployeeWraper.Get(task.LastModifiedBy);
            }

            if (task.SubTasks != null)
            {
                Subtasks = task.SubTasks.Select(x => new SubtaskWrapper(x, task)).ToList();
            }

            Progress = task.Progress;

            if (task.Milestone != 0 && task.MilestoneDesc != null)
            {
                Milestone = new SimpleMilestoneWrapper(task.MilestoneDesc);
            }

            if (task.Links.Any())
            {
                Links = task.Links.Select(r => new TaskLinkWrapper(r));
            }

            CanEdit            = ProjectSecurity.CanEdit(task);
            CanCreateSubtask   = ProjectSecurity.CanCreateSubtask(task);
            CanCreateTimeSpend = ProjectSecurity.CanCreateTimeSpend(task);
            CanDelete          = ProjectSecurity.CanDelete(task);
            CanReadFiles       = ProjectSecurity.CanReadFiles(task.Project);
        }
Ejemplo n.º 5
0
        public TaskWrapper(Task task)
        {
            if (task.SubTasks != null)
            {
                Subtasks = task.SubTasks.Select(x => new SubtaskWrapper(x, task)).ToList();
            }

            CreatedBy = EmployeeWraper.Get(task.CreateBy);
            if (task.CreateBy != task.LastModifiedBy)
            {
                UpdatedBy = EmployeeWraper.Get(task.LastModifiedBy);
            }

            if (task.Responsible != Guid.Empty)
            {
                Responsible = EmployeeWraper.Get(task.Responsible);
            }

            Id = task.ID;

            Updated  = (ApiDateTime)task.LastModifiedOn;
            Created  = (ApiDateTime)task.CreateOn;
            Deadline = (task.Deadline == DateTime.MinValue ? null : (ApiDateTime)task.Deadline);
            Priority = task.Priority;

            Title        = task.Title;
            Status       = (int)task.Status;
            Description  = task.Description;
            MilestoneId  = task.Milestone;
            ProjectOwner = new SimpleProjectWrapper(task.Project);
            CanEdit      = ProjectSecurity.CanEdit(task);
            CanWork      = ProjectSecurity.CanWork(task);

            if (task.Milestone != 0 && task.MilestoneDesc != null)
            {
                Milestone = new SimpleMilestoneWrapper(task.MilestoneDesc);
            }

            if (task.Responsibles != null)
            {
                Responsibles = task.Responsibles.Select(x => EmployeeWraper.Get(x)).ToList();
            }
        }
Ejemplo n.º 6
0
        public TaskWrapper(ProjectApiBase projectApiBase, Task task)
        {
            Id          = task.ID;
            Title       = task.Title;
            Description = task.Description;
            Status      = (int)task.Status;

            if (Status > 2)
            {
                Status = 1;
            }


            Deadline     = (task.Deadline == DateTime.MinValue ? null : new ApiDateTime(task.Deadline, TimeZoneInfo.Local));
            Priority     = task.Priority;
            ProjectOwner = new SimpleProjectWrapper(task.Project);
            MilestoneId  = task.Milestone;
            Created      = (ApiDateTime)task.CreateOn;
            Updated      = (ApiDateTime)task.LastModifiedOn;
            StartDate    = task.StartDate.Equals(DateTime.MinValue) ? null : (ApiDateTime)task.StartDate;

            if (task.SubTasks != null)
            {
                Subtasks = task.SubTasks.Select(x => new SubtaskWrapper(projectApiBase, x, task)).ToList();
            }

            Progress = task.Progress;

            if (task.Milestone != 0 && task.MilestoneDesc != null)
            {
                Milestone = new SimpleMilestoneWrapper(task.MilestoneDesc);
            }

            if (task.Links.Any())
            {
                Links = task.Links.Select(r => new TaskLinkWrapper(r));
            }

            if (task.Security == null)
            {
                ProjectSecurity.GetTaskSecurityInfo(task);
            }

            if (projectApiBase.Context.GetRequestValue("simple") != null)
            {
                CreatedById = task.CreateBy;
                UpdatedById = task.LastModifiedBy;
                if (task.Responsibles != null)
                {
                    ResponsibleIds = task.Responsibles;
                }
            }
            else
            {
                CreatedBy = projectApiBase.GetEmployeeWraper(task.CreateBy);
                if (task.CreateBy != task.LastModifiedBy)
                {
                    UpdatedBy = projectApiBase.GetEmployeeWraper(task.LastModifiedBy);
                }
                if (task.Responsibles != null)
                {
                    Responsibles = task.Responsibles.Select(projectApiBase.GetEmployeeWraper).OrderBy(r => r.DisplayName).ToList();
                }
            }

            CanEdit            = task.Security.CanEdit;
            CanCreateSubtask   = task.Security.CanCreateSubtask;
            CanCreateTimeSpend = task.Security.CanCreateTimeSpend;
            CanDelete          = task.Security.CanDelete;
            CanReadFiles       = task.Security.CanReadFiles;
        }
Ejemplo n.º 7
0
        public TaskWrapper(Task task)
        {
            Id = task.ID;
            Title = task.Title;
            Description = task.Description;
            Status = (int)task.Status;

            if (task.Responsibles != null)
            {
                Responsibles = task.Responsibles.Select(EmployeeWraper.Get).OrderBy(r => r.DisplayName).ToList();
            }


            Deadline = (task.Deadline == DateTime.MinValue ? null : new ApiDateTime(task.Deadline, TimeZoneInfo.Local));
            Priority = task.Priority;
            ProjectOwner = new SimpleProjectWrapper(task.Project);
            MilestoneId = task.Milestone;
            Created = (ApiDateTime)task.CreateOn;
            CreatedBy = EmployeeWraper.Get(task.CreateBy);
            Updated = (ApiDateTime)task.LastModifiedOn;
            StartDate = task.StartDate.Equals(DateTime.MinValue) ? null : (ApiDateTime)task.StartDate;

            if (task.CreateBy != task.LastModifiedBy)
            {
                UpdatedBy = EmployeeWraper.Get(task.LastModifiedBy);
            }

            if (task.SubTasks != null)
            {
                Subtasks = task.SubTasks.Select(x => new SubtaskWrapper(x, task)).ToList();
            }

            Progress = task.Progress;

            if (task.Milestone != 0 && task.MilestoneDesc != null)
            {
                Milestone = new SimpleMilestoneWrapper(task.MilestoneDesc);
            }

            if (task.Links.Any())
            {
                Links = task.Links.Select(r => new TaskLinkWrapper(r));
            }

            CanEdit = ProjectSecurity.CanEdit(task);
            CanCreateSubtask = ProjectSecurity.CanCreateSubtask(task);
            CanCreateTimeSpend = ProjectSecurity.CanCreateTimeSpend(task);
            CanDelete = ProjectSecurity.CanDelete(task);
        }
Ejemplo n.º 8
0
 public TaskWrapper(Task task, Milestone milestone) : this(task)
 {
     if (task.Milestone != 0)
         Milestone = new SimpleMilestoneWrapper(milestone);
 }