//show the add/edit form in add mode, ie, no active product. private void btnAdd_Click(object sender, EventArgs e) { frmAddEdit myForm = new frmAddEdit(ADD_MESSAGE); myForm.ShowDialog(); if (myForm.DialogResult == DialogResult.OK) { MessageBox.Show("Successfully added " + myForm.activePackage); ClearControls(); updatePackages(); fillDGVs(); } else if (myForm.DialogResult == DialogResult.Abort) { MessageBox.Show("Failed to add" + myForm.activePackage + "please try again"); } }
//show the add/edit dialogue, in edit mode, ie imports the active package private void btnEdit_Click(object sender, EventArgs e) { if (activePackage != null) { frmAddEdit myForm = new frmAddEdit(EDIT_MESSAGE, activePackage); myForm.ShowDialog(); if (myForm.DialogResult == DialogResult.OK) { updatePackages(); ClearControls(); MessageBox.Show("Successfully updated " + myForm.activePackage); } else if (myForm.DialogResult == DialogResult.Abort) { MessageBox.Show("Failed to edit " + myForm.activePackage); } } else { MessageBox.Show("Please select a package to edit."); } }
//show the add/edit form in add mode, ie, no active product. private void btnAdd_Click(object sender, EventArgs e) { frmAddEdit myForm = new frmAddEdit(ADD_MESSAGE); myForm.ShowDialog(); if (myForm.DialogResult == DialogResult.OK) { MessageBox.Show("Successfully added " + myForm.activePackage); ClearControls(); updatePackages(); fillDGVs(); } else if (myForm.DialogResult == DialogResult.Abort) { MessageBox.Show("Failed to add" + myForm.activePackage +"please try again"); } }