public TaskWindow(int boardID, int?taskID, KanbanBoardWindow board) { InitializeComponent(); this.boardID = boardID; this.board = board; // Hide warning labels hideWarningLabels(); if (taskID.HasValue) { // get column position this.taskID = taskID.Value; int columnPos = TaskDO.GetTask(this.taskID).ColumnPos - 1; // Set combobox values comboBox.ItemsSource = ColumnsDO.GetBoardColumnNames(boardID); comboBox.SelectedIndex = columnPos; // Fill the fields fillFields(this.taskID); } else { this.taskID = 0; // set combobox values comboBox.ItemsSource = ColumnsDO.GetBoardColumnNames(boardID); comboBox.SelectedIndex = 0; } }
public LoadBoardWindow(int?boardID, KanbanBoardWindow board = null) { InitializeComponent(); hideWarningLabels(); // verify if another board is loaded in the background if (board != null && boardID.HasValue) { this.board = board; this.boardID = boardID.Value; } }
private void loadBoardButton_Click(object sender, RoutedEventArgs e) { hideWarningLabels(); if (verifyBoardNameInput() == true) { // verify board is already loaded on the background if (board != null) { // verify loaded boardID is same as searched one if (BoardsDO.GetBoardID(kanbanBoardTextInput.Text) == boardID) { // if they are the same return loaded board board.LoadBoard(boardID); this.Close(); } else { // Create Board Window KanbanBoardWindow newBoardWindow = new KanbanBoardWindow(BoardsDO.GetBoardID(kanbanBoardTextInput.Text)); board.Close(); this.Close(); // Show Kanban Board Window newBoardWindow.Top = 100; newBoardWindow.Left = 150; newBoardWindow.Show(); } } // if board is not loaded on the background create new one else { // Create Board Window KanbanBoardWindow kanbanBoardWindow = new KanbanBoardWindow(BoardsDO.GetBoardID(kanbanBoardTextInput.Text)); // Closes Create Board WIndow this.Close(); // Show Kanban Board Window kanbanBoardWindow.Top = 100; kanbanBoardWindow.Left = 150; kanbanBoardWindow.Show(); } } }
// Method creates columns in boards private void createColumnsButton_Click(object sender, RoutedEventArgs e) { // Hide warning labels hideColumnsWarningLabels(); // Verify input if (verifyColumnsInput(getColumnNames()) == true) { ColumnsDO.CreateColumns(BoardsDO.GetBoardID(myBoard.BoardName), getColumnNames()); // Create Board Window KanbanBoardWindow kanbanBoardWindow = new KanbanBoardWindow(BoardsDO.GetBoardID(myBoard.BoardName)); // Closes Create Board WIndow this.Close(); // Show Kanban Board Window kanbanBoardWindow.Top = 100; kanbanBoardWindow.Left = 150; kanbanBoardWindow.Show(); } ; }