/// <summary> /// New Item /// </summary> private void NewItemBooks() { frmEditBooks form = new frmEditBooks(); var res = form.ShowDialog(); // Show Edit form while (res == DialogResult.Yes) // If New item request { form.Dispose(); form = new frmEditBooks(); // New Form res = form.ShowDialog(); // Show new Edit form } UpdateBooksOLV(); // Update Books OLV UpdateCopOLV(); // Update Copies OLV }
/// <summary> /// Edit Item /// </summary> private void EditItemBooks() { if (olvBooks.SelectedIndex >= 0) // If selected Item { frmEditBooks form = new frmEditBooks(); // Show Edit form var res = form.ShowDialog(((Books)olvBooks.SelectedObject).ID); while (res == DialogResult.Yes) // If New item request { form.Dispose(); form = new frmEditBooks(); // New Form res = form.ShowDialog(); // Show new Edit form } UpdateBooksOLV(); // Update Books OLV UpdateCopOLV(); // Update Copies OLV } }