Example #1
0
        public void EditComment(int commentID, string comment)
        {
            TaskComments comm = DbContext.TaskComments.Find(commentID);

            comm.CommentText = comment;
            DbContext.SaveChanges();
        }
Example #2
0
        public void DeleteComment(int commentID)
        {
            TaskComments comm = DbContext.TaskComments.Find(commentID);

            DbContext.TaskComments.Remove(comm);
            DbContext.SaveChanges();
        }
Example #3
0
 public static TaskComments AddTaskComment(Int64 userId, string taskId, string commentText, ILogger _logger, Helper.Cache _redisCache, Helper.AppSettings _appSettings)
 {
     try
     {
         TaskComments _TaskComments = new TaskComments();
         _TaskComments.Id          = ObjectId.GenerateNewId();
         _TaskComments.strId       = ObjectId.GenerateNewId().ToString();
         _TaskComments.userId      = userId;
         _TaskComments.taskId      = taskId;
         _TaskComments.commentText = commentText;
         _TaskComments.createdOn   = Domain.Socioboard.Helpers.SBHelper.ConvertToUnixTimestamp(DateTime.UtcNow);
         MongoRepository mongorepo = new MongoRepository("TaskComments", _appSettings);
         mongorepo.Add <TaskComments>(_TaskComments);
         return(_TaskComments);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #4
0
        private void Import(Tasks task, Bugnet.DatabaseContentDataSet.BugCommentRow bugComment, Entities _entt)
        {
            int _bugId = 0;

            try
            {
                _bugId = bugComment.BugCommentID;
                TaskComments _new = new TaskComments()
                {
                    Body = bugComment.Comment,
                    TaskComments2TaskTitle = task
                };
                _entt.TaskComments.InsertOnSubmit(_new);
                _new.TaskComments2TaskTitle.Adjust(bugComment.CreatedDate);
                Resources _author = GetOrAdd <Resources>(_entt.Resources, m_ResourcesDictionaryBugNet, bugComment.CreatedUserId);
                GetOrAddEstimation(_entt.Estimation, _author, _new.TaskComments2TaskTitle.Task2ProjectTitle);
                _entt.SubmitChanges();
            }
            catch (Exception _ex)
            {
                Console.WriteLine(String.Format("Error importing BugCommentDataTable of Name: {0}, because of {1}", _bugId, _ex.Message));
            };
        }