示例#1
0
        public Comment Get(int artifactId)
        {
            Comment comment = new Comment();

            try
            {
                DTOs.RDO commentDTO = new DTOs.RDO(artifactId);
                commentDTO.Fields = DTOs.FieldValue.AllFields;
                commentDTO.ArtifactTypeGuids.Add(new Guid(comment.ARTIFACT_TYPE));
                commentDTO         = client.Repositories.RDO.ReadSingle(artifactId);
                comment.ArtifactId = commentDTO.ArtifactID;
                comment.Name       = commentDTO.TextIdentifier;
                Entities.Artifact user = new Entities.Artifact(commentDTO.SystemCreatedBy.ArtifactID);
                user.Name         = commentDTO.SystemCreatedBy.FullName;
                comment.CreatedBy = user;
                Entities.Artifact lastUser = new Entities.Artifact(commentDTO.SystemLastModifiedBy.ArtifactID);
                lastUser.Name          = commentDTO.SystemCreatedBy.FullName;
                comment.LastModifiedBy = lastUser;
                comment.CreatedOn      = commentDTO.SystemCreatedOn.ToString();
                comment.LastModifiedOn = commentDTO.SystemLastModifiedOn.ToString();
                comment.imageBase64    = (string)commentDTO[new Guid(comment.COMMENT_THUMBNAIL_FIELD)].Value;
            }
            catch (Exception)
            {
                throw;
            }

            return(comment);
        }
示例#2
0
        public Workspace Get(int artifactId)
        {
            Workspace workspace = new Workspace();

            try
            {
                DTOs.Workspace workspaceDTO = client.Repositories.Workspace.ReadSingle(artifactId);
                workspace.ArtifactId = workspaceDTO.ArtifactID;
                workspace.Name       = workspaceDTO.Name;
                workspace.MatterId   = workspaceDTO.MatterID.Value;
                workspace.ClientId   = workspaceDTO.Client.ArtifactID;
                Entities.Artifact user = new Entities.Artifact(workspaceDTO.SystemCreatedBy.ArtifactID);
                user.Name           = workspaceDTO.SystemCreatedBy.FullName;
                workspace.CreatedBy = user;
            }
            catch (Exception)
            {
                throw;
            }
            return(workspace);
        }
示例#3
0
 public Entities.Document Get(int artifactId)
 {
     Entities.Document document = new Entities.Document();
     try
     {
         DTOs.Document           documentDTO = client.Repositories.Document.ReadSingle(artifactId);
         List <Entities.Comment> comments    = new List <Entities.Comment>();
         CommentRepositoryRSAPI  cr          = new CommentRepositoryRSAPI(this.client);
         DTOs.FieldValue         f1          = new DTOs.FieldValue();
         document.amountComments = 0;
         foreach (var f in documentDTO.Fields)
         {
             if (f.Name == "Commens - Document")
             {
                 if (f.Value != null)
                 {
                     DTOs.FieldValueList <DTOs.Artifact> list = (DTOs.FieldValueList <DTOs.Artifact>)f.Value;
                     document.amountComments = list.Count;
                     foreach (var field in list)
                     {
                         comments.Add(cr.Get(field.ArtifactID));
                     }
                 }
             }
         }
         document.ArtifactId = documentDTO.ArtifactID;
         document.Name       = documentDTO.TextIdentifier;
         document.Comments   = comments;
         Entities.Artifact user = new Entities.Artifact(documentDTO.SystemCreatedBy.ArtifactID);
         user.Name          = documentDTO.SystemCreatedBy.FullName;
         document.CreatedBy = user;
     }
     catch (Exception)
     {
         throw;
     }
     return(document);
 }