public void updateData(empObjects obj) { SqlConnection con = new SqlConnection(constring); con.Open(); SqlCommand cmd = new SqlCommand("update Emp_details set name ='" + obj.name + "', address ='" + obj.Address + "', state ='" + obj.state + "', Designation ='" + obj.Desigination + "', email ='" + obj.email + "', Mob ='" + obj.mobilenumber + "', qualification='" + obj.qualification + "', username='******',password='******'" + " where ID=" + obj.ID, con); SqlDataReader rd = cmd.ExecuteReader(); }
private void rmGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 5) { id = rmGrid.Rows[e.RowIndex].Cells[0].Value.ToString(); empObjects obj = new empObjects(); obj.ID = id; BLL.EmpDataBLL bllLayer = new BLL.EmpDataBLL(); bllLayer.delEmp(id); MessageBox.Show("Data Deleted Sucessfully"); rmGrid.DataSource = null; } }
public static void NewAdmin(empObjects eobj) { try { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["constring"].ConnectionString); con.Open(); SqlCommand cmd = new SqlCommand("insert into AdminLogin values ('" + eobj.Admin + "','" + eobj.AdminPass + "')", con); cmd.ExecuteNonQuery(); } catch (Exception) { return; } }
public void EmpData(empObjects obj, byte[] pic) { try { SqlConnection con = new SqlConnection(constring); con.Open(); SqlCommand cmd = new SqlCommand("insert into Emp_details ([name],[address],[state],[Designation],[email],[Mob],[qualification],[username],[password],[Path]) values ('" + obj.name + "','" + obj.Address + "','" + obj.state + "','" + obj.Desigination + "','" + obj.email + "'," + obj.mobilenumber + ",'" + obj.qualification + "','" + obj.username + "','" + obj.password + "','" + pic + "')", con); cmd.ExecuteNonQuery(); } catch (Exception) { return; } }
public DataTable adminLogin(empObjects eobj) { DataTable td = new DataTable(); SqlConnection con = new SqlConnection(constring); con.Open(); SqlCommand cmd = new SqlCommand("Select * from AdminLogin where username='******' and password ='******'", con); cmd.CommandTimeout = 90; SqlDataReader dr = cmd.ExecuteReader(); td.Load(dr); con.Close(); return(td); }
public DataTable LoginSource(empObjects obj) { DataTable dt = new DataTable(); SqlConnection con = new SqlConnection(constring); con.Open(); SqlCommand cmd = new SqlCommand("select [username],[password] from Emp_details where username='******' and password='******'", con); //cmd.Parameters.AddWithValue("@Username", obj.username); //cmd.Parameters.AddWithValue("@pass", obj.password); SqlDataReader dr = cmd.ExecuteReader(); dt.Load(dr); return(dt); }
public void update(empObjects obj) { EmpDataDAL dal = new EmpDataDAL(); dal.updateData(obj); }
public DataTable adlogin(empObjects eobj) { return(empAdd.adminLogin(eobj)); }
public static void AdnewAdmin(empObjects eobj) { DAL.EmpDataDAL.NewAdmin(eobj); }
public DataTable LoginBLL(empObjects obj) { EmpDataDAL LoginDal = new EmpDataDAL(); return(LoginDal.LoginSource(obj)); }
public void empDataAdd(empObjects obj, byte[] pic) { empAdd.EmpData(obj, pic); }