private void addUpdateSubTaskToolStripMenuItem_Click(object sender, EventArgs e) { if (childTask == null) { childTask = new childTasksForm(theUser, null); //childTask.MdiParent = this; childTask.StartPosition = FormStartPosition.CenterScreen; childTask.FormClosed += ChildTask_FormClosed; childTask.ShowDialog(); } else { childTask.Activate(); } }
private void listTaskGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == 12) { DataGridViewRow row = this.listTaskGridView.Rows[e.RowIndex]; Models.Task task = new Models.Task(); task.task_owner = (int)row.Cells["task_owner"].Value; task.taskID = (int)row.Cells["taskID"].Value; task.title = row.Cells["title"].Value.ToString(); if (row.Cells["task_priority"].Value == DBNull.Value) { task.task_priority = -1; } else { task.task_priority = Convert.ToInt32(row.Cells["task_priority"].Value); } if (row.Cells["taskType"].Value == DBNull.Value) { task.taskType = -1; } else { task.taskType = Convert.ToInt32(row.Cells["taskType"].Value); } childTasksForm subTaskView = new childTasksForm(user, task); subTaskView.StartPosition = FormStartPosition.CenterScreen; subTaskView.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.GetType().ToString()); } }