protected void btnUpdate_Click(object sender, EventArgs e) { Good lGood = new Good(); ImgInfo lGoodinfo = new ImgInfo(); lGood.GoodName = tbxGoodName.Text; lGood.GoodPrice = tbxGoodPrice.Text; lGood.GoodID = Convert.ToInt32(Session["GoodID"]); lGoodinfo.ImgAddress = tbxGoodImgUrl.Text; lGoodinfo.ImgTitle = tbxGoodImgTitle.Text; lGoodinfo.GoodID = Convert.ToInt32(Session["GoodID"]); GA Gadmin = new GA(); GAController gadmin = new GAController(); if (tbxGoodImgTitle.Text == "" || tbxGoodImgUrl.Text == "" || tbxGoodName.Text == "" || tbxGoodPrice.Text == "") { lbShow.Text = "信息不能为空"; } else { if (gadmin.UpdateGoodinfo(Gadmin, lGoodinfo, lGood)) { lbShow.Text = "修改成功"; } else { lbShow.Text = "修改失败"; } } }