private void Button_Cancel_Click(object sender, RoutedEventArgs e) { BoardWindow window = new BoardWindow(boardId, username); window.Show(); this.Close(); }
private void SetMaxTaskF() { try { if (boardInput.MaxTask != -1 && !UserController.checkMaxTasks(boardId, this.userName, boardInput.MaxTask, boardInput.SelectedColumn.columnId)) { MessageBox.Show("there are more tasks than the max input: " + boardInput.SelectedColumn.columnId); } else { if (UserController.setMaxTask(boardId, this.userName, boardInput.MaxTask, boardInput.SelectedColumn.columnId)) { MessageBox.Show("set max task for column: " + boardInput.SelectedColumn.columnId); BoardWindow win = new BoardWindow(boardId, userName); win.Show(); this.Close(); } else { MessageBox.Show("can't set max task for this column"); } } } catch (Exception) { } }
private void Edit() { if (UserController.editTask(boardId, et.EditTaskId, this.username, et.EditTaskTitle, et.EditTaskDecription, et.EditTaskDateTime)) { MessageBox.Show("Task was edit " + et.EditTaskId); BoardWindow window = new BoardWindow(boardId, username); window.Show(); this.Close(); } else { MessageBox.Show("can't edit this task"); } }
private void Add() { if (UserController.addTask(boardId, taskinput.Title, taskinput.Description, username, taskinput.DueTime)) { MessageBox.Show("new task was added"); BoardWindow window = new BoardWindow(boardId, username); window.Show(); this.Close(); } else { MessageBox.Show("can't add this task: illegal input/ no more space in the first column"); } }
private void DeleteTask() { try { if (UserController.deleteTask(boardId, boardInput.Selected.taskId, this.userName)) { MessageBox.Show("Task number " + this.boardInput.Selected.taskId + " deleted"); BoardWindow win = new BoardWindow(boardId, userName); win.Show(); this.Close(); } else { MessageBox.Show("Task number : " + this.boardInput.Selected.taskId + " cant be deleted"); } } catch (Exception) { } }
private void AddColumn() { try { if (UserController.addNewColumn(boardId, userName, boardInput.ColumnTitle)) { MessageBox.Show(this.boardInput.ColumnTitle + " Column added successfuly"); BoardWindow win = new BoardWindow(boardId, userName); win.Show(); this.Close(); } else { MessageBox.Show("Column name : " + this.boardInput.ColumnTitle + " is illegal"); } } catch (Exception) { } }
private void SortTasks() { try { if (UserController.sortTasks(boardId, userName, this.userName)) { MessageBox.Show("tasks were sorted successfuly"); BoardWindow win = new BoardWindow(boardId, userName); win.Show(); this.Close(); } else { MessageBox.Show("tasks cant be sorted"); } } catch (Exception) { } }
private void DeleteColumnF() { try { int i = UserController.indexOfColumn(boardId, this.userName, ((BoardColumnWindowRow)columnOrder.SelectedItem).columnId); if (i != -1 && UserController.DeleteColumn(boardId, this.userName, i)) { MessageBox.Show("Column " + ((BoardColumnWindowRow)columnOrder.SelectedItem).columnId + " was deleted"); } else { MessageBox.Show("can't delete column"); } BoardWindow win = new BoardWindow(boardId, userName); win.Show(); this.Close(); } catch (Exception) { } }
private void Change_State() { try { if (UserController.changeState(boardId, boardInput.Selected.taskId, this.userName)) { MessageBox.Show("Task : " + boardInput.Selected.taskId + " was moved"); BoardWindow win = new BoardWindow(boardId, userName); win.Show(); this.Close(); } else { MessageBox.Show("can't change task state anymore :("); } } catch (Exception) { } }
private void Change_State_Back() { try { int i = UserController.indexOfColumn(boardId, this.userName, ((BoardColumnWindowRow)columnOrder.SelectedItem).columnId); if (i != -1 && UserController.changeOrderLeft(boardId, this.userName, i)) { MessageBox.Show("State changed " + ((BoardColumnWindowRow)columnOrder.SelectedItem).columnId); } else { MessageBox.Show("State can't change!!!"); } BoardWindow win = new BoardWindow(boardId, userName); win.Show(); this.Close(); } catch (Exception) { } }