//删除订单 protected void Button12_Click(object sender, EventArgs e) { //历遍清单所有商品数量,查找库存 DataTable Unew = cartProBll.GetCartProOrderID(Mid); //获得详细清单列表 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 = proBll.GetproductByid(Opid);//获得商品信息 if (pdin.JisuanFs == 1) { int pstock = pdin.Stock + Onum;//库存结果,返回的商品数量 proBll.ProUpStock(Opid, pstock); } } oll.DeleteByID(Mid); function.WriteSuccessMsg("删除成功", "OrderList.aspx"); }