Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> AddColumn(int projectId, BoardOptionsInputModel inputModel)
        {
            if (!this.IsCurrentUserInProject(projectId))
            {
                return(Unauthorized());
            }

            await this.boardColumnsService.AddcolumnToTheLeftAsync(inputModel);

            return(RedirectToAction(nameof(Options), new { projectId = projectId }));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Options(int projectId)
        {
            if (!this.IsCurrentUserInProject(projectId))
            {
                return(Unauthorized());
            }

            var alreadyBoard = await this.boardColumnsService.GetColumnOptionsAsync(projectId);

            var board = new BoardOptionsInputModel()
            {
                AlreadyColumns = alreadyBoard,
            };

            return(View(board));
        }