/// <summary> /// New Item /// </summary> private void NewItemCopies() { frmEditRecipes form = new frmEditRecipes(); var res = form.ShowDialog(); // Show Edit form while (res == DialogResult.Yes) // If New item request { form.Dispose(); form = new frmEditRecipes(); // New Form res = form.ShowDialog(); // Show new Edit form } UpdateRecOLV(); // Update Items OLV }
/// <summary> /// Edit Item /// </summary> private void EditItemCopies() { if (olvRecipes.SelectedIndex >= 0) // If selected Item { frmEditRecipes form = new frmEditRecipes(); // Show Edit form var res = form.ShowDialog(((Recipes)olvRecipes.SelectedObject).ID); while (res == DialogResult.Yes) // If New item request { form.Dispose(); form = new frmEditRecipes(); // New Form res = form.ShowDialog(); // Show new Edit form } UpdateRecOLV(); // Update Items OLV } }