public void LoadBoard(string boardName) { thisBoard = null; StackPanelColumnControls.Children.Clear(); if (string.IsNullOrEmpty(boardName)) { return; } thisBoard = CommonMethods.SafeRunMethod.WithReturn(() => httpClientProvider.GetDatabaseBoardReader().GetWithUsingFilters(boardName).First()); if (thisBoard == null) { return; } var columns = CommonMethods.SafeRunMethod.WithReturn(() => httpClientProvider.GetDatabaseColumnReader().GetFromBoard(thisBoard.BoardId)); if (columns?.Any() != true) { return; } foreach (var column in columns) { StackPanelColumnControls.Children.Add(CreateColumnControl(column, boardName)); } ((ColumnControl)StackPanelColumnControls.Children[StackPanelColumnControls.Children.Count - 1]).BorderThickness = new Thickness(3, 2, 3, 0); }
private void ComboBoxBoards_OnDropDownOpened(object sender, EventArgs e) { var boardNames = CommonMethods.SafeRunMethod.WithReturn(() => httpClientProvider.GetDatabaseBoardReader().GetAll().Select(board => board.Name).ToArray()); if (boardNames == null) { return; } ComboBoxBoards.ItemsSource = new[] { string.Empty }.Concat(boardNames).ToArray(); }
public FullListTasksWindow(HttpClientProvider httpClientProvider, string boardName) { InitializeComponent(); this.httpClientProvider = httpClientProvider; board = CommonMethods.SafeRunMethod.WithReturn(() => httpClientProvider.GetDatabaseBoardReader().GetWithUsingFilters(boardName).First()); if (board == null) { return; } DataGridTasks.LoadTable(typeof(Task)); ReloadDataGridTasksItemsSource(); }
private Board GetThisBoard() { return(CommonMethods.SafeRunMethod.WithReturn(() => httpClientProvider.GetDatabaseBoardReader().GetById(thisTask.BoardId))); }
private void MenuItemAddTask_OnClick(object sender, RoutedEventArgs e) { var board = CommonMethods.SafeRunMethod.WithReturn(() => httpClientProvider.GetDatabaseBoardReader().GetById(thisColumn.BoardId)); CommonMethods.WorkWithTables.Add((task, isReadOnly) => new TaskWindow(httpClientProvider, task, GetUserNames(), GetColumnNames(), board.Name, board.BoardId, isReadOnly), httpClientProvider.GetDatabaseTaskEditor(), () => AddTask?.Invoke(this, default(EventArgs))); }