Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We are using C# and I'm quite stuck on this one step In the try block of the Modify button click event handler, add code
We are using C# and I'm quite stuck on this one step
In the try block of the Modify button click event handler, add code that calls the SimulateConcurrentUpdate() method and passes it the value of the ProductCode property of the class Product variable. This code should go right before the UpdateProduct() method is called.
== frmProductMaintenance.cs* + x MMABooksDB.cs App.config Product.cs nce Product Maintenance.frmProduct 1/Step 21 Review modify button click event handler Notice call of HandleConcurrencyConflict() 1 reference private void btnModify_Click(object sender, EventArgs e) { Product oldProduct = this.CloneProduct(); frmAddModify addModifyForm = new frmAddModify { AddProduct = false, Product = selectedProduct }; DialogResult result = addModifyForm.ShowDialog(); if (result DialogResult.OK) { try { selectedProduct = addModifyForm.Product; if(ProductDB.UpdateProduct(oldProduct, selectedProduct)) { this.DisplayProduct(); } else { this.HandleConcurrencyConflict(); } } catch (SqlException ex) { this.HandleDatabaseError(ex); } catch (Exception ex) { this.HandleGeneralError(ex); }Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started