コード例 #1
0
        public async Task AddcolumnToTheLeftAsync(BoardOptionsInputModel inputModel)
        {
            var boardColumnOption = new KanbanBoardColumnOption()
            {
                AddedOn     = DateTime.UtcNow,
                ColumnName  = inputModel.ColumnName,
                MaxItems    = inputModel.MaxItems,
                PositionLTR = ++inputModel.ColumnOrder,
            };

            //var column = new KanbanBoardColumn()
            //{
            //    AddedOn = DateTime.UtcNow,
            //    KanbanBoardColumnOption = boardColumnOption,
            //    //ProjectId = inputModel.ProjectId,
            //};

            // Shift already existing columns to right so there are no collisions in the order.
            await ShiftColumnPosition(inputModel.ColumnOrder, inputModel.ProjectId);

            await this.columnOptionsRepo.AddAsync(boardColumnOption);

            //await this.columnRepo.AddAsync(column);

            await this.columnOptionsRepo.SaveChangesAsync();

            //await this.columnRepo.SaveChangesAsync();
        }
コード例 #2
0
        private async Task AddDefaultKanbanBoardToProjectAsync(Project project)
        {
            var defaultBacklogColumnOptions = new KanbanBoardColumnOption()
            {
                AddedOn     = DateTime.UtcNow,
                ColumnName  = DefaultKanbanOptionsConstants.Backlog,
                MaxItems    = DefaultKanbanOptionsConstants.BacklogMaxItems,
                PositionLTR = DefaultKanbanOptionsConstants.BacklogPosition,
            };

            var defaultDoingColumnOptions = new KanbanBoardColumnOption()
            {
                AddedOn     = DateTime.UtcNow,
                ColumnName  = DefaultKanbanOptionsConstants.InProgress,
                MaxItems    = DefaultKanbanOptionsConstants.InProgressMaxItems,
                PositionLTR = DefaultKanbanOptionsConstants.InProgressPosition,
            };

            var defaultDoneColumnOptions = new KanbanBoardColumnOption()
            {
                AddedOn     = DateTime.UtcNow,
                ColumnName  = DefaultKanbanOptionsConstants.Done,
                MaxItems    = DefaultKanbanOptionsConstants.DoneMaxItems,
                PositionLTR = DefaultKanbanOptionsConstants.DonePosition,
            };

            var backlogkanbanBoardColumn = new KanbanBoardColumn()
            {
                AddedOn = DateTime.UtcNow,
                KanbanBoardColumnOption = defaultBacklogColumnOptions,
            };

            var doingkanbanBoardColumn = new KanbanBoardColumn()
            {
                AddedOn = DateTime.UtcNow,
                KanbanBoardColumnOption = defaultDoingColumnOptions,
            };

            var donekanbanBoardColumn = new KanbanBoardColumn()
            {
                AddedOn = DateTime.UtcNow,
                KanbanBoardColumnOption = defaultDoneColumnOptions,
            };

            project.KanbanBoardColumnOptions.Add(defaultDoneColumnOptions);
            project.KanbanBoardColumnOptions.Add(defaultDoingColumnOptions);
            project.KanbanBoardColumnOptions.Add(defaultBacklogColumnOptions);

            await this.boardRepo.AddAsync(backlogkanbanBoardColumn);

            await this.boardRepo.AddAsync(doingkanbanBoardColumn);

            await this.boardRepo.AddAsync(donekanbanBoardColumn);

            var board = this.boardRepo.AllAsNoTracking()
                        .Where(x => x.KanbanBoardColumnOption.ProjectId == 1);
            var boarde = this.boardRepo.AllAsNoTracking()
                         .Where(x => x.KanbanBoardColumnOption.ProjectId == 3);
        }