protected void btn_add_Click1(object sender, EventArgs e) { tbl_rescue_person_BAL objbal = new tbl_rescue_person_BAL(); tbl_rescue_person_DAL objdal = new tbl_rescue_person_DAL(); objdal.int_voluntar_team_id = Convert.ToInt16(ddl_voluntar_team_name.SelectedItem.Value); objdal.int_lost_id = Convert.ToInt16(ddl_lost_person_name.SelectedItem.Value); objdal.str_address = txt_address.Text; objdal.int_contact = Convert.ToInt64(txt_contact.Text); objdal.str_description = txt_description.Text; lblmsg.Visible = true; int val = objbal.insert_data(objdal); if (val > 0) { lblmsg.Text = "successfully inserted"; lblmsg.ForeColor = System.Drawing.Color.Green; binddata(""); } else if (val == -1) { lblmsg.Text = "name duplicate is not allowed"; lblmsg.ForeColor = System.Drawing.Color.Red; } changepanel(1, 0); }
protected void btn_update_Click(object sender, EventArgs e) { tbl_rescue_person_BAL objbal = new tbl_rescue_person_BAL(); tbl_rescue_person_DAL objdal = new tbl_rescue_person_DAL(); objdal.int_rescue_person_id = Convert.ToInt16(ViewState["id"]); objdal.int_voluntar_team_id = Convert.ToInt16(ddl_voluntar_team_name.SelectedItem.Value); objdal.int_lost_id = Convert.ToInt16(ddl_lost_person_name.SelectedItem.Value); objdal.str_address = txt_address.Text; objdal.int_contact = Convert.ToInt64(txt_contact.Text); objdal.str_description = txt_description.Text; lblmsg.Visible = true; int val = objbal.update_data(objdal); objbal.update_data(objdal); binddata(""); if (val > 0) { lblmsg.Text = "Data Update"; lblmsg.ForeColor = System.Drawing.Color.Green; } else { lblmsg.Text = "Error in Process,try again"; lblmsg.ForeColor = System.Drawing.Color.Red; } changepanel(1, 0); }
public void binddata(string query) { tbl_rescue_person_BAL objbal = new tbl_rescue_person_BAL(); DataSet ds = objbal.getdata(query); gvlist.DataSource = ds; gvlist.DataBind(); }
public void binddata(string query) { try { tbl_rescue_person_BAL objbal = new tbl_rescue_person_BAL(); DataSet ds = objbal.getdata(query); dv_list.DataSource = ds; dv_list.DataBind(); } catch (Exception ex) { } }
protected void btn_select_delete_Click(object sender, EventArgs e) { tbl_rescue_person_BAL objbal = new tbl_rescue_person_BAL(); tbl_rescue_person_DAL objdal = new tbl_rescue_person_DAL(); foreach (GridViewRow row in gvlist.Rows) { var check = row.FindControl("chkselect") as CheckBox; if (check.Checked) { var id = row.FindControl("Hiddenid") as HiddenField; objdal.int_rescue_person_id = Convert.ToInt16(id.Value); objbal.delete_data(objdal); binddata(""); } } }