Esempio n. 1
0
        public ProjectWrapperFull(ProjectApiBase projectApiBase, Project project, object filesRoot = null, bool isFollow = false, IEnumerable <string> tags = null)
        {
            Id          = project.ID;
            Title       = project.Title;
            Description = project.Description;
            Status      = (int)project.Status;
            if (projectApiBase.Context.GetRequestValue("simple") != null)
            {
                ResponsibleId = project.Responsible;
                CreatedById   = project.CreateBy;
                UpdatedById   = project.LastModifiedBy;
            }
            else
            {
                Responsible = projectApiBase.GetEmployeeWraperFull(project.Responsible);
                CreatedBy   = projectApiBase.GetEmployeeWraper(project.CreateBy);
                if (project.CreateBy != project.LastModifiedBy)
                {
                    UpdatedBy = projectApiBase.GetEmployeeWraper(project.LastModifiedBy);
                }
            }

            Created = (ApiDateTime)project.CreateOn;
            Updated = (ApiDateTime)project.LastModifiedOn;


            if (project.Security == null)
            {
                ProjectSecurity.GetProjectSecurityInfo(project);
            }
            Security      = project.Security;
            CanEdit       = Security.CanEdit;
            CanDelete     = Security.CanDelete;
            ProjectFolder = filesRoot;
            IsPrivate     = project.Private;

            TaskCount         = project.TaskCount;
            TaskCountTotal    = project.TaskCountTotal;
            MilestoneCount    = project.MilestoneCount;
            DiscussionCount   = project.DiscussionCount;
            TimeTrackingTotal = project.TimeTrackingTotal ?? "";
            DocumentsCount    = project.DocumentsCount;
            ParticipantCount  = project.ParticipantCount;
            IsFollow          = isFollow;
            Tags = tags;
        }