示例#1
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string isbn   = GridView1.Rows[e.RowIndex].Cells[1].Text;
        bool   result = ShoppingCartBLL.DeleteBook(isbn);

        Button1.Text = isbn.ToString();
        if (result)
        {
            RegisterStartupScript("key", "<script type='text/javascript'>alert('删除成功');</script>");
        }
        else
        {
            RegisterStartupScript("key", "<script type='text/javascript'>alert('删除失败');</script>");
        }
        Bind();
    }
示例#2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < GridView1.Rows.Count; i++)
     {
         if (((CheckBox)GridView1.Rows[i].FindControl("cb1")).Checked == true)
         {
             string isbn    = GridView1.Rows[i].Cells[1].Text;
             int    numbers = Convert.ToInt32(((TextBox)GridView1.Rows[i].Cells[12].FindControl("TextBox5")).Text);
             BookInfoBLL.AddBookToIndent(isbn, numbers);
             bool result = ShoppingCartBLL.DeleteBook(isbn);
             Button1.Text = isbn;
             RegisterStartupScript("key", "<script type='text/javascript'>alert('成功添加到购物车');</script>");
         }
     }
     Bind();
 }