Example #1
0
        protected override void AttachChildControls()
        {
            string a = (this.Page.Request["action"] == null) ? "" : this.Page.Request["action"].ToString().ToLower();

            if (this.Page.Request["isrecharge"].ToInt(0) == 1)
            {
                HtmlGenericControl htmlGenericControl = (HtmlGenericControl)this.FindControl("divsteps");
                htmlGenericControl.Visible = false;
            }
            if (a == "getstatus")
            {
                HttpContext.Current.Response.Clear();
                int num  = 0;
                int num2 = 0;
                while (num != 1)
                {
                    num2++;
                    Thread.Sleep(1000);
                    string text = (this.Page.Request["orderId"] == null) ? "" : this.Page.Request["orderId"].ToString();
                    if (text != "")
                    {
                        if (this.Page.Request["isrecharge"].ToInt(0) == 1)
                        {
                            num = (MemberProcessor.IsRechargeSuccess(text) ? 1 : (-1));
                        }
                        else
                        {
                            int orderStatus = TradeHelper.GetOrderStatus(text);
                            num = ((orderStatus == 2) ? 1 : (-1));
                        }
                    }
                    else
                    {
                        num = -1;
                    }
                    if (num2 == 25)
                    {
                        break;
                    }
                }
                StringBuilder stringBuilder = new StringBuilder("{");
                stringBuilder.AppendFormat("\"Status\":\"{0}\"", num);
                stringBuilder.Append("}");
                HttpContext.Current.Response.ContentType = "application/json";
                HttpContext.Current.Response.Write(stringBuilder.ToString());
                HttpContext.Current.Response.End();
            }
            else
            {
                Image           image            = (Image)this.FindControl("imgCode");
                HtmlInputHidden htmlInputHidden  = (HtmlInputHidden)this.FindControl("txt_OrderId");
                HtmlInputHidden htmlInputHidden2 = (HtmlInputHidden)this.FindControl("txt_isrecharge");
                HtmlAnchor      htmlAnchor       = (HtmlAnchor)this.FindControl("userLink");
                HtmlAnchor      htmlAnchor2      = (HtmlAnchor)this.FindControl("orderLink");
                HtmlImage       htmlImage        = (HtmlImage)this.FindControl("leftimg");
                HtmlImage       htmlImage2       = (HtmlImage)this.FindControl("rightimg");
                if (htmlInputHidden2 != null)
                {
                    htmlInputHidden2.Value = this.Page.Request.QueryString["isrecharge"].ToNullString();
                }
                if (htmlImage != null)
                {
                    htmlImage.Src = HiContext.Current.GetSkinPath() + "/images/erweima02.gif";
                }
                if (htmlImage2 != null)
                {
                    htmlImage2.Src = HiContext.Current.GetSkinPath() + "/images/phone.jpg";
                }
                if (htmlInputHidden != null)
                {
                    htmlInputHidden.Value = this.Page.Request.QueryString["orderId"].Trim();
                }
                string orderId = (this.Page.Request["orderId"] == null) ? "" : this.Page.Request["orderId"].ToString();
                if (htmlAnchor2 != null)
                {
                    htmlAnchor2.HRef = base.GetRouteUrl("user_OrderDetails", new
                    {
                        OrderId = orderId
                    });
                }
                if (htmlAnchor != null)
                {
                    htmlAnchor.HRef = "/User/UserDefault";
                }
                if (image != null)
                {
                    image.ImageUrl = "http://www.thonky.com/qr-encoder/encode.php?maxw=270&ec=&s=" + this.Page.Request.QueryString["code_url"];
                }
            }
        }
Example #2
0
        protected override void AttachChildControls()
        {
            string  text  = "";
            string  text2 = "";
            string  text3 = "";
            decimal num   = default(decimal);
            bool    flag  = false;
            string  a     = (this.Page.Request["action"] == null) ? "" : this.Page.Request["action"].ToString().ToLower();

            if (a == "getstatus")
            {
                HttpContext.Current.Response.Clear();
                int num2 = 0;
                int num3 = 0;
                while (num2 != 1)
                {
                    num3++;
                    Thread.Sleep(500);
                    text3 = ((this.Page.Request["orderId"] == null) ? "" : this.Page.Request["orderId"].ToString());
                    if (text3 != "")
                    {
                        if (this.Page.Request["isrecharge"].ToInt(0) == 1)
                        {
                            num2 = (MemberProcessor.IsRechargeSuccess(text3) ? 1 : (-1));
                        }
                        else
                        {
                            int orderStatus = TradeHelper.GetOrderStatus(text3);
                            num2 = ((orderStatus == 2) ? 1 : (-1));
                        }
                    }
                    else
                    {
                        num2 = -1;
                    }
                    if (num3 == 30)
                    {
                        break;
                    }
                }
                StringBuilder stringBuilder = new StringBuilder("{");
                stringBuilder.AppendFormat("\"Status\":\"{0}\"", num2);
                stringBuilder.Append("}");
                HttpContext.Current.Response.ContentType = "application/json";
                HttpContext.Current.Response.Write(stringBuilder.ToString());
                HttpContext.Current.Response.End();
            }
            else
            {
                text  = HttpContext.Current.Request.QueryString["QRCodeImg"];
                text2 = HttpContext.Current.Request.QueryString["QrCodeUrl"];
                text3 = HttpContext.Current.Request.QueryString["OrderId"];
                int    num4  = 0;
                string text4 = "";
                int.TryParse(HttpContext.Current.Request.QueryString["status"], out num4);
                if (string.IsNullOrEmpty(text) || string.IsNullOrEmpty(text2) || num4 != 1)
                {
                    text4 = "错误的二维码信息";
                }
                if (num4 == 1 && text4 == "")
                {
                    OrderInfo orderInfo = TradeHelper.GetOrderInfo(text3);
                    if (orderInfo == null)
                    {
                        text4 = "错误的订单信息";
                    }
                    else if (orderInfo.OrderStatus != OrderStatus.WaitBuyerPay)
                    {
                        text4 = "订单当前状态不能支付";
                    }
                    if (orderInfo != null)
                    {
                        if (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid)
                        {
                            text4 = "订单已支付";
                        }
                        num = orderInfo.GetTotal(true);
                    }
                }
                this.divMessage  = (HtmlGenericControl)this.FindControl("divMessage");
                this.divSuccess  = (HtmlGenericControl)this.FindControl("divSuccess");
                this.divError    = (HtmlGenericControl)this.FindControl("divError");
                this.ErrorMsg    = (HtmlGenericControl)this.FindControl("ErrorMsg");
                this.QRCodeImg   = (HtmlImage)this.FindControl("QRCodeImg");
                this.paymoney    = (HtmlGenericControl)this.FindControl("paymoney");
                this.txt_OrderId = (HtmlInputHidden)this.FindControl("txt_OrderId");
                this.defaultLink = (HtmlAnchor)this.FindControl("defaultLink");
                this.userLink    = (HtmlAnchor)this.FindControl("userLink");
                this.orderLink   = (HtmlAnchor)this.FindControl("orderLink");
                if (this.txt_OrderId != null)
                {
                    this.txt_OrderId.Value = text3;
                }
                if (this.orderLink != null)
                {
                    this.orderLink.HRef = base.GetRouteUrl("user_OrderDetails", new
                    {
                        OrderId = text3
                    });
                }
                if (this.userLink != null)
                {
                    this.userLink.HRef = "/User/UserDefault";
                }
                if (this.defaultLink != null)
                {
                    this.defaultLink.HRef = "/";
                }
                if (this.divError != null && this.divMessage != null)
                {
                    if (text4 != "")
                    {
                        this.divError.Visible   = true;
                        this.divMessage.Visible = false;
                        this.ErrorMsg.InnerHtml = text4;
                    }
                    else
                    {
                        this.divMessage.Visible = true;
                        this.divError.Visible   = false;
                        if (this.paymoney != null)
                        {
                            this.paymoney.InnerHtml = "¥" + num.F2ToString("f2");
                        }
                        if (this.QRCodeImg != null)
                        {
                            this.QRCodeImg.Src = text;
                        }
                    }
                }
            }
        }