You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
ProductFound= result of GetProduct() method of dataSvc<br />
if ProductFound is True<br />
Display Product name and Product price<br />
Else Display "Product ID not found"<br />
Stop button-click event handler<br />
Class Diagram for DataService Class<br />
DataService<br />
+numeric ProductID<br />
+string ProductName<br />
+string ProductPrice<br />
GetProduct()<br />
Pseudocode for GetProduct() Method of DataService Class<br />
Boolean GetProduct()<br />
Instantiate DataSet object for the Inventory database<br />
Instantiate TableAdapter object for the Products table in the Inventory database<br />
Declare Boolean variable Found<br />
Use the Products TableAdapter object to retrieve the Products record matching ProductID into the Inventory DataSet<br />
object<br />
If the count of Products records in the Inventory DataSet > 0<br />
Set ProductName=ProductName field of the first retrieved record<br />
Set ProductPrice=ProductPrice field of the first retrieved record<br />
Set Found=True<br />
Else<br />
Set Found = False<br />
Return Found<br />
End GetProduct()<br />
Remember This<br />
In a true client-server application running on a network, the code in the DataService class would be executed on the<br />
server (the data-services tier), and the form would be executed on the client (the user-interface tier). In this lab, both<br />
the DataService class and the form will be executed on the same computer.<br />
Deliverables<br />
Submit a Word document named Lab7YourFirstLastName.docx (where YourFirstLastName = your first and last name;<br />
e.g., Lab7JohnSmith.docx) containing the following.<br />
<br />
<br />
<br />
<br />
Screenshot of form showing the application running, with a valid product ID entered and the corresponding<br />
product name and price displayed<br />
Screenshot of form showing the application running, with an invalid product ID entered and the message<br />
"Product ID not found" displayed<br />
Copy of code for button-click event<br />
Copy of code for DataService class