Answered step by step
Verified Expert Solution
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 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 threelayer applications.
Start the application and set up the PayablesData library
Start a new project named PaymentEntry in your chapter directory.
Add a new class library project to the solution named PayablesData. To do that, you can rightclick on the solution in the Solution Explorer, select click on the Class Library template, and proceed from there.
Add the five classes in the PayablesData library thats in the PaymentEntry application in the Book applicationsChapter directory to the new PayablesData project. To do that, you can rightclick on the PayablesData project in the Solution Explorer, select and proceed from there.
Use the command to build the PayablesData project and create the DLL file for the class library. If you are using C# Express Edition, rightclick on the name of the PayablesData project in the Solution Explorer, then select from the shortcut menu
Build the Vendor Invoices form
Use the procedure in figure 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.
Use the procedure in figure in your textbook to drag the properties for the Vendor class onto the form so they look like the ones in figure Then, drag the Invoice class onto the form so it creates a DataGridView control like the one thats also shown in figure
Set the properties for the Name combo box using the procedure shown in figure of chapter 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.
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.
Add the code for the Load event handler thats shown in figure part 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.
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 threelayer applications more quickly. Build the Payment Entry form and complete the application
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 applicationsChapter directory.
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