Free Essay

Time and Attendance

In:

Submitted By anithacaroline
Words 10985
Pages 44
PREFACE

The world today is witnessing a new kind of revolution—the Information Revolution—ushered in by technology. This revolution is far more sweeping than any other revolution in history in its reach and influence, bringing fundamental changes in all aspects of our life. Information technology is the use of computers and software to manage information. As computers grew in speed and capability, a number of general-purpose database systems emerged. In the present context, I have great pleasure in presenting “Factory Time Attendance Management System (FTAMS)” program. This program is used by factories of all sizes. The FTAMS works with RFID time attendance devices to manage working hours of employees recorded in the devices in order to pay their wages. FTAMS could protect a factory from payroll fraud and provide both employer and employees with confidence in the accuracy of their wage payments. The present system is necessarily providing a convenient, simple, and comprehensive program on managing the time and attendance system for the benefits of employees and the factory.

I wanted to take this opportunity to welcome you to your education. Writing this book has been a lot of fun for me and I sincerely hope that you get a lot out of it. I have tried to be balanced in presenting both the advantages and disadvantages of some of the new ideas. I encourage you to adopt a similar open and critical stance when reading this book.

You are welcome to e-mail me at so.sereyboth@gmail.com with your thoughts and comments while you are reading this book or afterwards. I promise to get back to you speedily.

Mr. SO SEREYBOTH

MScIT (4th Semester)

Roll No. 541010894

ACKNOWLEDGEMENT

In my effort to successfully develop this project, I would like to thank all of the people who take part directly and indirectly to make it possible. First and foremost, I would like to offer my sincerely thank to my advisor who was part of this project in numerous ways for his encouragement and support. Without his supervision I would not complete this project. And, I would like to extend my huge thank to other teachers who have instructed me during my academic years for their advice, knowledge distribution and experience sharing.

At the outset, I pour my heartfelt gratitude towards Asso. Prof. DiepSeiha, President of BBU (For Head of Organization), for his non-ending suggestions and comments that has been the pathway to my successful project. For the most, I would like to thank Prof. (Dr.) T. R. Dash, Vice President of Post Graduate Studies, and Prof. (Dr.) M. Behera, Director of International Program who stood by us and shaped our approach in a better way than it could ever had; without whose supervision and support, I could not brought out this project.

I would like to specially thank my colleagues and classmates who have contributed valuable suggestion regarding the scope and content. They gave me inspiration and endless support during preparation of this project.

Mr. SO SEREYBOTH

MScIT (4th Semester)

Roll No. 541010894

CERTIFICATE BY HEAD OF ORGANIZATION

This is to certify that the project “Factory Time Attendance Management System” is the original work done by:

Mr. SO SEREYBOTH

Under a strict supervision and guidance, according to the syllabus as prescribed by the course of Master of Science in Information Technology (MScIT) of Sikkim Manipal University, India for the Major Project.

Further, this is to certify that the work reported in this dissertation has not been presented as part of any other academic work.

Associate Prof. DiepSeiha,

President of BBU

(For Head of Organization)

Build Bright University, Cambodia

CERTIFICATE BY DIRECTOR (ACADEMIC)

This is to certify that the project “Factory Time Attendance Management System” is the original work done by:

Mr. SO SEREYBOTH

Under a strict supervision and guidance, according to the syllabus as prescribed by the course of Master of Science in Information Technology (MScIT) of Sikkim Manipal University, India for the Major Project.

Further, this is to certify that the work reported in this dissertation has not been presented as part of any other academic work.

Prof. (Dr.) T. R. Dash

Vice President of Post Graduate Studies,

Build Bright University, Cambodia

CERTIFICATE BY DIRECTOR (ADMINISTRATION)

This is to certify that the project “Factory Time Attendance Management System” is the original work done by:

Mr. SO SEREYBOTH

Under a strict supervision and guidance, according to the syllabus as prescribed by the course of Master of Science in Information Technology (MScIT) of Sikkim Manipal University, India for the Major Project.

Further, this is to certify that the work reported in this dissertation has not been presented as part of any other academic work.

Prof. (Dr.) ManaranjanBehera,

Director of International Program,

Build Bright University, Cambodia

CERTIFICATE BY PROJECT INCHARGE

This is to certify that the project “Factory Time Attendance Management System” is the original work done by:

Mr. SO SEREYBOTH

Under a strict supervision and guidance, according to the syllabus as prescribed by the course of Master of Science in Information Technology (MScIT) of Sikkim Manipal University, India for the Major Project.

Further, this is to certify that the work reported in this dissertation has not been presented as part of any other academic work.

Mr. NEANG MAO,

Project In-charge,

Build Bright University, Cambodia

DECLARATION

I, SO SEREYBOTH, the MSc-IT student of Sikkim Manipal University, India would like to declare that the project on Factory Time Attendance Management System is the original work done by me and it has not been presented as part of any other academic work.

Mr. SO SEREYBOTH

MSc-IT (4th Semester)

Roll No. 541010894

abstract

This project aims at designing an attendance system with could effectively manage attendance of employees at factories in Cambodia. Attendance is marked after employee identification. For employee identification, a RFID card reorganization based identification system is used. RFID cards are considered to be the best and fastest method for biometric identification. In this project, many new algorithms have been used. Using these new algorithms, I have developed an identification system which is faster in implementation than any other available today in the market. Although I’m using this RFID card identification system for factory employee identification purpose in my project, the matching results are so good that I could perform very well on large database.

Table of Contents

PREFACE i

ACKNOWLEDGEMENT ii

CERTIFICATE BY HEAD OF ORGANIZATION iii

CERTIFICATE BY DIRECTOR (ACADEMIC) iv

CERTIFICATE BY DIRECTOR (ADMINISTRATION) v

CERTIFICATE BY PROJECT INCHARGE vi

DECLARATION vii

ABSTRACT viii

1 INTRODUCTION 1

1.1 Background 1

1.2 Statement of Problems 1

1.3 Objectives 2

1.4 Scope and Limitation 2

1.5 Glossary 3

2 SYSTEM REQUIREMENTS SPECIFICATION 4

2.1 Hardware and Software Requirements 4

2.2 Functional Requirements 4

2.3 Package Diagram 6

2.4 Use Case Diagram 6

2.5 Activities Diagram 12

2.6 State Diagram 18

3 SYSTEM DESIGN SPECIFICATIONS 20

3.1 System Architecture 20

3.2 Database Design 21

3.2.1 Entity Class 22 3.2.2 Data Structure 23 3.3 Class Design 30

3.3.1 Class Diagram 30 3.3.2 Sequence Diagram 31 3.4 User Interface 33

3.5 System Deployment 46

4 SYSTEM CODING 47

5 SYSTEM TESTING 68

5.1 Testing Cases 68

5.2 Testing Reports 69

6 CONCLUSION 71

7 BIBLIOGRAPHY 72

1 INTRODUCTION

1 Background

Factory Time Attendance Management System (FTAMS) is an innovative and comprehensive software that can connect to time attendance devices to manipulate employee attendance records. It can correctly compute for proper compensation of employees or workers, based on attendance records.

Whatever the payroll requirements, the system is capable of flexibility for meeting rules related to breaks, meals, rounding, time-off, and managing holidays.

3 Statement of Problems

Factories of all sizes use time attendance processes to gather information about the amount of time that employees spend on the job. For years, collating the employee time records in most of factories in Cambodia has always been somewhat of a problem because all work is done on paper, so that all calculation to generate report is done manually.

Disadvantages of present working system:

• Not User Friendly: The existing system is not user friendly because the retrieval of data is very slow and data is not maintained efficiently.

• Difficulty in Report Generating: We require more calculations to generate the report so it is generated at the end of the session.

• Manual Control: All calculations to generate report are done manually so there is greater chance of errors.

• Lots of Paper: Existing system requires a lot of papers. Loss of even a single register/record led to difficult situation because all the papers are needed to generate the reports.

• Time Consuming: Every work is done manually so we cannot generate reports in the middle of the session or as per the requirement because it is very time consuming.

4 Objectives

The specific objectives of the FTAMS:

• To computerize the traditional way of taking attendance

• To make easy to track the work time and overtime

• To make easy to generate reports automatically

5 Scope and Limitation

The Factory Time Attendance Management System is built as a desktop application. It will provide a guideline to register employees or workers with all of their information and attendance card numbers. So when an employee or worker is already registered, he or she will use the attendance card provided by the factory to record his or her attendance by scanning the card on the time attendance device.

The system is able to record leave of each employee. So if an employee or worker is late or absent, these days and time should be deducted accordingly. If an employee or worker has an attached consent of leave, no deductions should be made to the salary of him or her.

The FTAMS will automatically generate annual leave for employees or workers who have been working for over one year. This system is also able to download attendance records from time attendance devices and generate reports as per the requirement (monthly) or in the middle of the session.

This Factory Time Attendance Management System currently can only connect to RFID time attendance devices. On the other hand, the system cannot operate online as a web based application.

6 Glossary

• FTAMS: Factory Time Attendance Management System.

• Package Diagram: In general purpose, package is mechanism for organizing model elements and diagrams into groups. In the Unified Modeling Language (UML), a package diagram is a type of diagram that depicts the dependencies between the packages that make up a model.

• Use Case Diagram: A use case is a list of steps, typically defining interactions between an actor and a system, to achieve a goal. The actor can be a human or an external system and the gold represents as a use case.

The main purpose of a use case diagram is to show what system functions are performed for which actor.

• Activity Diagram: Activity diagrams are graphical representations of workflows of stepwise activities and actions with support for choice, iteration and concurrency. In the Unified Modeling Language, activity diagrams can be used to describe the business and operational step-by-step workflows of components in a system.

The main purpose of an activity diagram is to show the overall flow of control.

• State Diagram: A state diagram is a type of diagram used in computer science and related fields to describe the behavior of systems. State diagrams require that the system described is composed of a finite number of states; sometimes, this is indeed the case, while at other times this is a reasonable abstraction. Many forms of state diagrams exist, which differ slightly and have different semantics.

State diagrams are used to give an abstract description of the behavior of a system. This behavior is analyzed and represented in series of events that could occur in one or more possible states. Hereby "each diagram usually represents objects of a single class and tracks the different states of its objects through the system".

• RFID is a time attendance device name.

System Requirements Specification

1 Hardware and Software Requirements

Hardware:

1. CPU – Pentium 3 or above
2. RAM – 512 MB or above
3. Hard Disk – 40 GB or above
4. Mouse/Keyboard/Printer
5. RFID Time Attendance Device

Software:

1. Operating System - Windows XP or later version
2. .Net Framework 3.5
3. Microsoft SQL Server
4. Crystal Report Basic for Visual Studio 2008
5. Crystal ActiveX Report

3 Functional Requirements

The following is a functional requirement list:

|No. |Requirement |Use Case |
|1 |User Login |Login |
|2 |To register new employees and workers with attendance card number to the |Register Employee |
| |database and the time attendance devices | |
|3 |To inactivate employees or workers when they resign or have maternity |Inactivate Employee |
| |leave | |
|4 |To update or recreate new attendance cards |Update Card No. |
|5 |To search on all employees and workers |Search for Employee |
|6 |To update or modify employee or worker information |Update Employee Info |
|7 |To create positions for employees and workers |Create New Position |
|8 |To define base salary for employees and workers by position |Define Salary |
|9 |To create unions for workers |Create New Union |
|10 |To define rate for each union |Define Union Rate |
|11 |To enroll some workers to unions |Enroll Worker to Union |
|12 |To define work time for employees and workers |Define work time |
|13 |To define OT and Daily meal allowance rate for employees and workers |Define Meal Allowance Rate |
|14 |To create new user accounts |Create User Account |
|15 |To generate annual public holidays |Set up Annual Holiday |
|16 |To generate annual leave for employees and workers |Generate Annual Leave |
|17 |To record leave of employees or workers |Record Leave |
|18 |To install new RFID time attendance devices |Add New RFID Device |
|19 |To synchronize all card registration in the database with the new or |Synchronize Device |
| |existing RFID time attendance devices | |
|20 |To download attendances from the RFID time attendance devices |Download Attendance |
|21 |To adjust attendance detail |Adjust Attendance |
|22 |To insert attendances by manual |Insert Attendance Manually |
|23 |To generate weekly meal allowance report |Generate Meal Allowance Report |
|24 |To generate monthly salary report |Generate Payroll Report |

5 Package Diagram

This software consists of three main packages, Employee Registration Management, Payroll Calculation Management, and Time Attendance Device Management package. Figure 2.1 shows the initial architecture of these three packages, and a package which will provide the mechanisms for the distribution of the application. At this early stage in the project, it is not clear what this will be, but something will be necessary to meet the requirements.

[pic]

Figure 2.1 Initial Package Architecture

6 Use Case Diagram

There are three actors, Administrator, Accountant, and Technician, who use the system.

|Actor |Description |
|Administrator |The administrator has a responsibility to the employee management. |
|Accountant |The accountant works in the account department and is responsible for the major resource |
| |for employees including staffing and related financial matters. |
|Technician |The technician is responsible for installing new RFID time attendance devices and |
| |recognizing the devices with the system. After that, the technician has to synchronize the |
| |installed devices with the database. |

[pic]

Figure 2.2 Employee Management Use Case

|Use Case |Description |
|Login |The administrator must login to use the system. |
|Register Employee |When a new employee joins the factory, his or her details are recorded. He or she must be |
| |assigned the position, base salary, start work date, attendance card number, and the work |
| |time. Base salary defaults to the salary followed by the selected position. A new worker |
| |can be enrolled to a union. |
|Update Employee Info |Update Employee Info use case is always used to update information of an employee or |
| |worker. |
|Update Card No. |Sometimes employees could lose their attendance cards. When an attendance card is lost, |
| |the new card must be registered to the time attendance device to replace the lost one. The|
| |new card number must be unique. |
|Inactivate Employee |When an employee resigns or take a maternity leave, he or she must be inactivated from the|
| |system. There are two types of inactivation, resign and maternity leave. |
|Search for Employee |The administrator can use this use case to search on all employees or workers. |
|Create New Union |This use case is used to create new union names. Creating a new union must be assigned its|
| |rate. |
|Create New Position |When the factory creates new positions, this use case must be used. Creating a new |
| |position must be assigned a base salary. |
|Set up Annual Public Holiday |Recording annual public holidays is made once a year. |
|Record Leave |When an employee takes leave, the administrator must use this use case to record his/her |
| |leave information. To record leave, a leave type must be defined. |
|Adjust Attendance |Adjusting attendance information is made by the accountant. He or she will use this use |
| |case when some attendance information has problems. |
|Insert Attendance Manually |In a case when an employee or worker forgot to bring his or her attendance card, he or she|
| |should inform the administrator. The administrator will use this use case to enter an |
| |attendance record of the employee or worker manually into the database. |
|Create User Account |This use case is used to create new user accounts. |

[pic]

Figure 2.3 Payroll Calculation Management Use Case

|Use Case |Description |
|Login |The accountant must login to use the system. |
|Calculate Payroll |At the end of each month, the payroll is always calculated. Calculate Payroll use case is |
| |used to calculate monthly salary for all employees and workers in the factory. The |
| |accountant must define the current exchange rate before the calculation. After the |
| |calculation completes, the accountant can preview or print out the calculated payroll on a|
| |report. |
|Calculate Weekly Meal Allowance|Meal allowance is paid for only employees who work a whole day in a work day. Calculate |
| |Weekly Meal Allowance use case calculates the total meal allowance during a week. After |
| |the calculation completes, the accountant can preview or print out the calculated meal |
| |allowance on a report. |
|Download Attendance |Before either calculating payroll or weekly meal allowance, the accountant must download |
| |attendances from all devices. |
|Define Meal Allowance Rate |When an employee or a worker works overtime, he or she will get meal allowance. So this |
| |use case is used to define the meal allowance rate for an hour of overtime. |

[pic]

Figure 2.4 Time Attendance Device Management Use Case

|Use Case |Description |
|Login |The technician must login to use the system. |
|Add New |The technician takes care on the time attendance devices. When the factory adds a new |
|RFID Device |device, the technician should use Add New RFID Device use case to insert the new device |
| |information into the system. The device IP address and port number must be assigned. |
| |Moreover, the technician can test on the connection of the new device. |
|Test RFID Device |Test RFID Device use case is used to make a test on either a newly added or the existing |
| |RFID devices. |
|Synchronize RFID Device |After the new RFID device is added, it is always needed to be synchronized with the |
| |database. |

8 Activities Diagram

Activities Diagram for Login Use Case:

When the user starts up the application, the system will pop up a security form requiring the user to enter a correct username and password before performing the system. After that, the user should press login button to login to the system. The system will verify the entered username and password. When the username and password are valid, the system will show up the main windows form; otherwise, the system will pop up an invalid username and password form.

[pic]

Figure 2.5 Activities Diagram for Login Use Case

Activities Diagram for Register Employee:

When a worker or employee joins the factory, the administrator must register him or her as a new employee. To make the registration, the administrator must open the employee registration form then fill some required information of the employee such as card number, employee ID, name, sex, nationality, date of birth, position, start work date, salary, and work time. After filling the information, the administrator should press save button to save those information into the database and to register the card number into RFID time attendance devices. After you press the button, the system will validate the input information. If the employee ID is not duplicate, the information will be saved into the database; but if it is duplicate, the system will pop up a form to alert a duplicate data message. After the information is successfully saved, the system will automatically register the card number into all attendance devices. If the registration failed, the system will roll back the saved information in the database.

[pic]

Figure 2.6 Activities Diagram for Register Employee

Activities Diagram for Record Leave:

Recording leave is done when there is an employee or worker is absent from work. It is performed by the administrator. To record leave, he or she must open the leave form and then choose an employee name. After that, the administrator should define the date and type of leave. There are two types of leave, annual leave and informed leave. When the annual leave is selected, no deduction should be made, but if the informed leave is selected, the salary will be deducted. Finally, the administrator presses the save button to record the leave into the database.

[pic]

Activities Diagram for Calculate Payroll

Payroll calculation is always performed at the end of month. To calculate payroll, the accountant should press the new calculation button on the payroll list form. After pressing the button, the calculation windows form shows up. On this form, there are two types of duration, whole month and non whole month. On the other hand, the administrator must define the current exchange rate. He or she should press Start button to start the calculation and save into the database.

[pic]

Activities Diagram for Add New RFID Device

When the factory adds a new time attendance device, the technician should use the application to register and configure the new device. Time attendance devices that the system can support are RFID time attendance devices.

To add a new RFID attendance device, the technician should open a new device form. After the form is opened, the required information needed to be filled are device name, device IP address, and device port number. Once he or she presses the save button, the system validates the entered IP address. If it does not exist, the device information is saved into the database; otherwise, the system shows up a message.

[pic]

9 State Diagram

State Diagram of Register New Employee:

To register a new employee or worker, first, the user (the administrator) needs to open the registration form on the application. After the form shows up, the user has to fill some required information on the form. Moreover, he or she must assign a card number for the new employee or worker. When the information is completely filled, the user should press the Save button. After pressing, the system will validate the input information. If it is not valid, a message will show up and the process is canceled. But if it is valid, the saving process will start. When the process performs with any error, a failure message will show and the process is canceled. In contrast, if the saving process is successfully done, the defined card number will be registered into all setup RFID devices. Before the registration occurs, the test connection to the devices will happen. During the test, if there is any problem, the system will roll back and cancel the previous transaction.

[pic]

Figure 2.10 State Diagram of Register New Employee

State Diagram of Download Attendances:

To download attendance records from RFID devices, the user must press Download button. After pressing, the system will connect to all setup devices. If the all connections successfully done, the download will perform; but if not, the system will pop up a failure message. Once the download completed, the system will start saving the downloaded records. When the attendance records are successfully saved into the database, the records are shown on the list on the user interface; otherwise, the system will pop up a failure message.

[pic]

Figure 2.11 State Diagram of Download Attendances

System Design Specifications

1 System Architecture

FTAMS contains three main packages, Employee Registration Management, Payroll Calculation Management, and Time Attendance Device Management package.

• Employee Registration Management Package: This package controls all information of employees and workers.

• Payroll Calculate Management Package: This package controls all payroll data and calculates new payroll.

• Time Attendance Device Management Package: This package controls the information of registered RFID time attendance devices.

[pic]

Figure 3.1 Initial Package Architecture

4 Database Design

Database design is the process of producing a detailed data model of a database. This logical data model contains all the needed logical and physical design choices and physical storage parameters needed to generate a design in a Data Definition Language, which can then be used to create a database. A fully attributed data model contains detailed attributes for each entity.

The term database design can be used to describe many different parts of the design of an overall database system. Principally, and most correctly, it can be thought of as the logical design of the base data structures used to store the data. In the relational model these are the tables and views. In an object database the entities and relationships map directly to object classes and named relationships. However, the term database design could also be used to apply to the overall process of designing, not just the base data structures, but also the forms and queries used as part of the overall database application within the database management system (DBMS).

1 Entity Class

The following diagram illustrates the entity class in FTAMS.

[pic]

Figure 3.2 FTAMS Entity Class

1 Data Structure

Employee Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|EmpID |int |10 |NULL |No |
|EmpName |nvarchar |50 |NULL |No |
|Sex |nvarchar |5 |NULL |No |
|DOB |date | |NULL |No |
|BirthPlace |nvarchar |150 |NULL |Yes |
|EmpCardNo |int |10 |NULL |Yes |
|NationalityID |int |10 |NULL |No |
|PositionID |int |10 |NULL |No |
|StartWorkDate |date | |NULL |No |
|BaseSalary |decimal |18 |0 |Yes |
|UnionID |int |10 |NULL |No |
|WorkTimeID |int |10 |NULL |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_EmpID |Primary Key |EmpID | |
|Fk_NationalityID |Foreign Key |NationalityID |Nationality |
|Fk_PositionID |Foreign Key |PositionID |Position |
|Fk_UnionID |Foreign Key |UnionID |Union |
|Fk_WorkTimeID |Foreign Key |DefautlWorkTimeID |DefaultWorkTime |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_Employee |Primary Key |EmpID |

Position Table:

• Data Structure

|Column Name |Data Type |Size |Default Value |Allow Null |
|PositionID |int |10 |NULL |No |
|PositionName |nvarchar |50 |NULL |No |
|PositionGroupID |int |10 |NULL |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_PositionID |Primary Key |PositionID | |
|Fk_PositionGroupID |Foreign Key |PositionGroupID |PositionGroup |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_Position |Primary Key |PositionID |

Position Group Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|PositionGroupID |int |10 |NULL |No |
|PositionGroupName |nvarchar |50 |NULL |No |
|BaseSalary |int |10 |0 |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_PositionGroupID |Primary Key |PositionGroupID | |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_PositionGroup |Primary Key |PositionGroupID |

Default Work Time Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|DefaultWorkTimeID |int |10 |NULL |No |
|PositionGroupID |int |10 |NULL |No |
|StartTime |time | |NULL |No |
|EndTime |time | |NULL |No |
|BreakHour |int |10 |0 |No |
|MorningHour |int |10 |0 |No |
|AfternoonHour |int |10 |0 |No |
|PositionGroupID |int |10 |NULL |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_DefWorkTimeID |Primary Key |DefaultWorkTimeID | |
|Fk_PositionGroupID |Foreign Key |PositionGroupID |PositionGroup |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_DefaultWorkTime |Primary Key |DefaultWorkTimeID |

Default Rate Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|DefaultRateID |int |10 |NULL |No |
|PremiumRate |decimal |18 |0 |Yes |
|NormalMealRate |int |10 |0 |Yes |
|OTMealRate |int |10 |0 |Yes |
|NOTMultiplier |decimal |18 |0 |Yes |
|HOTMultiplier |decimal |18 |0 |Yes |
|WorkingBookRate |decimal |18 |0 |Yes |
|PositionGroupID |int |10 |NULL |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_DefaultRateID |Primary Key |DefaultRateID | |
|Fk_PositionGroupID |Foreign Key |PositionGroupID |PositionGroup |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_DefaultRate |Primary Key |DefaultRateID |

Past Rate Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|NoOfWorkedYear |int |10 |NULL |No |
|Rate |decimal |18 |0 |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_ NoOfWorkedYear |Primary Key |NoOfWorkedYear | |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_PastRate |Primary Key |NoOfWorkedYear |

Annual Leave Definition Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|NoOfWorkedYear |int |10 |NULL |No |
|AnnualLeave |int |10 |0 |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_ NoOfWorkedYear |Primary Key |NoOfWorkedYear | |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_AnnualLeaveDefinition |Primary Key |NoOfWorkedYear |

Union Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|UnionID |int |10 |NULL |No |
|UnionName |nvarchar |50 |NULL |No |
|Rate |decimal |18 |0 |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_UnionID |Primary Key |UnionID | |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_Union |Primary Key |UnionID |

Nationality Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|NationalityID |int |10 |NULL |No |
|NationalityName |nvarchar |50 |NULL |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_NationalityID |Primary Key |NationalityID | |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_Nationality |Primary Key |NationalityID |

Attendance Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|AttendanceID |int |10 |NULL |No |
|StartDateTime |datetime | |NULL |No |
|EndDateTime |datetime | |NULL |No |
|DayWorkHour |int |10 |0 |No |
|OTHour |int |10 |0 |No |
|NightShiftHour |int |10 |0 |No |
|IsHoliday |bit |1 |0 |No |
|EmpID |int |10 |NULL |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_AttendanceID |Primary Key |AttendanceID | |
|Fk_EmpID |Foreign Key |EmpID |Employee |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_Attendance |Primary Key |AttendanceID |

Employee Leave Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|LeaveID |int |10 |NULL |No |
|LeaveDate |date | |NULL |No |
|LeaveDuration |int |10 |0 |No |
|LeaveType |varchar |20 |NULL |Yes |
|EmpID |int |10 |NULL |No |
|LeaveTime |varchar |20 |NULL |Yes |
|EarlyStatus |varchar |10 |NULL |Yes |
|EarlyTime |varchar |10 |NULL |Yes |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_LeaveID |Primary Key |LeaveID | |
|Fk_EmpID |Foreign Key |EmpID |Employee |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_EmployeeLeave |Primary Key |LeaveID |

Time Attendance Device Table:

• Data Structure:

|Column Name |Data Type |Size |Default Value |Allow Null |
|DeviceName |varchar |10 |NULL |No |
|DeviceIP |varchar |50 |NULL |No |
|DevicePort |int |10 |NULL |No |

• Constraints:

|Constraint Name |Constrain Type |Column Name |Reference Table |
|Pk_DeviceIP |Primary Key |DeviceIP | |

• Indexes:

|Index Name |Index Type |Column Name |
|IX_TimeAttDevice |Primary Key |DeviceIP |

7 Class Design

1 Class Diagram

[pic]

2 Sequence Diagram

[pic]

Figure 3.4 Register New Employee Sequence Diagram

[pic]

Figure 3.5 Calculate Payroll Sequence Diagram

[pic]

Figure 3.6 Add New Device Sequence Diagram

8 User Interface

Regardless of the type of software applications being developed, systems cannot be effectively designed without an appropriate user interface. The user interface tier acts as the foundation for the project: without a solid foundation at this level, the project is at risk of collapsing at some point during development. The following figures illustrate the user interface of FTAMS.

[pic]

Figure 3.7 Login Form

The login form is used for logging into the system; so that the user must enter a correct username and password.

[pic]

Figure 3.8 FTAMS Main Form

The main form always shows up when the user has successfully logged in. This form contains all tools and functions of the FTAMS.

[pic]

Figure 3.9 RFID Time Attendance Devices Form

This form is used to manage the RFID time attendance devices. The user can use this form to add new or remove RFID time attendance devices. Moreover, on this form, he or she can test the connection to the devices. Sync Devices is a task that can allow the user sync all RFID time attendance devices.

[pic]

Figure 3.10 Create New Device Form

Create New Device form is used to register a new RFID time attendance device. The user must define the name, IP address, and port number of the device.

[pic]

Figure 3.11 Test Device Connection Form

Test Device Connection form is used to test the connection to some or all RFID time attendance devices. The use should choose some devices on the list before the test.

[pic]
Figure 3.12 Position Group Form

Position Group form is a form that can be used to view, add new, modify, or delete position groups. On this form, there are three boxes:

• Position Group: Defines a name of a group

• Description: Defines description of a group

• Type: Defines a type of a group

[pic]

Figure 3.13 Position Form

Position form is a form that can be used to view, add new, modify, or delete positions. On this form, there are four boxes:

• Position: Defines a name of a position.

• Description: Defines description of a position.

• Base Salary: Defines base salary for a position.

• Position Group: Defines a group for a position.

[pic]

Figure 3.14 Union Form

Union form is a form that can be used to view, add new, modify, or delete unions. On this form, there are three boxes:

• Union Name: Defines a name of a union.

• Description: Defines description of a union.

• Rate: Defines a rate of a union.

[pic]

Nationality form is a form that can be used to view, add new, modify, or delete nationalities. On this form, there are two boxes:

• Nationality: Defines a name of a nationality.

• Description: Defines description of a nationality.

[pic]

Figure 3.16 Employee Form

Employee form is a form that can be used to view, add new, modify, delete, or change the card number of an employee. Furthermore, the user can search on all employees using this form.

[pic]

Figure 3.17 Employee Registration Form

Employee Registration form is a form that can be used to register a new employee or worker. There are many requirements on this form:

• Card No.: Defines an attendance card number.

• Confirm Card No.: Defines the attendance card number again to confirm.

• Employee Name: Defines a name of an employee.

• Emp. ID: Defines the ID for the employee.

• ID Card No.: Defines the number of his or her ID card.

• Sex: Defines the sex of the employee.

• Nationality: Defines the nationality of the employee.

• Date of Birth: Defines the birth date of the employee.

• Has working book: An option to define if he or she has a working book.

• Place of Birth: Defines the birth place of the employee.

• Employee Group: Defines the group of the employee.

• Position: Defines a position for the employee.

• Base Salary: Defines base salary for the employee. It defaults to the selected position.

• Start Work Date: Defines the date when the employee starts working.

• Position Rate: Defines a position rate for the employee.

• Union: Defines some unions for the employee.

• Work Time: Defines a default work time for the employee.

• Description: Defines description of the employee.

[pic]

Figure 3.18 Employee Leave Form

Employee Leave form is a form that can be used to view or record leave of employees.

[pic]
Figure 3.19 Record Leave Form

Record Leave Form is used to record leave of an employee. There are some requirements and information on this form:

• Employee Name: Defines the name of the employee who takes leave.

• ID: Shows the ID of the employee.

• Card No.: Shows the employee’s card number.

• Sex: Shows the employee’s sex.

• Position: Shows the employee’s current position.

• Start Work Date: Shows the start work date of the employee.

• From: Defines the start date of the leave.

• To: Defines the end date of the leave.

• Leave Type: Defines the type of the leave.

[pic]

Figure 3.20 Employee Attendance Form

Employee Attendance Form is a form that can be used to view attendances of employees and workers. The user can use this form to insert an attendance of an employee manually. Moreover, he or she can use this form to download all attendance records from all RFID devices.

[pic]

Figure 3.21 Weekly Meal Allowance Form

Weekly Meal Allowance Form is used to view or generate new weekly meal allowance reports.

[pic]

Figure 3.22 Payroll Form

Payroll Form is a form that can be used to view or generate payroll reports.

[pic]

Figure 3.23 Payroll Report

[pic]

Figure 3.24 Weekly Meal Allowance Report

9 System Deployment

Front-end:
Microsoft Visual Studio 2008 is used as front end development tool, which is Microsoft integrated development environment for many programming languages including VB.NET. Crystal Report is used for viewing and/or printing reports.
Back-end:
In the backend, Microsoft SQL Server is used to design the database of FTAMS, which is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. Microsoft SQL Server is quiet popular among server database applications. I have used SQL Server Management Studio which is a graphical administration application to manage the database, users and permissions.

[pic]

Figure 3.23 Deployment Diagram of FTAMS

System Coding

Login

Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogIn.Click
Try
If (LogIn()) Then If (ValidateLogin() AndAlso IsCorrectLogin()) Then UpdateCurrentUser() My.Settings.Save() VBLIB.currentuser = txtUserName.Text Me.Hide() frmParent.Show() var._sql.doQueryData("spDevicesSelect", CommandType.StoredProcedure, _ Nothing, Nothing)._doFill(var.dtDevices) var.dtDevices.PrimaryKey = New DataColumn() {var.dtDevices.Columns("DeviceIP"), _ var.dtDevices.Columns("DevicePort")} 'Get server date... var.ServerDate = CDate(var._sql.doExecuteScalar("SELECT getDate();", _ Nothing, Nothing, CommandType.Text)) 'Get user setting table... Try If Not IO.File.Exists(Application.StartupPath + _ "\dtUserSetting.xml") Then var.dtUserSetting.TableName = "dtUserSetting" var.dtUserSetting.Columns.Add("SettingName") var.dtUserSetting.Columns.Add("SettingValue") 'Add a primary key... var.dtUserSetting.PrimaryKey = New DataColumn() {var.dtUserSetting.Columns("SettingName")} 'Write to xml... var.dtUserSetting.WriteXml(Application.StartupPath + _ "\dtUserSetting.xml", XmlWriteMode.WriteSchema) Else var.dtUserSetting.ReadXml(Application.StartupPath + _ "\dtUserSetting.xml") 'Add a primary key... var.dtUserSetting.PrimaryKey = New DataColumn() {var.dtUserSetting.Columns("SettingName")} ' 'Get khmer keyboard name... If Not var.dtUserSetting.Rows.Find("KhmerKBName") Is Nothing Then var.khmerKBName = var.dtUserSetting.Rows.Find( _ "KhmerKBName")("SettingValue").ToString var.chineseKBName = var.dtUserSetting.Rows.Find( _ "ChineseKBName")("SettingValue").ToString End If End If ' 'Check 4 new ann leave... fun._doCheck4NewAnnLeave() Catch ex As Exception MessageBox.Show(ex.Message) Return End Try End If End If
Catch ex As Exception VBLIB.MsgOk("សូមពិនិត្យមើលការភ្ជាប់ ប្រព័ន្ធដាតាបេស់អោយបានត្រឹមត្រូវ!", _ "Please check database connection!", ex.Message)
End Try

End Sub

Add New Device:

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If txtDeviceName.Text.Trim = "" Then VBLIB.MsgOk("សូមបញ្ចូល ឈ្មោះរបស់ ឧបករណ៍។", "Please enter a device name.") txtDeviceName.Focus() Return End If If txtIP1.Text.Length = 0 Or txtIP2.Text.Length = 0 Or txtIP3.Text.Length = 0 Or txtIP4.Text.Length = 0 Then MessageBox.Show("Please enter IP address.", "IP Address Missing") Return End If If txtDevPort.Text.Length = 0 Then MessageBox.Show("Please enter a port number.", "Port Number Missing") Return End If For Each dev As DataRow In _dtDev.Rows If dev("DeviceName").ToString.ToLower.Trim = txtDeviceName.Text.ToLower.Trim Then VBLIB.MsgOk("ឈ្មោះរបស់ ឧបករណ៍នេះ មានរួចហើយ។", "This device name already exists.") txtDeviceName.Focus() Return End If Next Dim ip As String = txtIP1.Text + "." + txtIP2.Text + "." + txtIP3.Text + "." + txtIP4.Text If Not _dtDev.Rows.Find(New String() {ip, txtDevPort.Text}) Is Nothing Then VBLIB.MsgOk("លេខ IP នេះមានរួចហើយ។", "This IP address already exists.") txtIP1.Focus() txtIP1.SelectAll() Return End If

Try var._sql.doExecuteSQL("spDevicesInsert", CommandType.StoredProcedure, _ New String() {"@DeviceIP", "@DevicePort", "@DeviceName"}, _ New String() {ip, txtDevPort.Text, txtDeviceName.Text.Trim}) Catch ex As Exception MessageBox.Show(ex.Message, "Save Error") Return End Try Dim r As DataRow = _dtDev.NewRow r("DeviceName") = txtDeviceName.Text.Trim r("DeviceIP") = ip r("DevicePort") = txtDevPort.Text _dtDev.Rows.Add(r) _dtDev.AcceptChanges() _lblCountDev.Text = _dtDev.Rows.Count.ToString + " គ្រឿង (Device(s))" _dgvDev(0, _dgvDev.RowCount - 1).Selected = True txtDeviceName.Text = "" txtIP1.Text = "" txtIP2.Text = "" txtIP3.Text = "" txtIP4.Text = "" txtDevPort.Text = "" txtDeviceName.Focus()
End Sub

Test Connection to Devices:

Public Sub _doProcess() Implements IProcessable._doProcess If _dtResult Is Nothing Then _dtResult = New DataTable 'Create failed devices table. _dtResult.Columns.Add("DeviceName") _dtResult.Columns.Add("DeviceIP") _dtResult.Columns.Add("Status") Else _dtResult.Clear() End If

Dim status As String = "" Dim row As DataRow = Nothing For Each dev As DataGridViewRow In dgvDevices.Rows If CBool(dev.Cells("Check").Value) = True Then Try If var.zkDevice Is Nothing Then var.zkDevice = New zkemkeeper.CZKEM End If If var.zkDevice.Connect_Net(dev.Cells("DeviceIP").Value.ToString, dev.Cells("DevicePort").Value.ToString) = True Then status = "Succeeded" Else status = "Failed" End If Catch ex As Exception status = "Failed" MessageBox.Show(ex.Message) End Try row = _dtResult.NewRow row("DeviceName") = dev.Cells("DeviceName").Value.ToString row("DeviceIP") = dev.Cells("DeviceIP").Value.ToString row("Status") = status _dtResult.Rows.Add(row) End If Next RaiseEvent _ProcessCompleted() If _dtResult.Rows.Count > 0 Then Dim frmResult As New frmDevice_TestResult(_dtResult) If frmResult.ShowDialog() = Windows.Forms.DialogResult.OK Then btnStart_Click(btnStart, Nothing) End If End If
End Sub

Sync Devices:

Public Sub _doProcess() Implements IProcessable._doProcess Dim userid As Integer, cardNo As String = "" Dim err As New StringBuilder Dim dtDevEmp, dtEmp2Sync As New DataTable Dim row As DataRow = Nothing Dim sqlBlkCopy As SqlClient.SqlBulkCopy

dtDevEmp.Columns.Add("UserID") dtDevEmp.Columns.Add("EmpCardNo")

For Each device As DataRow In var.dtDevices.Rows If var.zkDevice Is Nothing Then var.zkDevice = New zkemkeeper.CZKEM End If If var.zkDevice.Connect_Net(device("DeviceIP").ToString, device("DevicePort").ToString) = True Then dtDevEmp.Clear() While var.zkDevice.GetAllUserInfo(1, userid, "", "", 1, True) var.zkDevice.GetStrCardNumber(cardNo) row = dtDevEmp.NewRow row("UserID") = userid.ToString row("EmpCardNo") = cardNo dtDevEmp.Rows.Add(row) End While ' 'Clear the temp table for sync var._sql.doExecuteSQL("DELETE FROM TempSyncEmployee;", CommandType.Text, Nothing, Nothing) ' 'After adding, bulk copy to SQL DB... sqlBlkCopy = New SqlClient.SqlBulkCopy(var._sql._Connection) sqlBlkCopy.ColumnMappings.Add("UserID", "UserID") sqlBlkCopy.ColumnMappings.Add("EmpCardNo", "EmpCardNo") sqlBlkCopy.DestinationTableName = "TempSyncEmployee" sqlBlkCopy.WriteToServer(dtDevEmp) ' 'Select emp to sync... dtEmp2Sync.Clear() var._sql.doQueryData("spTempSyncEmp_Select", CommandType.StoredProcedure, Nothing, Nothing)._doFill(dtEmp2Sync) ' 'Loop to insert new... For Each emp As DataRow In dtEmp2Sync.Rows var.zkDevice.SetStrCardNumber(emp("EmpCardNo").ToString) If Not var.zkDevice.SetUserInfo(1, CInt(emp("UserID")), emp("EmpCardNo").ToString, "", 0, True) Then If Not err.ToString.Contains(device("DeviceIP").ToString) Then err.Append("- Device " + device("DeviceIP").ToString + " some failed insertion." + vbNewLine) End If End If Next Else err.Append("- Device " + device("DeviceIP").ToString + " not connected." + vbNewLine) Continue For End If Next 'When finished, raise the complete event... RaiseEvent _ProcessCompleted()

If err.Length > 0 Then MessageBox.Show("Some devices sync failed:" + vbNewLine + err.ToString, "Sync Devices") Else VBLIB.MsgOk("ដំណើរគារបានជោគជ័យ។", "Sync succeeded.") End If
End Sub

Add New Position Group:

Private Function _doSave() As Boolean If txtPGroup.Text.Trim = "" Then VBLIB.MsgOk("សូមធ្វើការបញ្ចូលឈ្មោះក្រុមតួនាទីអោយបានត្រឹមត្រូវ។", "Data Required") txtPGroup.Focus() Return False End If Me.Cursor = Cursors.WaitCursor Try If _vSaveNew Then Dim pgid() As Object = Nothing Dim type As String = "Officer" If cboType.SelectedIndex = 1 Then type = "Worker" End If var._sql.doExecuteSQL("spPositionGroupInsert", CommandType.StoredProcedure, _ New String() {"@PGroupName", "@Description", "@AddBy", "@Type"}, _ New String() {txtPGroup.Text, txtDescription.Text, VBLIB.currentuser, type}, _ New String() {"@PGroupID"}, New Integer() {10}, pgid, New SqlDbType() {SqlDbType.Int}) 'Update the list... Dim newRow As DataRow = _dtPGroup.NewRow newRow("PositionGroupID") = pgid(0).ToString newRow("PositionGroup") = txtPGroup.Text.Trim newRow("Description") = txtDescription.Text.Trim newRow("GroupType") = cboType.Text newRow("AddBy") = VBLIB.currentuser newRow("AddDateTime") = Today newRow("IsActive") = True _dtPGroup.Rows.Add(newRow) _dtPGroup.AcceptChanges() txtPGroup.Enabled = False txtDescription.Enabled = False dgvPGroupList.Rows(dgvPGroupList.RowCount - 1).Cells(0).Selected = True lblTotalRecords.Text = dgvPGroupList.RowCount.ToString + " ក្រុម" Else Dim type As String = "Officer" If cboType.SelectedIndex = 1 Then type = "Worker" End If var._sql.doExecuteSQL("spPositionGroupUpdate", CommandType.StoredProcedure, _ New String() {"@PGroupID", "@PGroupName", "@Description", "@User", "@Type"}, _ New String() {dgvPGroupList.SelectedRows(0).Cells("PositionGroupID").Value, _ txtPGroup.Text, txtDescription.Text, VBLIB.currentuser, type}) 'Update the list... With dgvPGroupList.SelectedRows(0) .Cells("PositionGroup").Value = txtPGroup.Text.Trim .Cells("Description").Value = txtDescription.Text.Trim .Cells("GroupType").Value = cboType.Text End With txtPGroup.Enabled = False txtDescription.Enabled = False _dtPGroup.AcceptChanges() End If

Catch ex As Exception Me.Cursor = Cursors.Default VBLIB.MsgOk(ex.Message, "Save Error!") Return False End Try Me.Cursor = Cursors.Default Return True
End Function

Add New Position:

Private Function _doSave() As Boolean If txtPosition.Text.Trim = "" Then VBLIB.MsgOk("សូមធ្វើការបញ្ចូលឈ្មោះតួនាទីអោយបានត្រឹមត្រូវ។", "Data Required") txtPosition.Focus() Return False End If If cboPositionGroup.SelectedIndex = -1 Then VBLIB.MsgOk("សូមធ្វើការក្រុមរបស់តួនាទីអោយបានត្រឹមត្រូវ។", "Data Required") cboPositionGroup.Focus() Return False End If Me.Cursor = Cursors.WaitCursor Try If _vSaveNew Then Dim pid() As Object = Nothing var._sql.doExecuteSQL("spPositionInsert", CommandType.StoredProcedure, _ New String() {"@PName", "@Description", "@BaseSalary", "@PGroupID", "@AddBy"}, _ New String() {txtPosition.Text, txtDescription.Text, Val(txtBaseSalary.Text).ToString, _ cboPositionGroup.SelectedValue.ToString, _ VBLIB.currentuser}, _ New String() {"@PID"}, New Integer() {10}, pid, New SqlDbType() {SqlDbType.Int}) 'Update the list... Dim newRow As DataRow = _dtPosition.NewRow newRow("PositionID") = pid(0).ToString newRow("PositionName") = txtPosition.Text.Trim newRow("BaseSalary") = Val(txtBaseSalary.Text).ToString newRow("Description") = txtDescription.Text.Trim newRow("PositionGroupID") = cboPositionGroup.SelectedValue.ToString newRow("PositionGroup") = cboPositionGroup.Text newRow("AddBy") = VBLIB.currentuser newRow("AddDateTime") = Today newRow("IsActive") = True _dtPosition.Rows.Add(newRow) _dtPosition.AcceptChanges()

txtPosition.Enabled = False txtDescription.Enabled = False cboPositionGroup.Enabled = False dgvPositionList.Rows(dgvPositionList.RowCount - 1).Cells(0).Selected = True lblTotalRecords.Text = dgvPositionList.RowCount.ToString + " តួនាទី" Else var._sql.doExecuteSQL("spPositionUpdate", CommandType.StoredProcedure, _ New String() {"@PositionID", "@PositionName", "@Description", "@BaseSalary", "@PGroupID", "@User"}, _ New String() {dgvPositionList.SelectedRows(0).Cells("PositionID").Value, _ txtPosition.Text, txtDescription.Text, Val(txtBaseSalary.Text).ToString, cboPositionGroup.SelectedValue.ToString(), VBLIB.currentuser}) 'Update the list... With dgvPositionList.SelectedRows(0) .Cells("PositionName").Value = txtPosition.Text.Trim .Cells("Description").Value = txtDescription.Text.Trim .Cells("BaseSalary").Value = Val(txtBaseSalary.Text).ToString .Cells("PositionGroupID").Value = cboPositionGroup.SelectedValue.ToString .Cells("PositionGroup").Value = cboPositionGroup.Text End With txtPosition.Enabled = False txtDescription.Enabled = False cboPositionGroup.Enabled = False _dtPosition.AcceptChanges() End If

Catch ex As Exception Me.Cursor = Cursors.Default If ex.Message.Contains("Position group not found") Then VBLIB.MsgOk("ក្រុមតួនាទីដែលលោកអ្នកជ្រើសរើសត្រូវបានលុបរួចទៅហើយ។ សូមជ្រើសរើសម្តងទៀត។", "Position group already deleted") Else VBLIB.MsgOk(ex.Message, "Save Error!") End If Return False End Try Me.Cursor = Cursors.Default Return True
End Function

Add New Union:

Private Function _doSave() As Boolean If txtUnion.Text.Trim = "" Then VBLIB.MsgOk("សូមធ្វើការបញ្ចូលឈ្មោះសហជីពអោយបានត្រឹមត្រូវ។", "Data Required") txtUnion.Focus() Return False End If If txtRate.Text.Trim = "" Then VBLIB.MsgOk("សូមធ្វើការតំលៃអត្រាអោយបានត្រឹមត្រូវ។", "Data Required") txtRate.Focus() Return False End If Me.Cursor = Cursors.WaitCursor Try If _vSaveNew Then Dim uid() As Object = Nothing var._sql.doExecuteSQL("spUnionInsert", CommandType.StoredProcedure, _ New String() {"@Union", "@Description", "@Rate", "@AddBy"}, _ New String() {txtUnion.Text, txtDescription.Text, txtRate.Text, _ VBLIB.currentuser}, _ New String() {"@UnionID"}, New Integer() {10}, uid, New SqlDbType() {SqlDbType.Int}) 'Update the list... Dim newRow As DataRow = _dtUnion.NewRow newRow("UnionID") = uid(0).ToString newRow("Union") = txtUnion.Text.Trim newRow("Description") = txtDescription.Text.Trim newRow("Rate") = txtRate.Text newRow("AddBy") = VBLIB.currentuser newRow("AddDateTime") = Today newRow("IsActive") = True _dtUnion.Rows.Add(newRow) _dtUnion.AcceptChanges()

txtUnion.Enabled = False txtDescription.Enabled = False txtRate.Enabled = False dgvUnion.Rows(dgvUnion.RowCount - 1).Cells(0).Selected = True lblTotalRecords.Text = dgvUnion.RowCount.ToString + " សហជីព" Else var._sql.doExecuteSQL("spUnionUpdate", CommandType.StoredProcedure, _ New String() {"@UnionID", "@Union", "@Description", "@Rate", "@User"}, _ New String() {dgvUnion.SelectedRows(0).Cells("UnionID").Value, _ txtUnion.Text, txtDescription.Text, txtRate.Text, VBLIB.currentuser}) 'Update the list... With dgvUnion.SelectedRows(0) .Cells("Union").Value = txtUnion.Text.Trim .Cells("Description").Value = txtDescription.Text.Trim .Cells("Rate").Value = txtRate.Text.Trim End With txtUnion.Enabled = False txtDescription.Enabled = False txtRate.Enabled = False _dtUnion.AcceptChanges() End If

Catch ex As Exception Me.Cursor = Cursors.Default VBLIB.MsgOk(ex.Message, "Save Error!") Return False End Try Me.Cursor = Cursors.Default Return True
End Function

Add New Nationality:

Private Function _doSave() As Boolean If txtNationality.Text.Trim = "" Then VBLIB.MsgOk("សូមធ្វើការបញ្ចូលឈ្មោះជនជាតិអោយបានត្រឹមត្រូវ។", "Data Required") txtNationality.Focus() Return False End If Me.Cursor = Cursors.WaitCursor Try If _vSaveNew Then Dim nid() As Object = Nothing var._sql.doExecuteSQL("spNationalityInsert", CommandType.StoredProcedure, _ New String() {"@Nationality", "@Description", "@AddBy"}, _ New String() {txtNationality.Text, txtDescription.Text, VBLIB.currentuser}, _ New String() {"@NationalityID"}, New Integer() {10}, nid, New SqlDbType() {SqlDbType.Int}) 'Update the list... Dim newRow As DataRow = _dtNationality.NewRow newRow("NationalityID") = nid(0).ToString newRow("Nationality") = txtNationality.Text.Trim newRow("Description") = txtDescription.Text.Trim newRow("AddBy") = VBLIB.currentuser newRow("AddDateTime") = Today newRow("IsActive") = True _dtNationality.Rows.Add(newRow) _dtNationality.AcceptChanges() txtNationality.Enabled = False txtDescription.Enabled = False dgvNationality.Rows(dgvNationality.RowCount - 1).Cells(0).Selected = True lblTotalRecords.Text = dgvNationality.RowCount.ToString + " ជនជាតិ" Else var._sql.doExecuteSQL("spNationalityUpdate", CommandType.StoredProcedure, _ New String() {"@NationalityID", "@Nationality", "@Description", "@User"}, _ New String() {dgvNationality.SelectedRows(0).Cells("NationalityID").Value, _ txtNationality.Text, txtDescription.Text, VBLIB.currentuser}) 'Update the list... With dgvNationality.SelectedRows(0) .Cells("Nationality").Value = txtNationality.Text.Trim .Cells("Description").Value = txtDescription.Text.Trim End With txtNationality.Enabled = False txtDescription.Enabled = False _dtNationality.AcceptChanges() End If

Catch ex As Exception Me.Cursor = Cursors.Default VBLIB.MsgOk(ex.Message, "Save Error!") Return False End Try Me.Cursor = Cursors.Default Return True
End Function

Register Employee:

Private Function _doSaveData() As Boolean

If txtEmpID.Text.Trim = "" Then VBLIB.MsgOk("សូមបញ្ចូលអត្តលេខរបស់ បុគ្គលិក អោយបានត្រឹមត្រូវ។", "Please enter employee's ID.") txtEmpID.Focus() Return False End If If txtEmpName.Text.Trim = "" Then VBLIB.MsgOk("សូមបញ្ចូលឈ្មោះបុគ្គលិកអោយបានត្រឹមត្រូវ។", _ "Please enter the name of the employee.") txtEmpName.Focus() Return False End If If cboGender.SelectedIndex = -1 Then VBLIB.MsgOk("សូមកំណត់ភេទរបស់បុគ្គលិកអោយបានត្រឹមត្រូវ។", _ "Please select the gender of the employee.") cboGender.Focus() Return False End If If cboNationality.SelectedIndex = -1 Then VBLIB.MsgOk("សូមជ្រើសរើសសញ្ជាតិរបស់បុគ្គលិកអោយបានត្រឹមត្រូវ។", _ "Please select the nationality of the employee.") cboNationality.Focus() Return False End If If txtBaseSalary.Text = "" Then VBLIB.MsgOk("សូមប្រាក់បៀវត្សគោលរបស់បុគ្គលិកអោយបានត្រឹមត្រូវ។", _ "Please define the employee's base salary.") txtBaseSalary.Focus() Return False End If If cboPosition.SelectedIndex = -1 Then VBLIB.MsgOk("សូមកំណត់តួនាទី របស់បុគ្គលិកអោយបានត្រឹមត្រូវ។", "Please select an employee group.") cboPosition.Focus() Return False End If If txtWorkTime.Tag Is Nothing Then VBLIB.MsgOk("សូម កំណត់ ម៉ោងធ្វើការ អោយបាន ត្រឹមត្រូវ។", "Please choose a work time.") btnSelectWTime.Focus() Return False End If

Dim empid As Object() = Nothing Try Dim bPhoto() As Byte = Nothing If Not picPhoto.Image Is Nothing Then Dim photo As New MemoryStream picPhoto.Image.Save(photo, ImageFormat.Jpeg) bPhoto = photo.GetBuffer End If

Dim empGroup As String = "" Dim userID() As Object = Nothing Dim par() As String = Nothing Dim arg() As Object = Nothing Dim devFailure As New StringBuilder 'To record failed devices.

If cboEmpGroup.SelectedIndex > -1 Then empGroup = _ cboEmpGroup.SelectedValue.ToString

If _vSaveNew Then 'Get the last user ID from the DB. var._sql.doExecuteSQL("spEmployeeCountEmp", _ CommandType.StoredProcedure, Nothing, Nothing, _ New String() {"@Count"}, _ New Integer() {10}, userID, _ New SqlDbType() {SqlDbType.Int})

'Insert employee var._sql.doExecuteSQL("spEmployeeInsert", _ CommandType.StoredProcedure, _ New String() {"@EmpName", "@EmpManualID", _ "@EmpIDCard", "@EmpCardNo", "@UserID", "@NationalityID", "@EmpGroupID", "@PositionID", "@Gender", "@DOB", "@POB", "@HireDate", "@BaseSalary", "@PositionRate", _ "@Description", "@User", "@Photo", _ "@DefWTimeID"}, _ New Object() {txtEmpName.Text, txtEmpID.Text.Trim, _ txtIDCardNo.Text, txtCardNo.Text, _ CType(userID(0), Integer) + 1, _ cboNationality.SelectedValue.ToString(), _ empGroup, cboPosition.SelectedValue.ToString(), _ cboGender.SelectedIndex.ToString, _ dtpDOB.Value.ToString("MM/dd/yyyy"),txtPOB.Text, _ dtpStartDate.Value.ToString("MM/dd/yyyy"), _ txtBaseSalary.Text, _ IIf(txtPositionRate.Text = "", "0", _ txtPositionRate.Text), txtDescription.Text, _ VBLIB.currentuser, bPhoto, _ txtWorkTime.Tag.ToString}, _ New String() {"@EmpID", "@Error"}, _ New Integer() {10, 50}, empid, _ New SqlDbType() {SqlDbType.BigInt, SqlDbType.VarChar}) ' 'Check error... If empid(1).ToString.Length = 0 Then ' 'Insert into the list. Dim r As DataRow = _dtEmployee.NewRow r("IsActive") = True r("EmpID") = empid(0) r("EmpName") = txtEmpName.Text.Trim r("EmpManualID") = txtEmpID.Text.Trim r("Gender") = cboGender.Text r("DOB") = dtpDOB.Value r("EmpIDCard") = txtIDCardNo.Text.Trim r("EmpCardNo") = txtCardNo.Text.Trim r("UserID") = CType(userID(0), Integer) + 1 r("Nationality") = cboNationality.Text If cboEmpGroup.SelectedIndex > -1 Then r("EmpGroupName") = cboEmpGroup.Text End If r("PositionName") = cboPosition.Text r("HireDate") = dtpStartDate.Value r("BirthPlace") = txtPOB.Text.Trim r("BaseSalary") = Double.Parse(txtBaseSalary.Text) r("PositionRate") = Double.Parse(IIf(txtPositionRate.Text = "", "0", txtPositionRate.Text)) r("AddBy") = VBLIB.currentuser r("AddDateTime") = Today If picPhoto.Image Is Nothing Then r("HasPhoto") = False Else r("HasPhoto") = True End If ' 'Add the new row to the list here. _dtEmployee.Rows.Add(r) _dtEmployee.AcceptChanges() _dgvEmployee(0, _dgvEmployee.RowCount - 1).Selected = True ' 'Connect to each card reader device... Dim ID As Integer = CType(userID(0), Integer) + 1 If var.zkDevice Is Nothing Then var.zkDevice = New zkemkeeper.CZKEM End If For Each rDevice As DataRow In var.dtDevices.Rows Try If var.zkDevice.Connect_Net(rDevice("DeviceIP").ToString(), rDevice("DevicePort").ToString) Then var.zkDevice.SetStrCardNumber(txtCardNo.Text.Trim()) Dim pvl As Integer = 0 If Not var.zkDevice.SetUserInfo(1, ID, txtEmpID.Text, _ "", pvl, True) Then 'When failed, record in db... fun._doInsertDeviceFailure(ID, _ Integer.Parse(txtCardNo.Text.Trim()), _ rDevice("DeviceIP").ToString, _ CType(rDevice("DevicePort"), Integer), _ "Insert") devFailure.Append("- IP: " + _ rDevice("DeviceIP").ToString + ", Port: " + _ rDevice("DevicePort").ToString + vbNewLine) End If Else fun._doInsertDeviceFailure(ID, _ Integer.Parse(txtCardNo.Text.Trim()), _ rDevice("DeviceIP").ToString, _ CType(rDevice("DevicePort"), Integer), "Insert") devFailure.Append("- IP: " + _ rDevice("DeviceIP").ToString + ", Port: " + _ rDevice("DevicePort").ToString + vbNewLine) End If Catch ex As Exception MessageBox.Show(ex.Message) End Try Next If devFailure.ToString.Length > 0 Then devFailure.Insert(0, "Some devices failed to register: " + _ vbNewLine) End If ' 'Clear boxes. _doClearBoxes() If devFailure.ToString.Length > 0 Then MessageBox.Show(devFailure.ToString) End If _vConfSaveB4Close = False txtCardNo.Focus() Else Dim errMsg As String = "" If empid(1).ToString = "Card number exists" Then errMsg = "លេខកាតរបស់ បុគ្គលិក ដែល លោកអ្នក កំពុង បញ្ចូល ធ្លាប់មានរួចហើយ។" + vbNewLine + _ "Card number already exists." ElseIf empid(1).ToString = "ID card exists" Then errMsg = "លេខអត្តសញ្ញាណប័ណ្ណ ដែលលោកអ្នក កំពុង បញ្ចូល ធ្លាប់មានរួចហើយ។" + vbNewLine + _ "ID card number already exists." ElseIf empid(1).ToString = "User id exists" Then errMsg = "User id already exists" ElseIf empid(1).ToString = "EmpManualID exists" Then errMsg = "អត្តលេខ នេះធ្លាប់បាន បញ្ចូល រួចហើយ។" + vbNewLine + "ID already exists." End If Dim frmExist As New frmEmployee_ExistingEmp(errMsg, _ empid(0).ToString) frmExist.ShowDialog() pnlBoxes.Enabled = True Return False End If

Else empid = New Object() { _ _dgvEmployee.SelectedRows(0).Cells("EmpID").Value.ToString} var._sql.doExecuteSQL("spEmployeeUpdate", _ CommandType.StoredProcedure, _ New String() {"@EmpID", "@EmpName", "@EmpIDCard", _ "@EmpCardNo", "@NationalityID", "@EmpGroupID", _ "@PositionID", "@Gender", "@DOB", "@POB", _ "@HireDate","@BaseSalary", "@PositionRate", _ "@Description", "@User", "@Photo", "@DefWTimeID"}, New Object() {empid(0).ToString, txtEmpName.Text, _ txtIDCardNo.Text, txtCardNo.Text, _ cboNationality.SelectedValue.ToString(), _ empGroup, cboPosition.SelectedValue.ToString(), _ cboGender.SelectedIndex.ToString, _ dtpDOB.Value.ToString("MM/dd/yyyy"), txtPOB.Text, dtpStartDate.Value.ToString("MM/dd/yyyy"), _ txtBaseSalary.Text, _ IIf(txtPositionRate.Text = "", "0", _ txtPositionRate.Text), txtDescription.Text, VBLIB.currentuser, bPhoto, _ txtWorkTime.Tag.ToString})

' 'Update the list. With _dgvEmployee.SelectedRows(0) .Cells("EmpName").Value = txtEmpName.Text.Trim .Cells("Gender").Value = cboGender.Text .Cells("DOB").Value = dtpDOB.Value .Cells("EmpIDCard").Value = txtIDCardNo.Text.Trim .Cells("EmpCardNo").Value = txtCardNo.Text.Trim .Cells("Nationality").Value = cboNationality.Text If cboEmpGroup.SelectedIndex > -1 Then .Cells("EmpGroupName").Value = cboEmpGroup.Text End If .Cells("PositionName").Value = cboPosition.Text .Cells("HireDate").Value = dtpStartDate.Value .Cells("BirthPlace").Value = txtPOB.Text.Trim .Cells("BaseSalary").Value = Double.Parse(txtBaseSalary.Text) .Cells("PositionRate").Value = _ Double.Parse(IIf(txtPositionRate.Text = "", "0", _ txtPositionRate.Text)) .Cells("AddBy").Value = VBLIB.currentuser .Cells("AddDateTime").Value = Today If picPhoto.Image Is Nothing Then .Cells("HasPhoto").Value = False Else .Cells("HasPhoto").Value = True End If End With If devFailure.ToString.Length > 0 Then MessageBox.Show("Some devices failed to update card number:" + vbNewLine + devFailure.ToString, "Devices Failed") End If _vConfSaveB4Close = False DialogResult = Windows.Forms.DialogResult.OK End If ' 'Insert or delete unions... For Each un As DataRow In _dtEmpUnions.Rows If un("Status").ToString = "New" Then var._sql.doExecuteSQL("spEmployeeUnionInsert", _ CommandType.StoredProcedure, _ New String() {"@EmpID", "@UnionID"}, _ New String() {empid(0).ToString, _ un("UnionID").ToString}) ElseIf un("Status").ToString = "Deleted" Then var._sql.doExecuteSQL("spEmployeeUnionDelete", _ CommandType.StoredProcedure, _ New String() {"@EmpID", "@UnionID"}, _ New String() {empid(0).ToString, _ un("UnionID").ToString}) End If Next ' 'Clear the union list... _dtEmpUnions.Clear() Catch ex As Exception VBLIB.MsgOk(ex.Message, "Save failed.") Return False End Try Return True
End Function

Record Leave:

Private Function _doSave() As Boolean 'Validate input... If txtEmpName.Tag Is Nothing Then VBLIB.MsgOk("សូមជ្រើសរើស ឈ្មោះបុគ្គលិក ដែលត្រូវសំរាក។", "Please select an employee's name.") txtEmpName.Focus() Return False End If If flpList.Controls.Count = 0 Then VBLIB.MsgOk("សូមចុចប៊ូតុង 'បង្កើតថ្ងៃឈប់សំរាក' ដើម្បី បង្កើត ថ្ងៃឈប់សំរាក សំរាប់ បុគ្គលិក ម្នាក់នេះ។", "Please press 'Generate Leave' button.") dtpFrom.Focus() Return False End If ' ' Dim FoundAnnLv As Boolean = False Dim CurLv As Integer = 0, NxtLv As Integer = 0 Dim CurLvDt, NxtLvDt As DateTime

For Each uc As ucLeaveRecord In flpList.Controls If uc.cboLeaveType.SelectedIndex = 0 Then FoundAnnLv = True If _dtAnnSpecLeave.Rows.Count = 0 Then If uc.cboDuration.SelectedIndex = 0 Then NxtLv += CInt(uc.cboDuration.SelectedValue) ElseIf uc.cboDuration.SelectedIndex = 0 Then If uc.cboDuration.SelectedIndex = 0 Then NxtLv += CInt(uc.cboDuration.SelectedValue) ElseIf uc.cboDuration.SelectedIndex RemCurLv Or NxtLv > 0 Then If _dtAnnSpecLeave.Rows.Count = 0 Then NxtLvDt = dtpFrom.Value 'Get only Year in SQL Else NxtLvDt = CDate(_dtAnnSpecLeave.Rows(0)("ToDate")) 'Get only Year in SQL End If ' 'Get the next annual leave... Try RemNxtLv = CInt(var._sql.doExecuteScalar("spYearlyLeave_GetNxtYearLeave", _ New String() {"@EmpID", "@From"}, New String() {txtEmpName.Tag.ToString, NxtLvDt.ToString("MM/dd/yyyy")}, CommandType.StoredProcedure)) Catch ex As Exception MessageBox.Show(ex.Message) Return False End Try If RemNxtLv = -1 Then MessageBox.Show("Annual leave not enough.") Return False End If Dim f As New frmEmployeeLeave_InformAnnual(CurLv, NxtLv, RemCurLv, RemNxtLv, _MorningHours, _AfternoonHours, dtpFrom.Value) If f.ShowDialog() Windows.Forms.DialogResult.OK Then Return False End If End If End If

'Get last id... Dim id As Integer = CInt(var._sql.doExecuteScalar("spEmployeeLeave_GetNextID", Nothing, Nothing, CommandType.StoredProcedure)) Dim t As SqlClient.SqlTransaction = var._sql._Connection.BeginTransaction

Dim LeaveTime, LeaveType, EarlyStatus, EarlyTime As String

For Each uc As ucLeaveRecord In flpList.Controls LeaveTime = "" LeaveType = "" EarlyStatus = "" EarlyTime = ""

If uc.cboDuration.SelectedIndex = 0 Then LeaveTime = "a day" ElseIf uc.cboDuration.SelectedIndex = 1 Then LeaveTime = "a morning" ElseIf uc.cboDuration.SelectedIndex = 2 Then LeaveTime = "a afternoon" ElseIf uc.cboDuration.SelectedIndex >= 4 Then EarlyStatus = uc.cboEarlyStatus.SelectedValue.ToString EarlyTime = uc.cboEarlyTime.SelectedValue.ToString End If

If uc.cboLeaveType.SelectedIndex = 0 Then LeaveType = "Annual Leave" ElseIf uc.cboLeaveType.SelectedIndex = 1 Then LeaveType = "Leave without paid" End If

Try var._sql.doExecuteSQL("spEmployeeLeaveInsert", CommandType.StoredProcedure, _ New String() {"@EmpID", "@From", "@Duration", "@LeaveTime", _ "@LeaveType", "@User", "@ID", "@DefWorkMin", "@EarlyStatus", "@EarlyTime"}, _ New String() {txtEmpName.Tag.ToString, CDate(uc.lblDate.Tag).ToString("MM/dd/yyyy"), _ uc.cboDuration.SelectedValue.ToString, LeaveTime, LeaveType, _ VBLIB.currentuser, id, _MorningHours + _AfternoonHours, EarlyStatus, EarlyTime}, t) Catch ex As Exception t.Rollback() MessageBox.Show(ex.Message) Return False End Try Next t.Commit() Return True
End Function

Download Attendances:

Public Sub _doProcess() Implements IProcessable._doProcess 'Connect to all devices... If _doConnectToDevices = False Then VBLIB.MsgOk("មានឧបករណ៍ មួយចំនួន មិនអាច ធ្វើការ ទាក់ទង បាន។ សូមពិនិត្យមើល ឧបករណ៍ អោយបាន ត្រឹមត្រូវ។", "Some devices cannot be connected. Please check the devices connection.") Else If fun._doDownloadAttendances("") = True Then ' 'Clear data in devices For Each dev As DataRow In var.dtDevices.Rows Try If var.zkDevice.Connect_Net(dev("DeviceIP").ToString, CInt(dev("DevicePort"))) = True Then var.zkDevice.ClearGLog(1) Else Throw New Exception("Some device connection failed.") End If Catch ex As Exception MessageBox.Show(ex.Message) RaiseEvent _ProcessCompleted() Return End Try Next ' 'Calulcate att... var._sql.doExecuteSQL("spInsertAttendances", CommandType.StoredProcedure, _ New String() {"@User"}, New String() {VBLIB.currentuser}) RaiseEvent _ProcessCompleted() btnRefresh_Click(btnRefresh, Nothing) Else RaiseEvent _ProcessCompleted() MessageBox.Show("Download failed.") End If End If
End Sub

Public Shared Function _doDownloadAttendances(ByVal EmployeeID As String) As Boolean Dim dtAtt, dtEmp As New DataTable Dim row As DataRow = Nothing Dim uid, year, month, day, h, min As Integer Dim empid As String = "" Dim empRow As DataRow = Nothing Dim DTime As DateTime Dim sql As String = "SELECT EmpID, UserID FROM Employee WHERE ISNULL(UserID, '') '';"

If empid.Trim.Length > 0 Then sql = "SELECT EmpID, UserID FROM Employee WHERE EmpID=" + EmployeeID + ";" End If var._sql.doQueryData(sql, CommandType.Text, Nothing, Nothing)._doFill(dtEmp) dtEmp.PrimaryKey = New DataColumn() {dtEmp.Columns("UserID")}

dtAtt.Columns.Add("EmpID") dtAtt.Columns.Add("WorkDateTime") dtAtt.Columns.Add("AddDateTime") dtAtt.Columns.Add("AddBy") dtAtt.Columns.Add("Machine")

For Each dev As DataRow In var.dtDevices.Rows Try If var.zkDevice.Connect_Net(dev("DeviceIP").ToString, CInt(dev("DevicePort"))) = True Then While var.zkDevice.GetAllGLogData(1, 1, uid, 1, 1, 1, year, month, day, h, min) empRow = dtEmp.Rows.Find(uid.ToString) If empRow Is Nothing Then empid = "" Else empid = empRow("EmpID").ToString End If DTime = DateTime.ParseExact(month.ToString + "/" + day.ToString + "/" + year.ToString, "M/d/yyyy", _ New Globalization.CultureInfo("en-US")).ToString("MM/dd/yyyy") + " " + h.ToString + ":" + min.ToString

row = dtAtt.NewRow row("EmpID") = empid row("WorkDateTime") = DTime.ToString("MM/dd/yyyy HH:mm") row("AddDateTime") = Today.ToString("MM/dd/yyyy") row("AddBy") = VBLIB.currentuser row("Machine") = Environment.MachineName

dtAtt.Rows.Add(row) End While Else Throw New Exception("Some device connection failed. Download canceled.") Return False End If Catch ex As Exception MessageBox.Show(ex.Message) Return False End Try Next ' 'Start to bulk copy to SQL... Try Dim bCopy As New SqlClient.SqlBulkCopy(var._sql._Connection)

bCopy.ColumnMappings.Add("EmpID", "EmpID") bCopy.ColumnMappings.Add("WorkDateTime", "WorkDateTime") bCopy.ColumnMappings.Add("AddDateTime", "AddDateTime") bCopy.ColumnMappings.Add("AddBy", "AddBy") bCopy.ColumnMappings.Add("Machine", "Machine") bCopy.DestinationTableName = "tmpAutoTrack" bCopy.WriteToServer(dtAtt) Catch ex As Exception MessageBox.Show(ex.Message) Return False End Try

Return True
End Function

System Testing

System Testing is a critical element of software quality assurance and represents the ultimate review of specification, design, and code generation. Once source code has been generated, software must be tested to uncover and correct as many errors as possible before delivery to customer. Our goal is to design a series of test case that have a likelihood of finding errors.

1 Testing Cases

While testing this system, the following cases are needed to be considered.

|Test Case |Test Objective |
|1 |Test on Login form |
|2 |Test on Add New Device form |
|3 |Test on Employee Registration form |
|4 |Test on Record Leave form |

2 Testing Reports

|Test Case |1 |
|Test Objective |Test on login authentication to access the system |
|Test Data |Valid: The user entered valid username and password |
| |Invalid: The user entered invalid username and password |
|Output |Valid: The user was allowed to operate the system by showing up the main form. |
| |Invalid: The user was not allowed to operate the system. He or she got a security |
| |message instead. |
|Result |Valid: The user successfully logged in to the system. |
| |Invalid: The user could not log in to the system |
|Conclusion |Both valid and invalid data were tested and the system responded properly to the |
| |given data. This means the system functions correctly. |

|Test Case |2 |
|Test Objective |Test on connection to a RFID time attendance device. |
|Test Data |Valid: The user entered a valid device IP address and port number. |
| |Invalid: The user entered an invalid device IP address and/or port number. |
|Output |Valid: The user was allowed to register the new RFID device. |
| |Invalid: The user was not allowed to register the new RFID device. He or she got a |
| |message instead. |
|Result |Valid: The user successfully registered the new RFID device. |
| |Invalid: The user could not register the new RFID device. |
|Conclusion |Both valid and invalid data were tested and the system responded properly to the |
| |given data. This means the system functions correctly. |

|Test Case |3 |
|Test Objective |Test on saving employee information into the database |
|Test Data |Valid: The user entered valid and filled all mandatory data. |
| |Invalid: The user entered invalid data. |
|Output |Valid: The user was allowed to save the employee information into the database. |
| |Invalid: The user was not allowed to save the employee information into the database.|
| |He or she got a save-failed message instead. |
|Result |Valid: The user successfully registered the new employee. |
| |Invalid: The user could not register the new employee. |
|Conclusion |Both valid and invalid data were tested and the system responded properly to the |
| |given data. This means the system functions correctly. |

|Test Case |4 |
|Test Objective |Test on recording an employee leave deducting annual leave |
|Test Data |Valid: The user recorded number of leave that is less than or equal to the number of|
| |total annual leave. |
| |Invalid: The user recorded number of leave that is greater than the number of total |
| |annual leave. |
|Output |Valid: The user was allowed to record the leave. |
| |Invalid: The user was not allowed to record the leave. He or she got an alert message|
| |instead. |
|Result |Valid: The user successfully recorded the leave. |
| |Invalid: The user could not record the leave. |
|Conclusion |Both valid and invalid data were tested and the system responded properly to the |
| |given data. This means the system functions correctly. |

Conclusion

Factory Time Attendance Management System (FTAMS) is an innovative and comprehensive software that can connect to time attendance devices to manipulate employee attendance records. It can correctly compute for proper compensation of employees or workers, based on attendance records.

Whatever the payroll requirements, the system is capable of flexibility for meeting rules related to breaks, meals, rounding, time-off, and managing holidays.

Advantages of FTAMS:

• User Friendly: The FTAMS is user friendly because the retrieval of data is very fast and data is maintained efficiently.

• Ease of Report Generating: All reports are generated automatically.

• Time Consuming: The traditional way of taking attendance is computerized so that most of work is done automatically.

Bibliography

• Search engine, http://www.google.com • Online encyclopedia Wikipedia, http://www.wikipedia.org • UML 2.0, http://www.sce.carleton.ca/squall • http://www.w3schools.com
-----------------------
[data valid]

[data invalid]

[requirement missing]

[requirement complete]

[invalid IP address]

[valid IP address]

Figure 2.7 Activities Diagram for Record Leave

Figure 2.8 Activities Diagram for Calculate Payroll

Figure 2.9 Activities Diagram for Add New RFID Device

Figure 3.3 FTAMS Class Diagram

Figure 3.15 Nationality Form

Similar Documents

Premium Essay

Time Attendance

...Time & Attendance Trends in the UK October 2015 Time & Attendance Trends in the UK White Paper Time & Attendance in the UK Brandon Hall Group Research Team September 2015 ©2015 Brandon Hall Group. Licensed for Distribution by Kronos Incorporated. Page 2 Time & Attendance Trends in the UK Table of Contents Introduction 4 Time & Attendance: A Critical Intersection 4 Laying the Foundation for Success 6 Taking Automation into the Future 8 Key Take-Aways 10 About Brandon Hall Group 11 ©2015 Brandon Hall Group. Licensed for Distribution by Kronos Incorporated. Page 3 Time & Attendance Trends in the UK Introduction NOTABLE INSIGHT Organisations with fully automated T&A processes are 32% more likely to be able to use their workforce data to support predictive analytics. Time and attendance (T&A) tracking and data are at the core of workforce management today and are key intersection points between HR and the business. Key findings from Brandon Hall Group’s 2015 HCM Technology Trends study show that organisations in the UK are beginning to take advantage of technology to automate T&A. As a result, they are able to experience key improvements in reporting and analytics capabilities and better support collaboration with other areas of the business: • Technology. 67% of UK organisations that have workforce management strategies say they have used technology to enable their T&A processes. ...

Words: 2546 - Pages: 11

Premium Essay

Computer Science Siwes Report on Time and Attendance Management (Jantek)

...KOGI STATE POLYTECHNIC SCHOOL OF APPLIED SCIENCES, MATHS/STAT/COMPUTER SCIENCE DEPARTMENT PMB 1101, LOKOJA, KOGI STATE A TECHNICAL REPORT ON STUDENT INDUSTRIAL WORK EXPERIENCE SCHEME (SIWES) AT THE TIME OFFICE, DANGOTE CEMENT PLC OBAJANA BY AIYEDE JOHN E. 2010/ND/CPS/370 IN PARTIAL Fulfillment of THE REQUIREMENT FOR THE AWARD OF NATIONAL DIPLOMA (ND) IN COMPUTER SCIENCE. FEBRUARY 2012. CHAPTER ONE INTRODUCTION 1.1 SIWES The Student Industrial Work-Experience Scheme (SIWES) is a planned and supervised training intervention based on stated and specific learning and career objectives, and geared towards developing the occupational competencies of the participants. It is a skill Training programme designed to expose and prepare students of Agriculture, Engineering, Technology, Environmental, Science, Medical Sciences and pure and applied science for the Industrial work situation which they likely to meet after graduation. Duration of SIWES is four (4) months in Polytechnics at the end of ND I, four (4) months in College of Education at the end of NCE II and six (6) months in the Universities at the end of 300 or 400 or 500 levels depending on the discipline. Therefore, SIWES is generic, cutting across over 60 programmes in the universities, over 40 programmes in the polytechnics and about 10 programmes in the colleges of education. Thus, SIWES is not specific to any one course of study or discipline. In Nigeria, industrial training...

Words: 4649 - Pages: 19

Premium Essay

A Fingerprint Based Biometric Authentication and Identification System for Time and Attendance Management

...A FINGERPRINT BASED BIOMETRIC AUTHENTICATION AND IDENTIFICATION SYSTEM FOR TIME AND ATTENDANCE MANAGEMENT ABSTRACT This project is about designing a system that automates the whole process of taking attendance and maintaining its records in an academic institute. Managing people is a difficult task for most of the organizations, and maintaining the attendance record is an important factor in people management. When considering academic institutes, taking the attendance of students on daily basis and maintaining the records is a major task. Manually taking the attendance and maintaining it for a long time adds to the difficulty of this task as well as wastes a lot of time. For this reason an efficient system is designed. This system takes attendance electronically with the help of a fingerprint sensor and all the records are saved on a computer server. In order to mark the attendance, student/staff has to place his/her finger on the fingerprint sensor. On identification student’s attendance record is updated in the database and he/she is notified through a screen. . TABLE OF CONTENTS Certification Acknowledgement Abstract Table of Contents List of Figures Chapter One Introduction Chapter Two Literature Review Chapter Three Methodology Chapter Four System Design Chapter Five Implementation Chapter Six Conclusion and Recommendation LIST OF FIGURES CHAPTER ONE INTRODUCTION 1.1 INTRODUCTION This chapter focuses on the background of the project, the objectives, scope and...

Words: 2434 - Pages: 10

Premium Essay

Attendance Systems

...employee attendance management system project.pdf FREE PDF DOWNLOAD NOW!!! Related searches for employee attendance management sy… Employee Attendance Management Sy… Student Attendance Management Sys… Software for Attendance Managemen… Employee Time Management System Related searches Employee Attendance Management System Student Attendance Management System Software for Attendance Management System Employee Time Management System Attendance Management Software Employee Performance Management Systems Employee Health Management Systems Online Project Management Systems Employee Payroll and Attendance Management System | … www.freestudentprojects.com/vb-net-projects/employee-payroll-and-att Pls send me how to log this payroll management system and send me a Vb code? thanks Employee Attendance Monitoring System Project | 1000 Projects 1000projects.org/employee-attendance-monitoring-system-project.html Payroll Management System ASP.Net Project with Documentation and Source Code Payroll management system is the heart of any Human Resource System of an ... ATTENDANCE MANAGEMENT SYSTEM | Projects - Classle https://www.classle.net/.../project_ideas/attendance-management-system Attendance management is the act of managing attendance or presence in a work setting to minimize loss due to employee downtime. Attendance control has … Attendance Management System | Free Student Projects www.freestudentprojects.com/.../attendance-management-system Attendance Management System. Project...

Words: 429 - Pages: 2

Premium Essay

Google

...Advanced Technology (IJEAT) ISSN: 2249 – 8958, Volume-2, Issue-3, February 2013 Wireless Fingerprint Based College Attendance System Using Zigbee Technology Gunjan Talaviya, Rahul Ramteke, A.K.Shete Abstract— In this paper we propose a system that takes attendance of student and maintaining its records in an academic institute automatically. Manually taking the attendance and maintaining it for a long time makes it difficult task as well as wastes a lot of time. For this reason an efficient system is designed. This system takes attendance with the help of a fingerprint sensor module and all the records are saved on a computer. Fingerprint sensor module and LCD screen are dynamic which can move in the room. In order to mark the attendance, student has to place his/her finger on the fingerprint sensor module. On identification of particular student, his attendance record is updated in the database and he/she is notified through LCD screen. In this system we are going to generate Microsoft excel attendance report on computer. This report will generate automatically after 15 days (depends upon user). This report will be sent to the respected HOD, teacher and student’s parents email Id. Index Terms—Fingerprints, Enrollment, Fingerprint sensor, Failure to enroll (FTE), Failure to capture (FTC), Verification, Fingerprint templates, identification. For attendance, the student places his/ her finger over the fingerprint device and the student’s matriculation number is sent to the...

Words: 1698 - Pages: 7

Premium Essay

Research Proposal Final

...HOW ELECTRONIC ATTENDANCE AFFECTS THE ATTENDANCE OF STUDENTS IN QATAR UNIVERISTY? SUBMITTED BY: SAKIB AHMED 201108809 AZEEM MOHAMED 201205726 COURSE NAME: RESEARCH METHODS DATE OF SUBMISSION: JUNE 2nd, 2014 INTRODUCTION Technology has an important presence in every sphere of our lives today. The field of education should make use of technology and the new, advanced and computerized tools available to us today to increase student attendance and improve their efficiency. The computerized tools can help professors in time management and also reduces errors in the calculation of attendance for usage in the student’s transcripts. It is clear from previous research studies that increased attendance of students helps to improve their grades and increase their motivation to study. Previous studies have also shown the improved performance of students after using computers and other animated tools in their classroom. This has led us to conduct this research to observe and document the effects of the electronic attendance system on students' attendance in QU. The purpose of this research is to understand if the electronic attendance system installed in Qatar University has improved the attendance and minimized the dropouts in lectures. Our understanding is that the attendance of the students has increased and that we were able to keep absenteeism at zero. This research will be done with the help of various departments of Qatar University. The advantages of using such an electronic...

Words: 1519 - Pages: 7

Premium Essay

Ghybhbyb

...Attendance Management System Project Report On “Attendance Management System” International School of Informatics and Management Sector-12,Mahaveer Marg, Mansarover, Jaipur Submitted By: 1. Saurabh Kumar Jain 2. Uma Joshi 3. Bhupesh Kumar Sharma Team Number:-15 1 Guided By Mr. Vijay Gupta Assistant Professor, IIIM, Jaipur. Attendance Management System CERTIFICATE This is to certify that this report embodies the original work done by Saurebh Kumar Jain, Uma Joshi and Bhupesh Kumar Sharma during this project submission as a partial fulfillment of the requirement for the System Design Project of Masters of Computer Application IV Semester, of the Rajasthan Technical University, Kota. Swati V. Chande Principal (MCA Department) International School of Informatics and Management Mr. Vijay Gupta Assistant Professor International School of Informatics and Management 2 Attendance Management System ACKNOWLEDGEMENT The satisfaction that accompanies that the successful completion of any task would be incomplete without the mention of people whose ceaseless cooperation made it possible, whose constant guidance and encouragement crown all efforts with success. We are grateful to our project guide Mr. Vijay Gupta Sir for the guidance, inspiration and constructive suggestions that helpful us in the preparation of this project. We also thank our colleagues who have helped in successful completion of the project. Saurabh Kumar Jain Uma Joshi Bhupesh Kumar...

Words: 1996 - Pages: 8

Free Essay

Attendance

...Lancaster University Management School Working Paper 2005/004 New issues in attendance demand: The case of the English football league Simmons, Rob and Forrest, David The Department of Economics Lancaster University Management School Lancaster LA1 4YX UK ©Simmons Rob and Forrest David All rights reserved. Short sections of text, not to exceed two paragraphs, may be quoted without explicit permission, provided that full acknowledgement is given. The LUMS Working Papers series can be accessed at http://www.lums.co.uk/publications/ LUMS home page: http://www.lums.lancs.ac.uk/ NEW ISSUES IN ATTENDANCE DEMAND: THE CASE OF THE ENGLISH FOOTBALL LEAGUE David Forrest* University of Salford Rob Simmons** Lancaster University November 2004 *School of Accounting, Economics and Management Science, University of Salford, Salford M5 4WT, e-mail: d.k.forrest@salford.ac.uk. Phone: 0044 (0)161 295 3674, Fax: 0044 (0)161 295 2130. **(Corresponding author) Department of Economics, The Management School, Lancaster University, Lancaster LA1 4YX, e-mail: r.simmons@lancaster.ac.uk. Phone 0044 (0)1524 594234, Fax 0044 (0)1524 594244. Acknowledgement We are grateful to two referees, Tunde Buraimo and participants at the Applied Econometrics Association, Football’s Econometrics Conference, in Patras, Greece, for helpful comments on an earlier draft. 1 ABSTRACT This paper uses an attendance demand model with panel data on over 4,000 games to examine economic problems of fixture congestion in...

Words: 9257 - Pages: 38

Premium Essay

Attendance Monitoring

...and Voltage Regulator. They also started to do services that also concerns electrical engineering works like designing and construction of electrical system, energy and power management consultancy, installation of automatic and manual power capacitor banks, electrical system maintenance, automatic and manual transfer switch, power system and battery switch and metal enclosure fabrication. And now, they look forward to become one of the nation’s leading electrical contractors, supplier of electrical equipments and provider of solutions to energy / power. Till now the company is successful since its establishment. Scope and Limitation: The study focuses on the monitoring of attendances of the employees in World Citi Colleges. The attendance monitoring system is concerned in getting the time when a student and employees logs in and out and whether the employees and students is present or not. Flow of the Current System: This system handles their...

Words: 2695 - Pages: 11

Premium Essay

Electronic Daily Time Record

...Development of Attendance Management System using Biometrics. O. Shoewu, Ph.D.1,2* and O.A. Idowu, B.Sc. 1 1 Department of Electronic and Computer Engineering, Lagos State University, Epe Campus, Nigeria. 2 Department of Electrical and Electronics, University of Benin, Edo State, Nigeria. E-mail: engrshoewu@lasunigeria.org* ABSTRACT In this paper, the development of an attendance management system using biometrics is proposed. Managing student attendance during lecture periods has become a difficult challenge. The ability to compute the attendance percentage becomes a major task as manual computation produces errors, and also wastes a lot of time. For the stated reason, an efficient attendance management system using biometrics is designed. This system takes attendance electronically with the help of a finger print device and the records of the attendance are stored in a database. Attendance is marked after student identification. For student identification, a biometric (fingerprint) identification based system is used. This process however, eliminates the need for stationary materials and personnel for the keeping of records. Eighty candidates were used to test the system and success rate of 94% was recorded. The manual attendance system average execution time for eighty students was 17.83 seconds while it was 3.79 seconds for the automatic attendance management system using biometrics. The results showed improved performance over manual attendance management system....

Words: 3034 - Pages: 13

Free Essay

Monitor Student’s Presence in Classroom

...number call by lecturers which is time consuming task and also to avoid proxy, second is parents monitor their children. This project aims at providing software to automatically record the students’ attendance during lecture in a classroom using facial recognition technology instead of the traditional manual roll call methods. Facial recognition method is very important and is used in various applications for identification and detection. Keywords —Face Recognition, Attendance System, Camera, Image Processing technology, OpenCV Library Software ___________________________________________________________________________________________________ Introduction This project deals with the development and implementation of a smart and real time attendance application that monitor and traces the exact position of a student. Parents whose numbers are registered in the school/college database can use this application in their mobile phones. It provides some authentication and thus enhances security of student by using CAMERA which is used in the classroom. Using this application, parents can be carefree about the safety of their children despite being busy in their hectic job schedule. It helps you to get the actual position of your children on your smart mobile phone or even your computer. It is enabled with 3D earth map that provides you most accurate position of your child at a regular interval of time. The software provides you real time positioning system with finest accuracy...

Words: 2211 - Pages: 9

Premium Essay

Design and Implementation of a Bio-Metric (Fingerprint) Clocking System

...conventional method of paper sheets and old file system method. Every corporate organization poses some standards concerning how attendance is to be confirmed for staff in offices. This is to enable the management of the organization identify those staff that are punctual and competent, that is why keeping the accurate record of attendance is very important. Also in institutions, tracking and monitoring staff time of attendance could pose a tedious task, time consuming and as well prone to errors. As an alternative to the traditional manual clocking process by staff in offices, biometrics characteristics can be used for authenticating staff. This research will focus on developing a Fingerprint based Biometric Clocking System.  The fingerprint Biometrics is adopted in this research work due to the fact that it is one of the most successful applications of biometric technology. In the manual signing processes, where a sheet of paper is placed at the entrance of the office for staff to write their names and signature as a form of confirming their presence for a particular day in the office, falsification in staff attendance mostly occur. A situation whereby a staff can sign on behalf of his or her colleague as being present in the office when that is not true. This can be so difficult to prevent from happening especially for large offices where row count can take longer time. The trending concern in this modern age is regarding national security, identifying theft as well as on-line terrorism...

Words: 1919 - Pages: 8

Premium Essay

Attendance Monitoring Syste,

...“Attendance Monitoring in EARIST” INTRODUCTION The emergence of electronic paradigm for learning compared to traditional method and availability of almost all information on the information superhighway(Internet), nowadays have caused students to be less motivated to come to the lecture rooms than ever before. Laziness on the part of students, nonchalance to school work, extra social activities that have no importance in aiding the objectives of the institution and a lot more, may prevent students from attending lectures. Sequel to these, lecturers and administrators in most developing countries have had to come up with ways to ensure a healthy participation from students, and make sure that the student-lecturer interactive relationship is kept intact. This in some cases have come in simple forms like roll calls, while in more interesting cases, can be formats like surprise quizzes, extra credit in class, etc. These strategies are however time consuming, stressful and laborious because the valuable lecture time that could otherwise been used for lectures is dedicated to student attendance taking [8] and sometimes not accurate. In addition to all these challenges, the attendances are recorded manually by the tutor and therefore are prone to personal errors. There arises a need for a more efficient and effective method of solving this problem. A technology that can solve this problem and even do more is the RFID technology. RFID is an automated identification and data...

Words: 1281 - Pages: 6

Premium Essay

Biometrics

...What is a Biometric Time and Attendance System? Biometrics is the identification of people based upon their physical characteristics; most commonly their fingerprints, hands, eyes, or facial features. While time and attendance systems are used to manage employee attendance, scheduling, and associated payroll tasks. Within time and attendance, biometric devices are often used as a punch clock in order to add an extra layer of security, accountability and efficiency. How Does Biometric Time and Attendance Software Work? Step 1: Biometric Devices: Using biometric time and attendance systemsallows employees to clock in and out using their fingerprint, retinal scan, etc. Often times this process is also accompanied by a PIN (Personal Identification Number) which must also match the fingerprint or other scan. Step 2: Time and Attendance Software: Pairing your biometric device with a time and attendance software allows for more efficient payroll and attendance processing. Rather than spending hours adding up manually submitted clock-in and clock-out times, your biometric time and attendance software will allow you to automatically import data into your payroll software. This will significantly cut down on processing time and will eliminate errors derived from manually inputting information. Different Types of Biometric Devices Fingerprint Scanners are probably the most common type of biometric time and attendance device, simply because they are easy to use and are generally quite...

Words: 573 - Pages: 3

Premium Essay

Rfid

...International Journal of Scientific & Engineering Research Volume 4, Issue 2, February-2013 ISSN 2229-5518 1 RFID-Based Students Attendance Management System Arulogun O. T., Olatunbosun, A., Fakolujo O. A., and Olaniyi, O. M. Abstract In recent years, there have been rise in the number of applications based on Radio Frequency Identification (RFID) systems and have been successfully applied to different areas as diverse as transportation, health-care, agriculture, and hospitality industry to name a few. RFID technology facilitates automatic wireless identification using electronic passive and active tags with suitable readers. In this paper, an attempt is made to solve recurrent lecture attendance monitoring problem in developing countries using RFID technology. The application of RFID to student attendance monitoring as developed and deployed in this study is capable of eliminating time wasted during manual collection of attendance and an opportunity for the educational administrators to capture face-to-face classroom statistics for allocation of appropriate attendance scores and for further managerial decisions. Keywords: RFID, Lecture, Attendance, Passive tag, Reader INTRODUCTION T he emergence of electronic paradigm for learning compared to traditional method and availability of almost all information on the information superhighway(Internet), nowadays have caused students to be less motivated to come to the lecture rooms than ever before. Laziness on the...

Words: 3596 - Pages: 15