void ButtonAddClick(object sender, EventArgs e) { using (SalesInfoDetailForm f = new SalesInfoDetailForm()) { if (WorkbenchSingleton.AddDialog(f) == DialogResult.OK) { info.AddDetail(f.Detail); RefreshList(); } } }
void ListView1DoubleClick(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { SalesInfoDetail i = info.Details[listView1.SelectedItems[0].Index]; using (SalesInfoDetailForm f = new SalesInfoDetailForm(i)) { if (WorkbenchSingleton.AddDialog(f) == DialogResult.OK) { RefreshList(); } } } }