protected void BatDel_Btn_Click(object sender, EventArgs e) { string CID = Request.Form["idchk"];//订单ID列表 if (!String.IsNullOrEmpty(CID)) { DataTable Ode = orderBll.GetOrderbyOrderlist(CID);//获得订单列表 int odcount = Ode.Rows.Count; for (int p = 0; p < odcount; p++) { int CartproOrderid = DataConverter.CLng(Ode.Rows[p]["id"]); //订单ID //历遍清单所有商品数量,查找库存/////////////////// DataTable Unew = Cll.GetCartProOrderID(CartproOrderid); //获得详细清单列表 for (int s = 0; s < Unew.Rows.Count; s++) { int Onum = DataConverter.CLng(Unew.Rows[s]["Pronum"]); int Opid = DataConverter.CLng(Unew.Rows[s]["ProID"]); M_Product pdin = Pll.GetproductByid(Opid);//获得商品信息 if (pdin.JisuanFs == 1) { int pstock = pdin.Stock + Onum;//库存结果,返回的商品数量 Pll.ProUpStock(Opid, pstock); } } ////////////////////////////////////////////////////// } orderBll.Delorderlist(CID); function.WriteSuccessMsg("删除成功", "OrderList.aspx"); } }