Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bookmark C# Employee Form Application Assignment Description: The objective for this assignment is to create a program that manages employee data stored in an employee

Bookmark

C# Employee Form Application Assignment Description:

The objective for this assignment is to create a program that manages employee data stored in an employee list. The user interface design should efficiently and robustly implement the required functionality as exemplified in class. The fields are: FirstName, LastName, EmpType, Salary.

The basic requirements for the program are as follows: Create a Windows Forms application (written in C#) named Employees, with:

o Menu, toolbar and status bar elements o Support File: Open, Save, Save As, Help: About, and Edit: Add,Delete,Properties

o Include an About box, customized to your liking

Add a listbox to the main form, docked so that it takes up the entire screen area

Use a common dialog box to get the name of the file to be opened

Define a public Employee object (class), with:

o A public constructor o Private data members and public properties for each of the four fields

o A public ToString method (overridden from the base class) that returns the last name, a comma, a space, and the first name.

Open the file using a StreamReader object and read the lines as records into instances of your class, by doing the following:

o Split the line of text read from the file

o Create a new instance of the Employee object

o Set each property of the Employee object accordingly, e.g., emp.FirstName = strSplit[0]; emp.LastName = strSplit[1]; etc.

Add each new Employee object to the list box occupying the main client area of the form o Verify that as the employees are displayed, the ToString method was called by the listbox to display the objects textual representation

Support a toolbar button, menu item and double-clicking an item to get properties on it.

Create a second dialog box style form to display employee properties, with:

o OK, Cancel buttons o Labels and TextBox controls for each field o A public property Employee in the form that is used to pass data back and forth between the main form and the properties form using the technique from the previous Windows Forms application

Support a Save (to the same filename) and Save As (allow them to pick a new filename) o Use the Rename, Create, Delete process to save the new contents of the file

When reading lines from the file and processing them, if any errors are encountered (such as failing to convert a string to an integer, let the user know the line number of the bad record in the file via MessageBox. Support Add and Delete of records as well.

Okay so my first form takes in the employees name first before you can do anything. The moment the name is entered, it is populated in

Form2:

image text in transcribed

After the new employees name populates, they proceed to fill out the remaining areas:

image text in transcribed

After the new employee hits Submit, it should redirect them to form1 where they will now see there name populated in the bottom listbox showing (Employees: lastName, firstName( is how it should populate)).

image text in transcribed

If they double-click or hit edit, they will be redirected to Form2 to make changes. After everything looks good, they will save it using regular save or save as.

Open will open a file saved(everything is to be stored, saved and written using a StreamReader. My Employee class should be stored as such:

Public Employee(string firstName, string lastName, string empType, double salary) Private variables and public properties(get/set) for each type Override the public ToString Example: Public override string ToString() { Return lastName + , + firstName;

Open the file using a StreamReader object and read the lines as records into instances of your class, by doing the following:

o Split the line of text read from the file

o Create a new instance of the Employee object o Set each property of the Employee object accordingly, e.g., emp.FirstName = strSplit[0]; emp.LastName = strSplit[1]; etc. image text in transcribed.

Please let me know if you have any questions!

Form File Edit Help John Doe Employee Name Enter Read Edit Delete Form2 First Name John Position Salary: Submit Last Name List of Employees Cancel

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

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions

Question

1. What is meant by Latitudes? 2. What is cartography ?

Answered: 1 week ago

Question

What is order of reaction? Explain with example?

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago