private static ProjectComment ToComment(object[] r)
 {
     var p = new ProjectComment
         {
             Discussion = new Message
                 {
                     ID = Convert.ToInt32(r[0]),
                     Title = Convert.ToString(r[1]),
                     Content = Convert.ToString(r[2]),
                     CreateBy = new Guid(Convert.ToString(r[3])),
                     CreateOn = Convert.ToDateTime(r[4]),
                     LastModifiedBy = new Guid(Convert.ToString(r[5])),
                     LastModifiedOn = Convert.ToDateTime(r[6]),
                     Project = new Project
                         {
                             ID = Convert.ToInt32(r[7]),
                             Title = Convert.ToString(r[8]),
                             Description = Convert.ToString(r[9]),
                             Status = (ProjectStatus)Convert.ToInt32(10),
                             StatusChangedOn = Convert.ToDateTime(r[11]),
                             Responsible = new Guid(Convert.ToString(r[12])),
                             Private = Convert.ToBoolean(r[13]),
                             CreateBy = new Guid(Convert.ToString(r[14])),
                             CreateOn = Convert.ToDateTime(r[15]),
                             LastModifiedBy = new Guid(Convert.ToString(r[16])),
                             LastModifiedOn = Convert.ToDateTime(r[17]),
                         }
                 }
         };
     if (r[18] != null)
     {
         p.Comment = new Comment
             {
                 ID = new Guid(Convert.ToString(r[18])),
                 Content = Convert.ToString(r[19]),
                 CreateBy = new Guid(Convert.ToString(r[20])),
                 CreateOn = Convert.ToDateTime(r[21]),
                 Parent = new Guid(Convert.ToString(r[22])),
                 TargetUniqID = Convert.ToString(r[23])
             };
     }
     return p;
 }
 private static FeedComment ToFeedComment(ProjectComment comment)
 {
     return new FeedComment(comment.Comment.CreateBy)
         {
             Id = comment.Comment.ID.ToString(),
             Description = HtmlSanitizer.Sanitize(comment.Comment.Content),
             Date = comment.Comment.CreateOn
         };
 }
Example #3
0
        private static ProjectComment ToComment(object[] r)
        {
            var p = new ProjectComment
                {
                    Task = new Task
                        {
                            ID = Convert.ToInt32(r[0]),
                            Title = Convert.ToString(r[1]),
                            Description = Convert.ToString(r[2]),
                            Priority = (TaskPriority)Convert.ToInt32(r[3]),
                            Status = (TaskStatus)Convert.ToInt32(r[4]),
                            StatusChangedOn = Convert.ToDateTime(r[5]),
                            Milestone = Convert.ToInt32(r[6]),
                            SortOrder = Convert.ToInt32(r[7]),
                            Deadline = Convert.ToDateTime(r[8]),
                            StartDate = Convert.ToDateTime(r[9]),
                            CreateBy = new Guid(Convert.ToString(r[10])),
                            CreateOn = Convert.ToDateTime(r[11]),
                            LastModifiedBy = new Guid(Convert.ToString(r[12])),
                            LastModifiedOn = Convert.ToDateTime(r[13]),
                            Responsibles =
                                r[14] != null
                                    ? new HashSet<Guid>(Convert.ToString(r[14]).Split(',').Select(x => new Guid(x)))
                                    : new HashSet<Guid>(),
                            Project = new Project
                                {
                                    ID = Convert.ToInt32(r[15]),
                                    Title = Convert.ToString(r[16]),
                                    Description = Convert.ToString(r[17]),
                                    Status = (ProjectStatus)Convert.ToInt32(18),
                                    StatusChangedOn = Convert.ToDateTime(r[19]),
                                    Responsible = new Guid(Convert.ToString(r[20])),
                                    Private = Convert.ToBoolean(r[21]),
                                    CreateBy = new Guid(Convert.ToString(r[22])),
                                    CreateOn = Convert.ToDateTime(r[23]),
                                    LastModifiedBy = new Guid(Convert.ToString(r[24])),
                                    LastModifiedOn = Convert.ToDateTime(r[25]),
                                }
                        }
                };

            if (r[26] != null)
            {
                p.Comment = new Comment
                    {
                        ID = new Guid(Convert.ToString(r[26])),
                        Content = Convert.ToString(r[27]),
                        CreateBy = new Guid(Convert.ToString(r[28])),
                        CreateOn = Convert.ToDateTime(r[29]),
                        Parent = new Guid(Convert.ToString(r[30])),
                        TargetUniqID = Convert.ToString(r[31])
                    };
            }
            return p;
        }