SlideShare una empresa de Scribd logo
1 de 31
1
A
Project Report
On
“Employee Management System”
Submitted in the partial fulfillment of the requirement
For the award of Diploma of
COMPUTER ENGINEERING
(Batch: 2014-2017)
G.B.N GOVT. POLYTECHNIC, NILOKHERI
Submitted by:-
Toshant Arora(14009080095)
Shubham (14009080088)
Tulsi Sharma(14009080096)
2
INDEX
TABLE OF CONTENTS
1. PROJECT DESCRIPTION
 Introduction
 Scope of project
 Objective of project
3. SNAPSHOT
 CONCLUSION
 FUTURE SCOPE
 REFERENCES
PROJECT DESCRIPTION
Objective of C# project on Employee Management System :-
The main objective of the C# project on Employee Management is to
Manage the details of information, leaves, salaries, login, employee. It
manages all the information about information, experience, employee,
information. The project is totally built at administrative end thus only
administrator is guaranteed the access. The purpose of the project is to
build an application program to reduce the manual work for managing the
informations, leaves, salary. It tracks all the details about the salary, login,
employee.
Functionalities provided by C# project on Employee Management
system are as follows:
1).Provides the searching facilities based on various factors. Such as
information, salary, Login, Employee
2).It tracks all the information of leaves, Login etc
3).Manage the information of Leaves
4).Shows the information and description of the information, Salary
5).To increase efficiency of managing the information, leaves
3
6).Editing, adding and updating of Records is improved which results in
proper resource management of information of data.
7).Manage the information of login.
8).Integration of all records of employee.
Input Data and Validation –
1) All the fields such as Salary, Employee and leave are validated and
don’t take invalid arguments.
2) Each form like Employee, Salary don’t take blank values.
3) Avoiding errors in data.
4) Controlling amount of input.
Scope of the Project:-
For all the s/w there is always a scope of future enhancements. There are
few enhancements which are pointed out in the proposed system. They are
as follows:
1. Module for Employee Loan.
2. Modules for proper arrangement of attendance of employees.
3. Introducing online version of the Software.
4. Introducing software for Employees side also.
5. More proper salary calculations based on various factors.
Objectives of the Project:-
 Time and Cost Effective – Software is making the process of keeping database
time and cost effective by making it easy to alter or update database and also keeping
that safe.
 Database Creation - A database of the registered users will be created and this
will help the users to fetch the details of Computer Center.
4
 Flexibility – Database provides flexibility to administrator..Records can be
inserted, deleted or updated with just a click.
 Informative - The software has all the necessary details about the Students and
Courses and provides all the relevant information therefore. For example, searching
of appropriate Student for like admission and then the information of admission is
added to Students records.
 Security - Proper authorization and authentication provisions have been made for
the security of the software so that only the registered administrators can look the
Information. Without proper login no one is allowed to access this software.
Snap shots
Welcome Page
5
Fig.3.12: login page
Table of Login Page:
Table 1: Login page
6
Fig.3.13: Employee Info Page
Table of Course Info page:
Table of Employee Info page
7
Salary page
Table of salary page
8
Leave page
Table of leave page
9
Forgot Password Page
10
Fig.3.14: Home Page
Welcome Page Coding :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Employees
{
public partial class Welcome : Form
{
public Welcome()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
}
private void Welcome_Load(object sender, EventArgs e)
{
}
private void timer2_Tick(object sender, EventArgs e)
{
try
{
progressBar1.Value = progressBar1.Value + 1;
label1.Text = progressBar1.Value.ToString() + ("% completed");
if (progressBar1.Value == 100)
{
this.Hide();
Loginf1 login = new Loginf1();
login.Show();
timer2.Stop();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
11
}
}
}
}
Login page coding :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Employees
{
public partial class Loginf1 : Form
{
public static string data;
public static string value;
SqlConnection con = new SqlConnection("Data Source=(local);Initial
Catalog=Databasefinal;Integrated Security=True;Pooling=False");
public Loginf1()
{
InitializeComponent();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
e)
{
this.Hide();
CreateAccount create = new CreateAccount();
create.Show();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
e)
{
this.Hide();
ForgotPassword forgot = new ForgotPassword();
forgot.Show();
}
12
private void Loginf1_Load(object sender, EventArgs e)
{
panel1.BackColor = Color.FromArgb(125, panel1.BackColor);
}
private void button1_Click_1(object sender, EventArgs e)
{
}
private void button1_Click_2(object sender, EventArgs e)
{
try
{
if ((textBox1.Text != "") && (textBox2.Text != ""))
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "checkuser";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
con.Open();
cmd.Parameters.AddWithValue("@username", textBox1.Text);
cmd.Parameters.AddWithValue("@password", textBox2.Text);
SqlParameter status = new SqlParameter("@status", SqlDbType.Char, 1);
status.Direction = ParameterDirection.Output;
cmd.Parameters.Add(status);
SqlParameter ret = new SqlParameter("@ret", SqlDbType.Int);
ret.Direction = ParameterDirection.ReturnValue;
cmd.Parameters.Add(ret);
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
Int32 r = Convert.ToInt32(cmd.Parameters["@ret"].Value);
String st = cmd.Parameters["@status"].Value.ToString();
if (r == 0)
{
MessageBox.Show("Wrong
Username","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
else if (r == -1)
{
MessageBox.Show("Wrong
Password","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
else if(r==1)
{
if (st == "A")
{
data = textBox1.Text;
this.Hide();
EmployeeManagementSystem emp = new
EmployeeManagementSystem();
13
emp.Show();
}
else if (st == "U")
{
this.Hide();
EmployeeManagementSystem emp = new
EmployeeManagementSystem();
emp.Show();
}
}
}
else
{
MessageBox.Show("Please Enter Username and Password", "Warning");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString(),"Warning",MessageBoxButtons.OK,MessageBoxIcon.Warni
ng);
}
finally
{
con.Close();
}
}
private void linkLabel2_LinkClicked_1(object sender,
LinkLabelLinkClickedEventArgs e)
{
this.Hide();
CreateAccount create = new CreateAccount();
create.Show();
}
private void linkLabel1_LinkClicked_1(object sender,
LinkLabelLinkClickedEventArgs e)
{
this.Hide();
ForgotPassword forgot = new ForgotPassword();
forgot.Show();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
button3.Hide();
14
button2.Show();
textBox2.UseSystemPasswordChar = true;
}
private void button2_Click(object sender, EventArgs e)
{
button2.Hide();
button3.Show();
textBox2.UseSystemPasswordChar = false;
}
private void textBox1_Enter(object sender, EventArgs e)
{
if(textBox1.Text=="User Name")
{
textBox1.Text = "";
textBox1.ForeColor = Color.Black;
}
}
private void textBox1_Leave(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
textBox1.Text = "User Name";
textBox1.ForeColor = Color.DarkGray;
}
}
private void textBox2_Enter(object sender, EventArgs e)
{
if (textBox2.Text == "Password")
{
textBox2.Text = "";
textBox2.ForeColor = Color.Black;
}
}
private void textBox2_Leave(object sender, EventArgs e)
{
if (textBox2.Text == "")
{
textBox2.Text = "Password";
textBox2.ForeColor = Color.DarkGray;
}
}
private void linkLabel2_LinkClicked_2(object sender,
LinkLabelLinkClickedEventArgs e)
{
this.Hide();
CreateAccount create = new CreateAccount();
create.Show();
}
15
private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
e)
{
value = "Guest Account";
this.Hide();
EmployeeManagementSystem emp = new EmployeeManagementSystem();
emp.Show();
}
}
}
Employee Info page Coding :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
namespace Employees
{
public partial class EmployeeInfo : Form
{
string imgelocation = "";
SqlConnection con = new SqlConnection("Data Source=(local);Initial
Catalog=Databasefinal;Integrated Security=True;Pooling=False");
public EmployeeInfo()
{
InitializeComponent();
}
private void Departmentlist()
{
SqlDataAdapter adp = new SqlDataAdapter("Select * from Tb_Department", con);
DataSet ds=new DataSet();
adp.Fill(ds);
comboBox2.DataSource = ds.Tables[0].DefaultView;
comboBox2.DisplayMember = "Department_Name";
comboBox2.ValueMember="Department_Id";
}
private void Reset()
{
textBox2.Text = "";
comboBox2.SelectedItem=null ;
textBox1.Text = "";
textBox4.Text = "";
maskedTextBox1.Text = "";
textBox6.Text = "";
textBox7.Text = "";
textBox5.Text = "";
16
richTextBox1.Text = "";
dateTimePicker1.ResetText();
dateTimePicker2.ResetText();
dateTimePicker3.ResetText();
comboBox1.ResetText();
}
private void EmployeeInfo_Load(object sender, EventArgs e)
{
try
{
groupBox1.BackColor = Color.FromArgb(125, groupBox1.BackColor);
groupBox2.BackColor = Color.FromArgb(125, groupBox2.BackColor);
Employeelist();
Departmentlist();
Reset();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
private Int32 MaxId()
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "Select isnull(Max(Emp_Id),0) from Tb_Employee where
Department_Name='"+comboBox2.SelectedValue+"'";
cmd.Connection = con;
con.Open();
Int32 Id = Convert.ToInt32(cmd.ExecuteScalar()) + 1;
cmd.Dispose();
con.Close();
return Id;
}
private void button3_Click(object sender, EventArgs e)
{
Reset();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
byte[] images = null;
FileStream Streem = new FileStream(imgelocation, FileMode.Open,
FileAccess.Read);
BinaryReader brs = new BinaryReader(Streem);
images = brs.ReadBytes((int)Streem.Length);
SqlCommand cmd = new SqlCommand();
17
cmd.CommandText = "insert into
Tb_Employee(Emp_Id,Emp_Name,Department_Name,Job_Title,Mobile,Email_Id,Address,Joining_Dat
e,Gender,DOB,Leaving_Date,Salary,Image,Total_Leave)Values(@empid,@empname,@departmentname
,@jobtitle,@mobile,@emailid,@address,@joiningdate,@gender,@dob,@leavingdate,@salary,@imag
e,@totalleave)";
cmd.Connection = con;
con.Open();
cmd.Parameters.AddWithValue("@empid", textBox1.Text);
cmd.Parameters.AddWithValue("@empname", textBox2.Text);
cmd.Parameters.AddWithValue("@departmentname",comboBox2.SelectedValue);
cmd.Parameters.AddWithValue("@jobtitle", textBox4.Text);
cmd.Parameters.AddWithValue("@totalleave", textBox5.Text);
cmd.Parameters.AddWithValue("@mobile", maskedTextBox1.Text);
cmd.Parameters.AddWithValue("@emailid", textBox6.Text);
cmd.Parameters.AddWithValue("@address", richTextBox1.Text);
cmd.Parameters.AddWithValue("@joiningdate", dateTimePicker1.Value);
cmd.Parameters.AddWithValue("@gender", comboBox1.SelectedItem);
cmd.Parameters.AddWithValue("@dob", dateTimePicker2.Value);
cmd.Parameters.AddWithValue("@leavingdate", dateTimePicker3.Value);
cmd.Parameters.AddWithValue("@salary", textBox7.Text);
cmd.Parameters.Add(new SqlParameter("@image", images));
int N = cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
Employeelist();
Reset();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
con.Close();
}
}
private void Employeelist()
{
SqlDataAdapter adp = new SqlDataAdapter("Select * from Tb_Employee where
Department_Name='"+comboBox2.SelectedValue+"'", con);
DataSet ds = new DataSet();
adp.Fill(ds);
dataGridView1.DataSource = ds.Tables[0].DefaultView;
}
private void pictureBox1_Click(object sender, EventArgs e)
{
try
{
OpenFileDialog open = new OpenFileDialog();
open.InitialDirectory = "C:";
18
open.Filter = "png files(*.png)|jpg files(*.jpg|All files(*.*)|*.*";
if (open.ShowDialog() == DialogResult.OK)
{
imgelocation = open.FileName.ToString();
pictureBox1.ImageLocation = imgelocation;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
con.Close();
}
}
private void button2_Click(object sender, EventArgs e)
{
try
{
byte[] images = null;
FileStream Streem = new FileStream(imgelocation, FileMode.Open,
FileAccess.Read);
BinaryReader brs = new BinaryReader(Streem);
images = brs.ReadBytes((int)Streem.Length);
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "update Tb_Employee set
Emp_Name=@empname,Job_Title=@jobtitle,Mobile=@mobile,Email_Id=@emailid,Joining_Date=@join
ingdate,Address=@address,DOB=@dob,Salary=@salary,Gender=@gender,Department_Id=@department
id,Leaving_Date=@leavingdate,Image=@image where Emp_Id=@empid";
cmd.Connection = con;
con.Open();
cmd.Parameters.AddWithValue("@empid", textBox1.Text);
cmd.Parameters.AddWithValue("@empname", textBox2.Text);
cmd.Parameters.AddWithValue("@departmentname", comboBox2.SelectedValue);
cmd.Parameters.AddWithValue("@jobtitle", textBox4.Text);
cmd.Parameters.AddWithValue("@mobile", maskedTextBox1.Text);
cmd.Parameters.AddWithValue("@emailid", textBox6.Text);
cmd.Parameters.AddWithValue("@address", richTextBox1.Text);
cmd.Parameters.AddWithValue("@joiningdate", dateTimePicker1.Value);
cmd.Parameters.AddWithValue("@gender", comboBox1.SelectedItem);
cmd.Parameters.AddWithValue("@dob", dateTimePicker2.Value);
cmd.Parameters.AddWithValue("@leavingdate", dateTimePicker3.Value);
cmd.Parameters.AddWithValue("@salary", textBox7.Text);
cmd.Parameters.Add(new SqlParameter("@image", images));
int N = cmd.ExecuteNonQuery();
19
cmd.Dispose();
con.Close();
Reset();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
con.Close();
}
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
textBox2.Text = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
comboBox2.SelectedItem =
dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
textBox4.Text = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
maskedTextBox1.Text =
dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString();
textBox6.Text = dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString();
textBox7.Text =
dataGridView1.Rows[e.RowIndex].Cells[11].Value.ToString();
textBox5.Text =
dataGridView1.Rows[e.RowIndex].Cells[13].Value.ToString();
richTextBox1.Text =
dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString();
comboBox1.SelectedItem=
dataGridView1.Rows[e.RowIndex].Cells[8].Value.ToString();
dateTimePicker1.Text =
dataGridView1.Rows[e.RowIndex].Cells[7].Value.ToString();
dateTimePicker2.Text =
dataGridView1.Rows[e.RowIndex].Cells[9].Value.ToString();
dateTimePicker3.Text =
dataGridView1.Rows[e.RowIndex].Cells[10].Value.ToString();
byte[] Images=new byte[0];
SqlDataAdapter adp = new SqlDataAdapter("Select Image from Tb_Employee
where Emp_Id='" + textBox1.Text + "'", con);
SqlCommand cmd = new SqlCommand("Select Image from Tb_Employee where
Emp_Id='" + textBox1.Text + "'", con);
cmd.CommandType=CommandType.Text;
DataSet ds = new DataSet();
adp.Fill(ds);
foreach(DataRow dr in ds.Tables[0].Rows)
{
Images=(byte[])dr["Image"];
}
20
byte[] imgData=Images;
MemoryStream stream = new MemoryStream(imgData);
pictureBox1.Image=Image.FromStream(stream);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
con.Close();
}
}
private void button4_Click(object sender, EventArgs e)
{
try
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "delete from Tb_Employee where Emp_Id=@empid";
cmd.Connection = con;
con.Open();
cmd.Parameters.AddWithValue("@empid", textBox1.Text);
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
Reset();
Employeelist();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
private void button5_Click_1(object sender, EventArgs e)
{
try
{
this.Hide();
EmployeeManagementSystem emp = new EmployeeManagementSystem();
emp.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
21
{
try
{
textBox1.Text = MaxId().ToString();
Employeelist();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
}
Client Info page coding :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Employees
{
public partial class ClientInfo : Form
{
SqlConnection con = new SqlConnection("Data Source=(local);Initial
Catalog=Databasefinal;Integrated Security=True;Pooling=False");
public ClientInfo()
{
InitializeComponent();
}
private void ClientInfo_Load(object sender, EventArgs e)
{
try
{
panel1.BackColor = Color.FromArgb(125, panel1.BackColor);
Clientlist();
Reset();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
private Int32 MaxId()
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "Select isnull(Max(Client_Id),0) from Tb_Client";
cmd.Connection = con;
con.Open();
22
Int32 i = Convert.ToInt32(cmd.ExecuteScalar()) + 1;
cmd.Dispose();
con.Close();
return i;
}
private void Clientlist()
{
SqlDataAdapter adp = new SqlDataAdapter("Select * from Tb_Client", con);
DataSet ds = new DataSet();
adp.Fill(ds);
dataGridView1.DataSource = ds.Tables[0].DefaultView;
}
private void Reset()
{
textBox1.Text = MaxId().ToString(); ;
textBox2.Text = "";
textBox3.Text = "";
richTextBox1.ResetText();
maskedTextBox1.ResetText();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "insert into
Tb_Client(Client_Id,Client_Name,Address,Contact_No,Email_Id)
Values(@clientid,@clientname,@address,@contactno,@emailid)";
cmd.Connection = con;
con.Open();
cmd.Parameters.AddWithValue("@clientid", textBox1.Text);
cmd.Parameters.AddWithValue("@clientname", textBox2.Text);
cmd.Parameters.AddWithValue("@address", richTextBox1.Text);
cmd.Parameters.AddWithValue("@contactno", maskedTextBox1.Text);
cmd.Parameters.AddWithValue("@emailid", textBox3.Text);
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
Reset();
Clientlist();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
con.Close();
}
}
23
private void button3_Click(object sender, EventArgs e)
{
try
{
Reset();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
private void button2_Click(object sender, EventArgs e)
{
try
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "Delete from Tb_Client where Client_Id=@clientid";
cmd.Connection = con;
con.Open();
cmd.Parameters.AddWithValue("@clientid", textBox1.Text);
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
Reset();
Clientlist();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
con.Close();
}
}
private void button4_Click(object sender, EventArgs e)
{
try
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "update Tb_Client set
Client_Name=@clientname,Address=@address,Contact_No=@contactno,Email_Id=@emailid where
Client_Id=@clientid";
cmd.Connection = con;
con.Open();
cmd.Parameters.AddWithValue("@clientname", textBox2.Text);
cmd.Parameters.AddWithValue("@clientid", textBox1.Text);
cmd.Parameters.AddWithValue("@address", richTextBox1.Text);
cmd.Parameters.AddWithValue("@contactno", maskedTextBox1.Text);
cmd.Parameters.AddWithValue("@emailid", textBox3.Text);
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
Reset();
24
Clientlist();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
con.Close();
}
}
private void button5_Click(object sender, EventArgs e)
{
try
{
this.Hide();
EmployeeManagementSystem emp = new EmployeeManagementSystem();
emp.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
textBox2.Text = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
richTextBox1.Text =
dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
maskedTextBox1.Text =
dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
textBox3.Text = dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
}
Leave page Coding :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
25
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Employees
{
public partial class Leave : Form
{
SqlConnection con = new SqlConnection("Data Source=(local);Initial
Catalog=Databasefinal;Integrated Security=True;Pooling=False");
public Leave()
{
InitializeComponent();
}
private void Leave_Load(object sender, EventArgs e)
{
Leavelist();
Reset();
}
private void Leavelist()
{
string query = "Select
E.Emp_Id,E.Emp_Name,L.Leave_From,L.Leave_To,L.Leave_Reason,L.Leave_Days,L.Total_Leave
from Tb_Employee E,Tb_Leave L where E.Emp_Id=L.Emp_Id";
SqlDataAdapter adp = new SqlDataAdapter(query, con);
DataSet ds = new DataSet();
adp.Fill(ds);
dataGridView1.DataSource = ds.Tables[0].DefaultView;
con.Close();
}
private void Reset()
{
textBox1.Text = "";
textBox2.Text = "";
dateTimePicker1.ResetText();
dateTimePicker2.ResetText();
richTextBox1.Text = "";
label7.Text = " 0";
}
private void button1_Click(object sender, EventArgs e)
{
try
{
con.Close();
26
if (dateTimePicker2.Value > dateTimePicker1.Value)
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "insert into
Tb_Leave(Emp_Id,Leave_From,Leave_To,Leave_Reason,Leave_Days,Total_Leave)Values(@empid,@le
avefrom,@leaveto,@leavereason,@leavedays,@totalleave)";
con.Open();
cmd.Parameters.AddWithValue("@empid", textBox1.Text);
cmd.Parameters.AddWithValue("@leavefrom", dateTimePicker1.Value);
cmd.Parameters.AddWithValue("@leaveto", dateTimePicker2.Value);
cmd.Parameters.AddWithValue("@leavereason", richTextBox1.Text);
cmd.Parameters.AddWithValue("@leavedays", textBox2.Text);
Int32 i = Convert.ToInt32(label7.Text) +
Convert.ToInt32(textBox2.Text);
if (i > 15)
{
MessageBox.Show("You have already taken the number of allowed
leaves");
}
else
{
cmd.Parameters.AddWithValue("@totalleave", i.ToString());
cmd.ExecuteNonQuery();
}
cmd.Dispose();
con.Close();
Reset();
Leavelist();
}
else
{
MessageBox.Show("The value of Leave to can't be less than leave
from");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
con.Close();
}
}
27
private void button2_Click(object sender, EventArgs e)
{
Reset();
}
private void button4_Click(object sender, EventArgs e)
{
this.Hide();
EmployeeManagementSystem emp = new EmployeeManagementSystem();
emp.Show();
}
private void button3_Click_1(object sender, EventArgs e)
{
try
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "Select Total_Leave from Tb_Leave where Emp_Id=@empid";
cmd.Connection = con;
con.Open();
cmd.Parameters.AddWithValue("@empid", textBox1.Text);
cmd.ExecuteNonQuery();
cmd.Dispose();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
label7.Text = reader["Total_Leave"].ToString();
}
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
con.Close();
}
}
}
}
Forgot Password Coding :
using System;
28
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Employees
{
public partial class ForgotPassword : Form
{
SqlConnection con = new SqlConnection("Data Source=(local);Initial
Catalog=Databasefinal;Integrated Security=True;Pooling=False");
public ForgotPassword()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
if (textBox1.Text != "")
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
con.Open();
cmd.CommandText = "forgot";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@username", textBox1.Text);
cmd.Parameters.AddWithValue("@question", comboBox1.SelectedItem);
cmd.Parameters.AddWithValue("@answer", textBox2.Text);
SqlParameter password = new SqlParameter("@password",
SqlDbType.VarChar, 100);
password.Direction = ParameterDirection.Output;
cmd.Parameters.Add(password);
SqlParameter ret = new SqlParameter("@ret", SqlDbType.Int);
ret.Direction = ParameterDirection.ReturnValue;
cmd.Parameters.Add(ret);
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
Int32 r = Convert.ToInt32(cmd.Parameters["@ret"].Value);
String st = cmd.Parameters["@password"].Value.ToString();
if (r == 0)
{
MessageBox.Show("Wrong Information");
}
else if (r == -1)
{
MessageBox.Show("Wrong Question or Invalid
Answer","Warning",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
else if (r == 1)
29
{
MessageBox.Show("Password is =" +
st,"Password",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
else
{
MessageBox.Show("Enter Username",
"Warning",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
con.Close();
}
}
private void button2_Click(object sender, EventArgs e)
{
try
{
this.Hide();
Loginf1 login = new Loginf1();
login.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
private void textBox1_Enter(object sender, EventArgs e)
{
if (textBox1.Text == "User Name")
{
textBox1.Text = "";
textBox1.ForeColor = Color.Black;
}
}
private void textBox2_Enter(object sender, EventArgs e)
{
if (textBox2.Text == "Password")
{
textBox2.Text = "";
textBox2.ForeColor = Color.Black;
}
}
private void textBox2_Leave(object sender, EventArgs e)
30
{
if (textBox2.Text == "")
{
textBox2.Text = "Password";
textBox2.ForeColor = Color.DimGray;
}
}
private void textBox1_Leave(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
textBox1.Text = "User Name";
textBox1.ForeColor = Color.DimGray;
}
}
}
}
CONCLUSION
The project is to digitalize the database of Employees in Organizations and enabling
Administrators to have benefit from Computers. Software acts as a Information System between
Employees and administrators. Here the user can keep his/her database secure and safe for a
unlimited period of time.
Software provides Employee management System for inserting ,updating, Searching and
deleting records with ease and simplicity. We will provide a fresh new approach to our esteemed
users to search for records and make databases in a digital way.
31

Más contenido relacionado

La actualidad más candente

College management system ppt
College management system pptCollege management system ppt
College management system pptShanthan Reddy
 
Employee Management System
Employee Management SystemEmployee Management System
Employee Management Systemvivek shah
 
Employee management system in Software Engineering
Employee management system in Software EngineeringEmployee management system in Software Engineering
Employee management system in Software EngineeringSadia Akter
 
Employee management system
Employee management systemEmployee management system
Employee management systemAnjaliSharma585
 
Project Proposal of an Employee Management System
Project Proposal of an Employee Management SystemProject Proposal of an Employee Management System
Project Proposal of an Employee Management SystemNurFathihaTahiatSeeu
 
Employee work management system project using codeIgniter
Employee work management system project using codeIgniter Employee work management system project using codeIgniter
Employee work management system project using codeIgniter Shahinul Islam Sujon
 
Employee Management System UML Diagrams Use Case Diagram, Activity Diagram, S...
Employee Management System UML Diagrams Use Case Diagram, Activity Diagram, S...Employee Management System UML Diagrams Use Case Diagram, Activity Diagram, S...
Employee Management System UML Diagrams Use Case Diagram, Activity Diagram, S...Mohammad Karim Shahbaz
 
Hostel management system
Hostel management systemHostel management system
Hostel management systemYashna Jawrani
 
Final major project presentation on (10 april2016) aits haldwani
Final major project  presentation on (10 april2016) aits haldwaniFinal major project  presentation on (10 april2016) aits haldwani
Final major project presentation on (10 april2016) aits haldwaniVijay Singh Khatri
 
Attendance management system
Attendance management system Attendance management system
Attendance management system SHIVANGI GOEL
 
Presentation Slides of College Management System Report
Presentation Slides of College Management System ReportPresentation Slides of College Management System Report
Presentation Slides of College Management System ReportMuhammadHusnainRaza
 
Sequence diagram for employee management system(EMS)
Sequence diagram for employee management system(EMS)Sequence diagram for employee management system(EMS)
Sequence diagram for employee management system(EMS)Achal (अचल) Porwal
 
Online Hostel Management System Proposal
Online Hostel Management System Proposal Online Hostel Management System Proposal
Online Hostel Management System Proposal farhanamusthafa
 
Hostel Management System(HMS)
Hostel Management  System(HMS)Hostel Management  System(HMS)
Hostel Management System(HMS)Omkar Walavalkar
 
Railway Reservation System - Software Engineering
Railway Reservation System - Software EngineeringRailway Reservation System - Software Engineering
Railway Reservation System - Software EngineeringLalit Pal
 
Student management system
Student management systemStudent management system
Student management systemGaurav Subham
 
Online Bus ticket reservation
Online Bus ticket reservationOnline Bus ticket reservation
Online Bus ticket reservationSmit Patel
 

La actualidad más candente (20)

College management system ppt
College management system pptCollege management system ppt
College management system ppt
 
Employee Management System
Employee Management SystemEmployee Management System
Employee Management System
 
Employee management system in Software Engineering
Employee management system in Software EngineeringEmployee management system in Software Engineering
Employee management system in Software Engineering
 
Employee management system
Employee management systemEmployee management system
Employee management system
 
Project Proposal of an Employee Management System
Project Proposal of an Employee Management SystemProject Proposal of an Employee Management System
Project Proposal of an Employee Management System
 
Employee work management system project using codeIgniter
Employee work management system project using codeIgniter Employee work management system project using codeIgniter
Employee work management system project using codeIgniter
 
College Management System
College Management SystemCollege Management System
College Management System
 
Employee Management System UML Diagrams Use Case Diagram, Activity Diagram, S...
Employee Management System UML Diagrams Use Case Diagram, Activity Diagram, S...Employee Management System UML Diagrams Use Case Diagram, Activity Diagram, S...
Employee Management System UML Diagrams Use Case Diagram, Activity Diagram, S...
 
Hostel management system
Hostel management systemHostel management system
Hostel management system
 
Final major project presentation on (10 april2016) aits haldwani
Final major project  presentation on (10 april2016) aits haldwaniFinal major project  presentation on (10 april2016) aits haldwani
Final major project presentation on (10 april2016) aits haldwani
 
Attendance management system
Attendance management system Attendance management system
Attendance management system
 
Hostel management
Hostel managementHostel management
Hostel management
 
Presentation Slides of College Management System Report
Presentation Slides of College Management System ReportPresentation Slides of College Management System Report
Presentation Slides of College Management System Report
 
Online attendance management system
Online attendance management systemOnline attendance management system
Online attendance management system
 
Sequence diagram for employee management system(EMS)
Sequence diagram for employee management system(EMS)Sequence diagram for employee management system(EMS)
Sequence diagram for employee management system(EMS)
 
Online Hostel Management System Proposal
Online Hostel Management System Proposal Online Hostel Management System Proposal
Online Hostel Management System Proposal
 
Hostel Management System(HMS)
Hostel Management  System(HMS)Hostel Management  System(HMS)
Hostel Management System(HMS)
 
Railway Reservation System - Software Engineering
Railway Reservation System - Software EngineeringRailway Reservation System - Software Engineering
Railway Reservation System - Software Engineering
 
Student management system
Student management systemStudent management system
Student management system
 
Online Bus ticket reservation
Online Bus ticket reservationOnline Bus ticket reservation
Online Bus ticket reservation
 

Destacado

Final major project presentation on (10 april2016) aits haldwani
Final major project  presentation on (10 april2016) aits haldwaniFinal major project  presentation on (10 april2016) aits haldwani
Final major project presentation on (10 april2016) aits haldwaniVijay Singh Khatri
 
Employee Management System By AZ DATAMALL
Employee Management System By AZ DATAMALLEmployee Management System By AZ DATAMALL
Employee Management System By AZ DATAMALLrohit154
 
Employee Management System in C++
Employee Management System in C++Employee Management System in C++
Employee Management System in C++Jayant Gope
 
2 a tubos e acessorios - copy
2 a tubos e acessorios - copy2 a tubos e acessorios - copy
2 a tubos e acessorios - copyzoulouwe
 
Transcon Triumph Phase I Brochure - Zricks.com
Transcon Triumph Phase I Brochure - Zricks.comTranscon Triumph Phase I Brochure - Zricks.com
Transcon Triumph Phase I Brochure - Zricks.comZricks.com
 
3Com 3C13633
3Com 3C136333Com 3C13633
3Com 3C13633savomir
 
Анна Абрамова. Знакомство с Archimate. Для встречи сообщества аналитиков Санк...
Анна Абрамова. Знакомство с Archimate. Для встречи сообщества аналитиков Санк...Анна Абрамова. Знакомство с Archimate. Для встречи сообщества аналитиков Санк...
Анна Абрамова. Знакомство с Archimate. Для встречи сообщества аналитиков Санк...Anna Abramova
 
Annual status of education report 2013 national
Annual status of education report 2013  nationalAnnual status of education report 2013  national
Annual status of education report 2013 nationalMohammad Moosa
 
L 17 Assessment in a Constructivist ,Technology-Supported Learning Ed Tech 1
L 17 Assessment in a Constructivist ,Technology-Supported Learning Ed Tech 1L 17 Assessment in a Constructivist ,Technology-Supported Learning Ed Tech 1
L 17 Assessment in a Constructivist ,Technology-Supported Learning Ed Tech 1lovely perez
 
Class presentation m. phil
Class presentation m. philClass presentation m. phil
Class presentation m. philMohammad Moosa
 

Destacado (15)

Final major project presentation on (10 april2016) aits haldwani
Final major project  presentation on (10 april2016) aits haldwaniFinal major project  presentation on (10 april2016) aits haldwani
Final major project presentation on (10 april2016) aits haldwani
 
Employee Management System By AZ DATAMALL
Employee Management System By AZ DATAMALLEmployee Management System By AZ DATAMALL
Employee Management System By AZ DATAMALL
 
Employee Management System in C++
Employee Management System in C++Employee Management System in C++
Employee Management System in C++
 
A minor project
A minor projectA minor project
A minor project
 
Business network group
Business network groupBusiness network group
Business network group
 
Bez názvu 1
Bez názvu 1Bez názvu 1
Bez názvu 1
 
2 a tubos e acessorios - copy
2 a tubos e acessorios - copy2 a tubos e acessorios - copy
2 a tubos e acessorios - copy
 
Presentación etwinning
Presentación etwinningPresentación etwinning
Presentación etwinning
 
Transcon Triumph Phase I Brochure - Zricks.com
Transcon Triumph Phase I Brochure - Zricks.comTranscon Triumph Phase I Brochure - Zricks.com
Transcon Triumph Phase I Brochure - Zricks.com
 
3Com 3C13633
3Com 3C136333Com 3C13633
3Com 3C13633
 
Анна Абрамова. Знакомство с Archimate. Для встречи сообщества аналитиков Санк...
Анна Абрамова. Знакомство с Archimate. Для встречи сообщества аналитиков Санк...Анна Абрамова. Знакомство с Archimate. Для встречи сообщества аналитиков Санк...
Анна Абрамова. Знакомство с Archimate. Для встречи сообщества аналитиков Санк...
 
Mobile Web Apps
Mobile Web AppsMobile Web Apps
Mobile Web Apps
 
Annual status of education report 2013 national
Annual status of education report 2013  nationalAnnual status of education report 2013  national
Annual status of education report 2013 national
 
L 17 Assessment in a Constructivist ,Technology-Supported Learning Ed Tech 1
L 17 Assessment in a Constructivist ,Technology-Supported Learning Ed Tech 1L 17 Assessment in a Constructivist ,Technology-Supported Learning Ed Tech 1
L 17 Assessment in a Constructivist ,Technology-Supported Learning Ed Tech 1
 
Class presentation m. phil
Class presentation m. philClass presentation m. phil
Class presentation m. phil
 

Similar a Employee management system report

payroll management -1.
payroll management -1.payroll management -1.
payroll management -1.DJananiJanani
 
IRJET- Android Application for Employee Monitoring and Tracking System.
IRJET- Android Application for Employee Monitoring and Tracking System.IRJET- Android Application for Employee Monitoring and Tracking System.
IRJET- Android Application for Employee Monitoring and Tracking System.IRJET Journal
 
Android Application For Employee Monitoring And Tracking System
Android Application For Employee Monitoring And Tracking SystemAndroid Application For Employee Monitoring And Tracking System
Android Application For Employee Monitoring And Tracking SystemSheila Sinclair
 
Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)PiyushKashyap54
 
Payroll Management System Complete Report
Payroll Management System Complete ReportPayroll Management System Complete Report
Payroll Management System Complete ReportSavio Aberneithie
 
Development of Web-based Job Fair Information System
Development of Web-based Job Fair Information SystemDevelopment of Web-based Job Fair Information System
Development of Web-based Job Fair Information SystemEditor IJCATR
 
Development of Web-based Job Fair Information System
Development of Web-based Job Fair Information SystemDevelopment of Web-based Job Fair Information System
Development of Web-based Job Fair Information SystemEditor IJCATR
 
Wedding Hall Management 9975053592
Wedding Hall Management 9975053592Wedding Hall Management 9975053592
Wedding Hall Management 9975053592sachinc020
 
IRJET- Office Automation System
IRJET- Office Automation SystemIRJET- Office Automation System
IRJET- Office Automation SystemIRJET Journal
 
Implement Fingerprint authentication for employee automation system
Implement Fingerprint authentication for employee automation systemImplement Fingerprint authentication for employee automation system
Implement Fingerprint authentication for employee automation systemTanjarul Islam Mishu
 
Hotel Management System final report
Hotel Management System final report  Hotel Management System final report
Hotel Management System final report jaysavani5
 
Final report mobile shop
Final report   mobile shopFinal report   mobile shop
Final report mobile shopViditsingh22
 
Mml micro project Building a Basic statistic calculator using r programming ...
Mml micro project Building a Basic statistic calculator  using r programming ...Mml micro project Building a Basic statistic calculator  using r programming ...
Mml micro project Building a Basic statistic calculator using r programming ...SakshamDandnaik
 
School management System
School management SystemSchool management System
School management SystemHATIM Bhagat
 
CampusRecruitment Django.pptx
CampusRecruitment Django.pptxCampusRecruitment Django.pptx
CampusRecruitment Django.pptxPoojaG86
 
What is going on - Application diagnostics on Azure - TechDays Finland
What is going on - Application diagnostics on Azure - TechDays FinlandWhat is going on - Application diagnostics on Azure - TechDays Finland
What is going on - Application diagnostics on Azure - TechDays FinlandMaarten Balliauw
 
Machine learning Courier.pptx
Machine learning Courier.pptxMachine learning Courier.pptx
Machine learning Courier.pptx17cse17GuruGanesh
 

Similar a Employee management system report (20)

payroll management -1.
payroll management -1.payroll management -1.
payroll management -1.
 
Flutter-Dart project || Hotel Management System
Flutter-Dart project || Hotel Management SystemFlutter-Dart project || Hotel Management System
Flutter-Dart project || Hotel Management System
 
IRJET- Android Application for Employee Monitoring and Tracking System.
IRJET- Android Application for Employee Monitoring and Tracking System.IRJET- Android Application for Employee Monitoring and Tracking System.
IRJET- Android Application for Employee Monitoring and Tracking System.
 
Android Application For Employee Monitoring And Tracking System
Android Application For Employee Monitoring And Tracking SystemAndroid Application For Employee Monitoring And Tracking System
Android Application For Employee Monitoring And Tracking System
 
Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)
 
Payroll Management System Complete Report
Payroll Management System Complete ReportPayroll Management System Complete Report
Payroll Management System Complete Report
 
Ijcatr04071001
Ijcatr04071001Ijcatr04071001
Ijcatr04071001
 
Development of Web-based Job Fair Information System
Development of Web-based Job Fair Information SystemDevelopment of Web-based Job Fair Information System
Development of Web-based Job Fair Information System
 
Development of Web-based Job Fair Information System
Development of Web-based Job Fair Information SystemDevelopment of Web-based Job Fair Information System
Development of Web-based Job Fair Information System
 
Wedding Hall Management 9975053592
Wedding Hall Management 9975053592Wedding Hall Management 9975053592
Wedding Hall Management 9975053592
 
IRJET- Office Automation System
IRJET- Office Automation SystemIRJET- Office Automation System
IRJET- Office Automation System
 
Implement Fingerprint authentication for employee automation system
Implement Fingerprint authentication for employee automation systemImplement Fingerprint authentication for employee automation system
Implement Fingerprint authentication for employee automation system
 
Hotel Management System final report
Hotel Management System final report  Hotel Management System final report
Hotel Management System final report
 
Final report mobile shop
Final report   mobile shopFinal report   mobile shop
Final report mobile shop
 
Mml micro project Building a Basic statistic calculator using r programming ...
Mml micro project Building a Basic statistic calculator  using r programming ...Mml micro project Building a Basic statistic calculator  using r programming ...
Mml micro project Building a Basic statistic calculator using r programming ...
 
Project Management System
Project Management SystemProject Management System
Project Management System
 
School management System
School management SystemSchool management System
School management System
 
CampusRecruitment Django.pptx
CampusRecruitment Django.pptxCampusRecruitment Django.pptx
CampusRecruitment Django.pptx
 
What is going on - Application diagnostics on Azure - TechDays Finland
What is going on - Application diagnostics on Azure - TechDays FinlandWhat is going on - Application diagnostics on Azure - TechDays Finland
What is going on - Application diagnostics on Azure - TechDays Finland
 
Machine learning Courier.pptx
Machine learning Courier.pptxMachine learning Courier.pptx
Machine learning Courier.pptx
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 

Último (20)

Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

Employee management system report

  • 1. 1 A Project Report On “Employee Management System” Submitted in the partial fulfillment of the requirement For the award of Diploma of COMPUTER ENGINEERING (Batch: 2014-2017) G.B.N GOVT. POLYTECHNIC, NILOKHERI Submitted by:- Toshant Arora(14009080095) Shubham (14009080088) Tulsi Sharma(14009080096)
  • 2. 2 INDEX TABLE OF CONTENTS 1. PROJECT DESCRIPTION  Introduction  Scope of project  Objective of project 3. SNAPSHOT  CONCLUSION  FUTURE SCOPE  REFERENCES PROJECT DESCRIPTION Objective of C# project on Employee Management System :- The main objective of the C# project on Employee Management is to Manage the details of information, leaves, salaries, login, employee. It manages all the information about information, experience, employee, information. The project is totally built at administrative end thus only administrator is guaranteed the access. The purpose of the project is to build an application program to reduce the manual work for managing the informations, leaves, salary. It tracks all the details about the salary, login, employee. Functionalities provided by C# project on Employee Management system are as follows: 1).Provides the searching facilities based on various factors. Such as information, salary, Login, Employee 2).It tracks all the information of leaves, Login etc 3).Manage the information of Leaves 4).Shows the information and description of the information, Salary 5).To increase efficiency of managing the information, leaves
  • 3. 3 6).Editing, adding and updating of Records is improved which results in proper resource management of information of data. 7).Manage the information of login. 8).Integration of all records of employee. Input Data and Validation – 1) All the fields such as Salary, Employee and leave are validated and don’t take invalid arguments. 2) Each form like Employee, Salary don’t take blank values. 3) Avoiding errors in data. 4) Controlling amount of input. Scope of the Project:- For all the s/w there is always a scope of future enhancements. There are few enhancements which are pointed out in the proposed system. They are as follows: 1. Module for Employee Loan. 2. Modules for proper arrangement of attendance of employees. 3. Introducing online version of the Software. 4. Introducing software for Employees side also. 5. More proper salary calculations based on various factors. Objectives of the Project:-  Time and Cost Effective – Software is making the process of keeping database time and cost effective by making it easy to alter or update database and also keeping that safe.  Database Creation - A database of the registered users will be created and this will help the users to fetch the details of Computer Center.
  • 4. 4  Flexibility – Database provides flexibility to administrator..Records can be inserted, deleted or updated with just a click.  Informative - The software has all the necessary details about the Students and Courses and provides all the relevant information therefore. For example, searching of appropriate Student for like admission and then the information of admission is added to Students records.  Security - Proper authorization and authentication provisions have been made for the security of the software so that only the registered administrators can look the Information. Without proper login no one is allowed to access this software. Snap shots Welcome Page
  • 5. 5 Fig.3.12: login page Table of Login Page: Table 1: Login page
  • 6. 6 Fig.3.13: Employee Info Page Table of Course Info page: Table of Employee Info page
  • 10. 10 Fig.3.14: Home Page Welcome Page Coding : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Employees { public partial class Welcome : Form { public Welcome() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { } private void Welcome_Load(object sender, EventArgs e) { } private void timer2_Tick(object sender, EventArgs e) { try { progressBar1.Value = progressBar1.Value + 1; label1.Text = progressBar1.Value.ToString() + ("% completed"); if (progressBar1.Value == 100) { this.Hide(); Loginf1 login = new Loginf1(); login.Show(); timer2.Stop(); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString());
  • 11. 11 } } } } Login page coding : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace Employees { public partial class Loginf1 : Form { public static string data; public static string value; SqlConnection con = new SqlConnection("Data Source=(local);Initial Catalog=Databasefinal;Integrated Security=True;Pooling=False"); public Loginf1() { InitializeComponent(); } private void panel1_Paint(object sender, PaintEventArgs e) { } private void button1_Click(object sender, EventArgs e) { } private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.Hide(); CreateAccount create = new CreateAccount(); create.Show(); } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.Hide(); ForgotPassword forgot = new ForgotPassword(); forgot.Show(); }
  • 12. 12 private void Loginf1_Load(object sender, EventArgs e) { panel1.BackColor = Color.FromArgb(125, panel1.BackColor); } private void button1_Click_1(object sender, EventArgs e) { } private void button1_Click_2(object sender, EventArgs e) { try { if ((textBox1.Text != "") && (textBox2.Text != "")) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "checkuser"; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con; con.Open(); cmd.Parameters.AddWithValue("@username", textBox1.Text); cmd.Parameters.AddWithValue("@password", textBox2.Text); SqlParameter status = new SqlParameter("@status", SqlDbType.Char, 1); status.Direction = ParameterDirection.Output; cmd.Parameters.Add(status); SqlParameter ret = new SqlParameter("@ret", SqlDbType.Int); ret.Direction = ParameterDirection.ReturnValue; cmd.Parameters.Add(ret); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Int32 r = Convert.ToInt32(cmd.Parameters["@ret"].Value); String st = cmd.Parameters["@status"].Value.ToString(); if (r == 0) { MessageBox.Show("Wrong Username","Error",MessageBoxButtons.OK,MessageBoxIcon.Error); } else if (r == -1) { MessageBox.Show("Wrong Password","Error",MessageBoxButtons.OK,MessageBoxIcon.Error); } else if(r==1) { if (st == "A") { data = textBox1.Text; this.Hide(); EmployeeManagementSystem emp = new EmployeeManagementSystem();
  • 13. 13 emp.Show(); } else if (st == "U") { this.Hide(); EmployeeManagementSystem emp = new EmployeeManagementSystem(); emp.Show(); } } } else { MessageBox.Show("Please Enter Username and Password", "Warning"); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(),"Warning",MessageBoxButtons.OK,MessageBoxIcon.Warni ng); } finally { con.Close(); } } private void linkLabel2_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e) { this.Hide(); CreateAccount create = new CreateAccount(); create.Show(); } private void linkLabel1_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e) { this.Hide(); ForgotPassword forgot = new ForgotPassword(); forgot.Show(); } private void checkBox1_CheckedChanged(object sender, EventArgs e) { } private void button3_Click(object sender, EventArgs e) { button3.Hide();
  • 14. 14 button2.Show(); textBox2.UseSystemPasswordChar = true; } private void button2_Click(object sender, EventArgs e) { button2.Hide(); button3.Show(); textBox2.UseSystemPasswordChar = false; } private void textBox1_Enter(object sender, EventArgs e) { if(textBox1.Text=="User Name") { textBox1.Text = ""; textBox1.ForeColor = Color.Black; } } private void textBox1_Leave(object sender, EventArgs e) { if (textBox1.Text == "") { textBox1.Text = "User Name"; textBox1.ForeColor = Color.DarkGray; } } private void textBox2_Enter(object sender, EventArgs e) { if (textBox2.Text == "Password") { textBox2.Text = ""; textBox2.ForeColor = Color.Black; } } private void textBox2_Leave(object sender, EventArgs e) { if (textBox2.Text == "") { textBox2.Text = "Password"; textBox2.ForeColor = Color.DarkGray; } } private void linkLabel2_LinkClicked_2(object sender, LinkLabelLinkClickedEventArgs e) { this.Hide(); CreateAccount create = new CreateAccount(); create.Show(); }
  • 15. 15 private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { value = "Guest Account"; this.Hide(); EmployeeManagementSystem emp = new EmployeeManagementSystem(); emp.Show(); } } } Employee Info page Coding : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; using System.IO; namespace Employees { public partial class EmployeeInfo : Form { string imgelocation = ""; SqlConnection con = new SqlConnection("Data Source=(local);Initial Catalog=Databasefinal;Integrated Security=True;Pooling=False"); public EmployeeInfo() { InitializeComponent(); } private void Departmentlist() { SqlDataAdapter adp = new SqlDataAdapter("Select * from Tb_Department", con); DataSet ds=new DataSet(); adp.Fill(ds); comboBox2.DataSource = ds.Tables[0].DefaultView; comboBox2.DisplayMember = "Department_Name"; comboBox2.ValueMember="Department_Id"; } private void Reset() { textBox2.Text = ""; comboBox2.SelectedItem=null ; textBox1.Text = ""; textBox4.Text = ""; maskedTextBox1.Text = ""; textBox6.Text = ""; textBox7.Text = ""; textBox5.Text = "";
  • 16. 16 richTextBox1.Text = ""; dateTimePicker1.ResetText(); dateTimePicker2.ResetText(); dateTimePicker3.ResetText(); comboBox1.ResetText(); } private void EmployeeInfo_Load(object sender, EventArgs e) { try { groupBox1.BackColor = Color.FromArgb(125, groupBox1.BackColor); groupBox2.BackColor = Color.FromArgb(125, groupBox2.BackColor); Employeelist(); Departmentlist(); Reset(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } private Int32 MaxId() { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select isnull(Max(Emp_Id),0) from Tb_Employee where Department_Name='"+comboBox2.SelectedValue+"'"; cmd.Connection = con; con.Open(); Int32 Id = Convert.ToInt32(cmd.ExecuteScalar()) + 1; cmd.Dispose(); con.Close(); return Id; } private void button3_Click(object sender, EventArgs e) { Reset(); } private void button1_Click(object sender, EventArgs e) { try { byte[] images = null; FileStream Streem = new FileStream(imgelocation, FileMode.Open, FileAccess.Read); BinaryReader brs = new BinaryReader(Streem); images = brs.ReadBytes((int)Streem.Length); SqlCommand cmd = new SqlCommand();
  • 17. 17 cmd.CommandText = "insert into Tb_Employee(Emp_Id,Emp_Name,Department_Name,Job_Title,Mobile,Email_Id,Address,Joining_Dat e,Gender,DOB,Leaving_Date,Salary,Image,Total_Leave)Values(@empid,@empname,@departmentname ,@jobtitle,@mobile,@emailid,@address,@joiningdate,@gender,@dob,@leavingdate,@salary,@imag e,@totalleave)"; cmd.Connection = con; con.Open(); cmd.Parameters.AddWithValue("@empid", textBox1.Text); cmd.Parameters.AddWithValue("@empname", textBox2.Text); cmd.Parameters.AddWithValue("@departmentname",comboBox2.SelectedValue); cmd.Parameters.AddWithValue("@jobtitle", textBox4.Text); cmd.Parameters.AddWithValue("@totalleave", textBox5.Text); cmd.Parameters.AddWithValue("@mobile", maskedTextBox1.Text); cmd.Parameters.AddWithValue("@emailid", textBox6.Text); cmd.Parameters.AddWithValue("@address", richTextBox1.Text); cmd.Parameters.AddWithValue("@joiningdate", dateTimePicker1.Value); cmd.Parameters.AddWithValue("@gender", comboBox1.SelectedItem); cmd.Parameters.AddWithValue("@dob", dateTimePicker2.Value); cmd.Parameters.AddWithValue("@leavingdate", dateTimePicker3.Value); cmd.Parameters.AddWithValue("@salary", textBox7.Text); cmd.Parameters.Add(new SqlParameter("@image", images)); int N = cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Employeelist(); Reset(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { con.Close(); } } private void Employeelist() { SqlDataAdapter adp = new SqlDataAdapter("Select * from Tb_Employee where Department_Name='"+comboBox2.SelectedValue+"'", con); DataSet ds = new DataSet(); adp.Fill(ds); dataGridView1.DataSource = ds.Tables[0].DefaultView; } private void pictureBox1_Click(object sender, EventArgs e) { try { OpenFileDialog open = new OpenFileDialog(); open.InitialDirectory = "C:";
  • 18. 18 open.Filter = "png files(*.png)|jpg files(*.jpg|All files(*.*)|*.*"; if (open.ShowDialog() == DialogResult.OK) { imgelocation = open.FileName.ToString(); pictureBox1.ImageLocation = imgelocation; } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { con.Close(); } } private void button2_Click(object sender, EventArgs e) { try { byte[] images = null; FileStream Streem = new FileStream(imgelocation, FileMode.Open, FileAccess.Read); BinaryReader brs = new BinaryReader(Streem); images = brs.ReadBytes((int)Streem.Length); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "update Tb_Employee set Emp_Name=@empname,Job_Title=@jobtitle,Mobile=@mobile,Email_Id=@emailid,Joining_Date=@join ingdate,Address=@address,DOB=@dob,Salary=@salary,Gender=@gender,Department_Id=@department id,Leaving_Date=@leavingdate,Image=@image where Emp_Id=@empid"; cmd.Connection = con; con.Open(); cmd.Parameters.AddWithValue("@empid", textBox1.Text); cmd.Parameters.AddWithValue("@empname", textBox2.Text); cmd.Parameters.AddWithValue("@departmentname", comboBox2.SelectedValue); cmd.Parameters.AddWithValue("@jobtitle", textBox4.Text); cmd.Parameters.AddWithValue("@mobile", maskedTextBox1.Text); cmd.Parameters.AddWithValue("@emailid", textBox6.Text); cmd.Parameters.AddWithValue("@address", richTextBox1.Text); cmd.Parameters.AddWithValue("@joiningdate", dateTimePicker1.Value); cmd.Parameters.AddWithValue("@gender", comboBox1.SelectedItem); cmd.Parameters.AddWithValue("@dob", dateTimePicker2.Value); cmd.Parameters.AddWithValue("@leavingdate", dateTimePicker3.Value); cmd.Parameters.AddWithValue("@salary", textBox7.Text); cmd.Parameters.Add(new SqlParameter("@image", images)); int N = cmd.ExecuteNonQuery();
  • 19. 19 cmd.Dispose(); con.Close(); Reset(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { con.Close(); } } private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { try { textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); textBox2.Text = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString(); comboBox2.SelectedItem = dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString(); textBox4.Text = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString(); maskedTextBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString(); textBox6.Text = dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString(); textBox7.Text = dataGridView1.Rows[e.RowIndex].Cells[11].Value.ToString(); textBox5.Text = dataGridView1.Rows[e.RowIndex].Cells[13].Value.ToString(); richTextBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString(); comboBox1.SelectedItem= dataGridView1.Rows[e.RowIndex].Cells[8].Value.ToString(); dateTimePicker1.Text = dataGridView1.Rows[e.RowIndex].Cells[7].Value.ToString(); dateTimePicker2.Text = dataGridView1.Rows[e.RowIndex].Cells[9].Value.ToString(); dateTimePicker3.Text = dataGridView1.Rows[e.RowIndex].Cells[10].Value.ToString(); byte[] Images=new byte[0]; SqlDataAdapter adp = new SqlDataAdapter("Select Image from Tb_Employee where Emp_Id='" + textBox1.Text + "'", con); SqlCommand cmd = new SqlCommand("Select Image from Tb_Employee where Emp_Id='" + textBox1.Text + "'", con); cmd.CommandType=CommandType.Text; DataSet ds = new DataSet(); adp.Fill(ds); foreach(DataRow dr in ds.Tables[0].Rows) { Images=(byte[])dr["Image"]; }
  • 20. 20 byte[] imgData=Images; MemoryStream stream = new MemoryStream(imgData); pictureBox1.Image=Image.FromStream(stream); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { con.Close(); } } private void button4_Click(object sender, EventArgs e) { try { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "delete from Tb_Employee where Emp_Id=@empid"; cmd.Connection = con; con.Open(); cmd.Parameters.AddWithValue("@empid", textBox1.Text); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Reset(); Employeelist(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } private void button5_Click_1(object sender, EventArgs e) { try { this.Hide(); EmployeeManagementSystem emp = new EmployeeManagementSystem(); emp.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
  • 21. 21 { try { textBox1.Text = MaxId().ToString(); Employeelist(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } } } Client Info page coding : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace Employees { public partial class ClientInfo : Form { SqlConnection con = new SqlConnection("Data Source=(local);Initial Catalog=Databasefinal;Integrated Security=True;Pooling=False"); public ClientInfo() { InitializeComponent(); } private void ClientInfo_Load(object sender, EventArgs e) { try { panel1.BackColor = Color.FromArgb(125, panel1.BackColor); Clientlist(); Reset(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } private Int32 MaxId() { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select isnull(Max(Client_Id),0) from Tb_Client"; cmd.Connection = con; con.Open();
  • 22. 22 Int32 i = Convert.ToInt32(cmd.ExecuteScalar()) + 1; cmd.Dispose(); con.Close(); return i; } private void Clientlist() { SqlDataAdapter adp = new SqlDataAdapter("Select * from Tb_Client", con); DataSet ds = new DataSet(); adp.Fill(ds); dataGridView1.DataSource = ds.Tables[0].DefaultView; } private void Reset() { textBox1.Text = MaxId().ToString(); ; textBox2.Text = ""; textBox3.Text = ""; richTextBox1.ResetText(); maskedTextBox1.ResetText(); } private void button1_Click(object sender, EventArgs e) { try { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "insert into Tb_Client(Client_Id,Client_Name,Address,Contact_No,Email_Id) Values(@clientid,@clientname,@address,@contactno,@emailid)"; cmd.Connection = con; con.Open(); cmd.Parameters.AddWithValue("@clientid", textBox1.Text); cmd.Parameters.AddWithValue("@clientname", textBox2.Text); cmd.Parameters.AddWithValue("@address", richTextBox1.Text); cmd.Parameters.AddWithValue("@contactno", maskedTextBox1.Text); cmd.Parameters.AddWithValue("@emailid", textBox3.Text); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Reset(); Clientlist(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { con.Close(); } }
  • 23. 23 private void button3_Click(object sender, EventArgs e) { try { Reset(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } private void button2_Click(object sender, EventArgs e) { try { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Delete from Tb_Client where Client_Id=@clientid"; cmd.Connection = con; con.Open(); cmd.Parameters.AddWithValue("@clientid", textBox1.Text); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Reset(); Clientlist(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { con.Close(); } } private void button4_Click(object sender, EventArgs e) { try { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "update Tb_Client set Client_Name=@clientname,Address=@address,Contact_No=@contactno,Email_Id=@emailid where Client_Id=@clientid"; cmd.Connection = con; con.Open(); cmd.Parameters.AddWithValue("@clientname", textBox2.Text); cmd.Parameters.AddWithValue("@clientid", textBox1.Text); cmd.Parameters.AddWithValue("@address", richTextBox1.Text); cmd.Parameters.AddWithValue("@contactno", maskedTextBox1.Text); cmd.Parameters.AddWithValue("@emailid", textBox3.Text); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Reset();
  • 24. 24 Clientlist(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { con.Close(); } } private void button5_Click(object sender, EventArgs e) { try { this.Hide(); EmployeeManagementSystem emp = new EmployeeManagementSystem(); emp.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { try { textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); textBox2.Text = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString(); richTextBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString(); maskedTextBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString(); textBox3.Text = dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } } } Leave page Coding : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq;
  • 25. 25 using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace Employees { public partial class Leave : Form { SqlConnection con = new SqlConnection("Data Source=(local);Initial Catalog=Databasefinal;Integrated Security=True;Pooling=False"); public Leave() { InitializeComponent(); } private void Leave_Load(object sender, EventArgs e) { Leavelist(); Reset(); } private void Leavelist() { string query = "Select E.Emp_Id,E.Emp_Name,L.Leave_From,L.Leave_To,L.Leave_Reason,L.Leave_Days,L.Total_Leave from Tb_Employee E,Tb_Leave L where E.Emp_Id=L.Emp_Id"; SqlDataAdapter adp = new SqlDataAdapter(query, con); DataSet ds = new DataSet(); adp.Fill(ds); dataGridView1.DataSource = ds.Tables[0].DefaultView; con.Close(); } private void Reset() { textBox1.Text = ""; textBox2.Text = ""; dateTimePicker1.ResetText(); dateTimePicker2.ResetText(); richTextBox1.Text = ""; label7.Text = " 0"; } private void button1_Click(object sender, EventArgs e) { try { con.Close();
  • 26. 26 if (dateTimePicker2.Value > dateTimePicker1.Value) { SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "insert into Tb_Leave(Emp_Id,Leave_From,Leave_To,Leave_Reason,Leave_Days,Total_Leave)Values(@empid,@le avefrom,@leaveto,@leavereason,@leavedays,@totalleave)"; con.Open(); cmd.Parameters.AddWithValue("@empid", textBox1.Text); cmd.Parameters.AddWithValue("@leavefrom", dateTimePicker1.Value); cmd.Parameters.AddWithValue("@leaveto", dateTimePicker2.Value); cmd.Parameters.AddWithValue("@leavereason", richTextBox1.Text); cmd.Parameters.AddWithValue("@leavedays", textBox2.Text); Int32 i = Convert.ToInt32(label7.Text) + Convert.ToInt32(textBox2.Text); if (i > 15) { MessageBox.Show("You have already taken the number of allowed leaves"); } else { cmd.Parameters.AddWithValue("@totalleave", i.ToString()); cmd.ExecuteNonQuery(); } cmd.Dispose(); con.Close(); Reset(); Leavelist(); } else { MessageBox.Show("The value of Leave to can't be less than leave from"); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { con.Close(); } }
  • 27. 27 private void button2_Click(object sender, EventArgs e) { Reset(); } private void button4_Click(object sender, EventArgs e) { this.Hide(); EmployeeManagementSystem emp = new EmployeeManagementSystem(); emp.Show(); } private void button3_Click_1(object sender, EventArgs e) { try { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select Total_Leave from Tb_Leave where Emp_Id=@empid"; cmd.Connection = con; con.Open(); cmd.Parameters.AddWithValue("@empid", textBox1.Text); cmd.ExecuteNonQuery(); cmd.Dispose(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { label7.Text = reader["Total_Leave"].ToString(); } con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { con.Close(); } } } } Forgot Password Coding : using System;
  • 28. 28 using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace Employees { public partial class ForgotPassword : Form { SqlConnection con = new SqlConnection("Data Source=(local);Initial Catalog=Databasefinal;Integrated Security=True;Pooling=False"); public ForgotPassword() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { if (textBox1.Text != "") { SqlCommand cmd = new SqlCommand(); cmd.Connection = con; con.Open(); cmd.CommandText = "forgot"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@username", textBox1.Text); cmd.Parameters.AddWithValue("@question", comboBox1.SelectedItem); cmd.Parameters.AddWithValue("@answer", textBox2.Text); SqlParameter password = new SqlParameter("@password", SqlDbType.VarChar, 100); password.Direction = ParameterDirection.Output; cmd.Parameters.Add(password); SqlParameter ret = new SqlParameter("@ret", SqlDbType.Int); ret.Direction = ParameterDirection.ReturnValue; cmd.Parameters.Add(ret); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Int32 r = Convert.ToInt32(cmd.Parameters["@ret"].Value); String st = cmd.Parameters["@password"].Value.ToString(); if (r == 0) { MessageBox.Show("Wrong Information"); } else if (r == -1) { MessageBox.Show("Wrong Question or Invalid Answer","Warning",MessageBoxButtons.OK,MessageBoxIcon.Warning); } else if (r == 1)
  • 29. 29 { MessageBox.Show("Password is =" + st,"Password",MessageBoxButtons.OK,MessageBoxIcon.Information); } } else { MessageBox.Show("Enter Username", "Warning",MessageBoxButtons.OK,MessageBoxIcon.Warning); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { con.Close(); } } private void button2_Click(object sender, EventArgs e) { try { this.Hide(); Loginf1 login = new Loginf1(); login.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } private void textBox1_Enter(object sender, EventArgs e) { if (textBox1.Text == "User Name") { textBox1.Text = ""; textBox1.ForeColor = Color.Black; } } private void textBox2_Enter(object sender, EventArgs e) { if (textBox2.Text == "Password") { textBox2.Text = ""; textBox2.ForeColor = Color.Black; } } private void textBox2_Leave(object sender, EventArgs e)
  • 30. 30 { if (textBox2.Text == "") { textBox2.Text = "Password"; textBox2.ForeColor = Color.DimGray; } } private void textBox1_Leave(object sender, EventArgs e) { if (textBox1.Text == "") { textBox1.Text = "User Name"; textBox1.ForeColor = Color.DimGray; } } } } CONCLUSION The project is to digitalize the database of Employees in Organizations and enabling Administrators to have benefit from Computers. Software acts as a Information System between Employees and administrators. Here the user can keep his/her database secure and safe for a unlimited period of time. Software provides Employee management System for inserting ,updating, Searching and deleting records with ease and simplicity. We will provide a fresh new approach to our esteemed users to search for records and make databases in a digital way.
  • 31. 31