private void btnAddBook_Click(object sender, EventArgs e) { BookAddUpdateFrm addBook = new BookAddUpdateFrm(); // for connecting first constructor of BookAddUpdate form. if (addBook.ShowDialog(this) == DialogResult.OK) { fill_listView(); // after the changes, clear and fill the listView again. } }
private void lvBooks_DoubleClick(object sender, EventArgs e) { if (lvBooks.SelectedItems.Count == 1) // if user select 'a line of listView' not more not less. { int indiceBookID = Convert.ToInt32(ALbookID[lvBooks.SelectedIndices[0]]); // for finding selected bookID from the array that we create. int indiceWriterID = Convert.ToInt32(ALwriterID[lvBooks.SelectedIndices[0]]); //for finding selected writerID from the array that we create. BookAddUpdateFrm updateBook = new BookAddUpdateFrm(indiceBookID, indiceWriterID); // for connecting other constructor of BookAddUpdate form. if (updateBook.ShowDialog(this) == DialogResult.OK) { fill_listView(); // after the changes, clear and fill the listView again. } } }