又是后台转前台。后台的SQL在前台怎么写呢??
这个是后台写的按键,主要是红字那部分不知道在前台JS中该怎么写~试过很多都抓不到数值
protected void Button3_Click(object sender, EventArgs e)
{
string cbl = " ";
string sqlSelect="";
string sqlFrom="";
for (int i = 0; i < cblCust_id.Items.Count; i++)
{
if (cblCust_id.Items[i].Selected == true)
{
cbl = cblCust_id.Items[i].Value;
sqlSelect += "P" + cbl + ".Stock P" + cbl + ", S" + cbl + ".tr_qty S" + cbl +"";
sqlFrom += " left join pd120 P" + cbl + " on P" + cbl + ".item_id=P1.item_id and P" + cbl + ".hou_no='" + cbl + "'"
+ " left join (select item_id,sum(tr_qty)tr_qty from sa395 "
+ " where tr_date>='2011/01/01' and tr_date<'2011/01/01' and substring(sale_id,1,6)='" + cbl + "' "
+ " group by item_id) S"+cbl+" on S"+cbl+".item_id=P1.item_id ";
}
}
if (cbl != "")
{
cbl = cbl.Substring(0, cbl.Length - 1);
Response.Redirect("SaRight.aspx?SelectSql=" + sqlSelect+"&FromSql=" +sqlFrom);
}
else
{
cbl = "空";
Response.Write("<script>alert('选中的值为:" + cbl + "')</script>");
}
}