コード例 #1
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string   delAdoptID  = GridView1.DataKeys[e.RowIndex].Value.ToString();
            AdoptPet adoptPetone = new AdoptPet();

            adoptPetone.DeleteAdoptPet(delAdoptID);
        }
コード例 #2
0
        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            AdoptPet adoptPet = new AdoptPet();

            for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
            {
                CheckBox cbox = (CheckBox)GridView1.Rows[i].FindControl("CheckBoxs");
                if (cbox.Checked == true)
                {
                    string sqlstr = GridView1.DataKeys[i].Value.ToString();
                    adoptPet.DeleteAdoptPet(sqlstr);
                }
            }
            BindGridNew(1);
        }
コード例 #3
0
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     string delAdoptID= GridView1.DataKeys[e.RowIndex].Value.ToString() ;
     AdoptPet adoptPetone = new AdoptPet();
     adoptPetone.DeleteAdoptPet(delAdoptID);
 }
コード例 #4
0
 protected void BtnDelete_Click(object sender, EventArgs e)
 {
     AdoptPet adoptPet = new AdoptPet();
     for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
     {
         CheckBox cbox = (CheckBox)GridView1.Rows[i].FindControl("CheckBoxs");
         if (cbox.Checked == true)
         {
             string sqlstr = GridView1.DataKeys[i].Value.ToString();
             adoptPet.DeleteAdoptPet(sqlstr);
         }
     }
     BindGridNew(1);
 }