/* * Opens the add subtask form */ private void btnAddSubtask_Click(object sender, EventArgs e) { if (taskTreeView.SelectedNode == null) { MessageBox.Show("Please select a task from the Task List."); } else if (subtaskForm == null) { //MessageBox.Show(this.getSelectedNodeTaskID().ToString()); Models.Task tag = (Models.Task)taskTreeView.SelectedNode.Tag; //MessageBox.Show(tag.taskID.ToString()); subtaskForm = new AddUpdateChildTaskForm(user, false, this, null); //childTask.MdiParent = this; subtaskForm.StartPosition = FormStartPosition.CenterScreen; subtaskForm.FormClosed += SubtaskForm_FormClosed; subtaskForm.ShowDialog(); } else { subtaskForm.Activate(); } }
public AddUpdateChildTaskForm(User _user, bool _isUpdate, dateForm dateForm, childTasksForm childTasksForm) { InitializeComponent(); user = _user; isUpdate = _isUpdate; //load tasks into comboBox this.dateForm = dateForm; this.childTasksForm = childTasksForm; //LoadComboBoxes(); //comboPriority.SelectedIndex = 0; instance = this; deadlinePicker.Format = DateTimePickerFormat.Custom; deadlinePicker.CustomFormat = "MM/dd/yyyy hh:mm tt"; if (dateForm != null) { this.taskTitle = TaskController.getATask(dateForm.getSelectedNodeTaskID()).title; } else if (childTasksForm != null) { this.taskTitle = childTasksForm.getTask().title; } }
private void SubtaskForm_FormClosed(object sender, FormClosedEventArgs e) { subtaskForm.Dispose(); subtaskForm = null; }
private void btnAddNewSubTask_Click(object sender, EventArgs e) { AddUpdateChildTaskForm addUpdateChildTaskForm = new AddUpdateChildTaskForm(user, false, null, this); addUpdateChildTaskForm.ShowDialog(); }