private void buttonSaveBook_Click(object sender, EventArgs e) { List <Inventory> listI = InventoryDA.ListInventory(); if (IsValidInventoryData()) { if (!Validation.IsUniqueISBN(listI, Convert.ToInt32(textBoxISBN.Text))) { MessageBox.Show("Duplicate", "DUPLICATE Author ID"); textBoxISBN.Clear(); textBoxISBN.Focus(); return; } Inventory aProducts = new Inventory(); aProducts.ISBNProduct = Convert.ToInt32(textBoxISBN.Text); aProducts.ProductTitle = textBoxBookTitle.Text; aProducts.ProductDescription = comboboxProductDescription.Text; aProducts.LastName = comboBoxAuthorId.Text; aProducts.PublisherName = comboBoxPublisherName.Text; aProducts.ProductYearPublished = Convert.ToInt32(textBoxYearPushlished.Text); aProducts.ProductQuantity = Convert.ToInt32(textBoxQuantityOnHand.Text); aProducts.ProductPrice = Convert.ToDouble(textBoxBookPrice.Text); InventoryDA.Save(aProducts); listB.Add(aProducts); buttonListBook.Enabled = true; ClearAll(); } }