protected void Button2_Click(object sender, EventArgs e) { CusProps p = new CusProps(); p.C_id = txt_eid.Text; p.C_name = txt_name.Text; p.C_cell = txt_cell.Text; p.C_address = txt_address.Text; p.C_cnic = cnic.Text; CusBLL cus = new CusBLL(); if (cus.updateCusBLL(p)) { massege("Record Updated Successfully"); txt_eid.Text = ""; txt_name.Text = ""; txt_cell.Text = ""; txt_address.Text = ""; cnic.Text = ""; } else { massege("Record Updated Unsuccessfull"); } }
private void button1_Click(object sender, EventArgs e) { CusProps p = new CusProps(); p.C_id = txt_eid.Text; p.C_name = txt_name.Text; p.C_cell = txt_cell.Text; p.C_address = txt_address.Text; p.C_cnic = cnic.Text; CusBLL cus = new CusBLL(); if (cus.updateCusBLL(p)) { MessageBox.Show("Record Updated Successfully"); txt_eid.Text = ""; txt_name.Text = ""; txt_cell.Text = ""; txt_address.Text = ""; cnic.Text = ""; } else { MessageBox.Show("Record Updated Unsuccessfull"); } }
protected void Button4_Click(object sender, EventArgs e) { CusProps p = new CusProps(); p.C_id = txt_eid.Text; CusBLL cus = new CusBLL(); DataTable dt = cus.searchCusBLL(p); if (dt.Rows.Count > 0) { massege("Record Found..!"); txt_name.Text = dt.Rows[0]["name"].ToString(); cnic.Text = dt.Rows[0]["cnic"].ToString(); txt_cell.Text = dt.Rows[0]["cell"].ToString(); txt_address.Text = dt.Rows[0]["address"].ToString(); } else { massege("Record Not Found..!"); txt_name.Text = ""; txt_cell.Text = ""; txt_address.Text = ""; cnic.Text = ""; } }
private void button3_Click(object sender, EventArgs e) { CusProps p = new CusProps(); p.C_id = txt_eid.Text; CusBLL cus = new CusBLL(); DataTable dt = cus.searchCusBLL(p); if (dt.Rows.Count > 0) { MessageBox.Show("Record Found..!"); txt_name.Text = dt.Rows[0]["name"].ToString(); cnic.Text = dt.Rows[0]["cnic"].ToString(); txt_cell.Text = dt.Rows[0]["cell"].ToString(); txt_address.Text = dt.Rows[0]["address"].ToString(); } else { MessageBox.Show("Record Not Found..!"); } }
public DataTable searchCusDAL(CusProps p) { string query = "select * from customer where cus_id ='" + p.C_id + "'"; return(db.search(query)); }
public bool updateCusDAL(CusProps p) { string query = "update customer set name = '" + p.C_name + "',cnic = '" + p.C_cnic + "',cell = '" + p.C_cell + "',address = '" + p.C_address + "' where cus_id = '" + p.C_id + "'; "; return(db.query_iud(query)); }
public bool deleteCusDAL(CusProps p) { string query = "delete from customer where cus_id ='" + p.C_id + "'"; return(db.query_iud(query)); }
public bool insertCusDAL(CusProps p) { string query = "INSERT INTO customer VALUES('" + p.C_id + "','" + p.C_name + "','" + p.C_cnic + "','" + p.C_cell + "','" + p.C_address + "')"; return(db.query_iud(query)); }
public DataTable searchCusBLL(CusProps p) { CusDAL obj = new CusDAL(); return(obj.searchCusDAL(p)); }
public bool updateCusBLL(CusProps p) { CusDAL obj = new CusDAL(); return(obj.updateCusDAL(p)); }
public bool deleteCusBLL(CusProps p) { CusDAL obj = new CusDAL(); return(obj.deleteCusDAL(p)); }
public bool insertCusBLL(CusProps p) { CusDAL obj = new CusDAL(); return(obj.insertCusDAL(p)); }