Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Employee Class -- P rogram language: VISUAL C# Programming -- full application code Create an application with a class named Employee, which contains the following:

Employee Class -- Program language: VISUAL C# Programming -- full application code image text in transcribed

Create an application with a class named Employee, which contains the following:

Private fields for an employee's name, ID number, department, and position of appropriate data type

Constructor which does not receive any arguments and initializes the private fields to the appropriate value

Parameterized Constructor which receives four arguments and assigns the values to the private fields

Properties which get and set the values of the corresponding private fields

The application should contain a Main form which allows the user to enter the employee's name, ID number,

department, and position. An Employee object should be instantiated and the values entered by the user should be

assigned to the private fields of the object using either the Parameterized Constructor or the Properties. The Add

Employee button should add the Employeee objects to a List object and each employee's name should be displayed

in a list box on the Main form. The Add Employee button should also clear the text boxes and set the focus to the

Name text box. All information is REQUIRED and a message should be displayed if any text box is left blank and

focus should return to the text box. Additionally, the ID number should be validated to ensure appropriate data type

(i.e., whole number) and that it is greater than zero. In each case of invalid data, a message should be displayed, the

text box cleared, and focus set back to the text box causing the error. The Clear button should clear ALL the controls

on the form and set the focus to the Name text box.

When the user selects a name from the list box, a second form (provide a descriptive name) should appear displaying

that employee's name, ID Number, department, and position by referencing the Employee objects that have been

added to the List object as shown in the sample second form shown below (hint: be sure and utilize the Properties):

IMPORTANT: Accessing Controls on a Different Form

It is possible for code that is outside the forms class to access the controls (e.g., labels, text boxes, etc.) on that form.

Controls that are placed on a form have Private access by default. In order for code that is outside the forms class to

access controls on that form the Modifiers property MUST be changed to Public. An alternative is to pass the List object as an argument to the form

The program MUST include standard features of a Windows application including:

Change the default Text property of the forms to something descriptive

Appropriate naming conventions for all controls (i.e., buttons, labels, text boxes, list, list box)

Buttons with appropriate name and standard keyboard access key

AcceptButton and CancelButton properties should be appropriately assigned to the Add Employee button and

Clear button, respectively

Ensure tab order for form is logical

Appropriate naming conventions and data type declarations for variables

Remove all unused event handlers from the program code

Employee Class Create an application with a class named Employee, which contains the following: Private fields for an employee's name, ID number, department, and position of appropriate data type Constructor which does not receive any arguments and initializes the private fields to the appropriate value Parameterized Constructor which receives four arguments and assigns the values to the private fields Properties which get and set the values of the corresponding private fields The application should contain a Main form which allows the user to enter the employee's name, ID number, department, and position. An Employee object should be instantiated and the values entered by the user should be assigned to the private fields of the object using either the Parameterized Constructor or the Properties. The Add Employee button should add the Employeee objects to a List object and each employee's name should be displayed in a list box on the Main form. The Add Employee button should also clear the text boxes and set the focus to the Name text box. All information is REQUIRED and a message should be displayed if any text box is left blank and focus should return to the text box. Additionally, the ID number should be validated to ensure appropriate data type (i.e., whole number) and that it is greater than zero. In each case of invalid data, a message should be displayed, the text box cleared, and focus set back to the text box causing the error. The Clear button should clear ALL the controls on the form and set the focus to the Name text box. A sample Main Form and sample Message Boxes are provided below: Employee Information - 0 X Name ID Number must be a whole number. Name cannot be blank. Department cannot be blank. ID Number Department Position " LOK DOKI ID Number must be greater than zero. Position cannot be blank. Add Clear OK When the user selects a name from the list box, a second form (provide a descriptive name) should appear displaying that employee's name, ID Number, department, and position by referencing the Employee objects that have been added to the List object as shown in the sample second form shown below (hint: be sure and utilize the Properties): Employee Details - a X Employee Details - 0 X Employee Details - 0 X Name Name Mak Jones Name Joy Rogera Susan Meyers 47899 ID Number ID Number 39119 ID Number 81774 Department Accounting Department Department Manufactura Position Vice President Position Programmer Poatian Engineer Close dose 1 Close IMPORTANT: Accessing Controls on a Different Form It is possible for code that is outside the form's class to access the controls (e.g., labels, text boxes, etc.) on that form. Controls that are placed on a form have Private access by default. In order for code that is outside the form's class to access controls on that form the Modifiers property MUST be changed to Public. See the Create Multiple Forms video demonstration under the Module 1: Videos link in Module 1: Classes and Multiform Projects (Chapter 9) on the Modules page for a lab-related example. An alternative is to pass the List object as an argument to the form (see the Pets Project Multiple Forms V02 Completed project under the Examples and Exercises heading in Module 1). The program MUST include standard features of a Windows application including: Change the default Text property of the forms to something descriptive Appropriate naming conventions for all controls (i.e., buttons, labels, text boxes, list, list box) Buttons with appropriate name and standard keyboard access key AcceptButton and CancelButton properties should be appropriately assigned to the Add Employee button and Clear button, respectively Ensure tab order for form is logical Employee Class Create an application with a class named Employee, which contains the following: Private fields for an employee's name, ID number, department, and position of appropriate data type Constructor which does not receive any arguments and initializes the private fields to the appropriate value Parameterized Constructor which receives four arguments and assigns the values to the private fields Properties which get and set the values of the corresponding private fields The application should contain a Main form which allows the user to enter the employee's name, ID number, department, and position. An Employee object should be instantiated and the values entered by the user should be assigned to the private fields of the object using either the Parameterized Constructor or the Properties. The Add Employee button should add the Employeee objects to a List object and each employee's name should be displayed in a list box on the Main form. The Add Employee button should also clear the text boxes and set the focus to the Name text box. All information is REQUIRED and a message should be displayed if any text box is left blank and focus should return to the text box. Additionally, the ID number should be validated to ensure appropriate data type (i.e., whole number) and that it is greater than zero. In each case of invalid data, a message should be displayed, the text box cleared, and focus set back to the text box causing the error. The Clear button should clear ALL the controls on the form and set the focus to the Name text box. A sample Main Form and sample Message Boxes are provided below: Employee Information - 0 X Name ID Number must be a whole number. Name cannot be blank. Department cannot be blank. ID Number Department Position " LOK DOKI ID Number must be greater than zero. Position cannot be blank. Add Clear OK When the user selects a name from the list box, a second form (provide a descriptive name) should appear displaying that employee's name, ID Number, department, and position by referencing the Employee objects that have been added to the List object as shown in the sample second form shown below (hint: be sure and utilize the Properties): Employee Details - a X Employee Details - 0 X Employee Details - 0 X Name Name Mak Jones Name Joy Rogera Susan Meyers 47899 ID Number ID Number 39119 ID Number 81774 Department Accounting Department Department Manufactura Position Vice President Position Programmer Poatian Engineer Close dose 1 Close IMPORTANT: Accessing Controls on a Different Form It is possible for code that is outside the form's class to access the controls (e.g., labels, text boxes, etc.) on that form. Controls that are placed on a form have Private access by default. In order for code that is outside the form's class to access controls on that form the Modifiers property MUST be changed to Public. See the Create Multiple Forms video demonstration under the Module 1: Videos link in Module 1: Classes and Multiform Projects (Chapter 9) on the Modules page for a lab-related example. An alternative is to pass the List object as an argument to the form (see the Pets Project Multiple Forms V02 Completed project under the Examples and Exercises heading in Module 1). The program MUST include standard features of a Windows application including: Change the default Text property of the forms to something descriptive Appropriate naming conventions for all controls (i.e., buttons, labels, text boxes, list, list box) Buttons with appropriate name and standard keyboard access key AcceptButton and CancelButton properties should be appropriately assigned to the Add Employee button and Clear button, respectively Ensure tab order for form is logical

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions