/// <summary> /// Pobiera wszystkie taskboardy /// </summary> private async Task GetTaskBoards() { try { HttpTaskBoardClient client = new HttpTaskBoardClient(); ICollection <TaskBoardPublic> response = await client.GetAllTaskboards(mContext.UserAccount.ID).ConfigureAwait(false); await Application.Current.Dispatcher.BeginInvoke(() => { foreach (TaskBoardPublic tb in response) { TaskBoards.Add(new TaskBoardContainer(tb, mContext)); } }); } catch (Exception) { mContext.DialogBuilder.ErrorDialog("Taskboards couldn't be retrieved, due to server error."); } }
/// <summary> /// Tworzy nowy TaskBoard /// </summary> private async Task CreateTaskBoard() { try { HttpTaskBoardClient client = new HttpTaskBoardClient(); TaskBoardPublic taskBoard = new TaskBoardPublic() { Name = "Unnamed TaskBoard", UserID = mContext.UserAccount.ID }; TaskBoardPublic response = await client.CreateTaskBoard(taskBoard).ConfigureAwait(false); await Application.Current.Dispatcher.BeginInvoke(() => { TaskBoards.Add(new TaskBoardContainer(response, mContext)); }); } catch (Exception) { mContext.DialogBuilder.ErrorDialog("Taskboard couldn't be created, due to server error."); } }