Example #1
0
        private void SaveTaskComments(IEnumerable <IComment> comments, int taskid)
        {
            var commentEngine = _engineFactory.CommentEngine;

            foreach (var comment in comments)
            {
                try
                {
                    var newComment = new Comment
                    {
                        CreateBy     = FindUser(comment.AuthorID),
                        Content      = comment.Body,
                        CreateOn     = comment.CreatedAt.ToUniversalTime(),
                        TargetUniqID = ProjectEntity.BuildUniqId <Task>(FindTask(taskid))
                    };
                    commentEngine.SaveOrUpdate(newComment);
                }
                catch (Exception e)
                {
                    StatusState.StatusLogError(string.Format(ImportResource.FailedToSaveComment, comment.ID), e);
                    LogError(string.Format("comment '{0}' failed", comment.ID), e);
                }
            }
        }
        private void SaveMessageComments(IComment[] comments, int messageid)
        {
            var commentEngine = _engineFactory.GetCommentEngine();

            foreach (var comment in comments)
            {
                try
                {
                    Comment newComment = new Comment()
                    {
                        CreateBy     = FindUser(comment.AuthorID),
                        Content      = comment.Body,
                        CreateOn     = comment.CreatedAt.ToUniversalTime(),
                        TargetUniqID = ProjectEntity.BuildUniqId <Message>(FindMessage(messageid))
                    };
                    commentEngine.SaveOrUpdate(newComment);
                }
                catch (Exception e)
                {
                    Status.LogError(string.Format(SettingsResource.FailedToSaveComment, comment.ID), e);
                    LogError(string.Format("comment '{0}' failed", comment.ID), e);
                }
            }
        }
 private void SaveTaskComments(IComment[] comments, int taskid)
 {
     var commentEngine = _engineFactory.GetCommentEngine();
     foreach (var comment in comments)
     {
         try
         {
             Comment newComment = new Comment()
             {
                 CreateBy = FindUser(comment.AuthorID),
                 Content = comment.Body,
                 CreateOn = comment.CreatedAt.ToUniversalTime(),
                 TargetUniqID = ProjectEntity.BuildUniqId<Task>(FindTask(taskid))
             };
             commentEngine.SaveOrUpdate(newComment);
         }
         catch (Exception e)
         {
             Status.LogError(string.Format(SettingsResource.FailedToSaveComment, comment.ID), e);
             LogError(string.Format("comment '{0}' failed", comment.ID), e);
         }
     }
 }
 private void SaveMessageComments(IEnumerable<IComment> comments, int messageid)
 {
     var commentEngine = _engineFactory.GetCommentEngine();
     foreach (var comment in comments)
     {
         try
         {
             var newComment = new Comment
                 {
                     CreateBy = FindUser(comment.AuthorID),
                     Content = comment.Body,
                     CreateOn = comment.CreatedAt.ToUniversalTime(),
                     TargetUniqID = ProjectEntity.BuildUniqId<Message>(FindMessage(messageid))
                 };
             commentEngine.SaveOrUpdate(newComment);
         }
         catch(Exception e)
         {
             Status.LogError(string.Format(ImportResource.FailedToSaveComment, comment.ID), e);
             LogError(string.Format("comment '{0}' failed", comment.ID), e);
         }
     }
 }