public void Edit(object sender, EventArgs args) { if (this.viewList.SelectedItems.Count > 0) { int currentID = Convert.ToInt32(this.viewList.SelectedItems[0].Tag); JobModel selectedJob = new JobModel(); for (int index = 0; index < currentJobs.Count; index++) { if (currentJobs[index].ID == currentID) { selectedJob = currentJobs[index]; } } EditView editView = new EditView(selectedJob); editView.ShowDialog(this); } }
public void Add(object sender, EventArgs args) { EditView editView = new EditView(); editView.ShowDialog(this); }