Download as pdf or txt
Download as pdf or txt
You are on page 1of 101

A

PROJECT REPORT
ON
Human Resource Management System

Submitted to
SHIVAJI UNIVERSITY, KOLHAPUR.
Submitted as partial fulfilment of the requirement of

BACHELOR OF COMPUTER APPLICATIONS


BCA-III CBCS (Sem-VI)

Submitted By

Mr. Kadam Abhishek Madhukar


Mr. Janugade Omkar Avinash
Mr. Khade Harshad Dattatray

UNDER THE GUIDANCE OF


Prof. Mr. SUTAR A.T.
(M.C.A.)

Through

THE PRINCIPAL

BALASAHEB DESAI COLLEGE, PATAN


Year
(2022-2023)
Koyana Education Society’s

Balasaheb Desai College, Patan

CERTIFICATE
This is to certify that the project report entitled Human Resource
Management System Submitted by Mr. Kadam Abhishek Madhukar, Mr.Janugade
Omkar Avinash, Mr.Khade Harshad Dattatray in partial fulfilment of the requirement
for the award of Bachelor of Computer Applications- III (Sem-VI) to Shivaji
University, Kolhapur has been carried out by them under the guidance of Mr. Sutar
A. T.

To the best my knowledge and belief, this is their original work and the matter
presented in this project has not submitted earlier.

Place: Patan Principal


Date: Dr. S. D. Pawar
Koyana Education Society’s

Balasaheb Desai College, Patan

CERTIFICATE

This is to certify that the project report entitled Human Resource Management
System submitted by Mr. Kadam Abhishek Madhukar, Mr.Janugade Omkar
Avinash, Mr.Khade Harshad Dattatray In partial fulfilment of the requirement for the
award of Bachelor of Computer Application-III (Sem-VI) to Shivaji University,
Kolhapur has been carried out by them under the guidance of Mr. Sutar A .T.
To the best my knowledge and belief, this is their original work and the matter
presented in this project has not submitted earlier.

Place: Patan Examiner Prof. Sutar. A. T.


Date: (Head of Computer Dept)
Koyana Education Society’s

Balasaheb Desai College, Patan

CERTIFICATE
This is to certify that the project report entitled Human Resource
Management System Submitted by Mr. Kadam Abhishek Madhukar, Mr.Janugade
Omkar Avinash, Mr.Khade Harshad Dattatray In partial fulfilment of the requirement
for the award of Bachelor of Computer Application-III (Sem-VI) to Shivaji University,
Kolhapur has been carried out by them under my guidance satisfactory.
To the best my knowledge and belief, this is their original work and the matter
presented in this Project has not submitted earlier.

Place: Patan Project Guide: Prof. Sutar A. T. Date:


DECLARATION
To,
The Principal,
Balasaheb Desai College, Patan.

Respected Sir,
We undersigned hereby declare that the project report
Human Resource Management System developed and submitted under the
guidance of Mr. Sutar A.T. This is our original work. The empirical finding in this project
is based on the data collection by us. While preparing this project. We have not copied
from any other project report.
We understand that, any such coping is liable to be punished in a way the center
university authorities may be deemed it.

Place: Patan
Date:

Thanking You,

Sign

Mr. Kadam Abhishek Madhukar

Mr.Janugade Omkar Avinash

Mr.Khade Harshad Dattatray


ACKNOWLEDGEMENT
It is great immense satisfaction to express our deepest sense of gratitude and
thanks to everyone who has directly or indirectly helped us to complete project
successfully.
We express our deepest sense of gratitude to Mr. Sutar A. T. who is rendered
valuable guidance and perceptual encouragement in completing project works
successfully in the schedule time and for providing us all facilities to carry the project
work. We are also thankful teaching and non-teaching staff of computer Department.
We sincerely thanks to computer department faculty members for their time to time
help during project work. Without the help of our colleagues and classmates this project
would not have been completed
Last but not least, we indebted to our parents for their encouragement and help
in building of our carrier.

SUBMITTED BY,

Mr. Kadam Abhishek Madhukar

Mr. Janugade Omkar Avinash

Mr. Khade Harshad Dattatray


INDEX
SR. PAGE
CONTENTS
NO. NO
1 INTRODUCTION TO PROJECT
• Introduction
1-5
• Existing system
• Needs & scope of computer system
2 SOFTWARE REQUIREMENT SPECIFICATION
• Requirement gathering
6-8
• Proposed System
• Questionnaires
3 REQUIREMENT
• Hardware 9-10
• Software
4 SYSTEM ANALYSIS
• DFD 11-14
• ERD
5 SYSTEM DESIGN
15-18
Database Design
6 USER INTERFACE DESIGN
• Forms 19-26
• Reports
7 LIMITATIONS 27
8 FUTURE MODIFICATION 28
9 CONCLUSION 29
10 BIBLIOGRAPHY 30
11 SOURCE CODE 31-93
12 STUDENT GUIDE MEET RECORD
94
Human Resource Management System

Introduction

Balasaheb Desai College, Patan Page 1


Human Resource Management System

INTRODUCTION TO PROJECT

Introduction:-

Some Small Businesses and Companies currently using a manual system


for the management and maintenance of critical information.the Human
Resource Management System (HRMS) .NET based Windows application
aimed at streamlining HR processes. This system caters to organizations that
currently rely on manual methods for managing HR-related information.

The HRMS offers an efficient alternative by automating various HR tasks


and replacing the traditional paper-based approach. With features such as
employee data management, performance evaluations, and payroll
processing, the HRMS provides a comprehensive solution to enhance
productivity and efficiency within an organization's HR department. The
system ensures accurate and secure storage of HR-related data,
eliminating the risk of losing important information.

Additionally, it enables fast retrieval of records, saving time and


improving workflow efficiency. By centralizing HR processes in a single
computerized system, the HRMS reduces the need for manual labour,
resulting in cost savings for the organization. Confidential data is protected
through password authorization, ensuring that sensitive HR information
remains accessible only to authorized personnel. In this documentation, we
will delve into the functionalities, configuration, and usage of the Human
Resource Management System, enabling organizations to optimize their HR
processes and achieve effective workforce management.

One computer can perform the work of many people in less time. So,
because of computerization economical problem is also minimized. Some
data is confidential and it should not be accessible to all the people of the
organization, authorization of data is given by the password protection

Balasaheb Desai College, Patan Page 2


Human Resource Management System

INTRODUCTION OF EXISTING SYSTEM

MANUAL SYSTEM:-

The current human resource management system relies heavily on paper-


based forms and scattered data storage across different departments. This
fragmented infrastructure often leads to inconsistencies in data across
various HR processes. Multiple copies of the same information may exist,
making it challenging to maintain accurate and up-to-date records. The
manual nature of the system also introduces the risk of errors and delays in
HR operations. To overcome these challenges, the Human Resource
Management System (HRMS) offers a comprehensive and centralized
solution. By replacing paper forms with an automated platform, the HRMS
ensures that all HR data is stored in a unified database. This eliminates
data redundancies and discrepancies, providing a single source of truth for
employee information, performance evaluations, attendance records, and
other HR-related data. With the HRMS, HR processes become streamlined,
efficient, and less prone to errors. The system enables quick and easy
access to accurate information, facilitating better decision-making and
enhancing overall HR management within the organization.

NEED OF COMPUTERIZED SYSTEM:-

Computerized systems play a vital role in managing data in human resource


management. Human resource departments in organizations handle a vast
amount of data, including employee information, payroll details, attendance
records, performance evaluations, and training records. By utilizing
computerized systems, this data can be efficiently stored, managed, and
retrieved without the need for manual efforts.

Balasaheb Desai College, Patan Page 3


Human Resource Management System

Computers serve a crucial function in various fields, including human


resource management. As electronic devices, computers have the
capability to store extensive records in their memory. They accept input
from users and provide output on screens or printers. The storage capacity
of computers is exceptionally high, allowing for the storage of large volumes
of data. Computerized systems offer superior interfaces with different
system components and subsystems, enabling seamless data sharing.
Therefore, computerization is necessary in human resource management.

One of the key advantages of computer-based systems is the accuracy and


reliability of the information stored within them. Computers minimize the
risks associated with manual work, where human errors and redundancies
can occur. By employing computerized systems, redundancy in storing data
can be eliminated, ensuring data integrity and minimizing the likelihood of
errors.

Another benefit of computerization is the ability to handle data by various


users. This facilitates friendly interactions and efficient collaboration
between users, enabling them to perform a significant amount of work within
a shorter time frame. Computerized systems store different types of
information separately and generate reports in a simple and accurate
manner.

In summary, computerization is essential in human resource management


as it enables efficient data management, accuracy, reliability, and enhanced
user interaction. By harnessing the power of computerized systems, human
resource departments can streamline their operations, improve data
accessibility, and make informed decisions based on accurate and up-to-
date information.

Balasaheb Desai College, Patan Page 4


Human Resource Management System

INTRODUCTION TO ORGANIZATION PROFILE

• Name:- Shri Software Solutions

• Address:- Shri Siddhivinayak, HN 2885


Chafoli Rd, Patan, Satara
MH 415206.

• Purpose:-
Shri Software Solutions is committed to providing innovative and
reliable technology solutions tailored to meet the specific needs of
businesses and organizations. Their goal is to enhance operational
efficiency, productivity, and competitiveness through cutting-edge
software applications and comprehensive IT services. They stay updated
with the latest advancements and industry best practices to deliver
secure and scalable solutions. As a trusted advisor and partner, Shri
Software Solutions empowers businesses to thrive in the digital age by
offering personalized and future-proof IT solutions.

• Service:-
Shri Software Solutions offers a wide range of services to cater to the
diverse needs of businesses. Their services include software development,
where they create innovative and customized applications to streamline
processes and improve efficiency. They also provide robust infrastructure
solutions, ensuring reliable and secure IT infrastructure for businesses.
Additionally, Shri Software Solutions offers comprehensive IT services such
as system integration, network management, and technical support,
providing a holistic approach to meet the technological requirements of their
clients.

Balasaheb Desai College, Patan Page 5


Human Resource Management System

PROPOSED SYSTEM

Objectives of Proposed System:-

1. Streamline employee information management.


2. Simplify attendance tracking.
3. Enhance performance evaluations.
4. Enable HR analytics and reporting.
5. Secure data management.
6. To give fast and accurate Result.
7. To reduce the paper work.
8. To secure private data.
9. Easy for decision making.
10. Used for feature management
11. To save time.
12. Enhance overall HR efficiency.

Balasaheb Desai College, Patan Page 6


Human Resource Management System

QUESTIONNAIRES

Que. 1: What challenges are you currently facing in your HR management


processes?
Answer: Our current HR management processes are largely manual and
time-consuming. The lack of a centralized system makes it difficult to
generate comprehensive reports and gain insights into our
workforce.

Que.2: How are you currently managing employee information, attendance


tracking, and payroll processing?
Answer: We are currently using spreadsheets and manual records to manage
employee information.

Que.3: Are you experiencing any difficulties in accurately tracking and


managing employee performance evaluations and training programs?
Answer: Yes, we face challenges in tracking and managing employee
performance evaluations and training programs.

Que.4: How do you currently handle the recruitment and onboarding process?
Answer: Our recruitment and onboarding processes involve a combination of
email communication, manual paperwork, and face-to-face
interactions.

Que.5: Do you face any challenges in generating comprehensive HR reports


and analytics to gain insights into your workforce and make informed
decisions?
Answer: Yes, our current manual processes make it difficult to generate
comprehensive HR reports and analytics. It takes considerable time
It takes considerable time and effort to compile data from various
sources and produce meaningful insights.

Balasaheb Desai College, Patan Page 7


Human Resource Management System

Que.6: How do you handle data security and confidentiality in your HR


management practices?
Answer: We have implemented access controls, limited physical access to
sensitive information, and have confidentiality agreements in place.

Que.7: Are there any specific features or functionalities you would like to see in
an HRM software solution?
Answer: We would like an HRM software solution that offers centralized
Employee information management, automated attendance
tracking, streamlined payroll processing, performance evaluation
tools, training program management, compliance tracking, and robust
reporting and analytics capabilities.

Que.8: What are your goals and expectations for implementing an HRM software
system?
Answer: Our goals for implement an HRM software system include improving
operational efficiency, reducing manual workloads, enhancing data
accuracy.

Que.9: How do you envision an HRM software solution benefiting your


organization in terms of efficiency, productivity, and overall HR
management?
Answer: We believe an HRM software solution would significantly improve
efficiency and productivity by automate manual task, reducing errors,
and providing real-time access to accurate data. It would streamline
HR processes, enhance collaboration, and enable us to make data-
driven decisions that positively impact our overall HR management
practices.

Balasaheb Desai College, Patan Page 8


Human Resource Management System

SOFTWARE REQUIREMENT SPECIFICATION

Feasibility study:-
1) Technical Feasibility:

• Software requirement (Recommended)

Operating System :- Windows 7/8/10/11

Programming Language :- C#.NET

Designing Tools :- Microsoft Visual Studio 2022,

Adobe Photoshop CS4, Paint.

Database : - Microsoft SQL Server (SQL Client)

Report : - Microsoft RDLC Report

• Hardware requirement (Recommended)


Processor :- P4 or Higher
Monitor :- 1024*768 pixel
Hard Disk :- 500 MB Minimum
RAM :- 1 GB Minimum
Printer :- Cannon Ink jet.
Display :- VGA/HDMI

Balasaheb Desai College, Patan Page 9


Human Resource Management System

2) Operational Feasibility:-
Operational feasibility ends at checking if the system will be help the
user to work in more efficient & accurate manner through all routine
operation. The system is made to be comprehensive in nature using a full
menu driven system & appropriate user informative message. On the
category, the work load on the user will be lessened to a great lessened to a
great extent, as the system is aimed at taking care of the complex
procedures & automatic calculations. Thus the system is operationally
feasible.

3) Economical Feasibility:-
While considering economical feasibility, it is checked in points like
performance, information & outputs for the system. Economic of the system
looks at the financial aspect of the project. It determines whether the system
is economical feasible, in other world it determines whether the investment
that goes into the implementation of the system is recoverable.

Balasaheb Desai College, Patan Page 10


Human Resource Management System

System Analysis

Balasaheb Desai College, Patan Page 11


Human Resource Management System

Data Flow Diagram:-


0th Level DFD

Balasaheb Desai College, Patan Page 12


Human Resource Management System

1st Level DFD

Balasaheb Desai College, Patan Page 13


Human Resource Management System

Entity Relationship Diagram (ERD):-

Balasaheb Desai College, Patan Page 14


Human Resource Management System

System Design

Balasaheb Desai College, Patan Page 15


Human Resource Management System

DATABASE DESIGN

Database Name: employee.mdf

1) AppliedLeave Table:

2) Departments Table :

Balasaheb Desai College, Patan Page 16


Human Resource Management System

3) Employee Table :

4) Payroll Table :

Balasaheb Desai College, Patan Page 17


Human Resource Management System

5) Projects Table :

6) QRattendence Table :

Balasaheb Desai College, Patan Page 18


Human Resource Management System

“Forms Design”

Balasaheb Desai College, Patan Page 19


Human Resource Management System

FORMS DESIGN

1) Dashboard Form :

2) Departments Form :

Balasaheb Desai College, Patan Page 20


Human Resource Management System

3) Employee Form :

4) Projects Form :

Balasaheb Desai College, Patan Page 21


Human Resource Management System

5) Leaves Form :

6) Payroll Form :

Balasaheb Desai College, Patan Page 22


Human Resource Management System

7) Reports Form :

Balasaheb Desai College, Patan Page 23


Human Resource Management System

“Reports”

Balasaheb Desai College, Patan Page 24


Human Resource Management System

REPORTS DESIGN

1) Employee Report :

Balasaheb Desai College, Patan Page 25


Human Resource Management System

2) Payroll Report :

3) Projects Report :

Balasaheb Desai College, Patan Page 26


Human Resource Management System

LIMITATIONS

1. Limited accessibility.
2. Lack of real-time updates.
3. Dependency on local infrastructure.
4. Reduced collaboration and communication.
5. Limited scalability.
6. Data backup and disaster recovery challenges.
7. Restricted integration capabilities.
8. The application may rely on manual software patch installations.
9. Lack of cloud-based features.
10. Difficulty in accessing support and updates.

Balasaheb Desai College, Patan Page 27


Human Resource Management System

FUTURE MODIFICATIONS

1. Mobile accessibility

2. Data synchronization

3. Cloud integration

4. Automated backup and disaster recovery

5. Enhanced collaboration and communication tools

6. Scalability and performance optimization

7. Automated software updates

8. API integration capabilities

9. Improved reporting and analytics

Balasaheb Desai College, Patan Page 28


Human Resource Management System

CONCLUSION

Keeping these in mind this system has been developed in a way, it should
accommodate future enhancement, similarly various features have included in this
system by giving due consideration of the organization. As this system is developed
using modular approach it facilities easy maintenance.

We are sincerely hope that this software system will reduce the burden of
management, that it will also save a lot of their valuable time and money this
exercise develops ours skills and also increase our confidence level.

Balasaheb Desai College, Patan Page 29


Human Resource Management System

BIBLOGRAPHY

1. V.P 6.0 PROGRAMMING : By Steven


Holzner
(Black Book)
2. Software Engineering : By Dr.Roger
Pressman
3. V.P 6.0 : Noel Jerk
(Complete Reference)

Balasaheb Desai College, Patan Page 30


Human Resource Management System

SOURCE CODE

Dashboard form Source code :

using AForge.Video;

using AForge.Video.DirectShow;

using Guna.UI2.WinForms;

using Guna.UI2.WinForms.Enums;

using System;

using System.Data;

using System.Data.SqlClient;

using System.Drawing;

using System.IO;

using System.Windows.Forms;

using Xamarin.Forms;

using ZXing;

using Color = System.Drawing.Color;

namespace WindowsFormsApp1

public partial class frmDashboard : Form

Timer timer = new Timer();

FilterInfoCollection filterInfoCollection;

VideoCaptureDevice videoCaptureDevice;

BarcodeReader bar = new BarcodeReader();

private bool qrCodeDetected=false;

private DateTime lastQRCodeDetectionTime;

public frmDashboard()

InitializeComponent();

Balasaheb Desai College, Patan Page 31


Human Resource Management System

timer1.Start();

SqlConnection cn = new SqlConnection(@"Data


Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\pooja\sou
rce\repos\HRM Application\Database\employee.mdf;Integrated
Security=True;Connect Timeout=30");

string dt = DateTime.Now.ToString("dd - MM - yyyy");

String time = DateTime.Now.ToString("hh:mm:tt");

public void MAX()

cn.Open();

string strMAX = "SELECT MAX(Id) FROM Employee";

SqlCommand cmdMAX = new SqlCommand(strMAX, cn);

SqlDataReader drMAX = cmdMAX.ExecuteReader();

while (drMAX.Read())

Empno.Text = drMAX[0].ToString();

cn.Close();

private void menuEmployee_Click(object sender, EventArgs e)

frmEmployee emp = new frmEmployee();

emp.Show();

this.Hide();

private void Exit_MouseHover(object sender, EventArgs e)

Exit.BackColor = Color.Gray;

private void Exit_MouseLeave(object sender, EventArgs e)

Balasaheb Desai College, Patan Page 32


Human Resource Management System

Exit.BackColor = Color.Black;

private void menuDepartments_Click(object sender, EventArgs e)

frmDepartments dep = new frmDepartments();

dep.Show();

this.Hide();

private void frmDashboard_Load(object sender, EventArgs e)

/* timer.Interval = 10000;

timer.Tick += new EventHandler(frmDashboard_Load);

timer.Start();*/

MAX();

emponleave();

gridleave();

pgbar();

private void timer1_Tick_1(object sender, EventArgs e)

Datetxt.Text = DateTime.Now.ToString(" hh:mm :ss:tt");

private void menuLeave_Click(object sender, EventArgs e)

frmLeavemanagement l = new frmLeavemanagement();

l.Show();

this.Hide();

Balasaheb Desai College, Patan Page 33


Human Resource Management System

private void menuPayroll_Click(object sender, EventArgs e)

frmPayroll fr = new frmPayroll();

fr.Show();

this.Hide();

private void guna2GradientButton1_Click(object sender, EventArgs e)

Loginform f = new Loginform();

f.Show();

this.Hide();

private void label6_Click(object sender, EventArgs e)

//for find todays leved employees

public void emponleave()

cn.Open();

string strMAX = "SELECT COUNT(leaveId) FROM AppliedLeave WHERE


leave_from= @date ";

SqlCommand cmdMAX = new SqlCommand(strMAX, cn);

cmdMAX.Parameters.AddWithValue("@date", Convert.ToDateTime(dt));

SqlDataReader drMAX = cmdMAX.ExecuteReader();

while (drMAX.Read())

txtempleave.Text = drMAX[0].ToString();

cn.Close();

Balasaheb Desai College, Patan Page 34


Human Resource Management System

//to show leave persons on leave

public void gridleave()

cn.Open();

string s = "Select empId, firstname, lastname, leave_to from


AppliedLeave where leave_from=@todayDate ";

SqlCommand command = new SqlCommand(s, cn);

command.Parameters.AddWithValue("@todayDate", Convert.ToDateTime(dt));

SqlDataAdapter adapter = new SqlDataAdapter(command);

DataTable dataTable = new DataTable();

adapter.Fill(dataTable);

gridonleave.DataSource = dataTable;

cn.Close();

//for selected item in row

public void cellcontent()

panelempdetail.Focus();

panelempdetail.Show();

string r = gridonleave.SelectedRows[0].Cells[0].Value.ToString();

cn.Open();

string strFind = "SELECT * FROM Employee WHERE Id=@id";

SqlCommand cmdFind = new SqlCommand(strFind, cn);

cmdFind.Parameters.AddWithValue("@id", r);

SqlDataReader find = cmdFind.ExecuteReader();

while (find.Read())

teid.Text = r;

tfname.Text = find[1].ToString();

tmname.Text = find.GetValue(2).ToString();

tlname.Text = find.GetValue(3).ToString();

tgender.Text = find.GetValue(4).ToString();

Balasaheb Desai College, Patan Page 35


Human Resource Management System

taddress.Text = find.GetValue(5).ToString();

tdob.Text = Convert.ToDateTime(find.GetValue(6)).ToString("dd - MM -
yyyy");

tqual.Text = find.GetValue(7).ToString();

tphno.Text = find.GetValue(8).ToString();

tmail.Text = find.GetValue(9).ToString();

tsalary.Text = find.GetValue(10).ToString();

tjoining.Text = Convert.ToDateTime(find.GetValue(11)).ToString("dd -
MM - yyyy");

tdesignation.Text = find.GetValue(12).ToString();

tdepartment.Text = find.GetValue(13).ToString();

tactive.Text = find.GetValue(14).ToString();

byte[] imageData = (byte[])find["photo"];

MemoryStream ms = new MemoryStream(imageData);

Bitmap bitmap = new Bitmap(ms);

imgEmp2.Image = bitmap;

cn.Close();

private void gridonleave_CellContentClick(object sender,


DataGridViewCellEventArgs e)

cellcontent();

private void ExitButton_Click(object sender, EventArgs e)

panelempdetail.Hide();

//for circular progress bar

public void pgbar()

cn.Open();

Balasaheb Desai College, Patan Page 36


Human Resource Management System

SqlCommand countCommand = new SqlCommand("SELECT COUNT(*) FROM Projects",


cn);

int projectCount = (int)countCommand.ExecuteScalar();

// create a command to retrieve the progress value for each project from
the database

SqlCommand progressCommand = new SqlCommand("SELECT Project_Name,


Progress FROM Projects", cn);

SqlDataReader reader = progressCommand.ExecuteReader();

int progressWidth = 150;

int spacing = 10;

for (int i = 0; i < projectCount; i++)

Guna2CircleProgressBar progressBar = new Guna2CircleProgressBar();

progressBar.Width = progressWidth;

progressBar.Height = progressWidth;

reader.Read();

int progressValue = (int)reader["Progress"];

String projectname = (string)reader["Project_Name"];

progressBar.Value = progressValue;

progressBar.ProgressThickness = 26;

progressBar.Text = projectname;

progressBar.TextMode = ProgressBarTextMode.Custom;

progressBar.ShowText = true;

progressBar.ProgressEndCap = System.Drawing.Drawing2D.LineCap.Round;

progressBar.ForeColor = Color.Black;

progressBar.ProgressColor = Color.LightSeaGreen;

progressBar.ProgressColor2 = Color.Cyan;

progressBar.Left = (i * (progressWidth + spacing)) + 10;

progressBar.Top = panelproject.Height / 2 - progressBar.Height / 2;

panelproject.Controls.Add(progressBar);

cn.Close();

Balasaheb Desai College, Patan Page 37


Human Resource Management System

//closes the camera

public void closecam()

if (videoCaptureDevice != null && videoCaptureDevice.IsRunning == true)

videoCaptureDevice.SignalToStop();

videoCaptureDevice = null;

public void opencam()

filterInfoCollection = new
FilterInfoCollection(FilterCategory.VideoInputDevice);

if (filterInfoCollection.Count > 0)

videoCaptureDevice = new
VideoCaptureDevice(filterInfoCollection[0].MonikerString);

videoCaptureDevice.NewFrame += VideoCaptureDevice_NewFrame;

videoCaptureDevice.Start();

else

frmcameraerror er = new frmcameraerror();

er.ShowDialog();

private void btnopncam_Click(object sender, EventArgs e)

opencam();

private void VideoCaptureDevice_NewFrame(object sender, NewFrameEventArgs


eventArgs)

Balasaheb Desai College, Patan Page 38


Human Resource Management System

try

qrCodeDetected = true;//!

lastQRCodeDetectionTime = DateTime.Now;//!

Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();

var result = bar.Decode(bitmap);

if (result != null)

Invoke(new Action(() =>

cn.Open();

string strFind = "SELECT * FROM Employee WHERE Id=@id";

SqlCommand cmdFind = new SqlCommand(strFind, cn);

cmdFind.Parameters.AddWithValue("@id", result.ToString());

SqlDataReader find = cmdFind.ExecuteReader();

if (!find.HasRows)

closecam();

frmqrnotfnd ida = new frmqrnotfnd();

ida.ShowDialog();

opencam();

cn.Close();

else

while (find.Read())

panelempattend.Show();//shows panel

panelempattend.BringToFront();

closecam();

txtid1.Text = result.ToString();

txtfname1.Text = find[1].ToString();

txtLname1.Text = find.GetValue(3).ToString();

Balasaheb Desai College, Patan Page 39


Human Resource Management System

txtGender1.Text = find.GetValue(4).ToString();

txtdesignation1.Text = find.GetValue(12).ToString();

txtdepartment1.Text = find.GetValue(13).ToString();

byte[] imageData = (byte[])find["photo"];

MemoryStream ms = new MemoryStream(imageData);

Bitmap bitmap1 = new Bitmap(ms);

picEmployee.Image = bitmap1;

lastQRCodeDetectionTime = DateTime.Now;
}

cn.Close();

}));

else

TimeSpan timeSinceLastDetection = DateTime.Now -


lastQRCodeDetectionTime;

if (qrCodeDetected && timeSinceLastDetection.TotalSeconds >= 25)

videoCaptureDevice.SignalToStop();

videoCaptureDevice = null;

qrCodeDetected = false;

MessageBox.Show("No QR code detected ,Video capture device


has been stopped.");

webcam.Image = bitmap;

catch (Exception exce)

MessageBox.Show("Not valid QR", exce.Message);

private void btnclscam_Click(object sender, EventArgs e)

Balasaheb Desai College, Patan Page 40


Human Resource Management System

closecam();

private void panqrattendclear()

txtid1.Text = null;

txtfname1.Text = null;

txtLname1.Text = null;

txtGender1.Text=null;

txtdesignation1.Text = null;

txtdepartment1.Text=null;

private void btnMarkAttendence_Click(object sender, EventArgs e)

try

cn.Open();

DateTime today = DateTime.Today;

string strFind = "SELECT * FROM QRattendence WHERE Emp_id='" +


txtid1.Text + "' and CONVERT(varchar(10), Date, 120) LIKE
CONVERT(varchar(10), @Today, 120) + '%'";

SqlCommand cmdFind = new SqlCommand(strFind, cn);

cmdFind.Parameters.AddWithValue("@Today", today);

SqlDataReader find = cmdFind.ExecuteReader();

if (!find.HasRows)

cn.Close();

cn.Open();

string strsave = "insert into QRattendence


values(@empid,@fname,@lname,@gender,@designation,@department,@dat
e)";

SqlCommand cmd = new SqlCommand(strsave, cn);

cmd.Parameters.AddWithValue("@empid", txtid1.Text);

Balasaheb Desai College, Patan Page 41


Human Resource Management System

cmd.Parameters.AddWithValue("@fname", txtfname1.Text);

cmd.Parameters.AddWithValue("@lname", txtLname1.Text);

cmd.Parameters.AddWithValue("@gender", txtGender1.Text);

cmd.Parameters.AddWithValue("@designation",
txtdesignation1.Text);

cmd.Parameters.AddWithValue("@department", txtdepartment1.Text);

cmd.Parameters.AddWithValue("@date", DateTime.Now);

cmd.ExecuteNonQuery();

cn.Close();

MessageBox.Show("Saved");

panqrattendclear();

panelempattend.Hide();

opencam();

else

MessageBox.Show("Already Marked");

cn.Close();

panelempattend.Hide();

opencam();

catch(Exception msg)

MessageBox.Show(msg.Message);

private void frmDashboard_FormClosed(object sender, FormClosedEventArgs e)

closecam();//close camera

Balasaheb Desai College, Patan Page 42


Human Resource Management System

private void Exit_Click_1(object sender, EventArgs e)

sharedclass s = new sharedclass();

s.exitbtn();

private void Projectmenu_Click_1(object sender, EventArgs e)

frmProjects frmProjects = new frmProjects();

frmProjects.Show();

this.Hide();

private void btnViewtodaysleave_Click(object sender, EventArgs e)

frmviewPresenty frmviewPresenty = new frmviewPresenty();

frmviewPresenty.ShowDialog();

private void mnuReports_Click(object sender, EventArgs e)

frmReports frmReports = new frmReports();

frmReports.ShowDialog();

Balasaheb Desai College, Patan Page 43


Human Resource Management System

Departments form Source code :


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
public partial class frmDepartments : Form
{
public frmDepartments()
{
InitializeComponent();
}

SqlConnection cn = new SqlConnection(@"Data


Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\pooja\source\repos\HRM
Application\Database\employee.mdf;Integrated Security=True;Connect Timeout=30");
//for find max of department id
public void MAX()
{
cn.Open();
string strMAX = "SELECT MAX(D_Id)+1 FROM Departments";
SqlCommand cmdMAX = new SqlCommand(strMAX, cn);
SqlDataReader drMAX = cmdMAX.ExecuteReader();
while (drMAX.Read())
{
txtDepartpId.Text = drMAX[0].ToString();
}
cn.Close();
}

//to show data in grid


public void show()
{
cn.Open();
string s = "select * from Departments";
SqlDataAdapter sa = new SqlDataAdapter(s, cn);
SqlCommandBuilder b = new SqlCommandBuilder(sa);
var ds = new DataSet();
sa.Fill(ds);
gridDepartment.DataSource = ds.Tables[0];
cn.Close();

private void menuDashboard_Click(object sender, EventArgs e)


{
frmDashboard frmDashboard = new frmDashboard();
frmDashboard.Show();
this.Hide();
}

private void menuEmployee_Click(object sender, EventArgs e)


{

Balasaheb Desai College, Patan Page 44


Human Resource Management System

frmEmployee emp = new frmEmployee();


emp.Show();
this.Hide();
}

private void menuProjects_Click(object sender, EventArgs e)


{
frmProjects pro=new frmProjects();
pro.Show();
this.Hide();
}
private void clear()
{
txtDepartpId.Text = "";
txtDepartName.Text = "";
txtDepartHead.Text = "";
txtDepartDesc.Text = "";
MAX();
}

private void btnSave_Click(object sender, EventArgs e)


{
if (txtDepartpId.Text != "" && txtDepartName.Text != "" &&
txtDepartHead.Text != "")
{
cn.Open();
string strsave = "insert into Departments
values(@D_Id,@Dep_Name,@Dep_Head,@Dep_Desc)";
SqlCommand cmd = new SqlCommand(strsave, cn);
cmd.Parameters.AddWithValue("@D_Id", txtDepartpId.Text);
cmd.Parameters.AddWithValue("@Dep_Name", txtDepartName.Text);
cmd.Parameters.AddWithValue("@Dep_Head", txtDepartHead.Text);
cmd.Parameters.AddWithValue("@Dep_Desc", txtDepartDesc.Text);
cmd.ExecuteNonQuery();
cn.Close();
frmsaved s = new frmsaved();
s.Show();
show();
clear();
MAX();
}

else
{
frmError er = new frmError();
er.Show();

}
}

private void btnclear_Click(object sender, EventArgs e)


{
clear();
MAX();
}

private void Exit_Click(object sender, EventArgs e)


{
sharedclass s = new sharedclass();
s.exitbtn();
}

private void frmDepartments_Load(object sender, EventArgs e)

Balasaheb Desai College, Patan Page 45


Human Resource Management System

{
MAX();
show();
}

private void btnUpdate_Click(object sender, EventArgs e)


{
if (txtDepartpId.Text != "" && txtDepartName.Text != "" &&
txtDepartHead.Text != "")
{
cn.Open();
string strupdate = "UPDATE Departments SET
Dep_Name=@Dep_Name,Dep_Head=@Dep_Head,Dep_Desc=@Dep_Desc WHERE D_Id=@D_Id";
SqlCommand cmd = new SqlCommand(strupdate, cn);
cmd.Parameters.AddWithValue("@D_Id", txtDepartpId.Text);
cmd.Parameters.AddWithValue("@Dep_Name", txtDepartName.Text);
cmd.Parameters.AddWithValue("@Dep_Head", txtDepartHead.Text);
cmd.Parameters.AddWithValue("@Dep_Desc", txtDepartDesc.Text);
cmd.ExecuteNonQuery();
cn.Close();
frmUpdate s = new frmUpdate();
s.Show();
show();
clear();
MAX();
}

else
{
frmError er = new frmError();
er.Show();

}
}
private void find()
{
if (txtDepartpId.Text != "")
{
cn.Open();
string strFind = "SELECT * FROM Departments WHERE D_Id=@D_Id";
SqlCommand cmdFind = new SqlCommand(strFind, cn);
cmdFind.Parameters.AddWithValue("@D_Id", txtDepartpId.Text);
SqlDataReader find = cmdFind.ExecuteReader();
if (!find.HasRows)
{
frmNotfound ida = new frmNotfound();
ida.ShowDialog();

}
while (find.Read())
{
txtDepartName.Text = find[1].ToString();
txtDepartHead.Text = find.GetValue(2).ToString();
txtDepartDesc.Text = find.GetValue(3).ToString();

}
cn.Close();
}
else
{
enterId i = new enterId();
i.ShowDialog();
}

Balasaheb Desai College, Patan Page 46


Human Resource Management System

private void btnFind_Click(object sender, EventArgs e)


{
find();
}

private void txtDepartpId_KeyDown(object sender, KeyEventArgs e)


{
if (e.KeyCode == Keys.Enter)
{
find();
}
}

private void cellcontent()


{
txtDepartpId.Text =
gridDepartment.SelectedRows[0].Cells[0].Value.ToString();
txtDepartName.Text
=gridDepartment.SelectedRows[0].Cells[1].Value.ToString();
txtDepartHead.Text =
gridDepartment.SelectedRows[0].Cells[2].Value.ToString();
txtDepartDesc.Text =
gridDepartment.SelectedRows[0].Cells[3].Value.ToString();

private void gridDepartment_CellContentClick(object sender,


DataGridViewCellEventArgs e)
{
cellcontent();
}

private void menuLeave_Click(object sender, EventArgs e)


{
frmLeavemanagement l = new frmLeavemanagement();
l.Show();
this.Hide();
}

private void menuPayroll_Click(object sender, EventArgs e)


{
frmPayroll fr = new frmPayroll();
fr.Show();
this.Hide();
}

private void guna2GradientButton1_Click(object sender, EventArgs e)


{
Loginform f = new Loginform();
f.Show();
this.Hide();
}

private void mnuReports_Click(object sender, EventArgs e)


{
frmReports frm = new frmReports();
frm.ShowDialog();
}
}
}

Balasaheb Desai College, Patan Page 47


Human Resource Management System

Employee form Source code :

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Data.OleDb;

using System.Data.SqlClient;

using System.Drawing;

using System.IO;

using System.Linq;

using System.Linq.Expressions;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using QRCoder;

namespace WindowsFormsApp1

public partial class frmEmployee : Form

public frmEmployee()

InitializeComponent();

string genderp;

string act;

string gend;

string Astatus;

Balasaheb Desai College, Patan Page 48


Human Resource Management System

SqlConnection cn=new SqlConnection(@"Data


Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\pooja\source\repos\HRM
Application\Database\employee.mdf;Integrated Security=True;Connect Timeout=30");

//to show data in grid view

public void show()

cn.Open();

string s = "select * from Employee";

SqlDataAdapter sa = new SqlDataAdapter(s, cn);

SqlCommandBuilder b = new SqlCommandBuilder(sa);

var ds = new DataSet();

sa.Fill(ds);

Empgrid.DataSource = ds.Tables[0];

cn.Close();

//function for find max number of id

public void MAX()

cn.Open();

string strMAX = "SELECT MAX(Id)+1 FROM Employee";

SqlCommand cmdMAX = new SqlCommand(strMAX,cn);

SqlDataReader drMAX = cmdMAX.ExecuteReader();

while (drMAX.Read())

txtEmpid.Text = drMAX[0].ToString();

cn.Close();

Balasaheb Desai College, Patan Page 49


Human Resource Management System

private void btnSave_Click(object sender, EventArgs e)

try

byte[] imageData = null;

using (MemoryStream ms = new MemoryStream())

imgqr.Image;

byte[] arr;

ImageConverter converter = new ImageConverter();

arr = (byte[])converter.ConvertTo(img, typeof(byte[]));

if (rdoMale.Checked == true)

gend = rdoMale.Text;

else

gend = rdoFemale.Text;

if (toggleActive.Checked == true)

Astatus = "Active";

else

Balasaheb Desai College, Patan Page 50


Human Resource Management System

Astatus = "Unactive";

if (imageData!=null && txtEmpid.Text != "" && txtFname.Text != ""


&& txtMname.Text != "" && txtLname.Text != "" && txtAddress.Text != "" &&
txtPhone.Text != "" && txtEmail.Text != "" && txtSalary.Text != "" &&
txtDesignation.Text != "" && txtDepartment.Text != "" && txtqualification.Text !=
"")

cn.Open();

string strsave = "insert into Employee


values(@id,@fname,@mname,@lname,@gender,@address,@dob,@Qualification,@phone,@emai
l,@salary,@jdate,@designation,@department,@status,@photo,@QR)";

SqlCommand cmd = new SqlCommand(strsave, cn);

cmd.Parameters.AddWithValue("@id", txtEmpid.Text);

cmd.Parameters.AddWithValue("@fname", txtFname.Text);

cmd.Parameters.AddWithValue("@mname", txtMname.Text);

cmd.Parameters.AddWithValue("@lname", txtLname.Text);

cmd.Parameters.AddWithValue("@gender", gend);

cmd.Parameters.AddWithValue("@address", txtAddress.Text);

cmd.Parameters.AddWithValue("@dob", txtDOB.Value);

cmd.Parameters.AddWithValue("@Qualification",
txtqualification.Text);

cmd.Parameters.AddWithValue("@phone", txtPhone.Text);

cmd.Parameters.AddWithValue("@email", txtEmail.Text);

cmd.Parameters.AddWithValue("@salary", txtSalary.Text);

cmd.Parameters.AddWithValue("@jdate", txtJdate.Value);

cmd.Parameters.AddWithValue("@designation",
txtDesignation.Text);

cmd.Parameters.AddWithValue("@department",
txtDepartment.Text);

cmd.Parameters.AddWithValue("@status", Astatus);

cmd.Parameters.AddWithValue("@photo", imageData);

cmd.Parameters.AddWithValue("@QR", arr);

Balasaheb Desai College, Patan Page 51


Human Resource Management System

cmd.ExecuteNonQuery();

cn.Close();

frmsaved s = new frmsaved();

s.ShowDialog();

show();

clear();

MAX();

else

frmError er = new frmError();

er.ShowDialog();

catch(Exception ex)

MessageBox.Show(ex.Message);

private void Exit_Click(object sender, EventArgs e)

sharedclass s = new sharedclass();

s.exitbtn();

private void imgEmployee_Click(object sender, EventArgs e)

Balasaheb Desai College, Patan Page 52


Human Resource Management System

OpenFileDialog open = new OpenFileDialog();

PictureBox p = sender as PictureBox;

if (p != null)

open.Filter = " (*.jpg;*.jpeg;*.png) | *.jpg;*.jpeg;*.png ";

if (open.ShowDialog() == DialogResult.OK)

p.Image = Image.FromFile(open.FileName);

private void frmEmployee_Load(object sender, EventArgs e)

show();

MAX();

private void menuDashboard_Click(object sender, EventArgs e)

frmDashboard frmDashboard = new frmDashboard();

frmDashboard.Show();

this.Hide();

private void menuDepartments_Click(object sender, EventArgs e)

frmDepartments dep = new frmDepartments();

dep.Show();

this.Hide();

Balasaheb Desai College, Patan Page 53


Human Resource Management System

private void btnNew_Click(object sender, EventArgs e)

clear();

MAX();

public void clear()

imgEmployee.Image=null;

imgqr.Image = null;

txtEmpid.Text = "";

txtFname.Text = "";

txtMname.Text = "";

txtLname.Text = "";

rdoFemale.Checked = false;

rdoMale.Checked = false;

txtAddress.Text = "";

txtqualification.SelectedItem=null;

txtPhone.Text = "";

txtEmail.Text = "";

txtSalary.Text = "";

txtDesignation.SelectedItem = null;

txtDepartment.SelectedItem = null;

toggleActive.Checked = false;

private void btnUpdate_Click(object sender, EventArgs e)

try

Balasaheb Desai College, Patan Page 54


Human Resource Management System

//for image array in byte

byte[] imageData = null;

using (MemoryStream ms = new MemoryStream())

imgEmployee.Image.Save(ms, imgEmployee.Image.RawFormat);

imageData = ms.ToArray();

//for qr image object

Image img = imgqr.Image;

byte[] arr;

ImageConverter converter = new ImageConverter();

arr = (byte[])converter.ConvertTo(img, typeof(byte[]));

if (rdoMale.Checked == true)

gend = rdoMale.Text;

else

gend = rdoFemale.Text;

if (toggleActive.Checked == true)

Astatus = "Active";

else

Astatus = "Unactive";

Balasaheb Desai College, Patan Page 55


Human Resource Management System

if (txtEmpid.Text != "" && txtFname.Text != "" && txtMname.Text


!= "" && txtLname.Text != "" && txtAddress.Text != "" && txtPhone.Text != "" &&
txtEmail.Text != "" && txtSalary.Text != "" && txtDesignation.Text != "" &&
txtDepartment.Text != "" && txtqualification.Text != "")

cn.Open();

string str = "UPDATE Employee SET firstname=@firstname,


middlename=@middlename,lastname=@lastname,
gender=@gender,address=@address,DOB=@DOB,Qualification=@Qualification,phonenumber
=@phonenumber,email=@email,salary=@salary,joiningdate=@joiningdate,designation=@d
esignation,department=department,status=@status,photo=@photo,QR=@QR WHERE
Id=@Id";

SqlCommand cmd = new SqlCommand(str, cn);

cmd.Parameters.AddWithValue("@firstname", txtFname.Text);

cmd.Parameters.AddWithValue("@middlename", txtMname.Text);

cmd.Parameters.AddWithValue("@lastname", txtLname.Text);

cmd.Parameters.AddWithValue("@gender", gend);

cmd.Parameters.AddWithValue("@address", txtAddress.Text);

cmd.Parameters.AddWithValue("@DOB", txtDOB.Value);

cmd.Parameters.AddWithValue("@Qualification",
txtqualification.Text);

cmd.Parameters.AddWithValue("@phonenumber", txtPhone.Text);

cmd.Parameters.AddWithValue("@email", txtEmail.Text);

cmd.Parameters.AddWithValue("@salary", txtSalary.Text);

cmd.Parameters.AddWithValue("@joiningdate", txtJdate.Value);

cmd.Parameters.AddWithValue("@designation",
txtDesignation.Text);

cmd.Parameters.AddWithValue("@department",
txtDepartment.Text);

cmd.Parameters.AddWithValue("@status", Astatus);

cmd.Parameters.AddWithValue("@photo", imageData);

cmd.Parameters.AddWithValue("@QR", arr);

cmd.Parameters.AddWithValue("@Id", txtEmpid.Text);

cmd.ExecuteNonQuery();

cn.Close();

frmUpdate s = new frmUpdate();

Balasaheb Desai College, Patan Page 56


Human Resource Management System

s.ShowDialog();

show();

clear();

MAX();

else

frmError er = new frmError();

er.ShowDialog();

catch(Exception ms)

MessageBox.Show(ms.Message);

//function for cell content click

public void cellcontent()

string gendercell;

string stausa;

txtEmpid.Text = Empgrid.SelectedRows[0].Cells[0].Value.ToString();

txtFname.Text = Empgrid.SelectedRows[0].Cells[1].Value.ToString();

txtMname.Text= Empgrid.SelectedRows[0].Cells[2].Value.ToString();

txtLname.Text= Empgrid.SelectedRows[0].Cells[3].Value.ToString();

gendercell = Empgrid.SelectedRows[0].Cells[4].Value.ToString();

txtAddress.Text= Empgrid.SelectedRows[0].Cells[5].Value.ToString();

txtDOB.Value =
Convert.ToDateTime(Empgrid.SelectedRows[0].Cells[6].Value.ToString());

Balasaheb Desai College, Patan Page 57


Human Resource Management System

txtqualification.SelectedItem =
Empgrid.SelectedRows[0].Cells[7].Value.ToString();

txtPhone.Text= Empgrid.SelectedRows[0].Cells[8].Value.ToString();

txtEmail.Text= Empgrid.SelectedRows[0].Cells[9].Value.ToString();

txtSalary.Text= Empgrid.SelectedRows[0].Cells[10].Value.ToString();

txtJdate.Value =
Convert.ToDateTime(Empgrid.SelectedRows[0].Cells[11].Value.ToString());

txtDesignation.SelectedItem=
Empgrid.SelectedRows[0].Cells[12].Value.ToString();

txtDepartment.SelectedItem=
Empgrid.SelectedRows[0].Cells[13].Value.ToString();

stausa = Empgrid.SelectedRows[0].Cells[14].Value.ToString();

byte[] imageData = (byte[]) Empgrid.SelectedRows[0].Cells[15].Value;

MemoryStream ms = new MemoryStream(imageData);

Bitmap bitmap = new Bitmap(ms);

imgEmployee.Image = bitmap;

//qr box image

byte[] qrdata = (byte[]) Empgrid.SelectedRows[0].Cells[16].Value;

MemoryStream qr1 = new MemoryStream(qrdata);

Bitmap bit = new Bitmap(qr1);

imgqr.Image = bit;

if (gendercell == "Male")

rdoMale.Checked = true;

else

rdoFemale.Checked = true;

//for toggle

if(stausa =="Active")

toggleActive.Checked = true;

else

toggleActive.Checked = false;

Balasaheb Desai College, Patan Page 58


Human Resource Management System

private void btnFind_Click(object sender, EventArgs e)

if (txtEmpid.Text != "")

cn.Open();

string strFind = "SELECT * FROM Employee WHERE Id=@id";

SqlCommand cmdFind = new SqlCommand(strFind, cn);

cmdFind.Parameters.AddWithValue("@id", txtEmpid.Text);

SqlDataReader find = cmdFind.ExecuteReader();

if (!find.HasRows)

frmNotfound ida = new frmNotfound();

ida.ShowDialog();

while (find.Read())

txtFname.Text = find[1].ToString();

txtMname.Text = find.GetValue(2).ToString();

txtLname.Text = find.GetValue(3).ToString();

genderp= find.GetValue(4).ToString();

txtAddress.Text = find.GetValue(5).ToString();

txtDOB.Value =
Convert.ToDateTime(find.GetValue(6).ToString());

txtqualification.SelectedItem = find.GetValue(7).ToString();

txtPhone.Text = find.GetValue(8).ToString();

txtEmail.Text = find.GetValue(9).ToString();

txtSalary.Text = find.GetValue(10).ToString();

txtJdate.Value =
Convert.ToDateTime((DateTime)find.GetValue(11));

Balasaheb Desai College, Patan Page 59


Human Resource Management System

txtDesignation.SelectedItem=find.GetValue(12).ToString();

txtDepartment.SelectedItem=find.GetValue(13).ToString();

act= find.GetValue(14).ToString();

byte[] imageData = (byte[])find["photo"];

MemoryStream ms = new MemoryStream(imageData);

Bitmap bitmap = new Bitmap(ms);

imgEmployee.Image = bitmap;

//qr box image

byte[] qrdata = (byte[])find["QR"];

MemoryStream qr1 = new MemoryStream(qrdata);

Bitmap bit = new Bitmap(qr1);

imgqr.Image = bit;

//for radio btn

if(genderp =="Male")

rdoMale.Checked = true;

if(genderp== "Female")

rdoFemale.Checked = true;

//for toggle button

if(act=="Active")

toggleActive.Checked = true;

else

Balasaheb Desai College, Patan Page 60


Human Resource Management System

toggleActive.Checked=false;

cn.Close();

else

enterId i = new enterId();

i.ShowDialog();

private void Empgrid_CellContentClick(object sender,


DataGridViewCellEventArgs e)

cellcontent();

private void menuLeave_Click(object sender, EventArgs e)

frmLeavemanagement l = new frmLeavemanagement();

l.Show();

this.Hide();

private void menuPayroll_Click(object sender, EventArgs e)

frmPayroll fr = new frmPayroll();

fr.Show();

this.Hide();

Balasaheb Desai College, Patan Page 61


Human Resource Management System

private void Empgrid_CellContentDoubleClick(object sender,


DataGridViewCellEventArgs e)

panelempdetail.Focus();

panelempdetail.Show();

panelempdetail.BringToFront();

string r = Empgrid.SelectedRows[0].Cells[0].Value.ToString();

cn.Open();

string strFind = "SELECT * FROM Employee WHERE Id=@id";

SqlCommand cmdFind = new SqlCommand(strFind, cn);

cmdFind.Parameters.AddWithValue("@id", r);

SqlDataReader find = cmdFind.ExecuteReader();

while (find.Read())

teid.Text = r;

tfname.Text = find[1].ToString();

tmname.Text = find.GetValue(2).ToString();

tlname.Text = find.GetValue(3).ToString();

tgender.Text = find.GetValue(4).ToString();

taddress.Text = find.GetValue(5).ToString();

tdob.Text = Convert.ToDateTime(find.GetValue(6)).ToString("dd -
MM - yyyy");

tqual.Text = find.GetValue(7).ToString();

tphno.Text = find.GetValue(8).ToString();

tmail.Text = find.GetValue(9).ToString();

tsalary.Text = find.GetValue(10).ToString();

tjoining.Text =
Convert.ToDateTime(find.GetValue(11)).ToString("dd - MM - yyyy");

tdesignation.Text = find.GetValue(12).ToString();

tdepartment.Text = find.GetValue(13).ToString();

tactive.Text = find.GetValue(14).ToString();

Balasaheb Desai College, Patan Page 62


Human Resource Management System

byte[] imageData = (byte[])find["photo"];

MemoryStream ms = new MemoryStream(imageData);

Bitmap bitmap = new Bitmap(ms);

imgEmp2.Image = bitmap;

cn.Close();

private void ExitButton_Click(object sender, EventArgs e)

panelempdetail.Hide();

private void panelempdetail_MouseDoubleClick(object sender,


MouseEventArgs e)

int a = Convert.ToInt32(teid.Text);

++a;

cn.Open();

string strFind = "SELECT * FROM Employee WHERE Id=@id";

SqlCommand cmdFind = new SqlCommand(strFind, cn);

cmdFind.Parameters.AddWithValue("@id", a);

SqlDataReader find = cmdFind.ExecuteReader();

while (find.Read())

teid.Text =Convert.ToString( a);

tfname.Text = find[1].ToString();

tmname.Text = find.GetValue(2).ToString();

tlname.Text = find.GetValue(3).ToString();

tgender.Text = find.GetValue(4).ToString();

Balasaheb Desai College, Patan Page 63


Human Resource Management System

taddress.Text = find.GetValue(5).ToString();

tdob.Text = Convert.ToDateTime(find.GetValue(6)).ToString("dd -
MM - yyyy");

tqual.Text = find.GetValue(7).ToString();

tphno.Text = find.GetValue(8).ToString();

tmail.Text = find.GetValue(9).ToString();

tsalary.Text = find.GetValue(10).ToString();

tjoining.Text =
Convert.ToDateTime(find.GetValue(11)).ToString("dd - MM - yyyy");

tdesignation.Text = find.GetValue(12).ToString();

tdepartment.Text = find.GetValue(13).ToString();

tactive.Text = find.GetValue(14).ToString();

byte[] imageData = (byte[])find["photo"];

MemoryStream ms = new MemoryStream(imageData);

Bitmap bitmap = new Bitmap(ms);

imgEmp2.Image = bitmap;

cn.Close();

private void guna2GradientButton1_Click(object sender, EventArgs e)

Loginform f = new Loginform();

f.Show();

this.Hide();

private void txtEmpid_TextChanged(object sender, EventArgs e)

QRCodeGenerator qrGenerator = new QRCodeGenerator();

QRCodeData qrCodeData = qrGenerator.CreateQrCode(txtEmpid.Text,


QRCodeGenerator.ECCLevel.Q);

Balasaheb Desai College, Patan Page 64


Human Resource Management System

QRCode qrCode = new QRCode(qrCodeData);

imgqr.Image = qrCode.GetGraphic(5);

private void projectsmenu_Click(object sender, EventArgs e)

frmProjects projectsmenu = new frmProjects();

projectsmenu.Show();

this.Hide();

private void mnuReports_Click(object sender, EventArgs e)

frmReports reportsmenu = new frmReports();

reportsmenu.ShowDialog();

Balasaheb Desai College, Patan Page 65


Human Resource Management System

Projects form Source code :

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Data.SqlClient;

using System.Diagnostics;

using System.Drawing;

using System.IO;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace WindowsFormsApp1

public partial class frmProjects : Form

public frmProjects()

InitializeComponent();

string ch;

SqlConnection cn = new SqlConnection(@"Data


Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\pooja\source\repos\HRM
Application\Database\employee.mdf;Integrated Security=True;Connect Timeout=30");

//for find max of Project id

public void MAX()

cn.Open();

string strMAX = "SELECT MAX(Project_Id)+1 FROM Projects";

Balasaheb Desai College, Patan Page 66


Human Resource Management System

SqlCommand cmdMAX = new SqlCommand(strMAX, cn);

SqlDataReader drMAX = cmdMAX.ExecuteReader();

while (drMAX.Read())

txtPrjid.Text = drMAX[0].ToString();

cn.Close();

//to show data in grid

public void show()

cn.Open();

string s = "select * from Projects";

SqlDataAdapter sa = new SqlDataAdapter(s, cn);

SqlCommandBuilder b = new SqlCommandBuilder(sa);

var ds = new DataSet();

sa.Fill(ds);

GridPrj.DataSource = ds.Tables[0];

cn.Close();

private void clear()

txtPrjid.Text = "";

txtPrjname.Text = "";

txtPrjhead.Text = "";

txtWorkingEmployees.Text = "";

toggleStateprj.Checked = false;

MAX();

Balasaheb Desai College, Patan Page 67


Human Resource Management System

private void guna2TrackBar1_Scroll(object sender, ScrollEventArgs e)

txtprogress.Text = (ProgressBar.Value).ToString()+"%";

private void toggleActive_CheckedChanged(object sender, EventArgs e)

if(toggleStateprj.Checked==true)

txtStateofProject.Text = "Done";

else

txtStateofProject.Text = "Working on it";

private void Exit_Click(object sender, EventArgs e)

sharedclass s=new sharedclass();

s.exitbtn();

private void btnSave_Click(object sender, EventArgs e)

if (txtPrjid.Text != "" && txtPrjname.Text != "" && txtPrjhead.Text


!= ""&& txtWorkingEmployees.Text!="")

string state;

if(toggleStateprj.Checked==true)

state = "Done";

Balasaheb Desai College, Patan Page 68


Human Resource Management System

else

state = "Working on it";

cn.Open();

string strsave = "insert into Projects


values(@P_id,@P_Name,@P_Head,@Workingempl,@Startson,@Progress,@Endson,@State)";

SqlCommand cmd = new SqlCommand(strsave, cn);

cmd.Parameters.AddWithValue("@P_id", txtPrjid.Text);

cmd.Parameters.AddWithValue("@P_Name", txtPrjname.Text);

cmd.Parameters.AddWithValue("@P_Head", txtPrjhead.Text);

cmd.Parameters.AddWithValue("@Workingempl",
txtWorkingEmployees.Text);

cmd.Parameters.AddWithValue("@Startson", txtStartDate.Value);

cmd.Parameters.AddWithValue("@Progress", ProgressBar.Value);

cmd.Parameters.AddWithValue("@Endson", txtEndDate.Value);

cmd.Parameters.AddWithValue("@State",state);

cmd.ExecuteNonQuery();

cn.Close();

frmsaved s = new frmsaved();

s.ShowDialog();

show();

clear();

MAX();

else

frmError er = new frmError();

er.Show();

Balasaheb Desai College, Patan Page 69


Human Resource Management System

private void frmProjects_Load(object sender, EventArgs e)

show();

MAX();

private void btnNew_Click(object sender, EventArgs e)

clear();

MAX();

private void btnUpdate_Click(object sender, EventArgs e)

if (txtPrjid.Text != "" && txtPrjname.Text != "" && txtPrjhead.Text


!= "" && txtWorkingEmployees.Text != "")

cn.Open();

string strupdate = "UPDATE Projects SET


Project_Name=@P_Name,Project_Head=@P_Head,Working_Employees=@Workingempl,Starton=
@Startson,Progress=@Progress,Endson=@Endson,StateofProject=@State WHERE
Project_Id=@P_id";

SqlCommand cmd = new SqlCommand(strupdate, cn);

cmd.Parameters.AddWithValue("@P_id", txtPrjid.Text);

cmd.Parameters.AddWithValue("@P_Name", txtPrjname.Text);

cmd.Parameters.AddWithValue("@P_Head", txtPrjhead.Text);

cmd.Parameters.AddWithValue("@Workingempl",
txtWorkingEmployees.Text);

cmd.Parameters.AddWithValue("@Startson", txtStartDate.Value);

Balasaheb Desai College, Patan Page 70


Human Resource Management System

cmd.Parameters.AddWithValue("@Progress", ProgressBar.Value);

cmd.Parameters.AddWithValue("@Endson", txtEndDate.Value);

cmd.Parameters.AddWithValue("@State", txtStateofProject.Text);

cmd.ExecuteNonQuery();

cn.Close();

frmUpdate u = new frmUpdate();

u.ShowDialog();

show();

clear();

MAX();

else

frmError er = new frmError();

er.Show();

private void find()

if (txtPrjid.Text != "")

cn.Open();

string strFind = "SELECT * FROM Projects WHERE Project_Id=@P_Id";

SqlCommand cmdFind = new SqlCommand(strFind, cn);

cmdFind.Parameters.AddWithValue("@P_Id", txtPrjid.Text);

SqlDataReader find = cmdFind.ExecuteReader();

if (!find.HasRows)

Balasaheb Desai College, Patan Page 71


Human Resource Management System

frmNotfound ida = new frmNotfound();

ida.ShowDialog();

while (find.Read())

txtPrjname.Text = find[1].ToString();

txtPrjhead.Text = find.GetValue(2).ToString();

txtWorkingEmployees.Text = find.GetValue(3).ToString();

txtStartDate.Value=Convert.ToDateTime(find.GetValue(4));

ProgressBar.Value=Convert.ToInt32(find.GetValue(5).ToString());

txtEndDate.Value=Convert.ToDateTime(find.GetValue(6).ToString());

ch=find.GetValue(7).ToString();

txtprogress.Text = (ProgressBar.Value).ToString() + "%";

if(ch== "Working on it")

toggleStateprj.Checked=false;

else

toggleStateprj.Checked=true;

cn.Close();

else

enterId i = new enterId();

i.ShowDialog();

Balasaheb Desai College, Patan Page 72


Human Resource Management System

private void btnFind_Click(object sender, EventArgs e)

find();

private void menuDashboard_Click(object sender, EventArgs e)

frmDashboard frmDashboard = new frmDashboard();

frmDashboard.Show();

this.Hide();

private void menuDepartments_Click(object sender, EventArgs e)

frmDepartments dep = new frmDepartments();

dep.Show();

this.Hide();

private void menuEmployee_Click(object sender, EventArgs e)

frmEmployee emp = new frmEmployee();

emp.Show();

this.Hide();

private void menuLeave_Click(object sender, EventArgs e)

Balasaheb Desai College, Patan Page 73


Human Resource Management System

frmLeavemanagement l = new frmLeavemanagement();

l.Show();

this.Hide();

private void menuPayroll_Click(object sender, EventArgs e)

frmPayroll fr = new frmPayroll();

fr.Show();

this.Hide();

private void logoutbtn_Click(object sender, EventArgs e)

Loginform f = new Loginform();

f.Show();

this.Hide();

public void cellcontent()

string state;

txtPrjid.Text = GridPrj.SelectedRows[0].Cells[0].Value.ToString();

txtPrjname.Text = GridPrj.SelectedRows[0].Cells[1].Value.ToString();

txtPrjhead.Text = GridPrj.SelectedRows[0].Cells[2].Value.ToString();

txtWorkingEmployees.Text =
GridPrj.SelectedRows[0].Cells[3].Value.ToString();

txtStartDate.Value =
Convert.ToDateTime(GridPrj.SelectedRows[0].Cells[4].Value.ToString());

ProgressBar.Value=
Convert.ToInt32(GridPrj.SelectedRows[0].Cells[5].Value.ToString());

txtEndDate.Value =
Convert.ToDateTime(GridPrj.SelectedRows[0].Cells[6].Value.ToString());

state = GridPrj.SelectedRows[0].Cells[7].Value.ToString();

Balasaheb Desai College, Patan Page 74


Human Resource Management System

txtprogress.Text = (ProgressBar.Value).ToString() + "%";

if (state == "Working on it")

toggleStateprj.Checked = false;

else

toggleStateprj.Checked = true;

private void GridPrj_CellContentClick(object sender,


DataGridViewCellEventArgs e)

cellcontent();

private void mnuReports_Click(object sender, EventArgs e)

frmReports frmReports = new frmReports();

frmReports.ShowDialog();

Balasaheb Desai College, Patan Page 75


Human Resource Management System

Leaves form Source code :


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
public partial class frmLeavemanagement : Form
{
public frmLeavemanagement()
{
InitializeComponent();
}
SqlConnection cn = new SqlConnection(@"Data
Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\pooja\source\repos\HRM
Application\Database\employee.mdf;Integrated Security=True;Connect Timeout=30");
string da;

private void txtEmpid_TextChanged(object sender, EventArgs e)


{
if (txtEmpid.Text != "")
{
cn.Open();
string strFind = "SELECT * FROM Employee WHERE Id=@id";
SqlCommand cmdFind = new SqlCommand(strFind, cn);
cmdFind.Parameters.AddWithValue("@id", txtEmpid.Text);
SqlDataReader find = cmdFind.ExecuteReader();
if (!find.HasRows)
{
frmNotfound ida = new frmNotfound();
ida.ShowDialog();

}
while (find.Read())
{
txtFname.Text = find[1].ToString();
txtMname.Text = find.GetValue(2).ToString();
txtLname.Text = find.GetValue(3).ToString();
txtDepartment.Text = find.GetValue(13).ToString();
}
cn.Close();
}
else
{
enterId i = new enterId();
i.ShowDialog();
}
}

//clear values in text box


private void clear()
{
txtleaveid.Text = " ";
txtEmpid.Text = "";
txtFname.Text = "";

Balasaheb Desai College, Patan Page 76


Human Resource Management System

txtMname.Text = "";
txtLname.Text = "";
txtDepartment.Text ="";
txtLeavetype.SelectedItem = null;
}

//find maximum of the leaveid


private void MAX()
{
cn.Open();
string strMAX = "SELECT MAX(LeaveId)+1 FROM AppliedLeave";
SqlCommand cmdMAX = new SqlCommand(strMAX, cn);
SqlDataReader drMAX = cmdMAX.ExecuteReader();
while (drMAX.Read())
{
txtleaveid.Text = drMAX[0].ToString();
}
cn.Close();
}

private void btnFind_Click(object sender, EventArgs e)


{
if (txtEmpid.Text != "" && txtFname.Text != "" && txtMname.Text != ""
&& txtLname.Text != "" && txtDepartment.Text != "")
{
cn.Open();
string strsave = "insert into AppliedLeave
values(@leaveid,@empid,@fname,@mname,@lname,@department,@leavetype,@fromdate,@tod
ate,@total_leave_count)";
SqlCommand cmd = new SqlCommand(strsave, cn);
cmd.Parameters.AddWithValue("@leaveid", txtleaveid.Text);
cmd.Parameters.AddWithValue("@empid", txtEmpid.Text);
cmd.Parameters.AddWithValue("@fname", txtFname.Text);
cmd.Parameters.AddWithValue("@mname", txtMname.Text);
cmd.Parameters.AddWithValue("@lname", txtLname.Text);
cmd.Parameters.AddWithValue("@department", txtDepartment.Text);
cmd.Parameters.AddWithValue("@leavetype", txtLeavetype.Text);
cmd.Parameters.AddWithValue("@fromdate", txtDfrom.Value);
cmd.Parameters.AddWithValue("@todate", txtDto.Value);

cmd.Parameters.AddWithValue("@total_leave_count",(txtDto.Value.Subtract(
txtDfrom.Value)).TotalDays);
cmd.ExecuteNonQuery();
cn.Close();
updateempleaves();
frmlapplied s = new frmlapplied();
s.ShowDialog();
clear();
MAX();

else
{
frmError er = new frmError();
er.Show();
}
}

private void updateempleaves()


{

cn.Open();

Balasaheb Desai College, Patan Page 77


Human Resource Management System

string daysc = "SELECT Present_Days FROM Payroll";


SqlCommand cmdd = new SqlCommand(daysc, cn);
SqlDataReader drd = cmdd.ExecuteReader();
while (drd.Read())
{
da = drd[0].ToString();
}
cn.Close();

cn.Open();
string str = "UPDATE Payroll SET Present_Days=@pd WHERE Emp_id=@id";
SqlCommand cmd = new SqlCommand(str, cn);
cmd.Parameters.AddWithValue("@pd", Convert.ToInt32(da)-
Convert.ToInt32(txtDto.Value.Subtract(txtDfrom.Value).TotalDays));
cmd.Parameters.AddWithValue("@id",txtEmpid.Text);
cn.Close();
}

private void Exit_Click(object sender, EventArgs e)


{
sharedclass s = new sharedclass();
s.exitbtn();
}

private void label7_Click(object sender, EventArgs e)


{
frmDashboard frmDashboard = new frmDashboard();
frmDashboard.Show();
this.Hide();
}

private void menuDepartments_Click(object sender, EventArgs e)


{
frmDepartments dep = new frmDepartments();
dep.Show();
this.Hide();
}

private void menuEmployee_Click(object sender, EventArgs e)


{
frmEmployee emp = new frmEmployee();
emp.Show();
this.Hide();
}

private void frmLeavemanagement_Load(object sender, EventArgs e)


{
MAX();
}

private void menuLeave_Click(object sender, EventArgs e)


{

private void menuPayroll_Click(object sender, EventArgs e)


{
frmPayroll fr = new frmPayroll();
fr.Show();
this.Hide();
}

private void menuProjects_Click(object sender, EventArgs e)

Balasaheb Desai College, Patan Page 78


Human Resource Management System

{
frmProjects pr = new frmProjects();
pr.show();
this.Hide();
}

private void guna2GradientButton1_Click(object sender, EventArgs e)


{
Loginform f = new Loginform();
f.Show();
this.Hide();
}

private void mnuReports_Click(object sender, EventArgs e)


{
frmReports frmReports = new frmReports();
frmReports.ShowDialog();
}
}
}

Balasaheb Desai College, Patan Page 79


Human Resource Management System

Payroll form Source code :

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Data.SqlClient;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace WindowsFormsApp1

public partial class frmPayroll : Form

public frmPayroll()

InitializeComponent();

SqlConnection cn = new SqlConnection(@"Data


Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\pooja\source\repos\HRM
Application\Database\employee.mdf;Integrated Security=True;Connect Timeout=30");

//to clear the textbox values

private void clear()

txtPaymentid.Text= "";

txtEmpid.Text = "";

txtFname.Text = "";

txtMname.Text = "";

txtLname.Text = "";

Balasaheb Desai College, Patan Page 80


Human Resource Management System

txtDepartment.Text = "";

txtDesignation.Text = "";

txtMonth.Text = "";

txtPresentdays.Text = "";

txtSalary.Text = "";

txtbonus.Text = "";

txtTotalSalary.Text = "";

txtMonth.Text = DateTime.Now.ToString("MMMM");

//emp id max value

private void MAX()

cn.Open();

string strMAX = "SELECT MAX(Payment_id)+1 FROM Payroll";

SqlCommand cmdMAX = new SqlCommand(strMAX, cn);

SqlDataReader drMAX = cmdMAX.ExecuteReader();

while (drMAX.Read())

txtPaymentid.Text = drMAX[0].ToString();

cn.Close();

private void findEmp()

if (txtEmpid.Text != "")

cn.Open();

string strFind = "SELECT * FROM Employee WHERE Id=@id";

SqlCommand cmdFind = new SqlCommand(strFind, cn);

cmdFind.Parameters.AddWithValue("@id", txtEmpid.Text);

Balasaheb Desai College, Patan Page 81


Human Resource Management System

SqlDataReader find = cmdFind.ExecuteReader();

if (!find.HasRows)

frmNotfound ida = new frmNotfound();

ida.ShowDialog();

try

while (find.Read())

txtFname.Text = find[1].ToString();

txtMname.Text = find.GetValue(2).ToString();

txtLname.Text = find.GetValue(3).ToString();

txtDesignation.Text = find.GetValue(12).ToString();

txtDepartment.Text = find.GetValue(13).ToString();

catch( Exception )

errordatatype er = new errordatatype();

er.ShowDialog();

cn.Close();

else

enterId i = new enterId();

i.ShowDialog();

Balasaheb Desai College, Patan Page 82


Human Resource Management System

private void Payroll_Load(object sender, EventArgs e)

MAX();

txtMonth.Text = DateTime.Now.ToString("MMMM");

private void txtEmpid_TextChanged(object sender, EventArgs e)

findEmp();

private void Exit_Click(object sender, EventArgs e)

sharedclass s = new sharedclass();

s.exitbtn();

private void btnNew_Click(object sender, EventArgs e)

clear();

MAX();

private void btnSave_Click(object sender, EventArgs e)

try

if (txtPaymentid.Text != "" && txtEmpid.Text != "" &&


txtFname.Text != "" && txtMname.Text != "" && txtLname.Text != "" &&
txtDepartment.Text != "" && txtDesignation.Text != "" && txtMonth.Text != "" &&
txtPresentdays.Text != "" && txtSalary.Text != "" && txtbonus.Text != "" &&
txtTotalSalary.Text != "")

Balasaheb Desai College, Patan Page 83


Human Resource Management System

cn.Open();

string strsave = "insert into Payroll values


(@Pid,@id,@fname,@mname,@lname,@Department,@Designation,@paymentdate,@month,@pres
entdays,@salary,@bonus,@totalSalary)";

SqlCommand cmd = new SqlCommand(strsave, cn);

cmd.Parameters.AddWithValue("@Pid", txtPaymentid.Text);

cmd.Parameters.AddWithValue("@id", txtEmpid.Text);

cmd.Parameters.AddWithValue("@fname", txtFname.Text);

cmd.Parameters.AddWithValue("@mname", txtMname.Text);

cmd.Parameters.AddWithValue("@lname", txtLname.Text);

cmd.Parameters.AddWithValue("@Department",
txtDepartment.Text);

cmd.Parameters.AddWithValue("@Designation",
txtDesignation.Text);

cmd.Parameters.AddWithValue("@paymentdate",
DateTime.Now.Date);

cmd.Parameters.AddWithValue("@month", txtMonth.Text);

cmd.Parameters.AddWithValue("@presentdays",
txtPresentdays.Text);

cmd.Parameters.AddWithValue("@salary", txtSalary.Text);

cmd.Parameters.AddWithValue("@bonus", txtbonus.Text);

cmd.Parameters.AddWithValue("@totalSalary",
txtTotalSalary.Text);

cmd.ExecuteNonQuery();

cn.Close();

frmsaved s = new frmsaved();

s.ShowDialog();

clear();

MAX();

else

frmError er = new frmError();

Balasaheb Desai College, Patan Page 84


Human Resource Management System

er.Show();

catch

private void btnUpdate_Click(object sender, EventArgs e)

try

if (txtPaymentid.Text != "" && txtEmpid.Text != "" &&


txtFname.Text != "" && txtMname.Text != "" && txtLname.Text != "" &&
txtDepartment.Text != "" && txtDesignation.Text != "" && txtMonth.Text != "" &&
txtPresentdays.Text != "" && txtSalary.Text != "" && txtbonus.Text != "" &&
txtTotalSalary.Text != "")

cn.Open();

string strsave = "UPDATE Payroll SET


Emp_id=@id,Fname=@fname,Mname=@mname,Lname=@lname,Department=@Department,Designat
ion=@Designation,Date_of_payment=@paymentdate,Month=@month,Present_Days=@presentd
ays,Salary=@salary,Bonus=@bonus,Total_Salary=@totalSalary WHERE Payment_id=@Pid";

SqlCommand cmd = new SqlCommand(strsave, cn);

cmd.Parameters.AddWithValue("@id", txtEmpid.Text);

cmd.Parameters.AddWithValue("@fname", txtFname.Text);

cmd.Parameters.AddWithValue("@mname", txtMname.Text);

cmd.Parameters.AddWithValue("@lname", txtLname.Text);

cmd.Parameters.AddWithValue("@Department",
txtDepartment.Text);

cmd.Parameters.AddWithValue("@Designation",
txtDesignation.Text);

Balasaheb Desai College, Patan Page 85


Human Resource Management System

cmd.Parameters.AddWithValue("@paymentdate",
DateTime.Now.Date);

cmd.Parameters.AddWithValue("@month", txtMonth.Text);

cmd.Parameters.AddWithValue("@presentdays",
txtPresentdays.Text);

cmd.Parameters.AddWithValue("@salary", txtSalary.Text);

cmd.Parameters.AddWithValue("@bonus", txtbonus.Text);

cmd.Parameters.AddWithValue("@totalSalary", txtTotalSalary);

cmd.Parameters.AddWithValue("@Pid", txtPaymentid.Text);

cmd.ExecuteNonQuery();

cn.Close();

frmUpdate s = new frmUpdate();

s.ShowDialog();

clear();

MAX();

else

frmError er = new frmError();

er.Show();

catch(Exception ex)

MessageBox.Show(ex.Message);

cn.Close();

private void menuEmployee_Click(object sender, EventArgs e)

frmEmployee emp = new frmEmployee();

Balasaheb Desai College, Patan Page 86


Human Resource Management System

emp.Show();

this.Hide();

private void label7_Click(object sender, EventArgs e)

frmDashboard frmDashboard = new frmDashboard();

frmDashboard.Show();

this.Hide();

private void menuDepartments_Click(object sender, EventArgs e)

frmDepartments dep = new frmDepartments();

dep.Show();

this.Hide();

private void menuLeave_Click(object sender, EventArgs e)

frmLeavemanagement l = new frmLeavemanagement();

l.Show();

this.Hide();

private void label6_MouseHover(object sender, EventArgs e)

stick.Visible = true;

Balasaheb Desai College, Patan Page 87


Human Resource Management System

private void stick_MouseLeave(object sender, EventArgs e)

stick.Visible=false;

private void label6_Click(object sender, EventArgs e)

frmPayrolldata d = new frmPayrolldata();

d.ShowDialog();

private void menuPayroll_Click(object sender, EventArgs e)

frmPayroll p = new frmPayroll();

p.Show();

this.Hide();

private void menuProjects_Click(object sender, EventArgs e)

frmProjects p = new frmProjects();

p.show();

this.Hide();

private void guna2GradientButton1_Click(object sender, EventArgs e)

Loginform f = new Loginform();

f.Show();

this.Hide();

Balasaheb Desai College, Patan Page 88


Human Resource Management System

private void projmenu_Click(object sender, EventArgs e)

frmProjects proj = new frmProjects();

proj.Show();

this.Hide();

private void txtbonus_Leave(object sender, EventArgs e)

try

if (txtbonus.Text != null)

int firstValue = Convert.ToInt32(txtSalary.Text);

int secondValue = Convert.ToInt32(txtbonus.Text);

int sum = firstValue + secondValue;

txtTotalSalary.Text = sum.ToString();

else

MessageBox.Show("insert Bonus");

catch

private void txtPresentdays_Leave(object sender, EventArgs e)

Balasaheb Desai College, Patan Page 89


Human Resource Management System

try

int a = Convert.ToInt32(txtPresentdays.Text);

if (a > 27)

MessageBox.Show("Present Days should be less than 28");

catch

private void mnuReports_Click(object sender, EventArgs e)

frmReports frmReports = new frmReports();

frmReports.ShowDialog();

Balasaheb Desai College, Patan Page 90


Human Resource Management System

Payroll Report form Source code :

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
public partial class frmPayrolldata : Form
{
public frmPayrolldata()
{
InitializeComponent();
}
string[] month = { "January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November", "December" };
String[] department = { "HR", "Sales", "Manufacture", "IT","Collection"};

SqlConnection cn = new SqlConnection(@"Data


Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\pooja\source\repos\HRM
Application\Database\employee.mdf;Integrated Security=True;Connect Timeout=30");
public void show()
{
cn.Open();
string s = "select * from Payroll";
SqlDataAdapter sa = new SqlDataAdapter(s, cn);
SqlCommandBuilder b = new SqlCommandBuilder(sa);
var ds = new DataSet();
sa.Fill(ds);
gridpayroll.DataSource = ds.Tables[0];
cn.Close();
}

public void sort()


{
if (rdodepartment.Checked == true)
{
cn.Open();
string s = "select * from Payroll WHERE Department = '" +
txtsort.Text + "' ";
SqlDataAdapter sa = new SqlDataAdapter(s, cn);
SqlCommandBuilder b = new SqlCommandBuilder(sa);
var ds = new DataSet();
sa.Fill(ds);
gridpayroll.DataSource = ds.Tables[0];
if (ds.Tables[0].Rows.Count == 0)
{
frmNotfound ida = new frmNotfound();
ida.ShowDialog();
}
cn.Close();
}
else if(rdomonth.Checked==true)

Balasaheb Desai College, Patan Page 91


Human Resource Management System

{
cn.Open();
string s = "select * from Payroll WHERE Month = '" + txtsort.Text
+ "' ";
SqlDataAdapter sa = new SqlDataAdapter(s, cn);
SqlCommandBuilder b = new SqlCommandBuilder(sa);
var ds = new DataSet();
sa.Fill(ds);
gridpayroll.DataSource = ds.Tables[0];
if( ds.Tables[0].Rows.Count == 0)
{
frmNotfound ida = new frmNotfound();
ida.ShowDialog();
}
cn.Close();
}
else
{
frmSortError er = new frmSortError();
er.ShowDialog();
}
}

private void frmPayrolldata_Load(object sender, EventArgs e)


{
show();
}

private void guna2GradientCircleButton1_Click(object sender, EventArgs e)


{
this.Close();
}

private void rdodepartment_Click(object sender, EventArgs e)


{
txtsort.Items.Clear();
for (int i = 0; i < 5; i++)
{
txtsort.Items.Add(department[i]);
}

private void rdomonth_CheckedChanged(object sender, EventArgs e)


{
txtsort.Items.Clear();
for(int i = 0; i < 12; i++)
{
txtsort.Items.Add(month[i]);
}
}

private void btnSort_Click(object sender, EventArgs e)


{
sort();
rdodepartment.Checked = false;
rdomonth.Checked = false;
txtsort.SelectedItem = null;
txtsort.Items.Clear();
}

Balasaheb Desai College, Patan Page 92


Human Resource Management System

private void Searchbox_KeyDown(object sender, KeyEventArgs e)


{
if (e.KeyCode == Keys.Enter)
{
cn.Open();
string s = "select * from Payroll WHERE Fname LIKE '" +
Searchbox.Text + "%' ";
SqlDataAdapter sa = new SqlDataAdapter(s, cn);
SqlCommandBuilder b = new SqlCommandBuilder(sa);
var ds = new DataSet();
sa.Fill(ds);
gridpayroll.DataSource = ds.Tables[0];
if (ds.Tables[0].Rows.Count == 0)
{
frmNotfound ida = new frmNotfound();
ida.ShowDialog();
}
cn.Close();
Searchbox.Text = "";
}
}

private void guna2ImageButton1_MouseHover(object sender, EventArgs e)


{

private void btnRefresh_Click(object sender, EventArgs e)


{
show();
Searchbox.Text = "";
rdodepartment.Checked = false;
rdomonth.Checked = false;
txtsort.SelectedItem = null;
}
}
}

Balasaheb Desai College, Patan Page 93


Human Resource Management System

Balasaheb Desai College, Patan


Student Guide Meet Record

2022-2023

Title of Project Class:


Human Resource Management BCA-III

Student Names 1)Abhishek Madhukar Kadam Guide Name:


2)Khade Harshad Dattatray
3)Janugade Omkar Avinash Mr.Sutar.A.T

S. Signature of Signature of Guide


Date Description
N. Guide Students Remark
1 Problem Identification and
Topicand title finalization
( 1st week of semester)

2 SRS submission and


approval( 6th week of
semester)
3 Logical Design of System
(DFD, System flowchart,
ERD,UML diagram,
Decision tables, Decision
tree ,site map which is
applicable)
(7th week of Semester)
4 Database Design
((8th week of Semester))

5 I/O Design (with Reports)


(10th of Semester)
6 Submission of
DraftProject
Report
(11th Week of semester )
7 Submission of
FinalProject
Report
(12th Week of semester )

HOD/ Director/Principal

Balasaheb Desai College, Patan Page 94

You might also like