private void btnAddNewReq_Click(object sender, EventArgs e) { frmAddReq addReq = new frmAddReq(); addReq.ShowDialog(); updateItems(); }
private void btnEditReq_Click(object sender, EventArgs e) { if (lstExistingItems.SelectedItem == null) { errProvider.SetError(lstExistingItems, "Select a requirement to edit."); return; } string name = lstExistingItems.SelectedItem.ToString(); if (this.itemNamesTableAdapter.Exists(name) > 0) { errProvider.SetError(lstExistingItems, "Cannot edit item from this form. Use main form."); return; } frmAddReq edit = new frmAddReq(); edit.editReq(lstExistingItems.SelectedItem.ToString()); edit.ShowDialog(); }