Exemplo n.º 1
0
    {    /// <summary>
        /// XML help?
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request["order_id"] != null)
                {
                    //修改订单状态

                    ROYcms.Sys.BLL.ROYcms_product_order ROYcms_product_order = new ROYcms.Sys.BLL.ROYcms_product_order();
                    ROYcms_product_order.order_status(Request["order_id"].Trim(), "0");//付款成功

                    //修改用户积分

                    string user_id = ROYcms.DB.DbHelpers.GetSingle("select user_id from ROYcms_product_order where order_id='" + Request["order_id"].Trim() + "'").ToString();
                    int    money   = Convert.ToInt32(ROYcms.DB.DbHelpers.GetSingle("select money from [ROYcms_user] where bh='" + user_id + "'") == null ? "0" : ROYcms.DB.DbHelpers.GetSingle("select money from [ROYcms_user] where bh='" + user_id + "'"));

                    ROYcms.DB.DbHelpers.NonQuery("update [ROYcms_user] SET money=" + ((Convert.ToInt32(Request["orderAmount"]) / 10) + money) + "  where bh='" + user_id + "'");


                    if (Request["k"] != null)
                    {
                        string canshu = "/_add_order.html?orderId=" + Request["order_id"] + "&orderAmount=" + (Convert.ToInt32(Request["orderAmount"]) / 10) + "&productName=英雄王座 充值&productNum=1";
                        if (ROYcms.Common.GetUrlText.GetText(canshu, "utf-8") == "兑换成功")
                        {
                            Response.ContentType = "text/plain";
                            Response.Write("兑换成功");
                        }
                        else
                        {
                            Response.ContentType = "text/plain";
                            Response.Write("失败!");
                        }
                    }
                    else
                    {
                        Response.ContentType = "text/plain";
                        Response.Write("付款成功");
                    }
                }
                else
                {
                    Response.Write("订单号码不能为空!");
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 创建订单
        /// </summary>
        /// <param name="orderId">订单号</param>
        /// <param name="orderAmount">价格 </param>
        /// <param name="productName">产品名称</param>
        /// <param name="productNum">数量</param>
        /// <param name="k">k</param>
        protected void Order_add(string orderId, string orderAmount, string productName, string productNum, string k)
        {
            string order_id = orderId;

            string   user_id            = ROYcms.Common.Session.Get("user_id"); //用户id
            string   order_status       = "1";                                  //订单状态 默认未支付0代表已经支付
            decimal  order_price        = decimal.Parse(orderAmount);           //订单金额
            string   order_payment      = "";                                   // 支付方式
            string   order_rec_name     = "";                                   //收件人
            string   order_rec_address  = "";                                   //收件人地址
            string   order_rec_code     = "";                                   //邮编
            string   order_rec_phone    = "";                                   //手机
            string   order_rec_tel      = "";                                   //固话
            string   order_shipping     = "";                                   //配送方式
            decimal  order_freight      = 0;                                    //运费
            string   order_deliveryTime = DateTime.Now.ToString();              //送货时间
            DateTime create_time        = DateTime.Now;                         //订单创建时间
            bool     ifdefault          = true;                                 //默认地址

            ROYcms.Sys.Model.ROYcms_product_order model = new ROYcms.Sys.Model.ROYcms_product_order();
            model.order_id           = order_id;
            model.user_id            = user_id;
            model.order_status       = order_status;
            model.order_price        = order_price;
            model.order_payment      = order_payment;
            model.order_rec_name     = order_rec_name;
            model.order_rec_address  = order_rec_address;
            model.order_rec_code     = order_rec_code;
            model.order_rec_phone    = order_rec_phone;
            model.order_rec_tel      = order_rec_tel;
            model.order_shipping     = order_shipping;
            model.order_freight      = order_freight;
            model.order_deliveryTime = order_deliveryTime;
            model.create_time        = create_time;
            model.ifdefault          = ifdefault;

            ROYcms.Sys.BLL.ROYcms_product_order bll = new ROYcms.Sys.BLL.ROYcms_product_order();
            NewXml(bll.Add(model));



            Response.Redirect("/administrator/Payment/99bill/99bill.aspx?orderId=" + orderId + "&orderAmount=" + orderAmount + "&productName=" + productName + "&productNum=" + productNum + "&k=" + k);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Order_Button_Click(object sender, EventArgs e)
        {
            string order_id = Label_order_id.Text.Trim();

            string   user_id            = ROYcms.Common.Session.Get("user_id");                                       //用户id
            string   order_status       = "1";                                                                        //订单状态 默认未支付0代表已经支付
            decimal  order_price        = decimal.Parse(Label_order_price.Text == "" ? "0" : Label_order_price.Text); //订单金额
            string   order_payment      = DropDownList_order_payment.SelectedValue;                                   // 支付方式
            string   order_rec_name     = this.txtorder_rec_name.Text;                                                //收件人
            string   order_rec_address  = this.txtorder_rec_address.Text;                                             //收件人地址
            string   order_rec_code     = this.txtorder_rec_code.Text;                                                //邮编
            string   order_rec_phone    = this.txtorder_rec_phone.Text;                                               //手机
            string   order_rec_tel      = this.txtorder_rec_tel.Text;                                                 //固话
            string   order_shipping     = DropDownList_order_shipping.SelectedValue.ToString();                       //配送方式
            decimal  order_freight      = 0;                                                                          //运费
            string   order_deliveryTime = this.txtorder_deliveryTime.Text;                                            //送货时间
            DateTime create_time        = DateTime.Now;                                                               //订单创建时间
            bool     ifdefault          = this.chkifdefault.Checked;                                                  //默认地址

            ROYcms.Sys.Model.ROYcms_product_order model = new ROYcms.Sys.Model.ROYcms_product_order();
            model.order_id           = order_id;
            model.user_id            = user_id;
            model.order_status       = order_status;
            model.order_price        = order_price;
            model.order_payment      = order_payment;
            model.order_rec_name     = order_rec_name;
            model.order_rec_address  = order_rec_address;
            model.order_rec_code     = order_rec_code;
            model.order_rec_phone    = order_rec_phone;
            model.order_rec_tel      = order_rec_tel;
            model.order_shipping     = order_shipping;
            model.order_freight      = order_freight;
            model.order_deliveryTime = order_deliveryTime;
            model.create_time        = create_time;
            model.ifdefault          = ifdefault;

            ROYcms.Sys.BLL.ROYcms_product_order bll = new ROYcms.Sys.BLL.ROYcms_product_order();
            NewXml(bll.Add(model));

            //   Response.Redirect("/administrator/Payment/99bill/99bill.aspx?orderId=" + orderId + "&orderAmount=" + orderAmount + "&productName=" + productName + "&productNum=" + productNum);
        }