10 months ago

BIS 311 DeVry Week 7 iLab

ProductFound= result of

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

Category Points % Description Create and rename form, add controls, and set 15 30% properties Create database connection, dataset, and 10 20% query function Code data service class 5 10% Windows form was created and named ProductLookup.vb. Form text property was set to Lab 7 Your Name (where Your Name = your full name). The following controls were added to the form: Identifying label and text box for entry of product ID; button to perform product lookup; and labels for display of product name, product price, and error message. Name and text properties of all controls were set appropriately, with no typos or spelling errors. A connection to the Inventory database and an associated dataset containing the Products table were created. A FillByProductID() method using an SQL query to retrieve a product record with a specified product ID has been added to the Products table adapter. A DataService class was created with code that corresponds to the given class diagram and pseudocode, with no errors. Class includes public properties for the product ID, product name, and product price, and a GetProduct() method that retrieves the product name and price for a specified product ID and returns a Boolean value indicating success or failure. Code button-click event 5 10% Button-click event code was entered that corresponds to the given pseudocode, with no syntax errors. An object of the DataService class is instantiated and used to retrieve the product name and price for the product ID entered by the user. The name and price are displayed if the product record was found, or the "Product ID not found" message otherwise. Test-run successfully application 15 30% Application is shown running successfully with screenshots for each of the 4 cases: cases 1–3 each show a valid product ID entered with correct name and price displayed; case 4 shows an invalid product ID entered with "Product ID not found" message displayed. Total 50 100% Required Software Visual Studio 2012 Access the software"> Steps: all iLAB STEPS Step 1: Create Project and Form">Back to Top (a) Important: Before beginning this lab, download the Microsoft Access database file Inventory.accdb from Doc Sharing and save it to your Downloads folder or on your computer desktop. Don't open the file from Doc Sharing, just save it and make a note of where it is located. If it downloads automatically when you click on it in Doc Sharing, it is most likely saved in your Downloads folder, but check to make sure. You will need to be able to locate this file to create a data connection to it in Step 2. (b) Log in to the Citrix iLab site as you did in the previous labs. Click the Microsoft Visual Studio 2012 icon to launch Visual Studio. (c) Pull down the File menu and select New Project . . . (d) In the New Project dialog, ensure that under Templates in the left column, Visual Basic is selected, and that in the center column, Windows Form Application is selected. In the Name field at the bottom of the dialog, enter ProductLookup. Click OK.

DEVRY CIS 336 Week 7 iLab 7