private ProductLinkModel SaveProductLinkToDb(ProductLinkModel productLink) { int productLinkId = SqliteDAProductLink.SaveProductLink(productLink); if (productLinkId > 0) { MessageBox.Show("New product link created successfully", "New Product Link", MessageBoxButtons.OK, MessageBoxIcon.Information); productLink.Id = productLinkId; } else { MessageBox.Show("Something went wrong. New product link could not be saved.\nCheck the error log for more information.", "New Product Link Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(productLink); }
// This method saves the new product link information, which was added by the user, to the database. private void saveNewProductLinkInformationToDb() { if (SqliteDAProductLink.SaveProductLink(this.productLink) > 0) { DialogResult dialogResult = MessageBox.Show("New product link created successfully", "New Product Link", MessageBoxButtons.OK, MessageBoxIcon.Information); if (dialogResult == DialogResult.OK) { this.Close(); } } else { MessageBox.Show("Something went wrong. New product link could not be saved.\nCheck the error log for more information.", "New Product Link Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }