SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

Online Attendance Management System
Online Attendance Management SystemOnline Attendance Management System
Online Attendance Management SystemRIDDHICHOUHAN2
 
College Department Management System
College Department Management SystemCollege Department Management System
College Department Management SystemJIGAR MAKHIJA
 
E learning project report (Yashraj Nigam)
E learning project report (Yashraj Nigam)E learning project report (Yashraj Nigam)
E learning project report (Yashraj Nigam)Yashraj Nigam
 
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 in Software Engineering
Employee management system in Software EngineeringEmployee management system in Software Engineering
Employee management system in Software EngineeringSadia Akter
 
Online Attendance System
Online Attendance SystemOnline Attendance System
Online Attendance SystemAkash Kr Sinha
 
Employee Management System
Employee Management SystemEmployee Management System
Employee Management SystemMonotheist Sakib
 
Banking Management System Project documentation
Banking Management System Project documentationBanking Management System Project documentation
Banking Management System Project documentationChaudhry Sajid
 
College Management System project
College Management System projectCollege Management System project
College Management System projectManish Kushwaha
 
Employee management system
Employee management systemEmployee management system
Employee management systemAnjaliSharma585
 
Student Management System
Student Management System Student Management System
Student Management System Vinay Yadav
 
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
 
Banking Management System Project
Banking Management System ProjectBanking Management System Project
Banking Management System ProjectChaudhry Sajid
 
Online Quiz System Project Report ppt
Online Quiz System Project Report pptOnline Quiz System Project Report ppt
Online Quiz System Project Report pptKishan Maurya
 

Was ist angesagt? (20)

Online Attendance Management System
Online Attendance Management SystemOnline Attendance Management System
Online Attendance Management System
 
Employee Management System
Employee Management SystemEmployee Management System
Employee Management System
 
College Department Management System
College Department Management SystemCollege Department Management System
College Department Management System
 
Online Admission System
Online Admission System  Online Admission System
Online Admission System
 
E learning project report (Yashraj Nigam)
E learning project report (Yashraj Nigam)E learning project report (Yashraj Nigam)
E learning project report (Yashraj Nigam)
 
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
 
Employee management system in Software Engineering
Employee management system in Software EngineeringEmployee management system in Software Engineering
Employee management system in Software Engineering
 
Online Attendance System
Online Attendance SystemOnline Attendance System
Online Attendance System
 
Employee Management System
Employee Management SystemEmployee Management System
Employee Management System
 
Banking Management System Project documentation
Banking Management System Project documentationBanking Management System Project documentation
Banking Management System Project documentation
 
College Management System
College Management SystemCollege Management System
College Management System
 
College Management System project
College Management System projectCollege Management System project
College Management System project
 
School Management System
School Management SystemSchool Management System
School Management System
 
Employee management system
Employee management systemEmployee management system
Employee management system
 
Student Management System
Student Management System Student Management System
Student Management System
 
ONLINE STUDENT FEEDBACK SYSTEM
ONLINE STUDENT FEEDBACK SYSTEMONLINE STUDENT FEEDBACK SYSTEM
ONLINE STUDENT FEEDBACK 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)
 
Banking Management System Project
Banking Management System ProjectBanking Management System Project
Banking Management System Project
 
Online Quiz System Project Report ppt
Online Quiz System Project Report pptOnline Quiz System Project Report ppt
Online Quiz System Project Report ppt
 

Andere mochten auch

Employee Management System
Employee Management SystemEmployee Management System
Employee Management Systemvivek shah
 
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
 
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
 
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
 

Andere mochten auch (17)

Employee Management System
Employee Management SystemEmployee Management System
Employee 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
 
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++
 
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...
 
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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 

Kürzlich hochgeladen (20)

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

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