protected void Button2_Click(object sender, EventArgs e) { EmpProps p = new EmpProps(); p.E_id = txt_eid.Text; p.E_name = txt_name.Text; p.E_cell = txt_cell.Text; p.E_address = txt_address.Text; p.E_email = txt_email.Text; p.E_password = txt_password.Text; EmpBLL emp = new EmpBLL(); if (emp.updateEmpBLL(p)) { Response.Write("<script>alert('Record Updated Successfully')</script>"); txt_eid.Text = ""; txt_name.Text = ""; txt_cell.Text = ""; txt_address.Text = ""; txt_email.Text = ""; txt_password.Text = ""; } else { Response.Write("<script>alert('Record Updated Unsuccessfull')</script>"); } }
private void button2_Click(object sender, EventArgs e) { EmpProps p = new EmpProps(); p.E_id = txt_eid.Text; EmpBLL emp = new EmpBLL(); if (emp.deleteEmpBLL(p)) { MessageBox.Show("Record Deleted Successfully"); txt_eid.Text = ""; txt_name.Text = ""; txt_cell.Text = ""; txt_address.Text = ""; } else { MessageBox.Show("Record Deleted Unsuccessfull"); } }
private void button3_Click(object sender, EventArgs e) { EmpProps p = new EmpProps(); p.E_id = txt_eid.Text; EmpBLL emp = new EmpBLL(); DataTable dt = emp.searchEmpBLL(p); if (dt.Rows.Count > 0) { MessageBox.Show("Record Found..!"); txt_name.Text = dt.Rows[0]["name"].ToString(); txt_cell.Text = dt.Rows[0]["cell"].ToString(); txt_address.Text = dt.Rows[0]["address"].ToString(); } else { MessageBox.Show("Record Not Found..!"); } }
protected void Button4_Click(object sender, EventArgs e) { EmpProps p = new EmpProps(); p.E_id = txt_eid.Text; EmpBLL emp = new EmpBLL(); DataTable dt = emp.searchEmpBLL(p); if (dt.Rows.Count > 0) { Response.Write("<script>alert('Record Found..!')</script>"); txt_name.Text = dt.Rows[0]["name"].ToString(); txt_cell.Text = dt.Rows[0]["cell"].ToString(); txt_address.Text = dt.Rows[0]["address"].ToString(); txt_email.Text = dt.Rows[0]["email"].ToString(); txt_password.Text = dt.Rows[0]["password"].ToString(); } else { Response.Write("<script>alert('Record Not Found..!')</script>"); } }
private void save_Click(object sender, EventArgs e) { EmpProps p = new EmpProps(); p.E_id = txt_eid.Text; p.E_name = txt_name.Text; p.E_cell = txt_cell.Text; p.E_address = txt_address.Text; EmpBLL emp = new EmpBLL(); if (emp.insertEmpBLL(p)) { MessageBox.Show("Record Inserted Successfully"); txt_eid.Text = ""; txt_name.Text = ""; txt_cell.Text = ""; txt_address.Text = ""; } else { MessageBox.Show("Record Inserted Unsuccessfull"); } }
public DataTable searchEmpDAL(EmpProps p) { string query = "select * from employee where emp_id ='" + p.E_id + "'"; return(db.search(query)); }
public bool updateEmpDAL(EmpProps p) { string query = "update employee set name = '" + p.E_name + "',cell = '" + p.E_cell + "',address = '" + p.E_address + "', email = '" + p.E_email + "', password = '******' where emp_id = '" + p.E_id + "'; "; return(db.query_iud(query)); }
public bool deleteEmpDAL(EmpProps p) { string query = "delete from employee where emp_id ='" + p.E_id + "'"; return(db.query_iud(query)); }
public bool insertEmpDAL(EmpProps p) { string query = "INSERT INTO employee VALUES('" + p.E_id + "','" + p.E_name + "','" + p.E_cell + "','" + p.E_address + "','" + p.E_email + "','" + p.E_password + "')"; return(db.query_iud(query)); }
public DataTable searchEmpBLL(EmpProps p) { EmpDAL obj = new EmpDAL(); return(obj.searchEmpDAL(p)); }
public bool updateEmpBLL(EmpProps p) { EmpDAL obj = new EmpDAL(); return(obj.updateEmpDAL(p)); }
public bool deleteEmpBLL(EmpProps p) { EmpDAL obj = new EmpDAL(); return(obj.deleteEmpDAL(p)); }
public bool insertEmpBLL(EmpProps p) { EmpDAL obj = new EmpDAL(); return(obj.insertEmpDAL(p)); }