Ejemplo n.º 1
0
        private void addBook_Click(object sender, EventArgs e)
        {
            BookForm bForm = new BookForm();

            bForm.ShowDialog();

            if (bForm.DialogResult == DialogResult.OK)
            {
                booksCollection.addBook(bForm.GetBook());
            }
        }
Ejemplo n.º 2
0
 private void editToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         BookForm editForm = new BookForm((Book)listView.SelectedItems[0].Tag);
         editForm.ShowDialog();
         if (editForm.DialogResult == DialogResult.OK)
         {
             editForm.EditedBook.copyExceptId(editForm.GetBook());
             vm.updateBook(editForm.EditedBook);
         }
     }
     catch (System.ArgumentOutOfRangeException ex)
     {
         Console.WriteLine(ex.Message);
     }
 }