Employee clocking System
language: C #
1. Analysis:
Figure 1 (Main page)
Available information according to Figure 1
1.Windows forms form, control DataGrid View (Display control), menu control, Label, Button,textbox.
2. To implement the menu control new, modify, delete and punch-in record; View features for Forms
Figure 2 (new, modify form)
(1) when new (2) is modified
According to Figure 2 (1) The information can be added when required to fill out according to Figure 2 (2) show that the original data changes and work number is not modified
Work number, age, name, gender selection.
Figure 3 (Punch card record form)
Fig. 3 is available
The number of records is displayed when the clock-out record is queried, and the employee clock-out record is displayed, such as the number of records is 0 display 0, if the data is not 0 (work number, name, check-in time, checkout time)
2. Building the structure
1. To display employee data
: Add Employee Class (employee)
: Declares an employee class as a list collection of types, initializes two records and binds to the DGV (Data Grid View shorthand)
Binding
To be added, modify and delete the data to be refreshed so create a refresh method
Example 1: Example 2:
Or
2. New
Open a new form in Figure 2 (1), in the new Form class, define the field to receive the data source "L" and decide to add or modify
is added when making various judgments:
1. Determine if the work bar is empty and the work number is duplicated
2. Determine if the Name column is empty
3. Determine whether the age bar is empty, whether the age is legal (such as greater than 18, and less than 65)
4. Select male and female and save (add to Data source "L")
5. Call Update
3. Modifications
Open a new form in Figure 2 (2), in the new Form class, define the field to receive the data source "L" and decide to add or modify
is to make various judgments when modifying:
2. Determine if the Name column is empty
3. Determine whether the age bar is empty, whether the age is legal (such as greater than 18, and less than 65)
4. Select male and female and save (add to Data source "L")
4. Delete
On the main page
1. Select a row of the DGV control (the row of the selected employee name (work number))
2. Confirm to the user whether to delete, such as confirm Delete, remove the object in the list collection
3. Call Refresh
5. View
On the main page
1. Check In/out number (fuzzy query, if not entered, show all)
6. Punch-in recording
To display the clock-out record: A new data source is required (dictionary is selected here)
Open the Punch record form
1. In the punch-Out record Form declaration field receive dictionary or main form
2. Display a total of several records, and detailed clock-out information
6. (2) (sign in, sign back)
Because there is a check-in record (Punch-in record), we add a shortcut menu control on the main form to bind on the DGV control and create a sign-in, checkout method to complete the punch-out
Operation. form the data to be added to the dictionary.
Employee clocking System