Sie sind auf Seite 1von 56

PAYROLL MANAGEMENT SYSTEM

A project Submitted to the School of Computer Science of

In Partial Fulfillment The Requirements of for the Degree of Bachelor of Bachelor of Computer Application
By

Sagar Yashwant Malusare


PRN No.Y003657 &

Ashish Pandurang Dhumal


PRN No.Y003645 &

Shraddha Bramhanath Hinge


PRN No.Y003634

(2010-2011)

SYNOPSIS
Payroll is very simple, flexible and user-friendly Management software. That takes care of all your requirements relating to accounting and management of employees Payroll. Payroll stores complete records of the employees, generates Pay-slips and Attendance Register, Computes all allowances and deductions and generates all statutory reports. Payroll is only salary processing software with good and wide-industry range of clients. It offers very high flexibility in defining various allowances, deductions; leave rules etc. for the employees and all formula for P.F etc. are definable and changeable at User's end. Payroll Application has been designed for the purpose of maintaining details of various allowances and deductions that needs to be given to the employees of the organization. Also, it generates the salary Sheet of the employees of the organization that assists the accounts department in many ways.

Main Objectives:-

There are multiple objectives behind the designing and implementation of the Module:
y

To prepare the detailed salary record of all the employees in an organization

To generate Pay-In-Slip through the calculation of salary

Proper usage of manpower

To maintain Allowances, Deductions, Loans, Savings and Arrears details for the employees

To generate reports in user-defined formats

To generate various important reports that provides valuable information to the top-level management

************

ACKNOWLEDGEMENT

We thank our Institute, CROWN COMPUTER for helping us in our project. Without the support of our institute, we would not able to succeed in our fieldwork and complete our project. We take the opportunity to thank

our,Prof.SandeshKarade&Prof.Sushil Mejariand other non-teaching staff who have extended their help and support to prepare our project on

Payroll Management System.

CONTENT
Chapter Name Page No.

1. System Study 1.1 Existing System 1.2 Drawbacks Of Existing System 1.3 Need for a New System 2. Introduction to Payroll Management System 2.1Features 3. Proposed System 3.1 Working 3.2 Objective/Advantages of New System

1-3

5-6

4. System Analysis 4.1 Analysis 4.2 Problem Understanding

5. Requirement Analysis 5.1 Requirements Specification 5.2 Constraints

6. System Design

7. Platform Used 7.1 Hardware Requirement 7.2 Software Requirement

10-11

8. DFD(Data Flow Diagram)

12

9. E-R Diagram

13

10. Table Used 10.1 EMP_IFO Table 10.2 DIALY_MUSTER Table 10.3 SAL_DETAIL Table 10.4 PAYROLL Table

14-15

11. Forms Layouts 11.1 LOG IN Form 11.2 WELCOME Form 11.3 EMPLOYEE INFORMATION Form 11.4 ADD SALARY DETAIL 11.5 EMPLOYEE SALARY DETAIL VIEW Form 11.6 EMPLOYEE INFO DETAIL VIEW Form 11.7 SEARCH FOR EMPLOYEE ID Form 11.8 SEARCH FOR ABSENT ID Form 11.9 SHOW SALARY DETAIL Form 11.10 PAYROLL Form 11.11 PAYROLL REPORT Form 11.12 ATTENDANCE REPORT OF EMPLOYEE Form 11.13 DESIGNATION WISE BASIC INFO Form

16-25

12. Coding 12.1 Coding For LOG IN Form 12.1.1 Code For User Name And Passward Correctness 12.2 Coding For Form EMPLOYE INFORMAION 12.2.1 Coding For Connection String Declaration 12.2.2 Code For ID 12.2.3 Code For Add New Data 12.2.4 Code For Validate(Only Number Allow) 12.2.5 Convert Small Case To Capital 12.2.6 Code For Close 12.3 Coding For Form ADD SALARY DETAIL 12.3.1 Coding For Connection String Declaration 12.3.2 Coding For Getting Employee ID In Combo box 12.3.3 Coding For Getting Employee Information 12.3.4 Code For Adding New Data 12.3.5 Code For Calling Search Box 12.3.6 Code For Clear 12.4 Coding For Form DAILY MUSTER 12.4.1 Coding For Connection String Declaration 12.4.2 Code For System Date 12.4.3 Code For Calculation Of Total Hours Works 12.4.4 Code For New Data And Ensure Data Not Repeated

26-47 26 27

29

32

12.5 Coding For Form EMPLOYEE INFO DETAIL AND SAL DETAIL VIEW 34 12.5.1 Coding For Connection String Declaration 12.5.2 Code For To Load Data In Grid View 12.5.3 Code For To Add Or Update New Data 12.5.4 Code For Saves To New Added Or Updated Data 12.5.5 Code For Delete Data 12.6 Coding For Form SEARCH BOX 36 12.6.1 Coding For Connection String Declaration 12.6.2 Code For Search Employee Id 12.6.3 Code For Getting a List Of All Employee ID 12.6.4 Code For Getting a List Of All Present ID 12.6.5 Code For Getting a List Of All Absent ID 12.7 Coding For Form SALARY DETAIL 39 12.7.1 Coding For Connection String Declaration 12.7.2 Code For Basic Info And Salary Detail Of Particular Employee 12.8 Coding For Form PAYROLL 41 12.8.1 Coding For Connection String Declaration 12.8.2 Code For Show Particular Employee Information 12.8.3 Coding For Count Absent Days 12.8.4 Coding For Count Present Days 12.8.5 Coding For Count leaves Days 12.8.6 Coding For All Sum All Days Hours Work 12.8.7 Coding For Calculate Net Salary 12.8.8 Coding For Save Data 12.8.9 Coating For Print Preview And Print 12.9 Code For The All REPORT 46 12.9.1 Code For Employee Information Report 12.9.2 Code For Employee Attendance Report 12.9.3 Code For Employee Designation Wise Information Report

13. Future Direction

48

14. Conclusion

49

Chapter 1

SYSTEM STUDY

In system study we study the existing system and new proposed system. In system study we study that what are the drawbacks, and limitations exist. What are the needs of the existing system? And also study what is the new proposed system, and how new proposed system removes the limitations and drawbacks of the existing system. In this Section we study the advantages of the new proposed system.

1.1 Existing system


This Organization is maintaining most of their day-to-day transactions data in the registers (i.e. manually). The employees of the organization are doing the whole work manually. All the work is done manually (i.e. maintained in registers) so different employees are appointed for the maintenance of registers containing all the information related to the organization. It is very time consuming and is also not error free in some situations. In existing manual system databases calculations are difficult to perform so report generation as very much difficult.

1.2Drawbacks of Existing System


Generally whenever we implement a new system it is developed to eliminate the shortcomings of an existing system. The computerized system has more edge over the manual system. It is because of accuracy, high speed, quick result, diligence etc. The existing system is totally based on manual system. Existing system has many drawbacks in comparison of computerized system 1. Time Consuming: High time consumption is the main weakness of the existing system. A lot of time is wasted in searching records from different files, which resulted in loss of time, and moreover workload also increases. Also a lot of time is wasted in duplicating the same entries in different registers. The overall checking of the records and modifications if necessary has to be made at several places which is time consuming and error prone. 2. Service and Working Conditions: With the unusual delay due to various reasons (such as nonavailability of record or absence of an employee etc) the customer suffers a lot. Without any firm reason he has to wait which disfigures the working conditions. 3. Difficulties in Retrieving Information: Sometimes, to get any of any type of instant information more than one document needs to be searched. This requires the opening of both files and then combining the information to get the required information. Further the files may not be indexed according to the need, which causes difficulty in retrieving information.

Page |1

4. Difficult for the Top Management to analyze data: Top management faces lots of problems to know about the details of the Current Transactions, Current Bookings, Current Cancellation and Employee as all is maintained at the lower level. Except for the media and their reliable resources they have nobody to ask about the current outputs and the overall results to be generated along with the reports at the end of the year. 5. Not Easy to understandable by new user: To understand the manual system the user have to get more practice and have a grape all fields that help by other employee and have to be in contact with that person. If the person was in leave the user can get the information from him.

6. Need more space to store: Here by using the paperwork system the user need to maintain all the documents in proper way to avoid the difficulty in action and need more space to store these documents because they cant destroy the old documents 7. Very Expensive: The existing manual system is very expensive method as lot of paper work has to be done and lot of wastage of manpower, which increase the expanses of existing system. 8. Data sharing: The different user in the different department cannot share data simultaneously. 9. Security feature are not prominent in the existing system.

1.3Need For a New System


To enhance the working of the fine Tech organization, which was completely handled manually, the improvement was thought on the basis of computerizing the major activities. The following factors were foreseen for the improvisation: 1. Identify the Opportunity to Improve Business Functions: It has been identified that computerization process is necessity and what business benefits can be derived by implementing this improvement. It will lead to better transaction handling in terms of speed, reliability and accuracy. 2. Improves Services and Working Conditions: To improve the working conditions of existing system in every parts of Tour & Travel Org. Customer services are need to improve to a greater extent.

3. User friendly: To make the system user friendly this system using window as its run time environment and is developed using Visual Studio 2008, which is very user-friendly rapid application developed tool. Because in the existing system register work was very difficult to handled by each user and was boring job. 4. Data Security: The proposed will also prevent unauthorized access to the system. At the very beginning, the user name and password is to be entered by the user and if it is correct only then the permission to use the software is given to user. There are different users according to different roles and one user cant use the resources given to another user.

Page |2

5. Data Redundancy: - The data is stored only once which can be accessed by any one at any time and at any place. So it can be minimized but cannot be removed completely . 6. Easy to Access: - In this database project, data can be easily access through computer networking. 7. Cost Reduction: - It requires less amount of Cost as compared to existing system . 8. Time & Efforts Reduction: - It requires fewer amounts of time and efforts. 9. Security mechanism: - Database can be secured by applying password, encryption and decryption techniques.

10. Concurrency Control: - This Database provides mechanisms to provide concurrent access and ensure the correctness of the data.

Page |3

Chapter 2

Introduction to Payroll Management System

A user friendly GUI (Graphical User Interface) based software Payroll Management System has been developed for organization, keeping in view the requirements of employees to prepare salary. The objective of the project was to computerize the payroll system which was earlier being handled manually every precaution has been taken at each process involved in the complex task of salary preparation. By computerization it implies that all process handling is entirely being done by computer. All the records necessary for the processes involved in the salary calculation are stored in a computer based record keeping system using a back-end tool. All the processes handling is done at the front-end by using a front-end. The project provides sample facilities to its users. The most important of the facilities are the report generation and printing which provides user with the hard copies of the data also.

2.1Features:
      Preparation of salary. Printing of Windows Based user friendly software. Maintenance of rich electronic records of employees available at station. Pay slips. Attendance record. Standard report generation

Page |4

Chapter 3

PROPOSED SYSTEM

This consists of Payroll System. All these transactions need to be carefully understood and taken into consideration. The system also contains a lot of data redundancy at various stages. One of the objectives of the new system would be to stores data in an efficient and non-redundant form and hence increase overall efficiency of the system. The new system should ensure of simple and easy data entry procedures through suggestive looking form. There are quite a number of lengthy calculations being done on the acquired data. These calculations should be thoroughly understood. The new system should be able to perform all these calculations automatically and efficiently. Numerous kinds of queries are done on large amounts of accumulated data, to find out the desired data. The new system should provide efficient, simple, fast and smarter procedures for retrieval of exhaustive types of data from the database. Finally, there are quite a number of reports that are generated during the normal working of the system. Each of these required reports should be understood very carefully and the new system shall provide easy and efficient methods for generation of these reports.

3.1 Working
The working of the project is based on payroll system for performing its working it use Visual Basic.NET as a front-end and SQL as a back-end. In which user perform all its functions in Visual Basic.NET environment and all database stores in the database oracle. This proposed system reserve the ticket on request of the user and also refund the unconfirmed orders after lasing the commission them. All the calculations are automatically and efficiently performed. The new computerized system has an edge over the manual system. The beneficial features of new computerized system are the following: 1. Improves Services and Working Conditions: The proposed system improves the existing working conditions in each step of inventory control system Customer services are improved to a greater extent. The whole process is very easy and efficient. 2. User Friendly: The new system is using windows as its runtime environment and is developed using Visual Basic.NET which is very user friendly rapid application development tool. The new system is totally graphical and user just has to select his desired option and the next step will be taken immediately and automatically by the system. 3. Less Time Consumption: Another aspect of system, which will reduce the time consumption, is its speed. The speed of system is measured in terms of response time i.e. the time it takes to respond to users request. Computer is an electronic device which can manipulate, modifies, retrieve and store information very speedily so it will be able to report within a fraction of time.

Page |5

3.2 Objective/Advantages of New System:


To overcome these above stated limitations in the Payroll Management System, we propose a new system that is computerized system of Payroll Management System. The proposed system would store all the information captured in different registers that will be linked with each other and will provide direct and immediate access. Using a computerized system, we will do storing of data. All the addition, deletion, modification, printing will be done through computer for faster accessing. This proposed system would set free from all the burdens mentioned in limitations of existing system. 1. Fast and Efficient: As compared to existing manual system, in proposed system the user can get the information fast, easily and efficiently from the computer since information is a single click away from the user. 2. Reliable and Accurate: As in proposed system the information is stored and processed in computers so that data will be more reliable and accurate. 3. Centralized Data: In the existing system most of data records are kept in registers and some data are maintained in Microsoft Excel due to this system the placement of the data is not at one particular place. But in proposed system each and every record is maintained on computer, which leads to the centralization of data and every user which have the access to system can retrieve the data at ease. 4. Low Operation and Maintenance Cost: The proposed system is not very costly as it doesnt includes many costs and overhead expenses like file management, stationary charges etc. 5. Non-Redundant Information: As in proposed system data maintained on the computers so inconsistency doesnt occurs whichever leads to problem like duplication of data. As in our project most of the inventory codes are Auto Generated hence There is no chance of duplication of the master records. 6. User Friendly: Proposed system is very user friendly. We have applied many check and balances (i.e. validation rules) in the proposed system so that a less knowledgeable person can also enter the data error free and at an ease. 7. Easy to Access: As compared to existing system, in proposed system the user can easily and efficiently access the information from the computer only if the user is given the right of the same. In the proposed system we have used the concept of level of access. We have created the users to access the database. So depending upon the type of hierarchy we can assign different rights for the user. 8. No Documentation: As everything is stored on the computer so there is any need of documentation or maintaining the files or registers.

P a g e |6

Chapter 4

SYSTEM ANALYSIS

4.1 Analysis
Analysis is a detailed study of the various operations performed by a system and their relationship within and outside of the system. A key question is: What must be done to solve the problem? One aspect of analysis is defining the boundaries of the system and determining whether or not a candidate system should consider other related systems. During analysis data are collected on the available files, decision points and transactions handled by the present system. Some logical system models and tools are used in analysis are data flow diagrams, interviews, on-sight observations and questionnaires etc. The interview is a commonly used tool in analysis. It requires special skills and sensitivity to the subjects being interviewed. Bias in data collection and interpretation can be a problem. Training, experience and common sense are required for collection of the information needed to do the analysis. Once analysis is completed, the analyst has a firm understanding of what is to be done. The next step is to decide how the problem might be solved. Thus, in system design, we move from the logical to the physical aspect of the life cycle.

4.2 Problem Understanding


One of the most difficult tasks is developing a clear in depth of the problem being investigated, without which it becomes impossible to specify the requirements for a new project with any accuracy. In the manual system the main problem was to understand the large and typical database and short form of information about any Employee Several questions should be proposed for this as: 1. What is the problem? In the manual system large amount of data handle is very difficult. It is difficult to access the required data from saved registers. And also large amount of data is very difficult store. 2. What are its causes? Due to store the data in large registers in manual system nobody can search and easily access the records of the employee at a time. In manual system records war search one by one that were very time consuming. 3. Why is it important that the problem be solved? The main point of view to solve the problems to change the manual system is fulfilling the required of the Management. Because nowadays very large amount of data need to be transferred. 4. What are the possible solutions to the problem? The solution of this problem is developed the computerized version of the manual system, which is less time consuming, and easy to handle.

P a g e |7

Chapter 5

REQUIREMENT ANALYSIS

5.1 Requirements Specification


The proposed project full fill all the requirement of the user although it related to booking of the tickets or with calculations and it also provides all the necessary features which is needed by the user of the software It is a structured, precise document, which defines each and every system service and constraint in detail. It may also be known as The functional specification and is generally used as basis for a contract between the user and the software developer.

Functional Requirements
The proposed project fulfills all the functional requirements of the organization. These are those requirements that define the functionality of the software system. Like of a, Attendance of a employee, making Pay slip. They are descriptions of the project functions.

Non-Functional Requirements
These are those requirements that place a constraint under the system operates for example response time or on the development process such as the choice of the programming language.

5.2 Constrain
The company functions manually. This system has a lot of problems as the work done is very time consuming and sometimes errors also creep in. so there was an urgent need to develop a system, which is simple, error free and suits the working of the institution. The software Payroll Management System is such software, which will serve to these purposes. Constraints are validations, which are used to check that the software is working properly. The software also has some constraints, which make it a successful application.

Page |8

Chapter6

SYSTEM DESIGN

The development of the Transaction Control Software consisted of studying of the existing manual system and developing an efficient computerized system that emphasizes on easy storage and retrieval of data in the database. The new system should ensure of simple and easy data entry procedures through suggestive looking form. There are quite a number of lengthy calculations being done on the acquired data. These calculations should be thoroughly understood. The new system should be able to perform all these calculations automatically and efficiently. There are quite a number of reports that are generated during the normal working of the system. Each of these required reports should be understood very carefully and the new system shall provide easy and efficient methods for generation of these reports. Moreover, the new system should provide a very easy to use interface, so that user should feel at home throughout the working of the system.

Page |9

Chapter 7

PLATFORM USED

7.1Hardware Requirement
Hardware is the term given to the machinery itself and to the various individual pieces of equipment. It refers to the physical devices of a computer system. Thus, the input, storage processing control and the output devices are hardware. Following are the minimum hardware and software specifications that are required for efficient performance of the system. Using a higher configuration than specified below can enhance the system performance further

HARDWARE SPECIFICATIONS
CPU RAM Keyboard Hard disk Intel Pentium IV 1.80 GHz or higher 1 GB (for best performance) 105 Standard keys 10GB or higher free space

7.2 Software Requirement


Software means a collection of program where the objective is to enhance the capabilities of the hardware machine. The following defines the software of the proposed system developments:

Software Specification
Operating System Window 98, XP Visual Basic.NET 2005, 2008 SQL

LANGUAGES USED
SQL: SQL (Structured Query Language) is a query language. It can define the structure of the data, modify data in the database and specify security constraints. SQL is a simple and powerful database access language and the standard language for relational database management system. SQL uses a combination of relational calculus constructs all the operations made to the data in an oracle database are performed using SQL declaration.

P a g e | 10

FRONT-END TOOLS Visual Basic.NET


Visual basic.NET is the latest incarnation of the worlds most popular computer programming language, and it brings a lot of new features to the table. This new things called dot.net is a revolutionary change from Visual Studio 6.0 (which included Visual Basic 6.0). Visual Basic .NET is not Visual Studio 7.0 as you might think. On the contrary, it is a new product developed from scratch, not tied to the previous version (and not entirely compatible either). In a sense, you might think of this as a whole new product line starting at version 1.0but thats only partially true. The people who created Visual Basic .NET took all of the favorite features of Visual Basic 6.0 and the features of a dozen other popular language, and crammed all of this new goodness into a single new development tool. The result is a stellar programming language, and it has no equivalent in the computer world. FEATURES OF Visual Basic.NET: Powerful Windows-based Applications Building Web-based Applications Simplified Deployment Powerful, Flexible, Simplified Data Access Improved Coding Direct Access to the Platform Full Object-Oriented Constructs XML Web Services Mobile Applications COM Interoperability Reuse Existing Investments Upgrade Wizard

Advantage of Visual Basic.NET:


1. First of all, VB.NET provides managed code execution that runs under the Common Language Runtime (CLR), resulting in robust, stable and secure applications. All features of the .NET framework are readily available in VB.NET. 2. VB.NET is totally object oriented. 3. The .NET framework comes with ADO.NET, which follows the disconnected paradigm, i.e. once the required records are fetched the connection no longer exists. It also retrieves the records that are expected to be accessed in the immediate future. This enhances Scalability of the application to a great extent. 4. VB.NET uses XML to transfer data between the various layers in the DNA Architecture i.e. data are passed as simple text strings. 5. Error handling has changed in VB.NET. A new Try-Catch-Finally block has been introduced to handle errors and exceptions as a unit, allowing appropriate action to be taken at the place the error occurred thus discouraging the use of ON ERROR GOTO statement. This again credits to the maintainability of the code. 6. Security has become more robust in VB.NET. In addition to the role based security in VB6, VB.NET comes with a new security model, Code Access security. This security controls on what the code can access. For example you can set the security to a component such that the component cannot access the database. This type of security is important because it allows building components that can be trusted to various degrees.

P a g e | 11

DFD (Data Fl

Diagram)

P a g e | 12

C apter 9

DIAGRAM

P a g e | 13

C apter 10

TAB

USED

10.1Tabl Name: E

_ NFO

Primary Key: - EMP _ID

Purpose: - Thi table contains the personal information of the employee

10.2Table Name: DAIL _ U TE

Purpose: - This table contains the employee daily attendance


P a g e | 14

10.3 Table Name: SAL DETAIL

Purpose: - This table contains the employee salary detail

10.4 Table Name: PAYROLL

Purpose: - This table contains the employee PAYROLL calculated record


P a g e | 15

Chapter 11

FORM LAYOUTS

11.1 FORM NAME: - LOG IN

Purpose: - This form is used to check the authori ation of user. If the user is an authori ed person he/she is gi en access to the system otherwise not.

P a g e | 16

11.2 FORM NAME: - WELCOME

Purpose: - Welcome screen

P a g e | 17

11.3 FORM NAME: - EMPLOYEE INFORMATION

Purpose: - This form is contain the personal information of the employee

P a g e | 18

11.4 FORM NAME: - ADD SALARY DETAIL

Purpose: - This form is contain the salary information of the employee

P a g e | 19

11.5 FORM NAME: - EMPLOYEE SALARY DETAIL

Purpose: - This form is show the detail salary information of the employee

11.6 FORM NAME: - EMPLOYEE INFO DETAIL

Purpose: - This form is show the detail basic Information of Employee

P a g e | 20

11.7 FORM NAME: - SEARCH FOR EMPLOYEE ID

Purpose: - This form is show the employee id on the given criteria.

11.8 FORM NAME: - SEARCH FOR ABSENT ID

Purpose: - With the help of this form you can find out the absent employee id for the date given by user.
P a g e | 21

11.9 FORM NAME: - SEARCH FOR SALARY DETAIL

Purpose: - With the help of this form you can find out the particular employee salary or basic information at on one click.

P a g e | 22

11.10 FORM NAME: - PAYROLL

Purpose: - With the help of this form you can perform calculation of payroll of employee with all detail like days present, hours work, absent days, leaves of one month

P a g e | 23

REPORTS 11.11REPORT NAME: - PAYROLL REPORT

Purpose: - With the help of this report you can get all distributed payroll for all employee at one page. 11.12 REPORT NAME: - ATTENDANCE REPORT OF EMPLOYEE

Purpose: - With the help of this report you can get particular employees attendance for particular month.
P a g e | 24

11.13 REPORT NAME: - DESIGNATION WISE BASIC INFO

Purpose: - With the help of this report you can get basic information of employee in the group of designation.

P a g e | 25

Chapter 12

CODEING

12.1COADING FOR LOG IN FORM


12.1.1 Code for User Name And Passward Correctness
If UsernameTextBox.Text = "" Then MessageBox.Show("You cannot leave USER NAME bank", "PAYROLL MANAGEMENT SYSTEM", MessageBoxButtons.OK, MessageBoxIcon.Hand) End If If PasswordTextBox.Text = "" Then MessageBox.Show("You cannot leave PASSWARD bank", "PAYROLL MANAGEMENT SYSTEM", MessageBoxButtons.OK, MessageBoxIcon.Hand) End If If (UsernameTextBox.Text = "bca" Or UsernameTextBox.Text = "BCA") And (PasswordTextBox.Text = "project" Or PasswordTextBox.Text = "PROJECT") Then MDIParent1.Show() Me.Hide() ElseIf MessageBox.Show("Wrong UserID or Password", "PAYROLL MANAGEMENT SYSTEM", MessageBoxButtons.OK, MessageBoxIcon.Warning) Then UsernameTextBox.Text = "" PasswordTextBox.Text = ""

P a g e | 26

12.2 COADING FOR FORM EMPLOYEE INFORMATION


12.2.1 Coding for Connection String Declaration
Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True")

12.2.2 Code for ID


Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim randomvalue As New Random 'create random object Dim randomhold As Integer 'generate random number For i As Integer = 0 To 9999 randomhold = randomvalue.Next(1, 9999) TextBox1.Text = randomhold Next Button1.Enabled = True End Sub

12.2.3Code for Add New Data


If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox7.Text = "" Or MaskedTextBox1.Text = "" Then MessageBox.Show("Text box can not be null", "PAYROLL MANAGEMENT SYSTEM", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) Else Dim cmd As New SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "insert into EMP_INFO values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & DateTimePicker1.Text & "','" & DateTimePicker2.Text & "','" & ComboBox1.Text & "','" & TextBox7.Text & "','" & MaskedTextBox1.Text & "')" cmd.ExecuteNonQuery()

P a g e | 27

If MessageBox.Show("RAGISTRATION OF BASIC INFORMATION IS COMPLETE", "RAGISTRATION COMPLTE(PAYROLL SYSTEM)", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) Then con.Close() ADD_SAL_DETAIL.Show() TextBox2.Text = "" TextBox3.Text = "" DateTimePicker1.Text = "" DateTimePicker2.Text = "" TextBox7.Text = "" MaskedTextBox1.Text = "" Else MessageBox.Show("THIS EMPLOYEE IS ALLREADY IN DATABASE .", "PAYROLL SYSTEM", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) TextBox2.Text = "" TextBox3.Text = "" DateTimePicker1.Text = "" DateTimePicker2.Text = "" TextBox7.Text = "" MaskedTextBox1.Text = "" End If End If End Sub

12.2.4 Code for Validate (only Number allow)


If (Char.IsPunctuation(e.KeyChar) = True Or Char.IsLetter(e.KeyChar) = True) And Asc(e.KeyChar) <> 8 Then e.Handled = True MsgBox("Enter Numbers Only", , "WRONG INPUT!") End If

12.2.5Code for Convert Small Case to Capital


Dim s As String s = TextBox2.Text s = s.ToUpper TextBox2.Text = s

12.2.6 Code for Close


Me.Close()

P a g e | 28

12.3COADING FOR FORM ADD SALARY DETAIL


12.3.1 Coding for Connection String Declaration
Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True")

12.3.2 For Getting Employee Id in Combo Box


Dim strSQL As String = "SELECT * FROM EMP_INFO" Dim da As New System.Data.SqlClient.SqlDataAdapter(strSQL, conn) Dim ds As New DataSet da.Fill(ds, "EMP_INFO") With Me.ComboBox1 .DataSource = ds.Tables("EMP_INFO") .DisplayMember = "EMP_ID" .ValueMember = "EMP_ID" If .SelectedIndex = 0 Then Else MessageBox.Show("ADD EMPLOYEE FIRST!", "NOT FOUND", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) Me.Close() End If End With

12.3.3 For Getting Employee Information by Button Click


Try Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "SELECT * FROM EMP_INFO WHERE EMP_ID=(" + ComboBox1.Text + ");" cmd.ExecuteNonQuery() Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(cmd.CommandText, con) Dim ds As DataSet = New DataSet da.Fill(ds, "EMP_INFO") Dim dt As DataTable = ds.Tables("EMP_INFO") Dim row As DataRow For Each row In dt.Rows TextBox1.Text = row("FIRST NAME") TextBox2.Text = row("LAST NAME") TextBox3.Text = row("DESGNATION") Next row

P a g e | 29

If ds.Tables("EMP_INFO").Rows.Count = 0 Then MessageBox.Show("Sorry No Record Found Please Try Again!", " PAYROLL SYSTEM ", MessageBoxButtons.OK, MessageBoxIcon.Information) End If ' Close connection con.Close() Catch ex As SqlClient.SqlException MessageBox.Show("Employee Not found" + ex.Message) End Try

12.3.4 For Adding New Data


If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or TextBox6.Text = "" Or TextBox7.Text = "" Or TextBox8.Text = "" Then MessageBox.Show("Text box can not be null", "PAYROLL MANAGEMENT SYSTEM", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) Else Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "insert into SAL_DETAIL values ('" & ComboBox1.Text & "','" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" & TextBox8.Text & "','" & TextBox9.Text & "','" & TextBox10.Text & "')" cmd.ExecuteNonQuery() MessageBox.Show("ADDITION OF SALARY DETAIL IS COMPLETE", "SALARY DETAIL COMPLETE(PAYROLL SYSTEM)", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) con.Close() TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" TextBox9.Text = "" TextBox10.Text = ""

12.3.5Code for Calling Search Box


SEARCHBOX.Show()

P a g e | 30

12.3.6 Code For Clear


Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" TextBox9.Text = "" TextBox10.Text = "" End Sub

P a g e | 31

12.4 CODE FOR FORM DAILY MUSTER


12.4.1 Coding for Connection String Declaration
Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True")

12.4.2 Code for System Date


Dim dt As New DateTime dt = Today ComboBox3.Text = (dt.Day) ComboBox4.Text = (dt.Month) ComboBox4.Text = GetMonthName(Val(ComboBox4.Text)) ComboBox5.Text = (dt.Year) Dim s As String s = ComboBox4.Text s = s.ToUpper ComboBox4.Text = s Private Function GetMonthName(ByVal monthNum As Integer) As String Dim strDate As New DateTime(1, monthNum, 1) Return strDate.ToString("MMMMMM") End Function

12.4.3 Code for Calculation For Total hours Work


Me.TextBox6.Text = TimeDiff(DateTimePicker2.Value, DateTimePicker1.Value) DateTimePicker2.Format = DateTimePickerFormat.Time DateTimePicker1.Format = DateTimePickerFormat.Time Private Function TimeDiff(ByVal Time2 As String, ByVal Time1 As String) As String Dim MinsDiff As String Dim TheHours As String MinsDiff = DateDiff("n", Time2, Time1) TheHours = Format(Int(IIf(MinsDiff < 0, MinsDiff + 1440, MinsDiff) / 60), "00") MinsDiff = Format(MinsDiff Mod 60, "00") TimeDiff = TheHours TextBox3.Text = MinsDiff End Function

P a g e | 32

12.4.4 Code for Adds New Data and Ensures Data Not Repeated
Me.EMP_INFOTableAdapter.Fill(Me.PayrolldatabseDataSetDAILY_MUSTER.EMP_INFO) Dim mycon As SqlClient.SqlConnection Dim mycmd As SqlClient.SqlCommand Dim myquery As String mycon = New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True") myquery = ("SELECT * FROM DIALY_MUSTER WHERE EMP_ID=(" + ComboBox1.Text + ")AND FIRST_NAME like '%" + TextBox1.Text + "%'AND LAST_NAME like '%" + TextBox2.Text + "%' AND PRESENT like '%" + ComboBox2.Text + "%'AND DATE=(" + ComboBox3.Text + ")AND MONTH like '%" + ComboBox4.Text + "%' AND YEAR=(" + ComboBox5.Text + ")") mycon.Open() mycmd = New SqlClient.SqlCommand(myquery, mycon) Dim dr As SqlClient.SqlDataReader mycmd.ExecuteNonQuery() dr = mycmd.ExecuteReader Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() If Not dr.HasRows Then cmd.CommandText = "insert into DIALY_MUSTER values ('" & ComboBox1.Text & "','" & TextBox1.Text & "','" & TextBox2.Text & "','" & ComboBox2.Text & "','" & DateTimePicker2.Text & "','" & DateTimePicker1.Text & " ','" & ComboBox3.Text & "','" & ComboBox4.Text & "','" & ComboBox5.Text & "','" & TextBox6.Text & "')" cmd.ExecuteNonQuery() MessageBox.Show("Record is successfully stored in DAILY MUSTER", "PAYROLL MANAGEMENT SYSTEM", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) TextBox1.Text = "" TextBox2.Text = "" DateTimePicker1.Text = "" DateTimePicker2.Text = "" ComboBox2.Text = "" TextBox6.Text = "" Else If MessageBox.Show("THE ENTRY FOR THIS EMPLOYEE HAVE DONE!" & ControlChars.CrLf & "DO YOU WANT TO DO ANOTHER EMPLOYEE ENTRY?", "ALREADY PRESENT", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) = Windows.Forms.DialogResult.No Then Me.Close() End If

P a g e | 33

12.5 CODE FOR FORM EMPLOYEE INFO DETAIL VIEW AND SAL DETAIL VIEW
12.5.1 Coding for Connection String Declaration
Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True")

12.5.2Code for to Load Data in Grid View


Dim sql As String = "SELECT * FROM EMP_INFO" Dim connection As New SqlClient.SqlConnection(connectionString) connection.Open() sCommand = New SqlClient.SqlCommand(sql, connection) sAdapter = New SqlClient.SqlDataAdapter(sCommand) sBuilder = New SqlClient.SqlCommandBuilder(sAdapter) sDs = New DataSet() sAdapter.Fill(sDs, "EMP_INFO") sTable = sDs.Tables("EMP_INFO") connection.Close() DataGridView1.DataSource = sDs.Tables("EMP_INFO") DataGridView1.ReadOnly = True Button1.Enabled = False Button7.Enabled = True Button2.Enabled = True DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect DataGridView1.Rows(0).Selected = True End Sub

12.5.3 Code for to Add New or Update Record


DataGridView1.[ReadOnly] = False Button1.Enabled = True Button7.Enabled = False Button2.Enabled = False End Sub

P a g e | 34

12.5.4 Code for Saves to New Added or Updated Record


sAdapter.Update(sTable) DataGridView1.[ReadOnly] = True Button1.Enabled = False Button7.Enabled = True Button2.Enabled = True

12.5.5 Code for Delete The Record


MessageBox.Show("PLEASE NOTE DOWN EMPLOYEE ID FOR FURTHER REFRENCE", "DO NOT FERGET", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) If MessageBox.Show("Do you want to delete this row ?", "Delete", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then DataGridView1.Rows.RemoveAt(DataGridView1.SelectedRows(0).Index) sAdapter.Update(sTable) MessageBox.Show("YOU ARE DELETED EMPLOYEE INFOMATION HERE ." & ControlChars.CrLf & "PLEASE DELETE SALRY DETAIL OF THAT EMPLOYEE", "PLEASE DELETE", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) EMPSALDETAIL_VIEW.Show()

P a g e | 35

12.6 CODE FOR SEARCH BOX 12.6.1 Coding for Connection String Declaration
Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True")

12.6.2 Code for Search Employee ID


Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "select EMP_ID from EMP_INFO where [FIRST NAME] like '%" + TextBox1.Text + "%'AND [LAST NAME] like '%" + TextBox2.Text + "%' AND [DESGNATION] like '%" + ComboBox1.Text + "%' AND [CONTACT NUMBER] like '%" + TextBox3.Text + "%';" cmd.ExecuteNonQuery() Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(cmd.CommandText, con) Dim ds As DataSet = New DataSet da.Fill(ds, "EMP_INFO") Dim dt As DataTable = ds.Tables("EMP_INFO") Dim row As DataRow For Each row In dt.Rows TextBox4.Text = row("EMP_ID") Next Next row If ds.Tables("EMP_INFO").Rows.Count = 0 Then MessageBox.Show("Sorry No Record Found Please Try Again!", " PAYROLL SYSTEM", MessageBoxButtons.OK, MessageBoxIcon.Information) End If con.Close() Catch ex As Exception End Try

12.6.3 Code for Getting a List Of All Employee ID


Dim mycon As SqlClient.SqlConnection Dim mycmd As SqlClient.SqlCommand Dim myquery As String mycon = New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True") myquery = ("SELECT EMP_ID FROM EMP_INFO") mycon.Open()
P a g e | 36

mycmd = New SqlClient.SqlCommand(myquery, mycon) Dim dr As SqlClient.SqlDataReader mycmd.ExecuteNonQuery() dr = mycmd.ExecuteReader While dr.Read ListBox1.Items.Add(dr.GetInt32(0)) End While mycon.Close() dr.Close()

12.6.4 Code for Getting a List of All Present ID


Dim mycon As SqlClient.SqlConnection Dim mycmd As SqlClient.SqlCommand Dim myquery As String mycon = New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True") myquery = ("SELECT EMP_ID FROM DIALY_MUSTER WHERE DATE=(" + ComboBox2.Text + ")AND MONTH like '%" + ComboBox3.Text + "%' AND YEAR=(" + ComboBox4.Text + ")") mycon.Open() mycmd = New SqlClient.SqlCommand(myquery, mycon) Dim dr As SqlClient.SqlDataReader mycmd.ExecuteNonQuery()

dr = mycmd.ExecuteReader While dr.Read ListBox2.Items.Add(dr.GetInt32(0)) End While If Not dr.HasRows Then MessageBox.Show("ATTENDANCE NOT MAINTAIN FOR THIS DATE", "ATTENDANCE(PAYROLL SYSTEM)", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) Button6.Enabled = False Button5.Enabled = False Button8.Enabled = True mycon.Close() dr.Close() Else : Button5.Enabled = False Button6.Enabled = True End If

P a g e | 37

12.6.5 Code for Getting a List of All Absent ID


Dim a As Int32 For Each a In (ListBox1.Items) If ListBox2.Items.Contains(a) Then Else : ListBox3.Items.Add(a) End If Next Dim itemCount As Integer = ListBox3.Items.Count If itemCount = 0 Then MessageBox.Show("NO ONE EMPLOYEE IS ABSENT TODAY!", "PAYROLL SYSTEM(ABSENTY)", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)

P a g e | 38

12.7 CODE FOR THE FORM SALARY DETAIL 12.7.1 Coding for Connection String Declaration
Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True")

12.7.2 Code for Show Basic Info and all Salary Detail of Particular E mployee
Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "SELECT * FROM EMP_INFO WHERE EMP_ID=(" + ComboBox1.Text + ");" cmd.ExecuteNonQuery() Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(cmd.CommandText, con) Dim ds As DataSet = New DataSet da.Fill(ds, "EMP_INFO") Dim dt As DataTable = ds.Tables("EMP_INFO") Dim row As DataRow For Each row In dt.Rows TextBox4.Text = row("DATE OF BIRTH") TextBox5.Text = row("JOINING DATE") TextBox6.Text = row("ADDRESS") TextBox7.Text = row("CONTACT NUMBER") Next row If ds.Tables("EMP_INFO").Rows.Count = 0 Then End If con.Close() Catch ex As Exception End Try Try Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "SELECT * FROM SAL_DETAIL WHERE EMP_ID=(" + ComboBox1.Text + ");" cmd.ExecuteNonQuery() Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(cmd.CommandText, con) Dim ds As DataSet = New DataSet da.Fill(ds, "SAL_DETAIL")

P a g e | 39

Dim dt As DataTable = ds.Tables("SAL_DETAIL") Dim row As DataRow For Each row In dt.Rows TextBox1.Text = row("FIRST NAME") TextBox2.Text = row("LAST NAME") TextBox3.Text = row("DESIGNATION") TextBox8.Text = row("BASIC SAL") TextBox9.Text = row("TRAVEL ALLOWANCE") TextBox10.Text = row("HRA") TextBox11.Text = row("SPECIAL ALLOWANCE") TextBox12.Text = row("ESI") TextBox13.Text = row("PF") TextBox14.Text = row("PROFESSIONAL TAX") Next row If ds.Tables("SAL_DETAIL").Rows.Count = 0 Then MessageBox.Show("Sorry No Record Found Please Try Again!", " PAYROLL SYSTEM(NOT FOUND) ", MessageBoxButtons.OK, MessageBoxIcon.Information) End If con.Close() Catch ex As Exception End Try End Sub

P a g e | 40

12.8CODE FOR THE FORM PAYROLL


12.8.1 Coding for Connection String Declaration
Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True")

13.8.2 Coding for Show Particular Employee Information


Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "SELECT * FROM SAL_DETAIL WHERE EMP_ID =(" + ComboBox1.Text + ");" cmd.ExecuteNonQuery() Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(cmd.CommandText, con) Dim ds As DataSet = New DataSet da.Fill(ds, "SAL_DETAIL") Dim dt As DataTable = ds.Tables("SAL_DETAIL") Dim row As DataRow For Each row In dt.Rows TextBox1.Text = row("FIRST NAME") TextBox2.Text = row("LAST NAME") TextBox3.Text = row("DESIGNATION") TextBox7.Text = row("BASIC SAL") TextBox8.Text = row("TRAVEL ALLOWANCE") TextBox9.Text = row("HRA") TextBox10.Text = row("SPECIAL ALLOWANCE") TextBox11.Text = row("ESI") TextBox12.Text = row("PF") TextBox13.Text = row("PROFESSIONAL TAX") Next row If ds.Tables("SAL_DETAIL").Rows.Count = 0 Then MessageBox.Show("Sorry No Record Found Please Try Again!", " PAYROLL SYSTEM ", MessageBoxButtons.OK, MessageBoxIcon.Information) End If con.Close() Catch ex As SqlClient.SqlException MessageBox.Show("select month and year" + ex.Message) End Try

P a g e | 41

12.8.3 Coding for Count Absent Days of Employee


Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "SELECT COUNT(PRESENT) FROM DIALY_MUSTER WHERE EMP_ID=(" + ComboBox1.Text + ")AND YEAR=(" + ComboBox3.Text + ")AND MONTH like '%" + ComboBox2.Text + "%'AND PRESENT like '%" + Label9.Text + "%'" Dim s1 As IDataReader s1 = cmd.ExecuteReader() Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(cmd.CommandText, con) Dim ds As DataSet = New DataSet 'da.Fill(ds, "DAILY_MUSTER") Dim dt As DataTable = ds.Tables("DIALY_MUSTER") ' Dim row As DataRow While s1.Read TextBox14.Text = s1.Item(0).ToString End While ' Close connection con.Close()

12.8.4 Coding for Count Present Days of Employee


Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "SELECT COUNT(PRESENT) FROM DIALY_MUSTER WHERE EMP_ID=(" + ComboBox1.Text + ")AND YEAR=(" + ComboBox3.Text + ")AND MONTH like '%" + ComboBox2.Text + "%'AND PRESENT like '%" + Label31.Text + "%'" Dim s1 As IDataReader s1 = cmd.ExecuteReader() Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(cmd.CommandText, con) Dim ds As DataSet = New DataSet Dim dt As DataTable = ds.Tables("DIALY_MUSTER") While s1.Read TextBox6.Text = s1.Item(0).ToString End While ' Close connection con.Close()

P a g e | 42

12.8.5 Coding for Counting Leaves Taken by Employee


Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "SELECT COUNT(PRESENT) FROM DIALY_MUSTER WHERE EMP_ID=(" + ComboBox1.Text + ")AND YEAR=(" + ComboBox3.Text + ")AND MONTH like '%" + ComboBox2.Text + "%'AND PRESENT like '%" + Label33.Text + "%'" Dim s1 As IDataReader s1 = cmd.ExecuteReader() Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(cmd.CommandText, con) Dim ds As DataSet = New DataSet Dim dt As DataTable = ds.Tables("DIALY_MUSTER") While s1.Read TextBox5.Text = s1.Item(0).ToString End While ' Close connection con.Close()

12.8.5 Coding for Sum All Days Hours Work


Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() cmd.CommandText = "SELECT SUM([HOURS WORK IN DAY]) FROM DIALY_MUSTER WHERE EMP_ID=(" + ComboBox1.Text + ")AND YEAR=(" + ComboBox3.Text + ")AND MONTH like '%" + ComboBox2.Text + "%'" Dim s1 As IDataReader s1 = cmd.ExecuteReader() Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(cmd.CommandText, con) Dim ds As DataSet = New DataSet Dim dt As DataTable = ds.Tables("DIALY_MUSTER") While s1.Read TextBox4.Text = s1.Item(0).ToString End While con.Close()

P a g e | 43

12.8.6 Coding for Calculate Net Salary


TextBox15.Text = Val(TextBox14.Text) * 70 Amount.Text = Val(TextBox7.Text) + Val(TextBox8.Text) + Val(TextBox9.Text) + Val(TextBox10.Text) - Val(TextBox11.Text) - Val(TextBox12.Text) - Val(TextBox13.Text) Val(TextBox15.Text) If TextBox6.Text = "0" Then Amount.Text = "0" End If txtRsToWords.Text = RupeesToWord(Val(Amount.Text))

12.8.7 Coding for Save Data


Dim mycon As SqlClient.SqlConnection Dim mycmd As SqlClient.SqlCommand Dim myquery As String mycon = New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True") myquery = ("SELECT * FROM PAYROLL WHERE EMP_ID=(" + ComboBox1.Text + ")AND [FIRST NAME]like'%" + TextBox1.Text + "%'AND [LAST NAME]like '%" + TextBox2.Text + "%' AND MONTH like'%" + ComboBox2.Text + "%'AND YEAR=(" + ComboBox3.Text + ")") mycon.Open() mycmd = New SqlClient.SqlCommand(myquery, mycon) Dim dr As SqlClient.SqlDataReader mycmd.ExecuteNonQuery() dr = mycmd.ExecuteReader Dim cmd As New SqlClient.SqlCommand() cmd.Connection = con con.Open() If Not dr.HasRows Then cmd.CommandText = "insert into PAYROLL VALUES ('" & ComboBox2.Text & "','" & ComboBox3.Text & "','" & ComboBox1.Text & "' ,'" & TextBox1.Text & "' ,'" & TextBox2.Text & "','" & TextBox3.Text & "' ,'" & TextBox4.Text & "','" & TextBox6.Text & "','" & TextBox14.Text & "' ,'" & TextBox5.Text & "','" & TextBox7.Text & "' ,'" & TextBox8.Text & "','" & TextBox9.Text & "','" & TextBox10.Text & "','" & TextBox11.Text & "','" & TextBox12.Text & "','" & TextBox13.Text & "','" & TextBox15.Text & "','" & Amount.Text & "','" & txtRsToWords.Text & "','" & ComboBox4.Text & "') cmd.ExecuteNonQuery() MessageBox.Show("Record is successfully stored in PAYROLL", "PAYROLL MANAGEMENT SYSTEM", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)

P a g e | 44

Else If MessageBox.Show("THE PAYROLL FOR THIS EMPLOYEE ALREADY CALCULATED FOR THIS MONTH!" & ControlChars.CrLf & "DO YOU WANT TO CALCULATE PAYROLL FOR ANOTHER EMPLOYEE?", "ALREADY PRESENT", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) = Windows.Forms.DialogResult.No Then con.Close() Me.Close()

12.8.8 Coding for Print Preview and Print


PrintForm2.Print() PrintForm1.Print()

P a g e | 45

12.9 CODE FOR THE ALL REPORT


12.9.1 Code for Employee Information Report
Dim myConnection As New SqlClient.SqlConnection() myConnection.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True" Dim MyCommand As New SqlClient.SqlCommand() MyCommand.Connection = myConnection MyCommand.CommandText = "Select * from EMP_INFO" MyCommand.CommandType = CommandType.Text Dim MyDA As New SqlClient.SqlDataAdapter() MyDA.SelectCommand = MyCommand MyCommand.CommandType = CommandType.Text Dim myDS As New DataSet() MyDA.Fill(myDS, "EMP_INFO") Dim oRpt As New CrystalReport3() oRpt.SetDataSource(myDS) CrystalReportViewer1.ReportSource = oRpt

12.9.2 Code for Employee Month Attendance Report


Dim myConnection As New SqlClient.SqlConnection() myConnection.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True" Dim MyCommand As New SqlClient.SqlCommand() MyCommand.Connection = myConnection MyCommand.CommandText = "Select * from DIALY_MUSTER WHERE EMP_ID=(" + ComboBox1.Text + ")AND YEAR=(" + ComboBox3.Text + ")AND MONTH like '%" + ComboBox2.Text + "%'" MyCommand.CommandType = CommandType.Text Dim MyDA As New SqlClient.SqlDataAdapter() MyDA.SelectCommand = MyCommand MyCommand.CommandType = CommandType.Text Dim myDS As New DataSet() MyDA.Fill(myDS, "DIALY_MUSTER") Dim oRpt As New CrystalReport2() oRpt.SetDataSource(myDS) CrystalReportViewer1.ReportSource = oRpt

P a g e | 46

12.9.3 Code for Employee Designation Wise Information Report


Dim myConnection As New SqlClient.SqlConnection() myConnection.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\USER\My Documents\Visual Studio 2005\Projects\PAY\PAY\payrolldatabse.mdf;Integrated Security=True;User Instance=True" Dim MyCommand As New SqlClient.SqlCommand() MyCommand.Connection = myConnection MyCommand.CommandText = "Select * from EMP_INFO" MyCommand.CommandType = CommandType.Text Dim MyDA As New SqlClient.SqlDataAdapter() MyDA.SelectCommand = MyCommand MyCommand.CommandType = CommandType.Text Dim myDS As New DataSet() 'This is our DataSet created at Design Time MyDA.Fill(myDS, "EMP_INFO") Dim oRpt As New CrystalReport3() oRpt.SetDataSource(myDS) CrystalReportViewer1.ReportSource = oRpt

P a g e | 47

Chapter 13

FUTURE DIRECTION

We have been working on the project for the past three months and concluded that the proposed system will be able to satisfy all the needs of a Payroll Management System. It is designed in a way that it can handle all the tasks of a Company easily and efficiently. The system can handle the reporting tasks very easily.

Future Enhancement:
 Use new more short coding method in .NET 2010 language for this software.  Modification in Database. Data base modification can be easily handled by introducing new techniques.  More User friendly. To make it easy to understand and handle. It can be make more user friendly by removing its complications.  More Robust. Add new features in the software to make it more robust.

P a g e | 48

Chapter 14

CONCLUSION

Our software has also made the report generation process very easy, as we do not have to go through different files to enter the data in the report Performas. Our software automatically does these processes just by the single click of mouse. Our software is designed using SQL as backend tool, which is higher version of oracle than the other lower versions of oracle such as oracle 8i. So if we will try to operate our software on the lower version of oracle, it would generate errors. Although we have put my full efforts to develop this project but still some things may have been left which can be upgraded later on.

P a g e | 49