Question
You will create a Windows form application that is responsible for managing a collection of Employee records. Each employee record will have properties for data,
You will create a Windows form application that is responsible for managing a collection of Employee records. Each employee record will have properties for data, and a property to retain a record number that will be used as a key. A key is like a unique identifier for a record. In this case, a record number can be an integer.
Each Employee object must have a first name, last name, department, salary, and record number. The record number should be unique for every Employee object. The Employee class will have private fields and public properties to get/set the data for first name, last name, salary, department, and record number.
The backend "database" will be simulated in this Windows form application as a generic List. You will create Employee records based on the Employee class, and store them in a collection (i.e. a List of Employee objects), in the code, in your form's code behind file (i.e. Form1.cs).
That collection must be built/accessible in a way so that your Form's code behind has access to the data at all times - it should be structured in such a way so that the data persists as long as the form is open on the screen. One option would be to make a generic Employee List variable at the class level in the Form's code-behind file (i.e. Form1.cs).
The layout of the form will need to include the following:
First Name - label and text box - enabled and allows data entry
Last name - label and text box - enabled and allows data entry
Department - label and text box - enabled and allows data entry
Salary - label and text box - enabled and allows data entry
Record number - record number of the employee - Read only / disabled - users should not be able to modify the employee record number
Previous Record button - will navigate to the previous record in the list and display the content of that employee in the controls above - For example, if I am on record #2 and click previous it will go back to #1. If you have no previous records to show, display a message box (ie MessageBox.Show(...)) indicating no more records are available.
Next record button - will navigate to the next record in the list and display the content of that employee in the controls above. For example, if I am on record #2 and click next it will go to #3. If you have no next records to show, display a message box indicating no more records are available.
Create new record - will add a record to the end of the list only if first name, last name, department, and salary are populated in the controls above. The record number will need to be generated based on whatever the next record number should be in your list. Finally, the assigned record number needs to display in the record number field above. After hitting click, everything about that new employee record should display in the controls above, including the new record number. A record should only create if the first name, last name, department, and salary text boxes are filled in. If any of that data is missing, you should show a message box indicating there is missing data that needs to be populated. Duplicate name/department/salary info is ok, but each employee must have a unique record and a unique record number. For example, you can have 6 "John Smith" records in "Human Resources" with a Salary of "50000" but each one of those John Smith records must have a unique record number.
Update Record - this should update the editable fields (first name, last name, department, and salary) on that specific / current record number that is showing in the controls above. After the update occurs, show a message box indicating the record has been updated. Updates should only occur if the first name, last name, department number, and salary info is populated. If any one of those fields are empty, you should disrupt the update process, and show a message box indicating fields must be populated before the update.
Delete record button - will delete a record from the list if the list is not empty. if the list is empty, display a message box indicating that the list is empty and an employee cannot be deleted. If the delete is successful, show the record either before or after the one that was deleted with the appropriate content/record number. If all employees are deleted, you should show blanks in all of the controls above, including record number.
Search record number label and text box - will allow a user to enter a record number to search on. This text box is enabled and should allow data entry.
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