Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In visual studio 2015 using visual basic el au Section 2 The Visual Basic language essentials Add an event handler for the Click event of
In visual studio 2015 using visual basic
el au Section 2 The Visual Basic language essentials Add an event handler for the Click event of the Save button that validates the data on the form using the methods of the Validator class (all three fields are required and the email field must be a valid email address), and then creates a new Customer object and closes the form if the data is valid. Add an event handler for the Click event of the Cancel button that simply closes the form. 6. 7. Add code to implement the Customer Maintenance form 8. Display the code for the Customer Maintenance form, and declare a module-level variable named customers of type List(Of Customer). Add an event handler for the Load event of the form that uses the GetCustomers method of the CustomerDB class to load the customers list and then adds the customers to the Customers list box. Use the GetDisplayText method of the Customer class to format the customer data. Add an event handler for the Click event of the Add button that creates a new instance of the New Customer form and displays it as a dialog box. If the Customer object that's available from the Customer variable in the New Customer form isn't equal to Nothing, this event handler should add that customer to the list, call the SaveCustomers method of the CustomerDB class to save the list, and then refresh the Cstomers list box. 9. 10. 11. Add an event handler for the Click event of the Delete button that removes he the selected customer from the list, calls the SaveCustomers method of CustomerDB class to save the list, and refreshes the Customers list box. Be sure to confirm the delete operation 12. Add an event handler for the Click event of the Exit button that closes the form. Run and test the application 13. Run the application and test it to be sure that it works properly. When you're done, end the application, but leave the solution open if you're going to continue with the next exercise. 1-2 Exercise 1 In this exercise, you'll modit Use a structure Cl Chapter I1How to create and use classes Exercise 11-1 Create a Customer Maintenance application that uses classes In this exercise, you'll create a Customer Maintenance application that uses three classes. To make this application easier to develop, we'll give you the starting forms, a complete Validator class, and a complete CustomerDB class t you'll use to work with the data in a file of customers. Note that the CustomerDB class assumes that the file of customers (Customers.xml) is in the C:VB 20151Files directory. If you placed this file in a different directory after downloading and installing the files for this book, you will need to change the path specification Open the project and add a Customer class 1. Open the application in the ClVB 2015iChapter I CustomerMaintenance directory. Then, review both of the forms in the Form Designer window so you get an idea of how this project should work Add a class named Customer to this project, and add the properties, method. and constructors that are shown in the table below. Implement the properties using the standard syntax 2. Property Description Gets or sets a string that contains the customer's first name. Gets or sets a string that contains the customer's last name Gets or sets a string that contains the customer's email address. FirstName LastName Email Description Returns a string that contains the customer's name and email address formatted like this: Joanne Smith, jsmith @ amaco.com Description Creates a Customer object with default values Method GetDisplayText ( Constructor New () New(first Name, lastName, Creates a Customer object with the specified values. email) When you complete the Customer class, use the Solution Explorer to review the members and jump to the code for one or more of the members. Then review the members for the Validator class. Note that one of the methods is Is ValidEmail, which you can use to validate email addresses. 3. en. Create a class diagram and use it to review the members and code of the Customer and Validator classes. 4. Add code to implement the Add Customer form 5. Display the cod le for the Add Customer form, and declare a public variable named Customer of type CustomerStep 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