コード例 #1
0
ファイル: Success.aspx.cs プロジェクト: wangscript007/roycms
 {    /// <summary>
     /// XML help?
     /// </summary>
     protected void Page_Load(object sender, EventArgs e)
     {
         if (!IsPostBack)
         {
             ROYcms.Sys.BLL.ROYcms_Goods_Order   Goods_Order_BLL   = new ROYcms.Sys.BLL.ROYcms_Goods_Order();
             ROYcms.Sys.Model.ROYcms_Goods_Order Goods_Order_Model = new ROYcms.Sys.Model.ROYcms_Goods_Order();
             ROYcms.Sys.BLL.ROYcms_Payment       Payment_BLL       = new ROYcms.Sys.BLL.ROYcms_Payment();
             ROYcms.Sys.Model.ROYcms_Payment     Payment_Model     = new ROYcms.Sys.Model.ROYcms_Payment();
             ROYcms.Sys.BLL.ROYcms_user          user_BLL          = new ROYcms.Sys.BLL.ROYcms_user();
             ROYcms.Sys.Model.ROYcms_user        user_Model        = new ROYcms.Sys.Model.ROYcms_user();
             string OrderId = Request["order_id"];
             if (OrderId != null)
             {
                 //修改订单状态
                 Goods_Order_Model = Goods_Order_BLL.GetModel(OrderId);
                 if (Goods_Order_Model == null)
                 {
                     //订单无效
                     return;
                 }
                 Goods_Order_Model.order_sn     = OrderId;
                 Goods_Order_Model.order_status = 1;
                 Goods_Order_BLL.Update_(Goods_Order_Model);
                 //创建支付记录
                 Payment_Model.PaymentAmount = Goods_Order_Model.goods_amount;
                 Payment_Model.PaymentName   = "支付接口名称";
                 Payment_Model.PaymentNum    = "支付号";
                 Payment_Model.PaymentType   = "支付接口类型";
                 Payment_Model.UserID        = Goods_Order_Model.user_id;
                 Payment_Model.UpdateTime    = DateTime.Now;
                 Payment_BLL.Add(Payment_Model);
                 //修改用户积分
                 user_Model = user_BLL.GetModel(Convert.ToInt32(Goods_Order_Model.user_id));
                 if (user_Model == null)
                 {
                     //用户无效
                     return;
                 }
                 user_Model.money = user_Model.money + Goods_Order_Model.goods_amount;
             }
             else
             {
                 ROYcms.Common.MessageBox.Show(this, "订单号码不能为空!");
             }
         }
     }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //支付成功后的操作
            string OrderId = ROYcms.Common.Request.GetQueryString("OrderId");

            //修改订单状态
            OrderModel = OrderBLL.GetModel(OrderId);
            OrderModel.order_status    = 1; //将订单修改为已确认
            OrderModel.pay_status      = 2; //修改支付状态 为已付款
            OrderModel.shipping_status = 3; //修改配送状态为 备货中
            OrderBLL.Update(OrderModel);
            //写入在线支付记录
            PaymentModel.PaymentAmount = 0;
            PaymentModel.PaymentName   = "";
            PaymentModel.PaymentNum    = "";
            PaymentModel.PaymentType   = "";
            PaymentModel.UserID        = Convert.ToInt32(ROYcms.Common.Session.Get("user_id") == null ? "0" : ROYcms.Common.Session.Get("user_id"));
            PaymentModel.CreateTime    = DateTime.Now;
            PaymentModel.UpdateTime    = DateTime.Now;
            PaymentBLL.Add(PaymentModel);
            //如果是充值到账户  加正账户余额 加正可用余额
        }