Example #1
0
    //确定支付按钮
    protected void payBtn_onCLick(object sender, EventArgs e)
    {
        oc.UpdateOrderState(OrderID, 1);
        //oc.UpdateGoodsInfoByOrderID(OrderID);
        //总金额
        string    strSql  = "select * from tb_OrderDetail where OrderID=" + OrderID;
        DataTable dsTable = dbobj.GetDataSetStr(strSql, "tbOrderDetail");

        for (int i = 0; i < dsTable.Rows.Count; i++)
        {
            int num = int.Parse(dsTable.Rows[i]["GoodsNum"].ToString());
            int id  = int.Parse(dsTable.Rows[i]["GoodsID"].ToString());
            gc.UpdateGoodsInfoByGoodsID(id, num);
            //大礼包数量处理
            string    sql = "select * from tb_GiftPacks where GiftPacksID=" + id;
            DataTable ds  = dbobj.GetDataSetStr(sql, "tbGiftPacks");
            for (int j = 0; j < ds.Rows.Count; j++)
            {
                int goodId  = int.Parse(ds.Rows[j]["GoodsID"].ToString());
                int goodNum = int.Parse(ds.Rows[i]["GoodsNum"].ToString());
                gc.UpdateGoodsInfoByGoodsID(goodId, goodNum);
            }
        }
        //付款完成后清除购物车
        bc.ClearCartGoods(UserID);
        //订单完成
        Response.Write(cc.MessageBox("支付成功!", "UserMyOrders.aspx"));
    }
Example #2
0
    //清理购物车
    protected void clearCart(object sender, EventArgs e)
    {
        int UserID = Convert.ToInt32(Session["UserID"]);

        bc.ClearCartGoods(UserID);
        //刷新页面
        Response.Redirect(Request.Url.ToString());
    }