예제 #1
0
 public void binddata(string query)
 {
     try
     {
         tbl_rescue_place_victim_BAL objbal = new tbl_rescue_place_victim_BAL();
         DataSet ds = objbal.getdata(query);
         gvlist.DataSource = ds;
         gvlist.DataBind();
     }
     catch (Exception ex)
     {
     }
 }
예제 #2
0
    private void bindlost(string query)
    {
        try
        {
            tbl_rescue_place_victim_BAL objbal = new tbl_rescue_place_victim_BAL();
            DataSet ds = objbal.getdata(query);

            ddl_place.DataSource = ds;
            ddl_place.DataBind();
        }
        catch (Exception ex)
        {
        }
    }
    protected void btn_update_Click(object sender, EventArgs e)
    {
        try
        {
            tbl_rescue_place_victim_BAL objbal = new tbl_rescue_place_victim_BAL();
            tbl_rescue_place_victim_DAL objdal = new tbl_rescue_place_victim_DAL();

            objdal.int_victim_id = Convert.ToInt16(ViewState["id"]);

            objdal.str_victim_name = txt_victim_name.Text;
            objdal.int_victim_age  = Convert.ToInt32(txt_age.Text);
            objdal.str_gender      = btn_rdo_gender.SelectedItem.Value;
            objdal.str_address     = txt_address.Text;

            objdal.str_victim_image_path = fu_victim.FileName;
            if (fu_victim.HasFile)
            {
                //if (fu_img.PostedFile.ContentLength <= 250000)
                //{
                string path = Server.MapPath("~/upload/rescue_place_victim_page/");
                fu_victim.SaveAs(path + fu_victim.FileName);
                //}
            }



            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);
        }
        catch (Exception ex)
        {
        }
    }
    private void bindplace(string query)
    {
        try
        {
            tbl_rescue_place_victim_BAL objbal = new tbl_rescue_place_victim_BAL();
            DataSet ds = objbal.getdata(query);

            dv_list.DataSource = ds;
            dv_list.DataBind();
        }
        catch (Exception ex)
        {
        }


        //hid_lang.Value = ds.Tables[0].Rows[0]["var_lang"].ToString();
        //hid_lat.Value = ds.Tables[0].Rows[0]["var_lat"].ToString();
    }
    protected void btn_add_Click(object sender, EventArgs e)
    {
        try
        {
            tbl_rescue_place_victim_BAL objbal = new tbl_rescue_place_victim_BAL();
            tbl_rescue_place_victim_DAL objdal = new tbl_rescue_place_victim_DAL();


            objdal.str_victim_name = txt_victim_name.Text;
            objdal.int_victim_age  = Convert.ToInt32(txt_age.Text);
            objdal.str_gender      = btn_rdo_gender.SelectedItem.Value;


            objdal.str_address = txt_address.Text;

            objdal.str_victim_image_path = fu_victim.FileName;

            if (fu_victim.HasFile)
            {
                string path = Server.MapPath("~/upload/rescue_place_victim_page/");
                fu_victim.SaveAs(path + fu_victim.FileName);
            }

            int val = objbal.insert_data(objdal);


            if (val > 0)
            {
                binddata("");
                lblmsg.Text      = "Data successfully inserted";
                lblmsg.ForeColor = System.Drawing.Color.Green;
            }
            changepanel(1, 0);
        }
        catch (Exception ex)
        {
        }
    }
예제 #6
0
    protected void btn_select_delete_Click(object sender, EventArgs e)
    {
        try
        {
            tbl_rescue_place_victim_BAL objbal = new tbl_rescue_place_victim_BAL();
            tbl_rescue_place_victim_DAL objdal = new tbl_rescue_place_victim_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_victim_id = Convert.ToInt16(id.Value);
                    objbal.delete_data(objdal);
                    binddata("");
                }
            }
        }
        catch (Exception ex)
        {
        }
    }