Exemplo n.º 1
0
 public async void RemoveBoard(BoardDTO board, string token)
 {
     try
     {
         CheckToken(token);
         var b = MapperBroker.GetBoardFromDTO(board);
         await repository.BoardManager.RemoveEntityAsync(b);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
 public async void RenameBoard(BoardDTO board, string newName, string token)
 {
     try
     {
         CheckToken(token);
         var b = MapperBroker.GetBoardFromDTO(board);
         await repository.BoardInteraction.RenameBoardAsync(b, newName);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 3
0
 public async void AddUserToBoard(BoardDTO board, UserInfo user)
 {
     try
     {
         CheckToken(user.Token);
         var b = MapperBroker.GetBoardFromDTO(board);
         var u = MapperBroker.GetUserFromDTO(user.User);
         await repository.BoardInteraction.AddUserToBoardAsync(b, u);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     };
 }
Exemplo n.º 4
0
 public async void AddCardListToBoard(BoardDTO board, CardListDTO cardList, string token)
 {
     try
     {
         CheckToken(token);
         var b  = MapperBroker.GetBoardFromDTO(board);
         var cl = MapperBroker.GetCardListFromDTO(cardList);
         await repository.BoardInteraction.AddCardListToBoardAsync(b, cl);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 5
0
        public async Task <BoardDTO> UpdateBoard(BoardDTO oldBoard, BoardDTO newBoard, string token)
        {
            try
            {
                CheckToken(token);
                var oldB = MapperBroker.GetBoardFromDTO(oldBoard);
                var newB = MapperBroker.GetBoardFromDTO(newBoard);
                oldB = await repository.BoardManager.UpdateEntityAsync(oldB, newB);
                await CommitAndSendCallbackAsync();

                return(MapperBroker.GetBoardDTOFromEntity(oldB));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }