Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise: Build the Payment Entry application using c# visual studio In this exercise, you ll start to build the application that s presented in Chapter

Exercise: Build the Payment Entry application using c# visual studio
In this exercise, youll start to build the application thats presented in Chapter 9 in your textbook, but youll use the existing PayablesData library. As a result, you wont have to code the business or database classes. This exercise will demonstrate how the use of object data sources can make it easier for you to build three-layer applications.
Start the application and set up the PayablesData library
1. Start a new project named PaymentEntry in your chapter 9 directory.
2. Add a new class library project to the solution named PayablesData. To do that, you can right-click on the solution in the Solution Explorer, select ->, click on the Class Library template, and proceed from there.
3. Add the five classes in the PayablesData library thats in the PaymentEntry application in the Book applications\Chapter 09 directory to the new PayablesData project. To do that, you can right-click on the PayablesData project in the Solution Explorer, select ->, and proceed from there.
4. Use the -> command to build the PayablesData project and create the DLL file for the class library. (If you are using C# 2010 Express Edition, right-click on the name of the PayablesData project in the Solution Explorer, then select from the shortcut menu).
Build the Vendor Invoices form
5. Use the procedure in figure 9-2 in your textbook to create an object data source for the Vendor class in the PayablesData library. In the step for selecting the object, click on the Add Reference button and add a reference to the PayablesData library. Then, create a second object data source, this time for the Invoice class.
6. Use the procedure in figure 9-3 in your textbook to drag the properties for the Vendor class onto the form so they look like the ones in figure 9-6. Then, drag the Invoice class onto the form so it creates a DataGridView control like the one thats also shown in figure 9-6.
7. Set the properties for the Name combo box using the procedure shown in figure 4-3 of chapter 4. In this case, you set DataSource to vendorBindingSource, DisplayMember to Name, and ValueMember to VendorID. Also, set the
DropDownStyle property to DropDownList, and be sure to change the
(DataBindings) Text property to none to remove the binding from the text box portion of the combo box.
8. Test the application to see how it works. At this time, no data is displayed because the business objects that are bound to the controls havent been populated with data.
9. Add the code for the Load event handler thats shown in figure 9-12(part 1), and add the code for the two methods that it calls. That will populate the business objects. Then, add the event handler for the SelectedIndexChanged event for the Name combo box.
10. Test theapplication to see that the form shows the data for any vendor that you select from the combo box. This should give you some idea of how the use of object data sources can help you build three-layer applications more quickly. Build the Payment Entry form and complete the application
11. If you think you can learn more by building the rest of this application, you should be able to do so without much trouble. And if you have problems, you can refer to the complete application in the Book applications\Chapter 09 directory.

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

=+b) What is the best choice using the expected-value approach?

Answered: 1 week ago