Ejemplo n.º 1
0
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        LinkButton LinkButton2 = (LinkButton)sender;
        Label      bookName    = (Label)LinkButton2.Parent.FindControl("Label1");

        BookInfo book = new BookInfo();

        book.BookName = bookName.Text;
        RegisterStartupScript("key", "<script type='text/javascript'>alert('购买成功');</script>");
        BookInfoBLL.AddBook(book, 1); //1用于购物车
    }
Ejemplo n.º 2
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            BookInfoModel book = new BookInfoModel();

            book.author_id    = int.Parse(txtauthorid.Text);
            book.catalog      = txtcatalog.Text;
            book.category_id  = int.Parse(DropDownList2.SelectedValue);
            book.image        = "";
            book.isbn         = txtisbn.Text;
            book.origintitle  = txtorigin.Text;
            book.pages        = txtpages.Text;
            book.price        = txtprice.Text;
            book.pubdate      = txtpubdate.Text;
            book.publisher_id = int.Parse(txtpublisherid.Text);
            book.subtitle     = txtsub.Text;
            book.summary      = txtsummary.Text;
            book.title        = txttitle.Text;
            string msg = BookInfoBLL.AddBook(book);

            ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script>showModal('" + msg + "');</script>");
        }