private void UpdateProduct_Click(object sender, EventArgs e) { try { int pBarcode = Convert.ToInt32(barcodeTxt.Text); string pName = comboName.Text; decimal pPrice = Convert.ToDecimal(txtPrice.Text); decimal pTax = Convert.ToDecimal(txtTax.Text); decimal pDiscount = Convert.ToDecimal(txtDiscount.Text); string pDescription = comboDescription.Text; int pCategoryID = Convert.ToInt32(comboCategory.SelectedIndex + 1); int pBrandID = Convert.ToInt32(comboBrand.SelectedIndex + 1); string pFullProductName = comboFullName.Text; string pShortProductName = comboShortName.Text; product.UpdateDatabase(pBarcode, pName, pPrice, pTax, pDiscount, pDescription, pCategoryID, pBrandID, pFullProductName, pShortProductName); MessageBox.Show("Product was successfully updated", "Inventory Management", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception error) { MessageBox.Show(error.Message, "Insert a new product", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }