c#winform里面的listbox请问这样可以得到总箱数吗?
intBOX_NO=0;//定义总箱数变量for(intj=0;j<listData.Items.Count;j++){stringsTransDataNo=listDa...
int BOX_NO = 0;//定义总箱数变量
for (int j = 0; j < listData.Items.Count; j++)
{
string sTransDataNo = listData.Items[j].ToString();
DataSet ds = SerProductOut.GetDataInfo(sTransDataNo);
if (!app.CheckEOF(ds)) throw new Exception(sTransUnit + "[" + sTransDataNo + "]查无对应资料");
for (int k = 0; k < ds.Tables[0].Rows.Count; k++)
{
DataRow dr = DsOut.Tables[0].NewRow();
dr[0] = ds.Tables[0].Rows[k]["BOX_NO"].ToString();
dr[1] = ds.Tables[0].Rows[k]["ITEM_NO"].ToString();
dr[2] = ds.Tables[0].Rows[k]["QTY"].ToString();
dr[3] = ds.Tables[0].Rows[k]["WIP_NO"].ToString();
dr[4] = ds.Tables[0].Rows[k]["STICKERS"].ToString();
DsOut.Tables[0].Rows.Add(dr);
BOX_NO += int.Parse(dr["BOX_NO"].ToString());
}
}
lbl_CouBox.Text = "共" + BOX_NO;//总箱数 展开
for (int j = 0; j < listData.Items.Count; j++)
{
string sTransDataNo = listData.Items[j].ToString();
DataSet ds = SerProductOut.GetDataInfo(sTransDataNo);
if (!app.CheckEOF(ds)) throw new Exception(sTransUnit + "[" + sTransDataNo + "]查无对应资料");
for (int k = 0; k < ds.Tables[0].Rows.Count; k++)
{
DataRow dr = DsOut.Tables[0].NewRow();
dr[0] = ds.Tables[0].Rows[k]["BOX_NO"].ToString();
dr[1] = ds.Tables[0].Rows[k]["ITEM_NO"].ToString();
dr[2] = ds.Tables[0].Rows[k]["QTY"].ToString();
dr[3] = ds.Tables[0].Rows[k]["WIP_NO"].ToString();
dr[4] = ds.Tables[0].Rows[k]["STICKERS"].ToString();
DsOut.Tables[0].Rows.Add(dr);
BOX_NO += int.Parse(dr["BOX_NO"].ToString());
}
}
lbl_CouBox.Text = "共" + BOX_NO;//总箱数 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询