private void ActionEditJob(Object sender, EventArgs e) { if (listMain.SelectedItems.Count == 0) { MessageBox.Show(this, "Nothing to edit! Select job first.", "Error"); return; } if (listMain.SelectedItems[0].Text == JobStatus.Completed.ToString()) { MessageBox.Show(this, "Can't edit already completed job.", "Error"); return; } FormCreateJob form = new FormCreateJob(GetJobByKey((Int32)listMain.SelectedItems[0].Tag)); form.OnJobAddition += new FormCreateJob.JobAdditionHandler(AtionJobEditing); form.ShowDialog(this); }
// Menu job private void ActionCreateJob(Object sender, EventArgs e) { FormCreateJob form = new FormCreateJob(); form.OnJobAddition += new FormCreateJob.JobAdditionHandler(ActionJobAdding); form.ShowDialog(this); }