13,347
社区成员
发帖
与我相关
我的任务
分享
帮忙看看代码要怎么做这是第二张图的代码
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Model;
namespace Web
{
public partial class bgxxCX : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false)
{
DataSet ds = BLL.zjbgBLL.getAllStock();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string condition = "";
string spbh = TextBox1.Text;
if (TextBox1.Text != "")
{
condition = condition + "bgxx.spbh ='" + TextBox1.Text + "'";
}
if (TextBox2.Text != "")
{
condition = condition + "bgxx.pih ='" + TextBox2.Text + "'";
}
DataSet ds = BLL.zjbgBLL.getStockByCondition(condition);
if (ds.Tables[0].Rows.Count > 0)
{
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
}
else
{
Response.Write("<script>alert('你查找的商品" + spbh + "商品编号不存在');</script>");
}
}
}
}