public async Task <IActionResult> EditColumn(int id)
        {
            var column = await _columnService.FindByIdAsync(id);

            if (column != null)
            {
                return(View(new Column
                {
                    Id = column.Id,
                    Title = column.Title
                }));
            }
            else
            {
                return(RedirectToAction("Index", "Board"));
            }
        }
Exemple #2
0
        public async Task <IActionResult> Edit(CardViewModel model)
        {
            var card = await _cardService.FindByIdAsync(model.Id);

            var column = await _columnService.FindByIdAsync(card.ColumnId);

            if (card != null)
            {
                card.Note        = model.Note;
                card.TaskDate    = model.TaskDate;
                card.Title       = model.Title;
                card.Description = model.Description;

                await _cardService.UpdateAsync(card);

                return(RedirectToAction("Detail", "Board", new { id = column.BoardId }));
            }
            return(View(model));
        }