Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

== 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions