Esempio n. 1
0
        public void Delete(TaskId taskId)
        {
            var task = ModelDatabase.GetTask(taskId);

            RemoveSpaceForTaskIndex(task.Index);
            DeleteTask(taskId);

            ModelDatabase.SaveChanges();
        }
Esempio n. 2
0
        public void Add(Comment table)
        {
            ModelDatabase.Comments.Add(new CommentEntity {
                CommentId      = Guid.NewGuid(),
                Content        = table.Content,
                CreateDateTime = DateTime.Now,
                UserId         = ModelDatabase.GetUser(table.UserId).UserId,
                TaskId         = ModelDatabase.GetTask(table.TaskId).TaskId
            });

            ModelDatabase.SaveChanges();
        }
        public void Add(Comment comment)
        {
            AddSpaceForCommentIndex(comment.Index);

            ModelDatabase.Comments.Add(new CommentEntity {
                Id             = Guid.NewGuid(),
                Index          = comment.Index,
                Content        = comment.Content,
                CreateDateTime = DateTime.Now,
                UserId         = ModelDatabase.GetUser(comment.UserId).Id,
                TaskId         = ModelDatabase.GetTask(comment.TaskId).Id
            });

            ModelDatabase.SaveChanges();
        }
Esempio n. 4
0
        public void Edit(Guid oldTableId, Task newTable)
        {
            var task = ModelDatabase.GetTask(oldTableId);

            task.Header      = newTable.Header;
            task.Description = newTable.Description;
            task.Branch      = string.IsNullOrEmpty(newTable.Branch) ? "-" : newTable.Branch;
            task.State       = newTable.State;
            task.Priority    = newTable.Priority;
            task.DeveloperId = ModelDatabase.GetUser(newTable.DeveloperId)?.UserId;
            task.ReviewerId  = ModelDatabase.GetUser(newTable.ReviewerId)?.UserId;
            task.ColumnId    = ModelDatabase.GetColumn(newTable.ColumnId)?.ColumnId;

            ModelDatabase.SaveChanges();
        }
Esempio n. 5
0
        public void Edit(TaskId oldTaskId, Task newTask)
        {
            var task = ModelDatabase.GetTask(oldTaskId);

            RemoveSpaceForTaskIndex(task.Index);
            AddSpaceForTaskIndex(newTask.Index);

            task.Index       = newTask.Index;
            task.Header      = newTask.Header;
            task.Description = newTask.Description;
            task.Branch      = string.IsNullOrEmpty(newTask.Branch) ? "-" : newTask.Branch;
            task.State       = newTask.State;
            task.Priority    = newTask.Priority;
            task.DeveloperId = ModelDatabase.GetUser(newTask.DeveloperId)?.Id;
            task.ReviewerId  = ModelDatabase.GetUser(newTask.ReviewerId)?.Id;
            task.ColumnId    = ModelDatabase.GetColumn(newTask.ColumnId)?.Id;

            ModelDatabase.SaveChanges();
        }
 public Task GetById(TaskId id)
 {
     return(ModelDatabase.GetTask(id).ToTable());
 }