Exemple #1
0
        private void GetPrize(System.Web.HttpContext context)
        {
            context.Response.ContentType = "application/json";
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder("{");
            string text = context.Request["gameid"];

            if (string.IsNullOrEmpty(text))
            {
                stringBuilder.Append("\"status\":\"0\",\"Desciption\":\"参数错误!\"}");
                context.Response.Write(stringBuilder.ToString());
                return;
            }
            GameInfo modelByGameId = GameHelper.GetModelByGameId(text);

            if (modelByGameId == null)
            {
                stringBuilder.Append("\"status\":\"0\",\"Desciption\":\"参数错误!\"}");
                context.Response.Write(stringBuilder.ToString());
                return;
            }
            if (System.DateTime.Now < modelByGameId.BeginTime)
            {
                stringBuilder.Append("\"status\":\"0\",\"Desciption\":\"活动还没开始!\"}");
                context.Response.Write(stringBuilder.ToString());
                return;
            }
            if (System.DateTime.Now > modelByGameId.EndTime || modelByGameId.Status == GameStatus.结束)
            {
                stringBuilder.Append("\"status\":\"0\",\"Desciption\":\"活动已结束!\"}");
                context.Response.Write(stringBuilder.ToString());
                return;
            }
            int num = 0;

            try
            {
                MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                num = currentMember.UserId;
            }
            catch (System.Exception)
            {
                stringBuilder.Append("\"status\":\"0\",\"Desciption\":\"请先登录!\"}");
                context.Response.Write(stringBuilder.ToString());
                return;
            }
            try
            {
                if (!MemberProcessor.CheckCurrentMemberIsInRange(modelByGameId.ApplyMembers, modelByGameId.DefualtGroup, modelByGameId.CustomGroup))
                {
                    stringBuilder.Append("\"status\":\"0\",\"Desciption\":\"当前会员不在活动的适用会员范围内\"}");
                    context.Response.Write(stringBuilder.ToString());
                    return;
                }
                GameHelper.IsCanPrize(modelByGameId.GameId, num);
            }
            catch (System.Exception ex)
            {
                stringBuilder.Append("\"status\":\"0\",\"Desciption\":\"" + ex.Message + "!\"}");
                context.Response.Write(stringBuilder.ToString());
                return;
            }
            lock (Hi_Ajax_Game.objLock)
            {
                try
                {
                    System.Collections.Generic.List <GameWinningPool> winningPoolList = GameHelper.GetWinningPoolList(Globals.ToNum(modelByGameId.GameId));
                    int    num2  = winningPoolList.Count <GameWinningPool>();
                    string text2 = "";
                    if (num2 > 0)
                    {
                        System.Random   random          = new System.Random();
                        int             index           = random.Next(0, num2);
                        GameWinningPool gameWinningPool = winningPoolList[index];
                        if (gameWinningPool != null)
                        {
                            int prizeId = 0;
                            if (gameWinningPool.GamePrizeId > 0)
                            {
                                GamePrizeInfo gamePrizeInfoById = GameHelper.GetGamePrizeInfoById(gameWinningPool.GamePrizeId);
                                if (gamePrizeInfoById != null)
                                {
                                    prizeId = gamePrizeInfoById.PrizeId;
                                    text2   = gamePrizeInfoById.PrizeName;
                                }
                                stringBuilder.Append(string.Concat(new object[]
                                {
                                    "\"status\":\"1\",\"Desciption\":\"\",\"prizeName\":\"",
                                    text2,
                                    "\",\"prizeState\":\"ok\",\"prizeId\":\"",
                                    gameWinningPool.GamePrizeId,
                                    "\",\"prize\":\"",
                                    gamePrizeInfoById.Prize,
                                    "\",\"prizeGrade\":\"",
                                    this.GetPrizeName(gamePrizeInfoById.PrizeGrade),
                                    "\"}"
                                }));
                            }
                            else
                            {
                                text2 = modelByGameId.NotPrzeDescription;
                                stringBuilder.Append("\"status\":\"1\",\"Desciption\":\"\",\"prizeName\":\"" + text2 + "\",\"prizeState\":\"fail\",\"prizeId\":\"0\",\"prizeGrade\":\"0\"}");
                            }
                            GameHelper.AddPrizeLog(new PrizeResultInfo
                            {
                                GameId  = modelByGameId.GameId,
                                PrizeId = prizeId,
                                UserId  = num
                            });
                            GameHelper.UpdateWinningPoolIsReceive(gameWinningPool.WinningPoolId);
                        }
                        context.Response.Write(stringBuilder.ToString());
                    }
                    else
                    {
                        text2 = (string.IsNullOrEmpty(modelByGameId.NotPrzeDescription) ? "谢谢参与!" : modelByGameId.NotPrzeDescription);
                        stringBuilder.Append("\"status\":\"1\",\"Desciption\":\"\",\"prizeName\":\"" + text2 + "\",\"prizeState\":\"fail\",\"prizeId\":\"0\",\"prizeGrade\":\"0\"}");
                        GameHelper.AddPrizeLog(new PrizeResultInfo
                        {
                            GameId  = modelByGameId.GameId,
                            PrizeId = 0,
                            UserId  = num
                        });
                        context.Response.Write(stringBuilder.ToString());
                    }
                }
                catch (System.Exception ex2)
                {
                    Globals.Debuglog(ex2.ToString(), "_GameDebuglog.txt");
                }
            }
        }
Exemple #2
0
 private void rptCartProducts_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
     {
         int     num;
         decimal num2;
         List <ShoppingCartItemInfo> list = (List <ShoppingCartItemInfo>)DataBinder.Eval(e.Item.DataItem, "LineItems");
         Literal literal  = (Literal)e.Item.Controls[0].FindControl("LitCoupon");
         Literal literal2 = (Literal)e.Item.Controls[0].FindControl("litExemption");
         Literal literal3 = (Literal)e.Item.Controls[0].FindControl("litoldExemption");
         Literal literal4 = (Literal)e.Item.Controls[0].FindControl("litoldTotal");
         Literal literal5 = (Literal)e.Item.Controls[0].FindControl("litTotal");
         Literal literal6 = (Literal)e.Item.Controls[0].FindControl("litbFreeShipping");
         string  str      = "";
         string  str2     = " <div class=\"btn-group coupon\">";
         object  obj2     = str2;
         obj2 = string.Concat(new object[] { obj2, "<button type=\"button\" class=\"btn btn-default dropdown-toggle coupondropdown\" data-toggle=\"dropdown\"   id='coupondropdown", DataBinder.Eval(e.Item.DataItem, "TemplateId"), "'>选择优惠券<span class=\"caret\"></span></button>" });
         str2 = string.Concat(new object[] { obj2, "<ul id=\"coupon", DataBinder.Eval(e.Item.DataItem, "TemplateId"), "\" class=\"dropdown-menu\" role=\"menu\">" });
         if (!((this.GetUserCoupons.Rows.Count <= 0) || this.isbargain))
         {
             obj2 = str;
             str  = string.Concat(new object[] { obj2, "<li><a onclick=\"Couponasetselect('", DataBinder.Eval(e.Item.DataItem, "TemplateId"), "','不使用','0',0,'0')\"   value=\"0\">不使用</a></li>" });
         }
         if (!this.isbargain)
         {
             num = 0;
             while (num < this.GetUserCoupons.Rows.Count)
             {
                 if ((this.GetUserCoupons.Rows[num]["MemberGrades"].ToString() == "0") || (this.GetUserCoupons.Rows[num]["MemberGrades"].ToString() == base.CurrentMemberInfo.GradeId.ToString()))
                 {
                     if (bool.Parse(this.GetUserCoupons.Rows[num]["IsAllProduct"].ToString()))
                     {
                         num2 = 0M;
                         foreach (ShoppingCartItemInfo info in list)
                         {
                             if (info.Type == 0)
                             {
                                 num2 += info.SubTotal;
                             }
                         }
                         if (decimal.Parse(this.GetUserCoupons.Rows[num]["ConditionValue"].ToString()) <= num2)
                         {
                             obj2 = str;
                             str  = string.Concat(new object[] {
                                 obj2, "<li><a onclick=\"Couponasetselect('", DataBinder.Eval(e.Item.DataItem, "TemplateId"), "','", this.GetUserCoupons.Rows[num]["CouponValue"], "元现金券','", this.GetUserCoupons.Rows[num]["CouponValue"], "',", this.GetUserCoupons.Rows[num]["Id"], ",'", this.GetUserCoupons.Rows[num]["CouponValue"], "元现金券|", this.GetUserCoupons.Rows[num]["Id"], "|", this.GetUserCoupons.Rows[num]["ConditionValue"], "|",
                                 this.GetUserCoupons.Rows[num]["CouponValue"], "')\" id=\"acoupon", DataBinder.Eval(e.Item.DataItem, "TemplateId"), this.GetUserCoupons.Rows[num]["Id"], "\" value=\"", this.GetUserCoupons.Rows[num]["Id"], "\">", this.GetUserCoupons.Rows[num]["CouponValue"], "元现金券</a></li>"
                             });
                         }
                     }
                     else
                     {
                         num2 = 0M;
                         bool flag = false;
                         foreach (ShoppingCartItemInfo info in list)
                         {
                             if ((info.Type == 0) && (MemberProcessor.GetCouponByProducts(int.Parse(this.GetUserCoupons.Rows[num]["CouponId"].ToString()), info.ProductId).Rows.Count > 0))
                             {
                                 num2 += info.SubTotal;
                                 flag  = true;
                             }
                         }
                         if (flag && (decimal.Parse(this.GetUserCoupons.Rows[num]["ConditionValue"].ToString()) <= num2))
                         {
                             obj2 = str;
                             str  = string.Concat(new object[] {
                                 obj2, "<li><a onclick=\"Couponasetselect('", DataBinder.Eval(e.Item.DataItem, "TemplateId"), "','", this.GetUserCoupons.Rows[num]["CouponValue"], "元现金券','", this.GetUserCoupons.Rows[num]["CouponValue"], "',", this.GetUserCoupons.Rows[num]["Id"], ",'", this.GetUserCoupons.Rows[num]["CouponValue"], "元现金券|", this.GetUserCoupons.Rows[num]["Id"], "|", this.GetUserCoupons.Rows[num]["ConditionValue"], "|",
                                 this.GetUserCoupons.Rows[num]["CouponValue"], "')\" id=\"acoupon", DataBinder.Eval(e.Item.DataItem, "TemplateId"), this.GetUserCoupons.Rows[num]["Id"], "\" value=\"", this.GetUserCoupons.Rows[num]["Id"], "\">", this.GetUserCoupons.Rows[num]["CouponValue"], "元现金券</a></li>"
                             });
                         }
                     }
                 }
                 num++;
             }
         }
         obj2 = str2 + str;
         str2 = string.Concat(new object[] { obj2, "</ul></div><input type=\"hidden\"  class=\"ClassCoupon\"   id=\"selectCoupon", DataBinder.Eval(e.Item.DataItem, "TemplateId"), "\"/>  " });
         if (!string.IsNullOrEmpty(str))
         {
             literal.Text = string.Concat(new object[] { str2, "<input type=\"hidden\"   id='selectCouponValue", DataBinder.Eval(e.Item.DataItem, "TemplateId"), "' class=\"selectCouponValue\" />" });
         }
         else
         {
             literal.Text = "<input type=\"hidden\"   id='selectCouponValue" + DataBinder.Eval(e.Item.DataItem, "TemplateId") + "' class=\"selectCouponValue\" />";
         }
         decimal num3 = 0M;
         decimal num4 = 0M;
         decimal num5 = 0M;
         decimal num6 = 0M;
         decimal num7 = 0M;
         int     num8 = 0;
         foreach (ShoppingCartItemInfo info2 in list)
         {
             if (info2.Type == 0)
             {
                 num7 += info2.SubTotal;
                 num8 += info2.Quantity;
             }
         }
         num6 = num7;
         if (!this.isbargain)
         {
             for (int i = 0; i < this.dtActivities.Rows.Count; i++)
             {
                 if ((int.Parse(this.dtActivities.Rows[i]["attendTime"].ToString()) != 0) && (int.Parse(this.dtActivities.Rows[i]["attendTime"].ToString()) <= ActivityHelper.GetActivitiesMember(base.CurrentMemberInfo.UserId, int.Parse(this.dtActivities.Rows[i]["ActivitiesId"].ToString()))))
                 {
                     continue;
                 }
                 num2 = 0M;
                 int       num10  = 0;
                 DataTable table2 = ActivityHelper.GetActivities_Detail(int.Parse(this.dtActivities.Rows[i]["ActivitiesId"].ToString()));
                 foreach (ShoppingCartItemInfo info2 in list)
                 {
                     if ((info2.Type == 0) && (ActivityHelper.GetActivitiesProducts(int.Parse(this.dtActivities.Rows[i]["ActivitiesId"].ToString()), info2.ProductId).Rows.Count > 0))
                     {
                         num2  += info2.SubTotal;
                         num10 += info2.Quantity;
                     }
                 }
                 bool flag2 = false;
                 if (table2.Rows.Count > 0)
                 {
                     for (num = 0; num < table2.Rows.Count; num++)
                     {
                         if (MemberHelper.CheckCurrentMemberIsInRange(table2.Rows[num]["MemberGrades"].ToString(), table2.Rows[num]["DefualtGroup"].ToString(), table2.Rows[num]["CustomGroup"].ToString(), base.CurrentMemberInfo.UserId))
                         {
                             if (bool.Parse(this.dtActivities.Rows[i]["isAllProduct"].ToString()))
                             {
                                 if (decimal.Parse(table2.Rows[num]["MeetMoney"].ToString()) > 0M)
                                 {
                                     if ((num7 != 0M) && (num7 >= decimal.Parse(table2.Rows[table2.Rows.Count - 1]["MeetMoney"].ToString())))
                                     {
                                         num4          = decimal.Parse(table2.Rows[table2.Rows.Count - 1]["MeetMoney"].ToString());
                                         num3          = decimal.Parse(table2.Rows[table2.Rows.Count - 1]["ReductionMoney"].ToString());
                                         literal6.Text = table2.Rows[table2.Rows.Count - 1]["bFreeShipping"].ToString();
                                         break;
                                     }
                                     if ((num7 != 0M) && (num7 <= decimal.Parse(table2.Rows[0]["MeetMoney"].ToString())))
                                     {
                                         num4 = decimal.Parse(table2.Rows[0]["MeetMoney"].ToString());
                                         num3 = decimal.Parse(table2.Rows[0]["ReductionMoney"].ToString());
                                         break;
                                     }
                                     if ((num7 != 0M) && (num7 >= decimal.Parse(table2.Rows[num]["MeetMoney"].ToString())))
                                     {
                                         num4          = decimal.Parse(table2.Rows[num]["MeetMoney"].ToString());
                                         num3          = decimal.Parse(table2.Rows[num]["ReductionMoney"].ToString());
                                         literal6.Text = table2.Rows[num]["bFreeShipping"].ToString();
                                     }
                                 }
                                 else
                                 {
                                     if ((num8 != 0) && (num8 >= int.Parse(table2.Rows[table2.Rows.Count - 1]["MeetNumber"].ToString())))
                                     {
                                         num4          = decimal.Parse(table2.Rows[table2.Rows.Count - 1]["MeetMoney"].ToString());
                                         num5          = decimal.Parse(table2.Rows[table2.Rows.Count - 1]["ReductionMoney"].ToString());
                                         flag2         = true;
                                         literal6.Text = table2.Rows[table2.Rows.Count - 1]["bFreeShipping"].ToString();
                                         break;
                                     }
                                     if ((num8 != 0) && (num8 <= int.Parse(table2.Rows[0]["MeetNumber"].ToString())))
                                     {
                                         num4  = decimal.Parse(table2.Rows[0]["MeetMoney"].ToString());
                                         num5  = decimal.Parse(table2.Rows[0]["ReductionMoney"].ToString());
                                         flag2 = true;
                                         break;
                                     }
                                     if ((num8 != 0) && (num8 >= int.Parse(table2.Rows[num]["MeetNumber"].ToString())))
                                     {
                                         num4          = decimal.Parse(table2.Rows[num]["MeetMoney"].ToString());
                                         num5          = decimal.Parse(table2.Rows[num]["ReductionMoney"].ToString());
                                         flag2         = true;
                                         literal6.Text = table2.Rows[num]["bFreeShipping"].ToString();
                                     }
                                 }
                             }
                             else
                             {
                                 num7 = num2;
                                 num8 = num10;
                                 if (decimal.Parse(table2.Rows[num]["MeetMoney"].ToString()) > 0M)
                                 {
                                     if ((num7 != 0M) && (num7 >= decimal.Parse(table2.Rows[table2.Rows.Count - 1]["MeetMoney"].ToString())))
                                     {
                                         num4          = decimal.Parse(table2.Rows[table2.Rows.Count - 1]["MeetMoney"].ToString());
                                         num3          = decimal.Parse(table2.Rows[table2.Rows.Count - 1]["ReductionMoney"].ToString());
                                         literal6.Text = table2.Rows[table2.Rows.Count - 1]["bFreeShipping"].ToString();
                                         break;
                                     }
                                     if ((num7 != 0M) && (num7 <= decimal.Parse(table2.Rows[0]["MeetMoney"].ToString())))
                                     {
                                         num4 = decimal.Parse(table2.Rows[0]["MeetMoney"].ToString());
                                         num3 = decimal.Parse(table2.Rows[0]["ReductionMoney"].ToString());
                                         break;
                                     }
                                     if ((num7 != 0M) && (num7 >= decimal.Parse(table2.Rows[num]["MeetMoney"].ToString())))
                                     {
                                         num4          = decimal.Parse(table2.Rows[num]["MeetMoney"].ToString());
                                         num3          = decimal.Parse(table2.Rows[num]["ReductionMoney"].ToString());
                                         literal6.Text = table2.Rows[num]["bFreeShipping"].ToString();
                                     }
                                 }
                                 else
                                 {
                                     if ((num8 != 0) && (num8 >= int.Parse(table2.Rows[table2.Rows.Count - 1]["MeetNumber"].ToString())))
                                     {
                                         num4          = decimal.Parse(table2.Rows[table2.Rows.Count - 1]["MeetMoney"].ToString());
                                         num3          = decimal.Parse(table2.Rows[table2.Rows.Count - 1]["ReductionMoney"].ToString());
                                         flag2         = true;
                                         literal6.Text = table2.Rows[table2.Rows.Count - 1]["bFreeShipping"].ToString();
                                         break;
                                     }
                                     if ((num8 != 0) && (num8 <= int.Parse(table2.Rows[0]["MeetNumber"].ToString())))
                                     {
                                         num4  = decimal.Parse(table2.Rows[0]["MeetMoney"].ToString());
                                         num3  = decimal.Parse(table2.Rows[0]["ReductionMoney"].ToString());
                                         flag2 = true;
                                         break;
                                     }
                                     if ((num8 != 0) && (num8 >= int.Parse(table2.Rows[num]["MeetNumber"].ToString())))
                                     {
                                         num4          = decimal.Parse(table2.Rows[num]["MeetMoney"].ToString());
                                         num3          = decimal.Parse(table2.Rows[num]["ReductionMoney"].ToString());
                                         flag2         = true;
                                         literal6.Text = table2.Rows[num]["bFreeShipping"].ToString();
                                     }
                                 }
                             }
                         }
                     }
                     if (flag2)
                     {
                         if (num8 > 0)
                         {
                             num5 += num3;
                         }
                     }
                     else if (((num7 != 0M) && (num4 != 0M)) && (num7 >= num4))
                     {
                         num5 += num3;
                     }
                 }
             }
         }
         literal2.Text = num5.ToString("F2");
         literal3.Text = num5.ToString("F2");
         decimal num12 = num6 - num5;
         literal5.Text = num12.ToString("F2");
         literal4.Text = (num6 - num5).ToString("F2");
     }
 }
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("设置收货地址");
            this.hidQQMapApiKey = (HtmlInputHidden)this.FindControl("hidQQMapApiKey");
            this.spanCityName   = (HtmlGenericControl)this.FindControl("spanCityName");
            this.hidShippingId  = (HtmlInputHidden)this.FindControl("hidShippingId");
            this.hidLatitude    = (HtmlInputHidden)this.FindControl("hidLatitude");
            this.hidLongitude   = (HtmlInputHidden)this.FindControl("hidLongitude");
            this.hidShipTo      = (HtmlInputHidden)this.FindControl("hidShipTo");
            this.hidCellphone   = (HtmlInputHidden)this.FindControl("hidCellphone");
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();
            string       value          = masterSettings.QQMapAPIKey;

            if (string.IsNullOrEmpty(value))
            {
                value = "SYJBZ-DSLR3-IWX3Q-3XNTM-ELURH-23FTP";
            }
            this.hidQQMapApiKey.Value = value;
            int num = this.Page.Request.QueryString["ShippingId"].ToInt(0);

            this.hidShippingId.Value    = num.ToNullString();
            this.hidShipTo.Value        = HttpUtility.UrlDecode(this.Page.Request.QueryString["shipTo"]);
            this.hidCellphone.Value     = HttpUtility.UrlDecode(this.Page.Request.QueryString["cellphone"]);
            this.spanCityName.InnerText = "选择城市";
            string text = HttpUtility.UrlDecode(this.Page.Request.QueryString["cityName"]);

            if (!string.IsNullOrWhiteSpace(text))
            {
                this.spanCityName.InnerText = HttpUtility.UrlDecode(text);
            }
            else
            {
                if (num > 0)
                {
                    ShippingAddressInfo shippingAddress = MemberProcessor.GetShippingAddress(num);
                    if (shippingAddress.LatLng != null && shippingAddress.LatLng.Split(',').Length == 2)
                    {
                        if (this.hidLatitude != null)
                        {
                            this.hidLatitude.Value = shippingAddress.LatLng.Split(',')[0];
                        }
                        if (this.hidLongitude != null)
                        {
                            this.hidLongitude.Value = shippingAddress.LatLng.Split(',')[1];
                        }
                        this.spanCityName.InnerText = RegionHelper.GetFullRegion(shippingAddress.RegionId, ",", false, 2).Split(',')[0];
                    }
                }
                double num2  = this.Page.Request.QueryString["latitude"].ToDouble(0);
                double num3  = this.Page.Request.QueryString["longitude"].ToDouble(0);
                string text2 = HttpUtility.UrlDecode(this.Page.Request.QueryString["chooseCity"]);
                if (num2 > 0.0 && num3 > 0.0)
                {
                    this.hidLatitude.Value  = num2.ToNullString();
                    this.hidLongitude.Value = num3.ToNullString();
                    if (!string.IsNullOrWhiteSpace(text2))
                    {
                        this.spanCityName.InnerText = HttpUtility.UrlDecode(text2);
                    }
                }
            }
        }
        protected override void AttachChildControls()
        {
            this.litItemParams = (Literal)this.FindControl("litItemParams");
            string     str           = HttpContext.Current.Request.QueryString.Get("orderid");
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (!string.IsNullOrEmpty(str) && (currentMember != null))
            {
                DataTable orderRedPager = ShareActHelper.GetOrderRedPager(str, currentMember.UserId);
                if ((orderRedPager != null) && (orderRedPager.Rows.Count > 0))
                {
                    DataView defaultView = orderRedPager.DefaultView;
                    if (defaultView.Count > 0)
                    {
                        ShareActivityInfo act = ShareActHelper.GetAct(Convert.ToInt32(defaultView[0]["RedPagerActivityId"]));
                        if (act != null)
                        {
                            string shareTitle  = act.ShareTitle;
                            string description = act.Description;
                            if (shareTitle.Contains("{{店铺名称}}") || description.Contains("{{店铺名称}}"))
                            {
                                HttpCookie cookie = new HttpCookie("Vshop-ReferralId");
                                if ((cookie != null) && (cookie.Value != null))
                                {
                                    DistributorsInfo userIdDistributors = new DistributorsInfo();
                                    userIdDistributors = DistributorsBrower.GetUserIdDistributors(int.Parse(cookie.Value));
                                    description        = description.Replace("{{店铺名称}}", userIdDistributors.StoreName);
                                    shareTitle         = shareTitle.Replace("{{店铺名称}}", userIdDistributors.StoreName);
                                }
                                else
                                {
                                    SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                                    description = description.Replace("{{店铺名称}}", masterSettings.SiteName);
                                    shareTitle  = shareTitle.Replace("{{店铺名称}}", masterSettings.SiteName);
                                }
                            }
                            if (shareTitle.Contains("{{微信昵称}}"))
                            {
                                shareTitle = shareTitle.Replace("{{微信昵称}}", currentMember.UserName);
                            }
                            if (description.Contains("{{微信昵称}}"))
                            {
                                description = description.Replace("{{微信昵称}}", currentMember.UserName);
                            }
                            string webUrlStart = Globals.GetWebUrlStart();
                            this.litItemParams.Text = string.Concat(new object[] { webUrlStart, act.ImgUrl, "|", shareTitle.Replace("|", "|"), "|", Globals.GetWebUrlStart(), "/Vshop/getredpager.aspx?id=", defaultView[0]["RedPagerActivityId"], "&userid=", currentMember.UserId, "&ReferralId=", Globals.GetCurrentDistributorId(), "|", description.Replace("|", "|") });
                        }
                    }
                    else
                    {
                        HttpContext.Current.Response.Redirect("/vshop/MemberCenter.aspx?t=1");
                    }
                }
                else
                {
                    orderRedPager = ShareActHelper.GetOrderRedPager(str, -100);
                    if (orderRedPager.Rows.Count > 0)
                    {
                        HttpContext.Current.Response.Redirect(string.Concat(new object[] { "/Vshop/getredpager.aspx?id=", orderRedPager.Rows[0]["RedPagerActivityId"].ToString(), "&userid=", currentMember.UserId, "&ReferralId=", Globals.GetCurrentDistributorId() }));
                        HttpContext.Current.Response.End();
                    }
                    else
                    {
                        HttpContext.Current.Response.Redirect("/vshop/MemberCenter.aspx?t=2");
                    }
                }
            }
            else
            {
                HttpContext.Current.Response.Redirect("/default.aspx");
                HttpContext.Current.Response.End();
            }
            PageTitle.AddSiteNameTitle("分享助力");
        }
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺推广");
            int        num           = Globals.RequestQueryNum("ReferralId");
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if ((num > 0) && (currentMember == null))
            {
                this.Page.Response.Redirect("/default.aspx?ReferralId=" + num);
                this.Page.Response.End();
            }
            if (!int.TryParse(this.Page.Request.QueryString["UserId"], out this.userId))
            {
                base.GotoResourceNotFound("");
            }
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(this.userId);

            if (userIdDistributors == null)
            {
                base.GotoResourceNotFound("");
            }
            this.litStroeDesc = (Literal)this.FindControl("litStroeDesc");
            this.litLinkurl   = (Literal)this.FindControl("litLinkurl");
            this.litStoreurl  = (Literal)this.FindControl("litStoreurl");
            string urlToEncode = Globals.FullPath("/Default.aspx?ReferralId=" + this.userId);

            this.litLinkurl.Text  = urlToEncode;
            this.litStoreurl.Text = urlToEncode;
            this.Logoimage        = (Image)this.FindControl("Logoimage");
            this.storeCode        = (HtmlImage)this.FindControl("storeCode");
            this.storeFollowCode  = (HtmlImage)this.FindControl("storeFollowCode");
            if (!string.IsNullOrEmpty(userIdDistributors.Logo))
            {
                this.Logoimage.ImageUrl = Globals.HostPath(this.Page.Request.Url) + userIdDistributors.Logo;
            }
            else
            {
                userIdDistributors.Logo = "/Utility/pics/headLogo.jpg";
            }
            this.storeCode.Src       = "/Api/CreatQRCode.ashx?code=" + Globals.UrlEncode(urlToEncode) + "&Logo=" + userIdDistributors.Logo;
            this.storeFollowCode.Src = "";
            ScanInfos info = ScanHelp.GetScanInfosByUserId(this.userId, 0, "WX");

            if (info == null)
            {
                ScanHelp.CreatNewScan(this.userId, "WX", 0);
                info = ScanHelp.GetScanInfosByUserId(this.userId, 0, "WX");
            }
            string qRImageUrlByTicket = "";

            if (!((info == null) || string.IsNullOrEmpty(info.CodeUrl)))
            {
                qRImageUrlByTicket = BarCodeApi.GetQRImageUrlByTicket(info.CodeUrl);
            }
            else
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                string       token          = TokenApi.GetToken_Message(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret);
                if (TokenApi.CheckIsRightToken(token))
                {
                    string str4 = BarCodeApi.CreateTicket(token, info.Sceneid, "QR_LIMIT_SCENE", "2592000");
                    if (!string.IsNullOrEmpty(str4))
                    {
                        qRImageUrlByTicket  = BarCodeApi.GetQRImageUrlByTicket(str4);
                        info.CodeUrl        = str4;
                        info.CreateTime     = DateTime.Now;
                        info.LastActiveTime = DateTime.Now;
                        ScanHelp.updateScanInfosCodeUrl(info);
                    }
                }
            }
            if (!string.IsNullOrEmpty(qRImageUrlByTicket))
            {
                this.storeFollowCode.Src = "/Api/CreatQRCode.ashx?Combin=" + Globals.UrlEncode(qRImageUrlByTicket) + "&Logo=" + userIdDistributors.Logo;
            }
            else
            {
                this.storeFollowCode.Src = "";
            }
            this.litStroeName      = (Literal)this.FindControl("litStroeName");
            this.litStroeName.Text = userIdDistributors.StoreName;
            this.litStroeDesc.Text = userIdDistributors.StoreDescription;
        }
        protected override void AttachChildControls()
        {
            this.litShipTo            = (System.Web.UI.WebControls.Literal) this.FindControl("litShipTo");
            this.litCellPhone         = (System.Web.UI.WebControls.Literal) this.FindControl("litCellPhone");
            this.litAddress           = (System.Web.UI.WebControls.Literal) this.FindControl("litAddress");
            this.rptCartProducts      = (AppshopTemplatedRepeater)this.FindControl("rptCartProducts");
            this.dropCoupon           = (Common_CouponSelect)this.FindControl("dropCoupon");
            this.litOrderTotal        = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderTotal");
            this.groupbuyHiddenBox    = (System.Web.UI.HtmlControls.HtmlInputControl) this.FindControl("groupbuyHiddenBox");
            this.rptAddress           = (AppshopTemplatedRepeater)this.FindControl("rptAddress");
            this.selectShipTo         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("selectShipTo");
            this.regionId             = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("regionId");
            this.litProductTotalPrice = (System.Web.UI.WebControls.Literal) this.FindControl("litProductTotalPrice");
            System.Collections.Generic.IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses();
            this.rptAddress.DataSource =
                from item in shippingAddresses
                orderby item.IsDefault
                select item;

            this.rptAddress.DataBind();
            this.rptPromotions = (AppshopTemplatedRepeater)this.FindControl("rptPromotions");
            ShippingAddressInfo shippingAddressInfo = shippingAddresses.FirstOrDefault((ShippingAddressInfo item) => item.IsDefault);

            if (shippingAddressInfo == null)
            {
                shippingAddressInfo = ((shippingAddresses.Count > 0) ? shippingAddresses[0] : null);
            }
            if (shippingAddressInfo != null)
            {
                this.litShipTo.Text    = shippingAddressInfo.ShipTo;
                this.litCellPhone.Text = shippingAddressInfo.CellPhone;
                this.litAddress.Text   = shippingAddressInfo.Address;
                this.selectShipTo.SetWhenIsNotNull(shippingAddressInfo.ShippingId.ToString());
                this.regionId.SetWhenIsNotNull(shippingAddressInfo.RegionId.ToString());
            }
            if (shippingAddresses == null || shippingAddresses.Count == 0)
            {
                this.Page.Response.Redirect(Globals.ApplicationPath + "/AppShop/AddShippingAddress.aspx?returnUrl=" + Globals.UrlEncode(System.Web.HttpContext.Current.Request.Url.ToString()));
                return;
            }
            ShoppingCartInfo shoppingCartInfo;

            if (int.TryParse(this.Page.Request.QueryString["buyAmount"], out this.buyAmount) && !string.IsNullOrEmpty(this.Page.Request.QueryString["productSku"]) && !string.IsNullOrEmpty(this.Page.Request.QueryString["from"]) && (this.Page.Request.QueryString["from"] == "signBuy" || this.Page.Request.QueryString["from"] == "groupBuy"))
            {
                this.productSku = this.Page.Request.QueryString["productSku"];
                if (int.TryParse(this.Page.Request.QueryString["groupbuyId"], out this.groupBuyId))
                {
                    this.groupbuyHiddenBox.SetWhenIsNotNull(this.groupBuyId.ToString());
                    shoppingCartInfo = ShoppingCartProcessor.GetGroupBuyShoppingCart(this.productSku, this.buyAmount, 0);
                }
                else
                {
                    shoppingCartInfo = ShoppingCartProcessor.GetShoppingCart(this.productSku, this.buyAmount, 0);
                }
            }
            else
            {
                shoppingCartInfo = ShoppingCartProcessor.GetShoppingCart();
            }
            if (shoppingCartInfo != null)
            {
                this.rptCartProducts.DataSource = shoppingCartInfo.LineItems;
                this.rptCartProducts.DataBind();
                this.dropCoupon.CartTotal = shoppingCartInfo.GetTotal();
                this.litOrderTotal.Text   = (this.litProductTotalPrice.Text = shoppingCartInfo.GetTotal().ToString("F2"));
                System.Collections.Generic.List <System.Collections.Generic.KeyValuePair <string, string> > list = new System.Collections.Generic.List <System.Collections.Generic.KeyValuePair <string, string> >();
                if (shoppingCartInfo.IsReduced)
                {
                    list.Add(new System.Collections.Generic.KeyValuePair <string, string>(PromotionHelper.GetShortName(PromoteType.Reduced), shoppingCartInfo.ReducedPromotionName + string.Format(" 优惠:{0}", shoppingCartInfo.ReducedPromotionAmount.ToString("F2"))));
                }
                if (shoppingCartInfo.IsFreightFree)
                {
                    list.Add(new System.Collections.Generic.KeyValuePair <string, string>(PromotionHelper.GetShortName(PromoteType.FullAmountSentFreight), string.Format("{0}", shoppingCartInfo.FreightFreePromotionName)));
                }
                if (shoppingCartInfo.IsSendTimesPoint)
                {
                    list.Add(new System.Collections.Generic.KeyValuePair <string, string>(PromotionHelper.GetShortName(PromoteType.FullAmountSentTimesPoint), string.Format("{0}:送{1}倍", shoppingCartInfo.SentTimesPointPromotionName, shoppingCartInfo.TimesPoint.ToString("F2"))));
                }
                if (this.groupBuyId == 0)
                {
                    this.rptPromotions.DataSource = list;
                    this.rptPromotions.DataBind();
                }
            }
            PageTitle.AddSiteNameTitle("订单确认");
        }
Exemple #7
0
 protected override void AttachChildControls()
 {
     this.rptvShipping    = (AppshopTemplatedRepeater)this.FindControl("rptvShipping");
     this.aLinkToAdd      = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("aLinkToAdd");
     this.aLinkToAdd.HRef = Globals.ApplicationPath + "/AppShop/AddShippingAddress.aspx";
     if (!string.IsNullOrEmpty(this.Page.Request.QueryString["returnUrl"]))
     {
         System.Web.UI.HtmlControls.HtmlAnchor expr_6D = this.aLinkToAdd;
         expr_6D.HRef = expr_6D.HRef + "?returnUrl=" + Globals.UrlEncode(this.Page.Request.QueryString["returnUrl"]);
     }
     System.Collections.Generic.IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses();
     if (shippingAddresses != null)
     {
         this.rptvShipping.DataSource = shippingAddresses;
         this.rptvShipping.DataBind();
     }
     PageTitle.AddSiteNameTitle("收货地址");
 }
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("会员中心");
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();
            MemberInfo   user           = HiContext.Current.User;

            this.aTakeOnStoreCount = (HtmlAnchor)this.FindControl("aTakeOnStoreCount");
            this.aWaitForSend      = (HtmlAnchor)this.FindControl("aWaitForSend");
            if (!masterSettings.OpenMultStore)
            {
                goto IL_005b;
            }
            goto IL_005b;
IL_005b:
            this.litAccountTip            = (Literal)this.FindControl("litAccountTip");
            this.ltFightGroupActiveNumber = (Literal)this.FindControl("ltFightGroupActiveNumber");
            this.litUserLink       = (Literal)this.FindControl("litUserLink");
            this.litUserName       = (Literal)this.FindControl("litUserName");
            this.litPaymentBalance = (Literal)this.FindControl("litPaymentBalance");
            this.litExpenditure    = (Literal)this.FindControl("litExpenditure");
            this.litCouponsCount   = (Literal)this.FindControl("litCouponsCount");
            this.litPrizeCount     = (Literal)this.FindControl("litPrizeCount");
            this.litCouponsWeiXinRedEnvelopeCount = (Literal)this.FindControl("litCouponsWeiXinRedEnvelopeCount");
            this.litExpenditure.SetWhenIsNotNull(user.Expenditure.F2ToString("f2"));
            this.litPaymentBalance.SetWhenIsNotNull(user.Balance.F2ToString("f2"));
            this.litPoints   = (Literal)this.FindControl("litPoints");
            this.litPoints1  = (Literal)this.FindControl("litPoints1");
            this.userPicture = (Image)this.FindControl("userPicture");
            Literal control = this.litPoints;
            int     points  = user.Points;

            control.SetWhenIsNotNull(points.ToString());
            Literal control2 = this.litPoints1;

            points = user.Points;
            control2.SetWhenIsNotNull(points.ToString());
            Control control3 = this.FindControl("liMySplittin");

            this.liReferralLink = (HtmlGenericControl)this.FindControl("liReferralLink");
            this.referralLink   = (HtmlAnchor)this.FindControl("referralLink");
            this.liGroupLink    = (HtmlGenericControl)this.FindControl("liGroupLink");
            Control control4 = this.FindControl("aLinkSignIn");

            this.liBindPhoneLink   = (HtmlGenericControl)this.FindControl("liBindPhoneLink");
            this.liBindEmailLink   = (HtmlGenericControl)this.FindControl("liBindEmailLink");
            this.litMyConsulations = (Literal)this.FindControl("litMyConsulations");
            this.requestBalance    = (Literal)this.FindControl("requestBalance");
            this.divRedEnvelope    = (HtmlGenericControl)this.FindControl("divRedEnvelope");
            this.hidAccountStatus  = (HtmlInputHidden)this.FindControl("hidAccountStatus");
            this.divReferralCenter = (HtmlGenericControl)this.FindControl("divReferralCenter");
            if (string.IsNullOrWhiteSpace(user.TradePassword))
            {
                this.litAccountTip.SetWhenIsNotNull("<em class=\"fontstyle nopassword\">未设置交易密码</em>");
            }
            else if (HiContext.Current.SiteSettings.IsOpenRechargeGift)
            {
                this.litAccountTip.SetWhenIsNotNull("<em class=\"fontstyle\">充值享优惠</em>");
            }
            else if (!string.IsNullOrWhiteSpace(user.TradePassword))
            {
                this.litAccountTip.SetWhenIsNotNull("<em class=\"fontstyle\">" + user.Balance.F2ToString("f2") + "</em>");
            }
            if (this.liBindPhoneLink != null)
            {
                if (string.IsNullOrEmpty(user.CellPhone) && HiContext.Current.SiteSettings.SMSEnabled && !string.IsNullOrEmpty(HiContext.Current.SiteSettings.SMSSettings))
                {
                    this.liBindPhoneLink.Visible = true;
                }
                else
                {
                    this.liBindPhoneLink.Visible = false;
                }
            }
            if (this.liBindEmailLink != null)
            {
                if (string.IsNullOrEmpty(user.Email))
                {
                    this.liBindEmailLink.Visible = true;
                }
                else
                {
                    this.liBindEmailLink.Visible = false;
                }
            }
            if (control4 is HtmlAnchor)
            {
                this.aSignIn = (control4 as HtmlAnchor);
            }
            if (control3 is HtmlGenericControl)
            {
                this.liMySplittin = (control3 as HtmlGenericControl);
            }
            this.litMemberGrade = (Literal)this.FindControl("litMemberGrade");
            MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(user.GradeId);

            if (memberGrade != null)
            {
                this.litMemberGrade.SetWhenIsNotNull(memberGrade.Name);
            }
            this.litUserName.Text = (string.IsNullOrEmpty(user.NickName) ? (string.IsNullOrEmpty(user.RealName) ? user.UserName : user.RealName) : user.NickName);
            if (!string.IsNullOrEmpty(user.Picture.ToNullString()))
            {
                this.userPicture.ImageUrl = user.Picture;
            }
            if (string.IsNullOrEmpty(user.CellPhone) && string.IsNullOrEmpty(user.Email))
            {
                this.hidAccountStatus.Value = "1";
            }
            this.litWaitForRecieveCount = (Literal)this.FindControl("litWaitForRecieveCount");
            this.litWaitForSend         = (Literal)this.FindControl("litWaitForSend");
            this.litTakeOnStoreCount    = (Literal)this.FindControl("litTakeOnStoreCount");
            this.litAfterSaleCount      = (Literal)this.FindControl("litAfterSaleCount");
            this.iAfterSaleCount        = (HtmlGenericControl)this.FindControl("iAfterSaleCount");
            this.litWaitForPayCount     = (Literal)this.FindControl("litWaitForPayCount");
            int userFavoriteCount = ProductBrowser.GetUserFavoriteCount();

            this.litFavoritesCount  = (Literal)this.FindControl("litFavoritesCount");
            this.litWaitReviewCount = (Literal)this.FindControl("litWaitReviewCount");
            this.litFavoritesCount.SetWhenIsNotNull(userFavoriteCount.ToString());
            this.iWaitForPayCount     = (HtmlGenericControl)this.FindControl("iWaitForPayCount");
            this.iWaitForSend         = (HtmlGenericControl)this.FindControl("iWaitForSend");
            this.iWaitForRecieveCount = (HtmlGenericControl)this.FindControl("iWaitForRecieveCount");
            this.iWaitReviewCount     = (HtmlGenericControl)this.FindControl("iWaitReviewCount");
            this.iTakeOnStoreCount    = (HtmlGenericControl)this.FindControl("iTakeOnStoreCount");
            OrderQuery orderQuery = new OrderQuery();

            orderQuery.IsAllOrder    = true;
            orderQuery.ShowGiftOrder = true;
            orderQuery.Status        = OrderStatus.WaitBuyerPay;
            int myFightGroupActiveNumber = VShopHelper.GetMyFightGroupActiveNumber(0);

            this.ltFightGroupActiveNumber.Text = ((myFightGroupActiveNumber == 0) ? string.Empty : (myFightGroupActiveNumber + "个团正在火拼中"));
            int num = MemberProcessor.GetUserOrderCount(HiContext.Current.UserId, orderQuery);

            if (num > 0)
            {
                this.litWaitForPayCount.SetWhenIsNotNull(num.ToString());
            }
            else if (this.iWaitForPayCount != null)
            {
                this.iWaitForPayCount.Visible = false;
            }
            else
            {
                this.litWaitForPayCount.SetWhenIsNotNull("0");
            }
            orderQuery.Status = OrderStatus.SellerAlreadySent;
            num = MemberProcessor.GetUserOrderCount(HiContext.Current.UserId, orderQuery);
            if (num > 0)
            {
                this.litWaitForRecieveCount.SetWhenIsNotNull(num.ToString());
            }
            else if (this.iWaitForRecieveCount != null)
            {
                this.iWaitForRecieveCount.Visible = false;
            }
            else
            {
                this.litWaitForRecieveCount.SetWhenIsNotNull("0");
            }
            orderQuery.Status = OrderStatus.BuyerAlreadyPaid;
            num = MemberProcessor.GetUserOrderCount(HiContext.Current.UserId, orderQuery);
            if (num > 0)
            {
                this.litWaitForSend.SetWhenIsNotNull(num.ToString());
            }
            else if (this.iWaitForSend != null)
            {
                this.iWaitForSend.Visible = false;
            }
            else
            {
                this.litWaitForSend.SetWhenIsNotNull("0");
            }
            orderQuery.Status = OrderStatus.WaitReview;
            num = MemberProcessor.GetUserOrderCount(HiContext.Current.UserId, orderQuery);
            if (num > 0)
            {
                this.litWaitReviewCount.SetWhenIsNotNull(num.ToString());
            }
            else if (this.iWaitReviewCount != null)
            {
                this.iWaitReviewCount.Visible = false;
            }
            else
            {
                this.litWaitReviewCount.SetWhenIsNotNull("0");
            }
            orderQuery.ItemStatus   = 0;
            orderQuery.Status       = OrderStatus.All;
            orderQuery.IsAfterSales = true;
            num = MemberProcessor.GetUserAfterSaleCount(HiContext.Current.UserId, false, null);
            if (num > 0)
            {
                this.litAfterSaleCount.SetWhenIsNotNull(num.ToString());
            }
            else if (this.iAfterSaleCount != null)
            {
                this.iAfterSaleCount.Visible = false;
            }
            else
            {
                this.litAfterSaleCount.SetWhenIsNotNull("0");
            }
            orderQuery.TakeOnStore  = true;
            orderQuery.ItemStatus   = 0;
            orderQuery.IsAfterSales = false;
            num = MemberProcessor.GetUserOrderCount(HiContext.Current.UserId, orderQuery);
            if (num > 0)
            {
                this.litTakeOnStoreCount.SetWhenIsNotNull(num.ToString());
            }
            else if (this.iTakeOnStoreCount != null)
            {
                this.iTakeOnStoreCount.Visible = false;
            }
            else
            {
                this.litTakeOnStoreCount.SetWhenIsNotNull("0");
            }
            int num2 = 0;
            int userObtainCouponNum = CouponHelper.GetUserObtainCouponNum(user.UserId);

            if (userObtainCouponNum > 0)
            {
                this.litCouponsCount.SetWhenIsNotNull(userObtainCouponNum.ToNullString() + "张");
            }
            int num3 = ActivityHelper.CountCurrUserNoReceiveAward(user.UserId);

            if (num3 > 0)
            {
                this.litPrizeCount.SetWhenIsNotNull(num3.ToNullString());
            }
            DataTable userWeiXinRedEnvelope = CouponHelper.GetUserWeiXinRedEnvelope(HiContext.Current.UserId, 1);

            num2 = ((userWeiXinRedEnvelope != null && userWeiXinRedEnvelope.Rows.Count > 0) ? userWeiXinRedEnvelope.Rows.Count : 0);
            if (num2 > 0)
            {
                this.litCouponsWeiXinRedEnvelopeCount.SetWhenIsNotNull(num2.ToString());
            }
            if (this.litUserLink != null)
            {
                Uri    url  = HttpContext.Current.Request.Url;
                string text = "";
                this.litUserLink.Text = string.Format(CultureInfo.InvariantCulture, "{0}://{1}{2}", new object[3]
                {
                    Globals.GetProtocal(HttpContext.Current),
                    url.Host,
                    text
                }) + "/WapShop/?ReferralUserId=" + HiContext.Current.UserId;
            }
            SiteSettings masterSettings2 = SettingsManager.GetMasterSettings();

            if (masterSettings2.OpenReferral != 1)
            {
                this.liReferralLink.Visible    = false;
                this.divReferralCenter.Visible = false;
            }
            else if (base.ClientType == ClientType.VShop && !masterSettings2.EnableVshopReferral)
            {
                this.liReferralLink.Visible    = false;
                this.divReferralCenter.Visible = false;
            }
            else if (user.Referral == null)
            {
                this.referralLink.HRef = "SplittinRule";
            }
            else if (user.Referral.ReferralStatus == 1 || user.Referral.ReferralStatus == 3)
            {
                this.referralLink.HRef = "ReferralRegisterresults.aspx";
            }
            this.litMyConsulations.Text = ProductBrowser.GetUserProductConsultaionsCount(HiContext.Current.UserId).ToNullString();
        }
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("申请分销");
            this.Page.Session["stylestatus"] = "2";
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(MemberProcessor.GetCurrentMember().UserId);

            if ((userIdDistributors != null) && (userIdDistributors.ReferralStatus == 0))
            {
                this.Page.Response.Redirect("DistributorCenter.aspx", true);
            }
            if ((userIdDistributors != null) && (userIdDistributors.ReferralStatus != 0))
            {
                this.litIsEnable       = (HtmlInputHidden)this.FindControl("litIsEnable");
                this.litIsEnable.Value = userIdDistributors.ReferralStatus.ToString();
            }
        }
Exemple #10
0
        protected override void OnInit(EventArgs e)
        {
            string str = HttpContext.Current.Request["action"];

            if (str == "ReCreadt")
            {
                HttpContext.Current.Response.ContentType = "application/json";
                string str2 = HttpContext.Current.Request["imageUrl"];
                string s    = "";
                if (string.IsNullOrEmpty(str2))
                {
                    s = "{\"success\":\"false\",\"message\":\"图片地址为空\"}";
                }
                try
                {
                    MemberInfo       currentMember      = MemberProcessor.GetCurrentMember();
                    DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMember.UserId);
                    string           str4  = str2;
                    string           str5  = str2;
                    ScanInfos        infos = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                    if (infos == null)
                    {
                        ScanHelp.CreatNewScan(currentMember.UserId, "WX", 0);
                        infos = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                    }
                    string qRImageUrlByTicket = "";
                    if (infos == null)
                    {
                        qRImageUrlByTicket = Globals.HostPath(HttpContext.Current.Request.Url) + "/Follow.aspx?ReferralId=" + currentMember.UserId.ToString();
                    }
                    else
                    {
                        qRImageUrlByTicket = BarCodeApi.GetQRImageUrlByTicket(infos.CodeUrl);
                    }
                    string str7      = File.ReadAllText(HttpRuntime.AppDomainAppPath.ToString() + "Storage/Utility/StoreCardSet.js");
                    string storeName = userIdDistributors.StoreName;
                    if (!this.siteSettings.IsShowDistributorSelfStoreName)
                    {
                        storeName = this.siteSettings.SiteName;
                    }
                    StoreCardCreater creater = new StoreCardCreater(str7, str4, str5, qRImageUrlByTicket, currentMember.UserName, storeName, currentMember.UserId, currentMember.UserId);
                    string           imgUrl  = "";
                    if (creater.ReadJson() && creater.CreadCard(out imgUrl))
                    {
                        s = "{\"success\":\"true\",\"message\":\"生成成功\"}";
                        DistributorsBrower.UpdateStoreCard(currentMember.UserId, imgUrl);
                    }
                    else
                    {
                        s = "{\"success\":\"false\",\"message\":\"" + imgUrl + "\"}";
                    }
                }
                catch (Exception exception)
                {
                    s = "{\"success\":\"false\",\"message\":\"" + exception.Message + "\"}";
                }
                HttpContext.Current.Response.Write(s);
                HttpContext.Current.Response.End();
            }
            if (this.SkinName == null)
            {
                this.SkinName = "skin-VStoreCard.html";
            }
            base.OnInit(e);
        }
Exemple #11
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["ReferralId"], out this.userId))
     {
         this.Context.Response.Redirect("/");
     }
     else
     {
         DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(this.userId);
         if (userIdDistributors == null)
         {
             this.Context.Response.Redirect("/");
         }
         else
         {
             this.imglogo = (HtmlImage)this.FindControl("QrcodeImg");
             int currentMemberUserId = Globals.GetCurrentMemberUserId(false);
             this.editPanel         = (HtmlControl)this.FindControl("editPanel");
             this.editPanel.Visible = false;
             if (currentMemberUserId == this.userId)
             {
                 this.imglogo.Attributes.Add("Admin", "true");
                 MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                 DateTime   cardCreatTime = userIdDistributors.CardCreatTime;
                 string     str           = File.ReadAllText(HttpRuntime.AppDomainAppPath.ToString() + "Storage/Utility/StoreCardSet.js");
                 JObject    obj2          = JsonConvert.DeserializeObject(str) as JObject;
                 DateTime   time2         = new DateTime();
                 if ((obj2 != null) && (obj2["writeDate"] != null))
                 {
                     time2 = DateTime.Parse(obj2["writeDate"].ToString());
                 }
                 ScanInfos info = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                 if (info == null)
                 {
                     ScanHelp.CreatNewScan(currentMember.UserId, "WX", 0);
                     info = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                 }
                 string codeUrl = "";
                 if (info == null)
                 {
                     codeUrl = Globals.HostPath(HttpContext.Current.Request.Url) + "/Follow.aspx?ReferralId=" + currentMember.UserId.ToString();
                 }
                 else
                 {
                     codeUrl = info.CodeUrl;
                     if (string.IsNullOrEmpty(codeUrl))
                     {
                         string token = TokenApi.GetToken_Message(this.siteSettings.WeixinAppId, this.siteSettings.WeixinAppSecret);
                         if (TokenApi.CheckIsRightToken(token))
                         {
                             string str4 = BarCodeApi.CreateTicket(token, info.Sceneid, "QR_LIMIT_SCENE", "2592000");
                             if (!string.IsNullOrEmpty(str4))
                             {
                                 codeUrl             = str4;
                                 info.CodeUrl        = str4;
                                 info.CreateTime     = DateTime.Now;
                                 info.LastActiveTime = DateTime.Now;
                                 ScanHelp.updateScanInfosCodeUrl(info);
                             }
                         }
                     }
                     if (string.IsNullOrEmpty(codeUrl))
                     {
                         codeUrl = Globals.HostPath(HttpContext.Current.Request.Url) + "/Follow.aspx?ReferralId=" + currentMember.UserId.ToString();
                     }
                     else
                     {
                         codeUrl = BarCodeApi.GetQRImageUrlByTicket(codeUrl);
                     }
                 }
                 if (string.IsNullOrEmpty(userIdDistributors.StoreCard) || (cardCreatTime < time2))
                 {
                     string storeName = userIdDistributors.StoreName;
                     if (!this.siteSettings.IsShowDistributorSelfStoreName)
                     {
                         storeName = this.siteSettings.SiteName;
                     }
                     StoreCardCreater creater = new StoreCardCreater(str, currentMember.UserHead, userIdDistributors.Logo, codeUrl, currentMember.UserName, storeName, this.userId, this.userId);
                     string           imgUrl  = "";
                     if (creater.ReadJson() && creater.CreadCard(out imgUrl))
                     {
                         DistributorsBrower.UpdateStoreCard(this.userId, imgUrl);
                     }
                 }
             }
             if (string.IsNullOrEmpty(userIdDistributors.StoreCard))
             {
                 userIdDistributors.StoreCard = "/Storage/master/DistributorCards/StoreCard" + this.userId.ToString() + ".jpg";
             }
             this.ShareInfo   = (HtmlInputHidden)this.FindControl("ShareInfo");
             this.imglogo.Src = userIdDistributors.StoreCard;
             PageTitle.AddSiteNameTitle("掌柜名片");
         }
     }
 }
Exemple #12
0
 protected void rptList_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         System.Web.UI.WebControls.Repeater repeater = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("rptSubList");
         OrderInfo orderInfo = OrderHelper.GetOrderInfo(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderID").ToString());
         if (orderInfo != null && orderInfo.LineItems.Count > 0)
         {
             repeater.DataSource = orderInfo.LineItems.Values;
             repeater.DataBind();
         }
         OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderStatus");
         string      a           = "";
         if (!(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") is System.DBNull))
         {
             a = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway");
         }
         int num = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyId") != System.DBNull.Value) ? ((int)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyId")) : 0;
         System.Web.UI.HtmlControls.HtmlInputButton htmlInputButton  = (System.Web.UI.HtmlControls.HtmlInputButton)e.Item.FindControl("btnModifyPrice");
         System.Web.UI.HtmlControls.HtmlInputButton htmlInputButton2 = (System.Web.UI.HtmlControls.HtmlInputButton)e.Item.FindControl("btnSendGoods");
         System.Web.UI.WebControls.Button           button           = (System.Web.UI.WebControls.Button)e.Item.FindControl("btnPayOrder");
         System.Web.UI.WebControls.Button           button2          = (System.Web.UI.WebControls.Button)e.Item.FindControl("btnConfirmOrder");
         System.Web.UI.HtmlControls.HtmlInputButton htmlInputButton3 = (System.Web.UI.HtmlControls.HtmlInputButton)e.Item.FindControl("btnCloseOrderClient");
         System.Web.UI.HtmlControls.HtmlAnchor      htmlAnchor       = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckRefund");
         System.Web.UI.HtmlControls.HtmlAnchor      htmlAnchor2      = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckReturn");
         System.Web.UI.HtmlControls.HtmlAnchor      htmlAnchor3      = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckReplace");
         System.Web.UI.WebControls.Literal          literal          = (System.Web.UI.WebControls.Literal)e.Item.FindControl("WeiXinNickName");
         System.Web.UI.WebControls.Literal          literal2         = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litOtherInfo");
         int        totalPointNumber = orderInfo.GetTotalPointNumber();
         MemberInfo member           = MemberProcessor.GetMember(orderInfo.UserId, true);
         if (member != null)
         {
             literal.Text = "买家:" + member.UserName;
         }
         System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
         decimal total = orderInfo.GetTotal();
         if (total > 0m)
         {
             stringBuilder.Append("<strong>¥" + total.ToString("F2") + "</strong>");
             stringBuilder.Append("<small>(含运费¥" + orderInfo.AdjustedFreight.ToString("F2") + ")</small>");
         }
         if (totalPointNumber > 0)
         {
             stringBuilder.Append("<small>" + totalPointNumber.ToString() + "积分</small>");
         }
         if (orderInfo.PaymentType == "货到付款")
         {
             stringBuilder.Append("<span class=\"setColor bl\"><strong>货到付款</strong></span>");
         }
         if (string.IsNullOrEmpty(stringBuilder.ToString()))
         {
             stringBuilder.Append("<strong>¥" + total.ToString("F2") + "</strong>");
         }
         literal2.Text = stringBuilder.ToString();
         if (orderStatus == OrderStatus.WaitBuyerPay)
         {
             htmlInputButton.Visible = true;
             htmlInputButton.Attributes.Add("onclick", "DialogFrame('../trade/EditOrder.aspx?OrderId=" + System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderID") + "&reurl='+ encodeURIComponent(goUrl),'修改订单价格',900,450)");
             htmlInputButton3.Attributes.Add("onclick", "CloseOrderFun('" + System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderID") + "')");
             htmlInputButton3.Visible = true;
             if (a != "hishop.plugins.payment.podrequest")
             {
                 button.Visible = true;
             }
         }
         if (orderStatus == OrderStatus.ApplyForRefund)
         {
             htmlAnchor.Visible = true;
         }
         if (orderStatus == OrderStatus.ApplyForReturns)
         {
             htmlAnchor2.Visible = true;
         }
         if (orderStatus == OrderStatus.ApplyForReplacement)
         {
             htmlAnchor3.Visible = true;
         }
         if (num > 0)
         {
             GroupBuyStatus groupBuyStatus = (GroupBuyStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyStatus");
             htmlInputButton2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid && groupBuyStatus == GroupBuyStatus.Success);
         }
         else
         {
             htmlInputButton2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid || (orderStatus == OrderStatus.WaitBuyerPay && a == "hishop.plugins.payment.podrequest"));
         }
         htmlInputButton2.Attributes.Add("onclick", "DialogFrame('../trade/SendOrderGoods.aspx?OrderId=" + System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderID") + "&reurl='+ encodeURIComponent(goUrl),'订单发货',750,220)");
         button2.Visible = (orderStatus == OrderStatus.SellerAlreadySent);
     }
 }
Exemple #13
0
        private bool ValShippingAddress(System.Web.HttpContext context, ref string erromsg)
        {
            //System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("[\\u4e00-\\u9fa5a-zA-Z]+[\\u4e00-\\u9fa5_a-zA-Z0-9]*");
            System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("^[\\u4e00-\\u9fa5]{2,6}$");
            if (string.IsNullOrEmpty(context.Request.Params["ShippingTo"].Trim()) || !regex.IsMatch(context.Request.Params["ShippingTo"].Trim()))
            {
                //erromsg = "收货人名字不能为空,只能是汉字或字母开头,长度在2-20个字符之间";
                erromsg = "收货人名字只能为2-6个汉字";
                return(false);
            }
            if (string.IsNullOrEmpty(context.Request.Params["AddressDetails"].Trim()))
            {
                erromsg = "详细地址不能为空";
                return(false);
            }
            if (context.Request.Params["AddressDetails"].Trim().Length < 3 || context.Request.Params["AddressDetails"].Trim().Length > 60)
            {
                erromsg = "详细地址长度在3-60个字符之间";
                return(false);
            }
            int cityId = 0, provinceId = 0;

            if (context.Request.Params["CityId"] != null && !string.IsNullOrEmpty(context.Request.Params["CityId"].Trim()))
            {
                cityId = Convert.ToInt32(context.Request.Params["CityId"].Trim());
            }

            if (context.Request.Params["ProvinceId"] != null && !string.IsNullOrEmpty(context.Request.Params["ProvinceId"].Trim()))
            {
                provinceId = Convert.ToInt32(context.Request.Params["ProvinceId"].Trim());
            }

            Dictionary <int, string> dic        = RegionHelper.GetCitys(provinceId);
            Dictionary <int, string> dictionary = RegionHelper.GetCountys(cityId);

            if ((dic.Count > 0 && cityId <= 0) || (dictionary.Count > 0 && (string.IsNullOrEmpty(context.Request.Params["RegionId"].Trim()) || System.Convert.ToInt32(context.Request.Params["RegionId"].Trim()) <= 0)))
            {
                erromsg = "请选择收货地址";
                return(false);
            }

            int    regionId                     = Convert.ToInt32(context.Request.Params["RegionId"].Trim());
            string regionIdstr                  = RegionHelper.GetFullPath(regionId);

            if ((dic.Count > 0 && cityId <= 0) || (dictionary.Count > 0 && regionIdstr.Split(',').Length != 3))
            {
                erromsg = "请选择完整的地区";
                return(false);
            }

            if (string.IsNullOrEmpty(context.Request.Params["TelPhone"].Trim()) && string.IsNullOrEmpty(context.Request.Params["CellHphone"].Trim().Trim()))
            {
                erromsg = "电话号码和手机二者必填其一";
                return(false);
            }
            if (!string.IsNullOrEmpty(context.Request.Params["TelPhone"].Trim()) && (context.Request.Params["TelPhone"].Trim().Length < 3 || context.Request.Params["TelPhone"].Trim().Length > 20))
            {
                erromsg = "电话号码长度限制在3-20个字符之间";
                return(false);
            }
            if (!string.IsNullOrEmpty(context.Request.Params["CellHphone"].Trim()) && (context.Request.Params["CellHphone"].Trim().Length < 3 || context.Request.Params["CellHphone"].Trim().Length > 20))
            {
                erromsg = "手机号码长度限制在3-20个字符之间";
                return(false);
            }
            string patternIdentityCard = "^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$";

            System.Text.RegularExpressions.Regex regexIdentityCard = new System.Text.RegularExpressions.Regex(patternIdentityCard);
            string IdentityCard = context.Request.Params["IdentityCard"].Trim();

            //if (!string.IsNullOrEmpty(IdentityCard) && !regexIdentityCard.IsMatch(IdentityCard))
            //{
            //     erromsg="请输入正确的身份证号码";
            //    return false;
            //}
            if (MemberProcessor.GetShippingAddressCount() > HiContext.Current.Config.ShippingAddressQuantity)
            {
                erromsg = string.Format("最多只能添加{0}个收货地址", HiContext.Current.Config.ShippingAddressQuantity);
                return(false);
            }
            return(true);
        }
Exemple #14
0
        private Literal litEndtime;//抢购结束时间

        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["cutDownId"], out this.cutDownId))
            {
                base.GotoResourceNotFound("");
            }
            this.rptProductImages      = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.litItemParams         = (Literal)this.FindControl("litItemParams");
            this.litProdcutName        = (Literal)this.FindControl("litProdcutName");
            this.litActivities         = (Literal)this.FindControl("litActivities");
            this.litSalePrice          = (Literal)this.FindControl("litSalePrice");    //原价
            this.litCurrentPrice       = (Literal)this.FindControl("litCurrentPrice"); //当前价格
            this.litShortDescription   = (Literal)this.FindControl("litShortDescription");
            this.litDescription        = (Literal)this.FindControl("litDescription");
            this.litStock              = (Literal)this.FindControl("litStock");
            this.skuSelector           = (Common_SKUSelector)this.FindControl("skuSelector");
            this.linkDescription       = (HyperLink)this.FindControl("linkDescription");
            this.expandAttr            = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
            this.litSoldCount          = (Literal)this.FindControl("litSoldCount");
            this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount");
            this.litReviewsCount       = (Literal)this.FindControl("litReviewsCount");
            this.litHasCollected       = (HtmlInputHidden)this.FindControl("litHasCollected");
            this.litCategoryId         = (HtmlInputHidden)this.FindControl("litCategoryId");
            this.litproductid          = (HtmlInputHidden)this.FindControl("litproductid");
            this.litCutDownId          = (HtmlInputControl)this.FindControl("litCutDownId");
            this.litEndtime            = (Literal)this.FindControl("litEndtime");//抢购结束时间
            //ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);
            CutDownInfo  cutDownInfo    = PromoteHelper.GetCutDown(this.cutDownId);
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
            //ProductBrowseInfo info2 = ProductBrowser.GetProductBrowseInfo(countDownInfoByCountDownId.ProductId, null, null, masterSettings.StoreStockValidateType, masterSettings.OpenMultStore);
            ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), cutDownInfo.ProductId);

            this.litproductid.Value = product.ProductId.ToString();

            if (!string.IsNullOrEmpty(this.litActivities.Text) && (product == null))
            {
                base.GotoResourceNotFound("此商品已不存在");
            }
            if (product.SaleStatus != ProductSaleStatus.OnSale)
            {
                base.GotoResourceNotFound("此商品已下架");
            }
            if (this.rptProductImages != null)
            {
                string       locationUrl = "javascript:;";
                SlideImage[] imageArray  = new SlideImage[] { new SlideImage(product.ImageUrl1, locationUrl), new SlideImage(product.ImageUrl2, locationUrl), new SlideImage(product.ImageUrl3, locationUrl), new SlideImage(product.ImageUrl4, locationUrl), new SlideImage(product.ImageUrl5, locationUrl) };
                this.rptProductImages.DataSource = from item in imageArray
                                                   where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                   select item;
                this.rptProductImages.DataBind();
            }
            string mainCategoryPath = product.MainCategoryPath;

            if (!string.IsNullOrEmpty(mainCategoryPath))
            {
                this.litCategoryId.Value = mainCategoryPath.Split(new char[] { '|' })[0];
            }
            else
            {
                this.litCategoryId.Value = "0";
            }
            this.litProdcutName.Text = product.ProductName;
            this.litSalePrice.Text   = cutDownInfo.FirstPrice.ToString("F2");//原价是该活动的初始价
            if (product.MarketPrice.HasValue)
            {
                this.litCurrentPrice.SetWhenIsNotNull(cutDownInfo.CurrentPrice.ToString("F2"));//现价是该商品的被砍后的价格
            }
            this.litShortDescription.Text = product.ShortDescription;
            if (this.litDescription != null)
            {
                this.litDescription.Text = product.Description;
            }
            this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
            this.litStock.Text         = cutDownInfo.Count.ToString(); //库存为限购数量
            this.skuSelector.ProductId = cutDownInfo.ProductId;        //为型号选择器绑定productid
            if (this.litEndtime != null)                               //倒计时
            {
                this.litEndtime.Text = Convert.ToDateTime(cutDownInfo.EndDate).ToString();
            }
            this.skuSelector.ProductId = cutDownInfo.ProductId;
            if (this.expandAttr != null)
            {
                this.expandAttr.ProductId = cutDownInfo.ProductId;
            }
            if (this.linkDescription != null)
            {
                this.linkDescription.NavigateUrl = "/Vshop/ProductDescription.aspx?productId=" + cutDownInfo.ProductId;
            }
            this.litConsultationsCount.SetWhenIsNotNull(ProductBrowser.GetProductConsultationsCount(cutDownInfo.ProductId, false).ToString());
            this.litReviewsCount.SetWhenIsNotNull(ProductBrowser.GetProductReviewsCount(cutDownInfo.ProductId).ToString());
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();
            bool       flag          = false;

            if (currentMember != null)
            {
                flag = ProductBrowser.CheckHasCollect(currentMember.UserId, cutDownInfo.ProductId);
            }
            this.litHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
            ProductBrowser.UpdateVisitCounts(cutDownInfo.ProductId);
            PageTitle.AddSiteNameTitle("商品详情");
            string str3 = "";

            if (!string.IsNullOrEmpty(masterSettings.GoodsPic))
            {
                str3 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.GoodsPic;
            }
            this.litItemParams.Text = string.Concat(new object[] { str3, "|", masterSettings.GoodsName, "|", masterSettings.GoodsDescription, "$", Globals.HostPath(HttpContext.Current.Request.Url), product.ImageUrl1, "|", this.litProdcutName.Text, "|", product.ShortDescription, "|", HttpContext.Current.Request.Url });
            this.litCutDownId.SetWhenIsNotNull(cutDownInfo.CutDownId.ToString());
        }
Exemple #15
0
        protected override void AttachChildControls()
        {
            this.rptCategories                = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.rptProducts                  = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptProducts.ItemDataBound   += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.rptProducts_ItemDataBound);
            this.rptCategories.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.rptCategories_ItemDataBound);
            this.img            = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgDefaultBg");
            this.pager          = (Pager)this.FindControl("pager");
            this.litstorename   = (System.Web.UI.WebControls.Literal) this.FindControl("litstorename");
            this.litdescription = (System.Web.UI.WebControls.Literal) this.FindControl("litdescription");
            this.litattention   = (System.Web.UI.WebControls.Literal) this.FindControl("litattention");
            this.imglogo        = (HiImage)this.FindControl("imglogo");
            this.litImgae       = (System.Web.UI.WebControls.Literal) this.FindControl("litImgae");
            this.litItemParams  = (System.Web.UI.WebControls.Literal) this.FindControl("litItemParams");
            if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"]))
            {
                System.Web.HttpCookie httpCookie = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + httpCookie.Value);
                }
            }
            if (this.rptCategories.Visible)
            {
                DataTable brandCategories = CategoryBrowser.GetBrandCategories();
                this.itemcount = brandCategories.Rows.Count;
                if (brandCategories.Rows.Count > 0)
                {
                    this.rptCategories.DataSource = brandCategories;
                    this.rptCategories.DataBind();
                }
            }
            this.Page.Session["stylestatus"] = "3";
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            PageTitle.AddSiteNameTitle(masterSettings.SiteName);
            this.litstorename.Text   = masterSettings.SiteName;
            this.litdescription.Text = masterSettings.ShopIntroduction;
            if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
            {
                this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[]
                {
                    '|'
                })[0];
            }
            if (this.referralId <= 0)
            {
                System.Web.HttpCookie httpCookie2 = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (httpCookie2 != null && !string.IsNullOrEmpty(httpCookie2.Value))
                {
                    this.referralId = int.Parse(httpCookie2.Value);
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            else
            {
                System.Web.HttpCookie httpCookie2 = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (httpCookie2 != null && !string.IsNullOrEmpty(httpCookie2.Value) && this.referralId.ToString() != httpCookie2.Value)
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            System.Collections.Generic.IList <BannerInfo> list = new System.Collections.Generic.List <BannerInfo>();
            list = VshopBrowser.GetAllBanners();
            foreach (BannerInfo current in list)
            {
                TplCfgInfo tplCfgInfo = new NavigateInfo();
                tplCfgInfo.LocationType = current.LocationType;
                tplCfgInfo.Url          = current.Url;
                string text = "javascript:";
                if (!string.IsNullOrEmpty(current.Url))
                {
                    text = tplCfgInfo.LoctionUrl;
                }
                System.Web.UI.WebControls.Literal expr_3E2 = this.litImgae;
                string text2 = expr_3E2.Text;
                expr_3E2.Text = string.Concat(new string[]
                {
                    text2,
                    "<a  id=\"ahref\" href='",
                    text,
                    "'><img src=\"",
                    current.ImageUrl,
                    "\" title=\"",
                    current.ShortDesc,
                    "\" alt=\"",
                    current.ShortDesc,
                    "\" /></a>"
                });
            }
            if (list.Count == 0)
            {
                this.litImgae.Text = "<a id=\"ahref\"  href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\"  /></a>";
            }
            DistributorsInfo distributorsInfo = new DistributorsInfo();

            distributorsInfo = DistributorsBrower.GetUserIdDistributors(this.referralId);
            if (distributorsInfo != null && distributorsInfo.UserId > 0)
            {
                PageTitle.AddSiteNameTitle(distributorsInfo.StoreName);
                this.litdescription.Text = distributorsInfo.StoreDescription;
                this.litstorename.Text   = distributorsInfo.StoreName;
                if (!string.IsNullOrEmpty(distributorsInfo.Logo))
                {
                    this.imglogo.ImageUrl = distributorsInfo.Logo;
                }
                else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                {
                    this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[]
                    {
                        '|'
                    })[0];
                }
                if (!string.IsNullOrEmpty(distributorsInfo.BackImage))
                {
                    this.litImgae.Text = "";
                    string[] array = distributorsInfo.BackImage.Split(new char[]
                    {
                        '|'
                    });
                    for (int i = 0; i < array.Length; i++)
                    {
                        string text3 = array[i];
                        if (!string.IsNullOrEmpty(text3))
                        {
                            System.Web.UI.WebControls.Literal expr_5D7 = this.litImgae;
                            expr_5D7.Text = expr_5D7.Text + "<a ><img src=\"" + text3 + "\" title=\"\"  /></a>";
                        }
                    }
                }
            }
            this.dtpromotion = ProductBrowser.GetAllFull();
            if (this.rptProducts != null)
            {
                ProductQuery productQuery = new ProductQuery();
                productQuery.PageSize  = this.pager.PageSize;
                productQuery.PageIndex = this.pager.PageIndex;
                productQuery.SortBy    = "DisplaySequence";
                productQuery.SortOrder = SortAction.Desc;
                DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), productQuery);
                this.rptProducts.DataSource = homeProduct.Data;
                this.rptProducts.DataBind();
                this.pager.TotalRecords = homeProduct.TotalRecords;
                if (this.pager.TotalRecords <= this.pager.PageSize)
                {
                    this.pager.Visible = false;
                }
            }
            if (this.img != null)
            {
                this.img.Src = new VTemplateHelper().GetDefaultBg();
            }
            if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.GuidePageSet;
            }
            string userAgent = this.Page.Request.UserAgent;

            if (userAgent.ToLower().Contains("alipay") && !string.IsNullOrEmpty(masterSettings.AliPayFuwuGuidePageSet))
            {
                if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
                {
                    this.litattention.Text = masterSettings.AliPayFuwuGuidePageSet;
                }
            }
            string text4 = "";

            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                text4 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string text5 = "";
            string text6 = (distributorsInfo == null) ? masterSettings.SiteName : distributorsInfo.StoreName;

            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                text5 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[]
                {
                    '|'
                })[0];
            }
            this.litItemParams.Text = string.Concat(new string[]
            {
                text4,
                "|",
                masterSettings.ShopHomeName,
                "|",
                masterSettings.ShopHomeDescription,
                "$"
            });
            this.litItemParams.Text = string.Concat(new object[]
            {
                this.litItemParams.Text,
                text5,
                "|好店推荐之",
                text6,
                "商城|一个购物赚钱的好去处|",
                System.Web.HttpContext.Current.Request.Url
            });
        }
Exemple #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = base.Request.QueryString.Get("orderId");

            if (!string.IsNullOrEmpty(str))
            {
                List <OrderInfo> orderMarkingOrderInfo = ShoppingProcessor.GetOrderMarkingOrderInfo(str);
                if (orderMarkingOrderInfo.Count != 0)
                {
                    decimal num = 0M;
                    foreach (OrderInfo info in orderMarkingOrderInfo)
                    {
                        num += info.GetTotal();
                    }
                    PackageInfo package = new PackageInfo {
                        Body       = str,
                        NotifyUrl  = string.Format("http://{0}/pay/wx_Pay.aspx", base.Request.Url.Host),
                        OutTradeNo = str,
                        TotalFee   = (int)(num * 100M)
                    };
                    if (package.TotalFee < 1M)
                    {
                        package.TotalFee = 1M;
                    }
                    string     openId        = "";
                    MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                    if (currentMember != null)
                    {
                        openId = currentMember.OpenId;
                    }
                    package.OpenId = openId;
                    wid            = currentMember.wid;
                    //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                    Chenduo.Model.sf_website website = new Chenduo.BLL.sf_website().GetModelByWid(wid);
                    //PayRequestInfo req = new PayClient(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, masterSettings.WeixinPartnerID, masterSettings.WeixinPartnerKey, masterSettings.WeixinPaySignKey).BuildPayRequest(package);
                    PayRequestInfo req = new PayClient(wid, website.appid, website.appsecret, website.weixin_pay_account, website.account_pay_key, "").BuildPayRequest(package);
                    this.pay_json = this.ConvertPayJson(req);
                    DataTable shareActivity = ShareActHelper.GetShareActivity();
                    int       num2          = 0;
                    decimal   num3          = 0M;
                    if (shareActivity.Rows.Count > 0)
                    {
                        for (int i = 0; i < shareActivity.Rows.Count; i++)
                        {
                            if ((num != 0M) && (num >= decimal.Parse(shareActivity.Rows[shareActivity.Rows.Count - 1]["MeetValue"].ToString())))
                            {
                                num2 = int.Parse(shareActivity.Rows[shareActivity.Rows.Count - 1]["Id"].ToString());
                                num3 = decimal.Parse(shareActivity.Rows[shareActivity.Rows.Count - 1]["MeetValue"].ToString());
                                break;
                            }
                            if ((num != 0M) && (num <= decimal.Parse(shareActivity.Rows[0]["MeetValue"].ToString())))
                            {
                                num2 = int.Parse(shareActivity.Rows[0]["Id"].ToString());
                                num3 = decimal.Parse(shareActivity.Rows[0]["MeetValue"].ToString());
                                break;
                            }
                            if ((num != 0M) && (num >= decimal.Parse(shareActivity.Rows[i]["MeetValue"].ToString())))
                            {
                                num2 = int.Parse(shareActivity.Rows[i]["Id"].ToString());
                                num3 = decimal.Parse(shareActivity.Rows[i]["MeetValue"].ToString());
                            }
                        }
                        if (num >= num3)
                        {
                            this.shareid = num2;
                        }
                    }
                }
            }
        }
        private void btnRegister_Click(object sender, EventArgs e)
        {
            if (!this.chkAgree.Checked)
            {
                this.ShowMessage("您必须先阅读并同意注册协议", false);
            }
            else if (string.Compare(this.txtUserName.Text.Trim().ToLower(CultureInfo.InvariantCulture), "anonymous", false, CultureInfo.InvariantCulture) == 0)
            {
                this.ShowMessage("已经存在相同的用户名", false);
            }
            else if ((this.txtUserName.Text.Trim().Length < 2) || (this.txtUserName.Text.Trim().Length > 20))
            {
                this.ShowMessage("用户名不能为空,且在2-20个字符之间", false);
            }
            else if (string.Compare(this.txtPassword.Text, this.txtPassword2.Text) != 0)
            {
                this.ShowMessage("两次输入的密码不相同", false);
            }
            else if (this.txtPassword.Text.Length == 0)
            {
                this.ShowMessage("密码不能为空", false);
            }
            else if ((this.txtPassword.Text.Length < Membership.Provider.MinRequiredPasswordLength) || (this.txtPassword.Text.Length > HiConfiguration.GetConfig().PasswordMaxLength))
            {
                this.ShowMessage(string.Format("密码的长度只能在{0}和{1}个字符之间", Membership.Provider.MinRequiredPasswordLength, HiConfiguration.GetConfig().PasswordMaxLength), false);
            }
            else
            {
                Member member = null;
                if (HiContext.Current.SiteSettings.IsDistributorSettings)
                {
                    member = new Member(UserRole.Underling);
                    member.ParentUserId = HiContext.Current.SiteSettings.UserId;
                }
                else
                {
                    member = new Member(UserRole.Member);
                }
                if (HiContext.Current.ReferralUserId > 0)
                {
                    member.ReferralUserId = new int?(HiContext.Current.ReferralUserId);
                }
                member.GradeId             = MemberProcessor.GetDefaultMemberGrade();
                member.Username            = Globals.HtmlEncode(this.txtUserName.Text.Trim());
                member.Email               = this.txtEmail.Text;
                member.Password            = this.txtPassword.Text;
                member.PasswordFormat      = MembershipPasswordFormat.Hashed;
                member.TradePasswordFormat = MembershipPasswordFormat.Hashed;
                member.TradePassword       = this.txtPassword.Text;
                if (this.txtCellPhone != null)
                {
                    member.CellPhone = this.txtCellPhone.Text;
                }
                member.IsApproved = true;
                member.RealName   = string.Empty;
                member.Address    = string.Empty;
                if (this.ValidationMember(member))
                {
                    if (!HiContext.Current.CheckVerifyCode(this.txtNumber.Text))
                    {
                        this.ShowMessage("验证码输入错误", false);
                    }
                    else
                    {
                        switch (MemberProcessor.CreateMember(member))
                        {
                        case CreateUserStatus.UnknownFailure:
                            this.ShowMessage("未知错误", false);
                            return;

                        case CreateUserStatus.Created:
                        {
                            Messenger.UserRegister(member, this.txtPassword.Text);
                            member.OnRegister(new UserEventArgs(member.Username, this.txtPassword.Text, null));
                            IUser            user         = Users.GetUser(0, member.Username, false, true);
                            ShoppingCartInfo shoppingCart = ShoppingCartProcessor.GetShoppingCart();
                            CookieShoppingProvider.Instance().ClearShoppingCart();
                            HiContext.Current.User = user;
                            if (shoppingCart != null)
                            {
                                ShoppingCartProcessor.ConvertShoppingCartToDataBase(shoppingCart);
                            }
                            HttpCookie authCookie = FormsAuthentication.GetAuthCookie(member.Username, false);
                            user.GetUserCookie().WriteCookie(authCookie, 30, false);
                            this.Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("registerUserSave") + "?UserId=" + user.UserId);
                            return;
                        }

                        case CreateUserStatus.DuplicateUsername:
                            this.ShowMessage("已经存在相同的用户名", false);
                            return;

                        case CreateUserStatus.DuplicateEmailAddress:
                            this.ShowMessage("电子邮件地址已经存在", false);
                            return;

                        case CreateUserStatus.InvalidFirstCharacter:
                        case CreateUserStatus.Updated:
                        case CreateUserStatus.Deleted:
                        case CreateUserStatus.InvalidQuestionAnswer:
                            return;

                        case CreateUserStatus.DisallowedUsername:
                            this.ShowMessage("用户名禁止注册", false);
                            return;

                        case CreateUserStatus.InvalidPassword:
                            this.ShowMessage("无效的密码", false);
                            return;

                        case CreateUserStatus.InvalidEmail:
                            this.ShowMessage("无效的电子邮件地址", false);
                            return;
                        }
                    }
                }
            }
        }
Exemple #18
0
        protected override void AttachChildControls()
        {
            int num;
            int num2;

            PageTitle.AddSiteNameTitle("我的奖品");
            this.rptList       = (VshopTemplatedRepeater)this.FindControl("rptList");
            this.txtTotal      = (HtmlInputHidden)this.FindControl("txtTotal");
            this.txtShowTabNum = (HtmlInputHidden)this.FindControl("txtShowTabNum");
            HtmlSelect select = (HtmlSelect)this.FindControl("txtRevAddress");
            IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses();

            select.Items.Clear();
            foreach (ShippingAddressInfo info in shippingAddresses)
            {
                string str  = "";
                string text = "";
                str  = string.Concat(new object[] { info.ShipTo, "|", info.CellPhone, "|", info.RegionId, "|", info.Address });
                text = info.ShipTo + " " + info.CellPhone + " " + RegionHelper.GetFullRegion(info.RegionId, ",") + " " + info.Address;
                select.Items.Add(new ListItem(text, str));
            }
            select.Items.Add(new ListItem("--新增收货地址--", "addNew"));
            string str3 = Globals.RequestQueryStr("ShowTab");

            if (string.IsNullOrEmpty(str3))
            {
                str3 = "0";
            }
            PrizesDeliveQuery entity = new PrizesDeliveQuery();

            if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
            {
                num = 1;
            }
            if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
            {
                num2 = 20;
            }
            string extendLimits = "";

            if (str3 == "0")
            {
                extendLimits = " and status in(0,1,2) ";
            }
            else
            {
                extendLimits = " and status=3 ";
            }
            this.txtShowTabNum.Value = str3;
            entity.Status            = -1;
            entity.SortBy            = "LogId";
            entity.SortOrder         = SortAction.Desc;
            entity.PageIndex         = num;
            entity.PrizeType         = -1;
            entity.PageSize          = num2;
            entity.UserId            = Globals.GetCurrentMemberUserId();
            Globals.EntityCoding(entity, true);
            DbQueryResult result = GameHelper.GetPrizesDeliveryList(entity, extendLimits, "*");

            this.rptList.DataSource = result.Data;
            this.rptList.DataBind();
            this.txtTotal.SetWhenIsNotNull(result.TotalRecords.ToString());
        }
        private void BindDrawRecords()
        {
            decimal amount = MemberProcessor.GetBalanceAmountByUserId(HiContext.Current.User.UserId, "Expenses");

            litBalanceDrawRequestAmount.SetWhenIsNotNull(amount.ToString("F2"));
        }
Exemple #20
0
        private void ProcessGetAmountList(System.Web.HttpContext context)
        {
            context.Response.ContentType = "application/json";
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();
            string     s             = "{\"success\":\"false\"}";
            int        type          = Globals.RequestFormNum("type");
            int        num           = Globals.RequestFormNum("page");
            int        num2          = Globals.RequestFormNum("pagesize");

            if (num2 < 5)
            {
                num2 = 10;
            }
            if (num < 1)
            {
                num = 1;
            }
            DbQueryResult amountListRequest = MemberAmountProcessor.GetAmountListRequest(type, num, num2, currentMember.UserId);
            object        data = amountListRequest.Data;

            if (data != null)
            {
                System.Data.DataTable     dataTable     = (System.Data.DataTable)data;
                System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
                int    count = dataTable.Rows.Count;
                string text  = string.Empty;
                if (count > 0)
                {
                    decimal d = decimal.Parse(dataTable.Rows[0]["TradeAmount"].ToString());
                    text = System.Math.Round(d, 2).ToString();
                    int i = 0;
                    stringBuilder.Append(string.Concat(new string[]
                    {
                        "{\"id\":",
                        dataTable.Rows[i]["ID"].ToString(),
                        ",\"AvailableAmount\":\"",
                        Globals.String2Json(System.Math.Round((decimal)dataTable.Rows[i]["AvailableAmount"], 2).ToString()),
                        "\",\"TradeTime\":\"",
                        System.DateTime.Parse(dataTable.Rows[i]["TradeTime"].ToString()).ToString("yyyy-MM-dd"),
                        "\",\"TradeAmount\":\"",
                        text,
                        "\",\"TradeType\":\"",
                        MemberHelper.StringToTradeType(dataTable.Rows[i]["TradeType"].ToString()),
                        "\"}"
                    }));
                    for (i = 1; i < count; i++)
                    {
                        d    = decimal.Parse(dataTable.Rows[i]["TradeAmount"].ToString());
                        text = System.Math.Round(d, 2).ToString();
                        stringBuilder.Append(string.Concat(new string[]
                        {
                            ",{\"id\":",
                            dataTable.Rows[i]["ID"].ToString(),
                            ",\"AvailableAmount\":\"",
                            Globals.String2Json(System.Math.Round((decimal)dataTable.Rows[i]["AvailableAmount"], 2).ToString()),
                            "\",\"TradeTime\":\"",
                            System.DateTime.Parse(dataTable.Rows[i]["TradeTime"].ToString()).ToString("yyyy-MM-dd"),
                            "\",\"TradeAmount\":\"",
                            text,
                            "\",\"TradeType\":\"",
                            MemberHelper.StringToTradeType(dataTable.Rows[i]["TradeType"].ToString()),
                            "\"}"
                        }));
                    }
                }
                s = string.Concat(new object[]
                {
                    "{\"success\":\"true\",\"rowtotal\":\"",
                    dataTable.Rows.Count,
                    "\",\"total\":\"",
                    amountListRequest.TotalRecords,
                    "\",\"lihtml\":[",
                    stringBuilder.ToString(),
                    "]}"
                });
            }
            context.Response.Write(s);
            context.Response.End();
        }
        private void UserPayOrder()
        {
            string returnUrl = this.GetReturnUrl(this.Order.OrderSource);

            if (this.Order.OrderStatus == OrderStatus.Closed)
            {
                OrderHelper.SetExceptionOrder(this.Order.OrderId, "支付异常,请联系买家退款");
                Messenger.OrderException(Users.GetUser(this.Order.UserId), this.Order, "订单支付异常,请联系卖家退款.订单号:" + this.Order.OrderId);
            }
            else if (this.Order.OrderStatus == OrderStatus.BuyerAlreadyPaid)
            {
                base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}</br><a href='{2}'>查看订单详情</a></p>", this.OrderId, this.Amount.ToString("F"), returnUrl));
            }
            else
            {
                int maxCount        = 0;
                int yetOrderNum     = 0;
                int currentOrderNum = 0;
                if (this.Order.GroupBuyId > 0)
                {
                    GroupBuyInfo groupBuy = TradeHelper.GetGroupBuy(this.Order.GroupBuyId);
                    if (groupBuy == null || groupBuy.Status != GroupBuyStatus.UnderWay)
                    {
                        base.Response.Write($"<p style=\"font-size:16px;\">订单为团购订单,团购活动已结束,支付失败</br><a href='{returnUrl}'>查看订单详情</a></p>");
                        return;
                    }
                    yetOrderNum     = TradeHelper.GetOrderCount(this.Order.GroupBuyId);
                    currentOrderNum = this.Order.GetGroupBuyOerderNumber();
                    maxCount        = groupBuy.MaxCount;
                    if (maxCount < yetOrderNum + currentOrderNum)
                    {
                        base.Response.Write($"<p style=\"font-size:16px;\">订单为团购订单,订购数量超过订购总数,支付失败</br><a href='{returnUrl}'>查看订单详情</a></p>");
                        return;
                    }
                }
                if (this.Order.CheckAction(OrderActions.BUYER_PAY) && TradeHelper.UpdateOrderStatus(this.Order))
                {
                    Task.Factory.StartNew(delegate
                    {
                        TradeHelper.UserPayOrder(this.Order, false, true);
                        try
                        {
                            if (this.Order.GroupBuyId > 0 && maxCount == yetOrderNum + currentOrderNum)
                            {
                                TradeHelper.SetGroupBuyEndUntreated(this.Order.GroupBuyId);
                            }
                            if (this.Order.ParentOrderId == "-1")
                            {
                                OrderQuery orderQuery           = new OrderQuery();
                                orderQuery.ParentOrderId        = this.Order.OrderId;
                                IList <OrderInfo> listUserOrder = MemberProcessor.GetListUserOrder(this.Order.UserId, orderQuery);
                                foreach (OrderInfo item in listUserOrder)
                                {
                                    OrderHelper.OrderConfirmPaySendMessage(item);
                                }
                            }
                            else
                            {
                                OrderHelper.OrderConfirmPaySendMessage(this.Order);
                            }
                        }
                        catch (Exception ex)
                        {
                            IDictionary <string, string> dictionary = new Dictionary <string, string>();
                            dictionary.Add("ErrorMessage", ex.Message);
                            dictionary.Add("StackTrace", ex.StackTrace);
                            if (ex.InnerException != null)
                            {
                                dictionary.Add("InnerException", ex.InnerException.ToString());
                            }
                            if (ex.GetBaseException() != null)
                            {
                                dictionary.Add("BaseException", ex.GetBaseException().Message);
                            }
                            if (ex.TargetSite != (MethodBase)null)
                            {
                                dictionary.Add("TargetSite", ex.TargetSite.ToString());
                            }
                            dictionary.Add("ExSource", ex.Source);
                            Globals.AppendLog(dictionary, "支付更新订单收款记录或者消息通知时出错:" + ex.Message, "", "", "UserPay");
                        }
                        this.Order.OnPayment();
                    });
                    base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}</br><a href='{2}'>查看订单详情</a></p>", this.OrderId, this.Amount.ToString("F"), returnUrl));
                }
                else
                {
                    base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}</br><a href='{2}'>查看订单详情</a></p>", this.OrderId, this.Amount.ToString("F"), returnUrl));
                }
            }
        }
Exemple #22
0
        private void ProcessAddAmountApply(System.Web.HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string s = "";

            if (this.CheckAddAmountApply(context, ref s))
            {
                string  accountCode = context.Request["account"].Trim();
                decimal amount      = decimal.Parse(context.Request["applymoney"].Trim());
                int     num         = 0;
                int.TryParse(context.Request["requesttype"].Trim(), out num);
                string remark   = context.Request["remark"].Trim();
                string text     = context.Request["realname"].Trim();
                string bankName = context.Request["bankname"].Trim();
                MemberAmountRequestInfo memberAmountRequestInfo = new MemberAmountRequestInfo();
                MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                memberAmountRequestInfo.UserId      = currentMember.UserId;
                memberAmountRequestInfo.UserName    = currentMember.UserName;
                memberAmountRequestInfo.RequestTime = System.DateTime.Now;
                memberAmountRequestInfo.Amount      = amount;
                memberAmountRequestInfo.RequestType = (RequesType)num;
                memberAmountRequestInfo.AccountCode = accountCode;
                if (num == 3 || num == 0)
                {
                    memberAmountRequestInfo.AccountCode = currentMember.OpenId;
                }
                string text2 = string.IsNullOrEmpty(text) ? currentMember.RealName : text;
                if (string.IsNullOrEmpty(text2))
                {
                    text2 = currentMember.UserName;
                }
                if (string.IsNullOrEmpty(text2))
                {
                    text2 = "未设置";
                }
                memberAmountRequestInfo.AccountName = text2;
                memberAmountRequestInfo.BankName    = bankName;
                memberAmountRequestInfo.Remark      = remark;
                memberAmountRequestInfo.State       = RequesState.未审核;
                memberAmountRequestInfo.CellPhone   = currentMember.CellPhone;
                if ((string.IsNullOrEmpty(currentMember.OpenId) || currentMember.OpenId.Length < 28) && (num == 3 || num == 0))
                {
                    s = "{\"success\":false,\"msg\":\"您的帐号未绑定,无法通过微信支付余额!\"}";
                }
                else if (MemberAmountProcessor.CreatAmountApplyRequest(memberAmountRequestInfo))
                {
                    try
                    {
                        MemberAmountRequestInfo memberAmountRequestInfo2 = memberAmountRequestInfo;
                        if (memberAmountRequestInfo2 != null)
                        {
                            Messenger.SendWeiXinMsg_MemberAmountDrawCashRequest(memberAmountRequestInfo2);
                        }
                    }
                    catch (System.Exception)
                    {
                    }
                    s = "{\"success\":true,\"msg\":\"申请成功!\"}";
                }
                else
                {
                    s = "{\"success\":false,\"msg\":\"申请失败!\"}";
                }
            }
            context.Response.Write(s);
            context.Response.End();
        }
Exemple #23
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("申请分销");
            this.Page.Session["stylestatus"] = "2";
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (string.IsNullOrEmpty(currentMember.UserBindName))
            {
                this.Page.Response.Redirect("/BindUserMessage.aspx?returnUrl=/Vshop/DistributorValid.aspx", true);
                this.Page.Response.End();
            }
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMember.UserId);

            if (userIdDistributors != null && userIdDistributors.ReferralStatus == 0)
            {
                this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx", true);
                this.Page.Response.End();
            }
            bool         flag           = false;
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            if (masterSettings.DistributorApplicationCondition)
            {
                decimal expenditure        = currentMember.Expenditure;
                int     finishedOrderMoney = masterSettings.FinishedOrderMoney;
                if (finishedOrderMoney > 0)
                {
                    decimal   num = 0m;
                    DataTable userOrderPaidWaitFinish = OrderHelper.GetUserOrderPaidWaitFinish(currentMember.UserId);
                    for (int i = 0; i < userOrderPaidWaitFinish.Rows.Count; i++)
                    {
                        OrderInfo orderInfo = OrderHelper.GetOrderInfo(userOrderPaidWaitFinish.Rows[i]["orderid"].ToString());
                        if (orderInfo != null)
                        {
                            decimal total = orderInfo.GetTotal();
                            if (total > 0m)
                            {
                                num += total;
                            }
                        }
                    }
                    if (currentMember.Expenditure + num >= finishedOrderMoney)
                    {
                        flag = true;
                    }
                }
                if (!flag)
                {
                    if (masterSettings.EnableDistributorApplicationCondition)
                    {
                        if (!string.IsNullOrEmpty(masterSettings.DistributorProductsDate) && !string.IsNullOrEmpty(masterSettings.DistributorProducts))
                        {
                            if (masterSettings.DistributorProductsDate.Contains("|"))
                            {
                                System.DateTime value  = default(System.DateTime);
                                System.DateTime value2 = default(System.DateTime);
                                bool            flag2  = System.DateTime.TryParse(masterSettings.DistributorProductsDate.Split(new char[]
                                {
                                    '|'
                                })[0].ToString(), out value);
                                bool flag3 = System.DateTime.TryParse(masterSettings.DistributorProductsDate.Split(new char[]
                                {
                                    '|'
                                })[1].ToString(), out value2);
                                if (flag2 && flag3 && System.DateTime.Now.CompareTo(value) >= 0 && System.DateTime.Now.CompareTo(value2) < 0)
                                {
                                    if (MemberProcessor.CheckMemberIsBuyProds(currentMember.UserId, masterSettings.DistributorProducts, new System.DateTime?(value), new System.DateTime?(value2)))
                                    {
                                        flag = true;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                flag = true;
            }
            if (!flag)
            {
                this.Page.Response.Redirect("/Vshop/DistributorRegCheck.aspx", true);
                this.Page.Response.End();
            }
            int num2 = 0;

            this.idImg = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("idImg");
            string text = string.Empty;

            if (int.TryParse(this.Page.Request.QueryString["ReferralId"], out num2))
            {
                if (num2 > 0)
                {
                    DistributorsInfo userIdDistributors2 = DistributorsBrower.GetUserIdDistributors(num2);
                    if (userIdDistributors2 != null)
                    {
                        if (!string.IsNullOrEmpty(userIdDistributors2.Logo))
                        {
                            text = userIdDistributors2.Logo;
                        }
                    }
                }
            }
            if (string.IsNullOrEmpty(text))
            {
                text = masterSettings.DistributorLogoPic;
            }
            this.idImg.Src = text;
            if (userIdDistributors != null && userIdDistributors.ReferralStatus != 0)
            {
                this.litIsEnable       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litIsEnable");
                this.litIsEnable.Value = userIdDistributors.ReferralStatus.ToString();
            }
        }
Exemple #24
0
        private void ProcessSubmmitAmount(System.Web.HttpContext context)
        {
            context.Response.ContentType = "application/json";
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            stringBuilder.Append("{");
            if (currentMember == null)
            {
                stringBuilder.Append("\"Status\":\"Eror\",\"ErrorMsg\":\"请先登录!\"");
                stringBuilder.Append("}");
                context.Response.ContentType = "application/json";
                context.Response.Write(stringBuilder.ToString());
                return;
            }
            int     num        = int.Parse(context.Request["paymentType"]);
            decimal num2       = decimal.Parse(context.Request["Amount"]);
            string  generateId = Globals.GetGenerateId();

            if (num2 > 1000000m)
            {
                stringBuilder.Append("\"Status\":\"Eror\",\"ErrorMsg\":\"最大充值金额不大于100万!\"");
                stringBuilder.Append("}");
                context.Response.ContentType = "application/json";
                context.Response.Write(stringBuilder.ToString());
                return;
            }
            MemberAmountDetailedInfo memberAmountDetailedInfo = new MemberAmountDetailedInfo();

            memberAmountDetailedInfo.UserId          = currentMember.UserId;
            memberAmountDetailedInfo.UserName        = currentMember.UserName;
            memberAmountDetailedInfo.PayId           = generateId;
            memberAmountDetailedInfo.TradeAmount     = num2;
            memberAmountDetailedInfo.TradeType       = TradeType.Recharge;
            memberAmountDetailedInfo.TradeTime       = System.DateTime.Now;
            memberAmountDetailedInfo.State           = 0;
            memberAmountDetailedInfo.AvailableAmount = currentMember.AvailableAmount + num2;
            memberAmountDetailedInfo.Remark          = "余额充值";
            if (num == 88)
            {
                memberAmountDetailedInfo.TradeWays = TradeWays.WeChatWallet;
            }
            else
            {
                PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode(num);
                if (paymentMode != null)
                {
                    if (paymentMode.Gateway == "hishop.plugins.payment.ws_wappay.wswappayrequest")
                    {
                        memberAmountDetailedInfo.TradeWays = TradeWays.Alipay;
                    }
                    else if (paymentMode.Gateway == "Hishop.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest")
                    {
                        memberAmountDetailedInfo.TradeWays = TradeWays.ShengFutong;
                    }
                }
            }
            if (MemberAmountProcessor.CreatAmount(memberAmountDetailedInfo))
            {
                stringBuilder.Append("\"Status\":\"OK\",\"PayIdStatus\":\"" + memberAmountDetailedInfo.PayId + "\",");
                stringBuilder.AppendFormat("\"PayId\":\"{0}\"", memberAmountDetailedInfo.PayId);
            }
            else
            {
                stringBuilder.Append("\"Status\":\"Error\"");
                stringBuilder.AppendFormat(",\"ErrorMsg\":\"提交充值失败!\"", new object[0]);
            }
            stringBuilder.Append("}");
            context.Response.ContentType = "application/json";
            context.Response.Write(stringBuilder.ToString());
        }
Exemple #25
0
        //2015-8-20添加:填补了了冻结和解冻功能
        protected void reDistributor_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int userid = Convert.ToInt32(e.CommandArgument);

            switch (e.CommandName)
            {
            case "Frozen":
                DistributorsBrower.FrozenCommision(userid, "1");
                break;

            case "UnFre":
                DistributorsBrower.FrozenCommision(userid, "0");
                break;

            case "ReSetPwd":
                MemberProcessor.SetPwd(userid.ToString(), "888888");
                break;

            case "Prom":
                DistributorsBrower.Updateaspnet_DistributorsUserId(userid);
                break;

            case "Store":
                DistributorsBrower.Updateaspnet_DistributorsServiceStoreId(userid);    //升级门店
                break;

            case "Tore":
                DistributorsBrower.Updateaspnet_DistributorsServiceToreId(userid);    //分销商
                break;

            case "Delete":
                if (DistributorsBrower.DeleteDistributor(userid))
                {
                    this.ShowMsg("删除成功!", true);
                    return;
                }
                else
                {
                    this.ShowMsg("该分销商包含下属,无法删除!", false);
                    return;
                }
                break;

            case "Down":
                /*
                 * string str = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + "/Storage/master/QRcord.jpg";
                 *
                 * string path = Server.MapPath("/Storage/temp/" + userid + ".jpg");
                 * string imgURL = string.Format("{0}/API/GetQRCode.ashx?code={0}/Vshop/Default.aspx?ReferralId={1}", Globals.HostPath(System.Web.HttpContext.Current.Request.Url), userid);
                 */
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                string       savepath       = System.Web.HttpContext.Current.Server.MapPath("~/Storage/TicketImage") + "\\" + string.Format("distributor_{0}", userid) + ".jpg";
                if (!File.Exists(savepath))
                {
                    Hishop.Weixin.MP.Api.TicketAPI.GetTicketImage(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, string.Format("distributor_{0}", userid), false);
                }
                string qrCodeBackImgUrl = "/Storage/TicketImage/" + string.Format("distributor_{0}", userid) + ".jpg";
                DownFile(this, savepath);
                break;
            }


            if (e.CommandName == "ReSetPwd")
            {
                string uName = MemberProcessor.GetMember(userid).UserName;
                NameValueCollection queryStrings = new NameValueCollection();
                queryStrings.Add("Grade", this.DrGrade.SelectedValue);
                queryStrings.Add("StoreName", this.txtStoreName.Text);
                queryStrings.Add("CellPhone", this.txtCellPhone.Text);
                queryStrings.Add("RealName", this.txtRealName.Text);
                queryStrings.Add("MicroSignal", this.txtMicroSignal.Text);
                queryStrings.Add("Status", this.DrStatus.SelectedValue);
                queryStrings.Add("IsAgent", this.hiIsAgent.Value);
                queryStrings.Add("pageSize", this.pager.PageSize.ToString(System.Globalization.CultureInfo.InvariantCulture));
                string urlPage = base.GetPage(queryStrings);
                this.ShowMsgAndReUrl("重置成功!<br/>" + uName + "的密码目前为 888888,请通知该用户尽快修改密码!", true, urlPage);
                return;
            }
            this.ReBind(true);
        }
Exemple #26
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (currentMember != null)
            {
                MemberGradeInfo memberGrade   = MemberProcessor.GetMemberGrade(currentMember.GradeId);
                OrderInfo       userLastOrder = MemberProcessor.GetUserLastOrder(currentMember.UserId);
                string          arg           = (!string.IsNullOrEmpty(currentMember.UserBindName)) ? currentMember.UserBindName : currentMember.UserName;
                string          arg2          = (!string.IsNullOrEmpty(currentMember.OpenId)) ? currentMember.UserName : string.Empty;
                int             port          = context.Request.Url.Port;
                string          text          = (port == 80) ? "" : (":" + port.ToString());
                string.Concat(new string[]
                {
                    "http://",
                    context.Request.Url.Host,
                    text,
                    Globals.ApplicationPath,
                    "/Admin/member/managemembers.aspx?Username="******"&pageSize=10"
                });
                string           arg3 = currentMember.UserBindName + "【" + ((memberGrade != null) ? memberGrade.Name : "普通会员") + "】";
                string           arg4 = currentMember.OrderNumber.ToString() + "单(¥" + currentMember.Expenditure.ToString("F2") + ")";
                string           arg5 = (userLastOrder != null) ? userLastOrder.OrderDate.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty;
                string           arg6 = string.Empty;
                string           arg7 = string.Empty;
                string           arg8 = string.Empty;
                string           arg9 = string.Empty;
                int              currentMemberUserId = Globals.GetCurrentMemberUserId();
                DistributorsInfo userIdDistributors  = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);
                if (userIdDistributors != null)
                {
                    DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId);
                    string           text2           = "0.00";
                    DistributorsInfo distributorInfo = DistributorsBrower.GetDistributorInfo(userIdDistributors.UserId);
                    if (distributorInfo != null)
                    {
                        text2 = distributorInfo.ReferralBlance.ToString("F2");
                    }
                    string str  = "0";
                    string str2 = "0";
                    System.Data.DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);
                    if (distributorsSubStoreNum != null || distributorsSubStoreNum.Rows.Count > 0)
                    {
                        str  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                        str2 = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
                    }
                    string.Concat(new string[]
                    {
                        "http://",
                        context.Request.Url.Host,
                        text,
                        Globals.ApplicationPath,
                        "/Admin/Fenxiao/distributorlist.aspx?MicroSignal=",
                        currentMember.UserName,
                        "&Status=0&pageSize=10"
                    });
                    arg6 = userIdDistributors.StoreName + "【" + distributorGradeInfo.Name + "】";
                    arg7 = "¥" + userIdDistributors.OrdersTotal.ToString("F2");
                    arg8 = string.Concat(new string[]
                    {
                        "¥",
                        text2,
                        "(待提现¥",
                        userIdDistributors.ReferralBlance.ToString("F2"),
                        ",已提现¥",
                        userIdDistributors.ReferralRequestBalance.ToString("F2"),
                        ")"
                    });
                    arg9 = "一级分店数" + str + ",二级分店数" + str2;
                }
                stringBuilder.Append("<script>");
                stringBuilder.Append("var mechatMetadataInter = setInterval(function() {");
                stringBuilder.Append("if (window.mechatMetadata) {");
                stringBuilder.Append("clearInterval(mechatMetadataInter);");
                stringBuilder.Append("window.mechatMetadata({");
                stringBuilder.AppendFormat("appUserName: '******',", arg);
                stringBuilder.AppendFormat("appNickName: '{0}',", currentMember.UserName);
                stringBuilder.AppendFormat("realName: '{0}',", currentMember.RealName);
                stringBuilder.AppendFormat("avatar: '{0}',", currentMember.UserHead);
                stringBuilder.AppendFormat("tel: '{0}',", currentMember.CellPhone);
                stringBuilder.AppendFormat("email: '{0}',", currentMember.Email);
                stringBuilder.AppendFormat("QQ: '{0}',", currentMember.QQ);
                stringBuilder.AppendFormat("weibo: '',", new object[0]);
                stringBuilder.AppendFormat("weixin: '{0}',", arg2);
                stringBuilder.AppendFormat("address: '{0}',", currentMember.Address);
                stringBuilder.Append("extraParams: {");
                stringBuilder.AppendFormat("'会员帐号': '{0}',", arg3);
                stringBuilder.AppendFormat("'会员订单': '{0}',", arg4);
                stringBuilder.AppendFormat("'会员积分': '{0}',", currentMember.Points.ToString());
                stringBuilder.AppendFormat("'最近购买': '{0}',", arg5);
                stringBuilder.AppendFormat("'店铺名称': '{0}',", arg6);
                stringBuilder.AppendFormat("'销售额': '{0}',", arg7);
                stringBuilder.AppendFormat("'佣金信息': '{0}',", arg8);
                stringBuilder.AppendFormat("'分店数量': '{0}'", arg9);
                stringBuilder.Append("}");
                stringBuilder.Append("});");
                stringBuilder.Append("}");
                stringBuilder.Append("}, 500);");
                stringBuilder.Append("</script>");
            }
            context.Response.Write(stringBuilder.ToString() + " ");
        }
Exemple #27
0
        protected override void AttachChildControls()
        {
            this.litShipTo       = (Literal)this.FindControl("litShipTo");
            this.litCellPhone    = (Literal)this.FindControl("litCellPhone");
            this.litAddress      = (Literal)this.FindControl("litAddress");
            this.litShowMes      = (Literal)this.FindControl("litShowMes");
            this.GetUserCoupons  = MemberProcessor.GetUserCoupons();
            this.rptCartProducts = (VshopTemplatedRepeater)this.FindControl("rptCartProducts");
            this.rptCartProducts.ItemDataBound += new RepeaterItemEventHandler(this.rptCartProducts_ItemDataBound);
            this.litOrderTotal         = (Literal)this.FindControl("litOrderTotal");
            this.litPointNumber        = (Literal)this.FindControl("litPointNumber");
            this.litDisplayPointNumber = (Literal)this.FindControl("litDisplayPointNumber");
            this.aLinkToShipping       = (HtmlAnchor)this.FindControl("aLinkToShipping");
            this.groupbuyHiddenBox     = (HtmlInputControl)this.FindControl("groupbuyHiddenBox");
            this.rptAddress            = (VshopTemplatedRepeater)this.FindControl("rptAddress");
            this.selectShipTo          = (HtmlInputHidden)this.FindControl("selectShipTo");
            this.regionId      = (HtmlInputHidden)this.FindControl("regionId");
            this.litAddAddress = (Literal)this.FindControl("litAddAddress");
            IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses();

            //if (CS$<>9__CachedAnonymousMethodDelegate2 == null)
            //{
            //    CS$<>9__CachedAnonymousMethodDelegate2 = new Func<ShippingAddressInfo, bool>(null, (IntPtr) <AttachChildControls>b__0);
            //}
            //this.rptAddress.DataSource = Enumerable.OrderBy<ShippingAddressInfo, bool>(shippingAddresses, CS$<>9__CachedAnonymousMethodDelegate2);
            //this.rptAddress.DataBind();
            //if (CS$<>9__CachedAnonymousMethodDelegate3 == null)
            //{
            //    CS$<>9__CachedAnonymousMethodDelegate3 = new Func<ShippingAddressInfo, bool>(null, (IntPtr) <AttachChildControls>b__1);
            //}
            this.rptAddress.DataSource = from item in shippingAddresses
                                         orderby item.IsDefault
                                         select item;

            this.rptAddress.DataBind();
            ShippingAddressInfo info = shippingAddresses.FirstOrDefault <ShippingAddressInfo>(item => item.IsDefault);

            //ShippingAddressInfo info = Enumerable.FirstOrDefault<ShippingAddressInfo>(shippingAddresses, CS$<>9__CachedAnonymousMethodDelegate3);
            if (info == null)
            {
                info = (shippingAddresses.Count > 0) ? shippingAddresses[0] : null;
            }
            if (info != null)
            {
                this.litShipTo.Text    = info.ShipTo;
                this.litCellPhone.Text = info.CellPhone;
                this.litAddress.Text   = info.Address;
                this.selectShipTo.SetWhenIsNotNull(info.ShippingId.ToString());
                this.regionId.SetWhenIsNotNull(info.RegionId.ToString());
            }
            this.litAddAddress.Text = " href='/Vshop/AddShippingAddress.aspx?returnUrl=" + Globals.UrlEncode(HttpContext.Current.Request.Url.ToString()) + "'";
            if ((shippingAddresses == null) || (shippingAddresses.Count == 0))
            {
                this.Page.Response.Redirect(Globals.ApplicationPath + "/Vshop/AddShippingAddress.aspx?returnUrl=" + Globals.UrlEncode(HttpContext.Current.Request.Url.ToString()));
            }
            else
            {
                this.aLinkToShipping.HRef = Globals.ApplicationPath + "/Vshop/ShippingAddresses.aspx?returnUrl=" + Globals.UrlEncode(HttpContext.Current.Request.Url.ToString());
                List <ShoppingCartInfo> orderSummitCart = new List <ShoppingCartInfo>();
                if (((int.TryParse(this.Page.Request.QueryString["buyAmount"], out this.buyAmount) && !string.IsNullOrEmpty(this.Page.Request.QueryString["productSku"])) && !string.IsNullOrEmpty(this.Page.Request.QueryString["from"])) && ((this.Page.Request.QueryString["from"] == "signBuy") || (this.Page.Request.QueryString["from"] == "groupBuy")))
                {
                    this.productSku = this.Page.Request.QueryString["productSku"];
                    if (this.isbargain)
                    {
                        int bargainDetialId = Globals.RequestQueryNum("bargainDetialId");
                        orderSummitCart = ShoppingCartProcessor.GetListShoppingCart(this.productSku, this.buyAmount, bargainDetialId, 0);
                    }
                    else
                    {
                        int buyAmount = this.buyAmount;
                        int id        = Globals.RequestQueryNum("limitedTimeDiscountId");
                        if (id > 0)
                        {
                            bool flag = true;
                            LimitedTimeDiscountInfo discountInfo = LimitedTimeDiscountHelper.GetDiscountInfo(id);
                            if (discountInfo == null)
                            {
                                flag = false;
                            }
                            if (flag)
                            {
                                int num4 = ShoppingCartProcessor.GetLimitedTimeDiscountUsedNum(id, this.productSku, 0, base.CurrentMemberInfo.UserId, false);
                                if (MemberHelper.CheckCurrentMemberIsInRange(discountInfo.ApplyMembers, discountInfo.DefualtGroup, discountInfo.CustomGroup, base.CurrentMemberInfo.UserId))
                                {
                                    if ((discountInfo.LimitNumber > 0) && (this.buyAmount <= (discountInfo.LimitNumber - num4)))
                                    {
                                        buyAmount = discountInfo.LimitNumber - num4;
                                        if (buyAmount > this.buyAmount)
                                        {
                                            buyAmount = this.buyAmount;
                                        }
                                    }
                                    else if (discountInfo.LimitNumber != 0)
                                    {
                                        id = 0;
                                    }
                                }
                                else
                                {
                                    id = 0;
                                }
                            }
                            else
                            {
                                id = 0;
                            }
                        }
                        orderSummitCart = ShoppingCartProcessor.GetListShoppingCart(this.productSku, buyAmount, 0, id);
                    }
                }
                else
                {
                    orderSummitCart = ShoppingCartProcessor.GetOrderSummitCart();
                }
                if (orderSummitCart == null)
                {
                    HttpContext.Current.Response.Write("<script>alert('商品已下架或没有需要结算的订单!');location.href='/Vshop/ShoppingCart.aspx'</script>");
                }
                else
                {
                    if (orderSummitCart.Count > 1)
                    {
                        this.litShowMes.Text = "<div style=\"color: #F60; \"><img  src=\"/Utility/pics/u77.png\">您所购买的商品不支持同一个物流规则发货,系统自动拆分成多个子订单处理</div>";
                    }
                    this.rptCartProducts.DataSource = orderSummitCart;
                    this.rptCartProducts.DataBind();
                    decimal num5 = 0M;
                    decimal num6 = 0M;
                    decimal num7 = 0M;
                    int     num8 = 0;
                    foreach (ShoppingCartInfo info3 in orderSummitCart)
                    {
                        num8 += info3.GetPointNumber;
                        num5 += info3.Total;
                        num6 += info3.Exemption;
                        num7 += info3.ShipCost;
                    }
                    decimal num9 = num6;
                    this.litOrderTotal.Text = (num5 - num9).ToString("F2");
                    if (num8 == 0)
                    {
                        this.litDisplayPointNumber.Text = "style=\"display:none;\"";
                    }
                    this.litPointNumber.Text = num8.ToString();
                    PageTitle.AddSiteNameTitle("订单确认");
                }
            }
        }
Exemple #28
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("申请分销");
            this.Page.Session["stylestatus"] = "2";
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (string.IsNullOrEmpty(currentMember.UserBindName))
            {
                this.Page.Response.Redirect("/BindUserMessage.aspx?returnUrl=/Vshop/DistributorValid.aspx", true);
                this.Page.Response.End();
            }
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMember.UserId);

            if ((userIdDistributors != null) && (userIdDistributors.ReferralStatus == 0))
            {
                this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx", true);
                this.Page.Response.End();
            }
            bool         flag           = false;
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            if (masterSettings.DistributorApplicationCondition)
            {
                decimal expenditure        = currentMember.Expenditure;
                int     finishedOrderMoney = masterSettings.FinishedOrderMoney;
                if (finishedOrderMoney > 0)
                {
                    decimal   num3 = 0M;
                    DataTable userOrderPaidWaitFinish = OrderHelper.GetUserOrderPaidWaitFinish(currentMember.UserId);
                    decimal   total     = 0M;
                    OrderInfo orderInfo = null;
                    for (int i = 0; i < userOrderPaidWaitFinish.Rows.Count; i++)
                    {
                        orderInfo = OrderHelper.GetOrderInfo(userOrderPaidWaitFinish.Rows[i]["orderid"].ToString());
                        if (orderInfo != null)
                        {
                            total = orderInfo.GetTotal();
                            if (total > 0M)
                            {
                                num3 += total;
                            }
                        }
                    }
                    if ((currentMember.Expenditure + num3) >= finishedOrderMoney)
                    {
                        flag = true;
                    }
                }
                if ((!flag && masterSettings.EnableDistributorApplicationCondition) && ((!string.IsNullOrEmpty(masterSettings.DistributorProductsDate) && !string.IsNullOrEmpty(masterSettings.DistributorProducts)) && masterSettings.DistributorProductsDate.Contains("|")))
                {
                    DateTime time  = new DateTime();
                    DateTime time2 = new DateTime();
                    bool     flag2 = DateTime.TryParse(masterSettings.DistributorProductsDate.Split(new char[] { '|' })[0].ToString(), out time);
                    bool     flag3 = DateTime.TryParse(masterSettings.DistributorProductsDate.Split(new char[] { '|' })[1].ToString(), out time2);
                    if ((((flag2 && flag3) && (DateTime.Now.CompareTo(time) >= 0)) && (DateTime.Now.CompareTo(time2) < 0)) && MemberProcessor.CheckMemberIsBuyProds(currentMember.UserId, masterSettings.DistributorProducts, new DateTime?(time), new DateTime?(time2)))
                    {
                        flag = true;
                    }
                }
            }
            else
            {
                flag = true;
            }
            if (!flag)
            {
                this.Page.Response.Redirect("/Vshop/DistributorRegCheck.aspx", true);
                this.Page.Response.End();
            }
            int result = 0;

            this.idImg = (HtmlImage)this.FindControl("idImg");
            string logo = string.Empty;

            if (int.TryParse(this.Page.Request.QueryString["ReferralId"], out result) && (result > 0))
            {
                DistributorsInfo info4 = DistributorsBrower.GetUserIdDistributors(result);
                if ((info4 != null) && !string.IsNullOrEmpty(info4.Logo))
                {
                    logo = info4.Logo;
                }
            }
            if (string.IsNullOrEmpty(logo))
            {
                logo = masterSettings.DistributorLogoPic;
            }
            this.idImg.Src = logo;
            if ((userIdDistributors != null) && (userIdDistributors.ReferralStatus != 0))
            {
                this.litIsEnable       = (HtmlInputHidden)this.FindControl("litIsEnable");
                this.litIsEnable.Value = userIdDistributors.ReferralStatus.ToString();
            }
        }
Exemple #29
0
        /// <summary>
        /// 根据当前用户获取当前页是否跳转
        /// </summary>
        public static string ReturnUrlByUser(MemberInfo mInfo)
        {
            //设置当前用户访问的店铺CookieID
            DistributorsInfo currentDistributors = DistributorsBrower.GetCurrentDistributors(Globals.ToNum(mInfo.UserId), true);

            if (currentDistributors != null)
            {
                HiAffiliation.SetReferralIdCookie(currentDistributors.UserId.ToString(), "", false);
            }
            else
            {
                HiAffiliation.SetReferralIdCookie(mInfo.ReferralUserId.ToString(), "", false);
            }

            //设置跳转地址
            HttpCookie httpCookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
            string     result;
            string     str = HttpContext.Current.Request.Url.PathAndQuery.ToString();

            if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
            {
                Globals.Debuglog("1_httpCookie:" + httpCookie.Value);
                if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["ReferralId"]))
                {
                    Globals.Debuglog("2_ReferralId:" + HttpContext.Current.Request.QueryString["ReferralId"]);
                    HiUriHelp hiUriHelp   = new HiUriHelp(HttpContext.Current.Request.QueryString);
                    string    queryString = hiUriHelp.GetQueryString("ReferralId");

                    if (!string.IsNullOrEmpty(queryString))
                    {
                        Globals.Debuglog("3_queryString:" + queryString);
                        if (queryString == httpCookie.Value)
                        {
                            result = string.Empty;
                            return(result);
                        }
                        Globals.Debuglog("4_queryString:" + queryString);

                        //如果访问的店铺不是平台,但之前存储的店铺是平台时,强制更改【V20170906】
                        if (queryString != "0" && httpCookie.Value == "0")
                        {
                            int iReferralUserId = 0;
                            int.TryParse(queryString, out iReferralUserId);
                            if (iReferralUserId > 0)
                            {
                                Globals.Debuglog("5_queryString:" + queryString);
                                httpCookie.Value = queryString;
                                MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                                Globals.Debuglog("5_queryString2:" + queryString);
                                currentMember.ReferralUserId = currentMember.ReferralUserId;
                                Globals.Debuglog("5_queryString3:" + queryString);
                                bool bb = MemberProcessor.UpdateReferralUserId(currentMember.UserId, iReferralUserId);
                                Globals.Debuglog("5_queryString4:" + queryString + "__" + bb.ToString() + "__" + currentMember.UserId);
                                HiAffiliation.SetReferralIdCookie(queryString, "", false);
                                Globals.Debuglog("5_iReferralUserId:" + iReferralUserId);
                            }
                        }

                        hiUriHelp.SetQueryString("ReferralId", httpCookie.Value);
                        result = HttpContext.Current.Request.Url.AbsolutePath + hiUriHelp.GetNewQuery();
                        Globals.Debuglog("6_result:" + result);
                        return(result);
                    }
                }
                Globals.Debuglog("7_result:");
                if (((IList)HttpContext.Current.Request.QueryString.AllKeys).Contains("returnUrl"))
                {
                    result = string.Empty;
                }
                else if (HttpContext.Current.Request.Url.AbsolutePath == "/logout.aspx")
                {
                    result = string.Empty;
                }
                else if (!((IList)HttpContext.Current.Request.QueryString.AllKeys).Contains("ReferralId") && HttpContext.Current.Request.QueryString.Count > 0)
                {
                    Globals.Debuglog("8_result:" + httpCookie.Value);
                    result = str + "&ReferralId=" + httpCookie.Value;
                }
                else if (!((IList)HttpContext.Current.Request.QueryString.AllKeys).Contains("ReferralId"))
                {
                    Globals.Debuglog("9_result:" + httpCookie.Value);
                    result = str + "?ReferralId=" + httpCookie.Value;
                }
                else
                {
                    result = string.Empty;
                }
            }
            else
            {
                result = string.Empty;
            }
            return(result);
        }
Exemple #30
0
        private void GetPrizeLists(System.Web.HttpContext context)
        {
            context.Response.ContentType = "application/json";
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder("{");
            string text = context.Request["gameid"];

            if (string.IsNullOrEmpty(text))
            {
                stringBuilder.Append("\"status\":\"0\",\"Desciption\":\"参数错误!\"}");
                context.Response.Write(stringBuilder.ToString());
                return;
            }
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();
            GameInfo   modelByGameId = GameHelper.GetModelByGameId(text);

            if (modelByGameId == null)
            {
                stringBuilder.Append("\"status\":\"0\",\"Desciption\":\"游戏不存在!\"}");
                context.Response.Write(stringBuilder.ToString());
                return;
            }
            Hi_Ajax_Game.GameData gameData = new Hi_Ajax_Game.GameData
            {
                status            = 1,
                Description       = modelByGameId.Description,
                BeginDate         = modelByGameId.BeginTime,
                EndDate           = modelByGameId.EndTime,
                LimitEveryDay     = modelByGameId.LimitEveryDay,
                MaximumDailyLimit = modelByGameId.MaximumDailyLimit,
                MemberCheck       = modelByGameId.MemberCheck,
                HasPhone          = string.IsNullOrEmpty(currentMember.CellPhone) ? 0 : 1
            };
            System.Collections.Generic.IList <GamePrizeInfo>         gamePrizeListsByGameId = GameHelper.GetGamePrizeListsByGameId(modelByGameId.GameId);
            System.Collections.Generic.List <Hi_Ajax_Game.PrizeData> list = new System.Collections.Generic.List <Hi_Ajax_Game.PrizeData>();
            GamePrizeInfo gamePrizeInfo  = new GamePrizeInfo();
            GamePrizeInfo gamePrizeInfo2 = new GamePrizeInfo();
            GamePrizeInfo gamePrizeInfo3 = new GamePrizeInfo();
            GamePrizeInfo gamePrizeInfo4 = new GamePrizeInfo();

            switch (gamePrizeListsByGameId.Count <GamePrizeInfo>())
            {
            case 1:
            {
                gamePrizeInfo = gamePrizeListsByGameId.FirstOrDefault((GamePrizeInfo p) => p.PrizeGrade == PrizeGrade.一等奖);
                string prizeFullName = GameHelper.GetPrizeFullName(new PrizeResultViewInfo
                    {
                        PrizeType      = gamePrizeInfo.PrizeType,
                        GivePoint      = gamePrizeInfo.GivePoint,
                        GiveCouponId   = gamePrizeInfo.GiveCouponId,
                        GiveShopBookId = gamePrizeInfo.GiveShopBookId
                    });
                list.Add(new Hi_Ajax_Game.PrizeData
                    {
                        prizeId       = gamePrizeInfo.PrizeId,
                        prize         = gamePrizeInfo.Prize,
                        prizeType     = gamePrizeInfo.PrizeGrade.ToString(),
                        prizeCount    = gamePrizeInfo.PrizeRate,
                        prizeName     = GameHelper.GetPrizeName(gamePrizeInfo.PrizeType, prizeFullName),
                        PrizeFullName = prizeFullName
                    });
                break;
            }

            case 2:
            {
                gamePrizeInfo = gamePrizeListsByGameId.FirstOrDefault((GamePrizeInfo p) => p.PrizeGrade == PrizeGrade.一等奖);
                string prizeFullName = GameHelper.GetPrizeFullName(new PrizeResultViewInfo
                    {
                        PrizeType      = gamePrizeInfo.PrizeType,
                        GivePoint      = gamePrizeInfo.GivePoint,
                        GiveCouponId   = gamePrizeInfo.GiveCouponId,
                        GiveShopBookId = gamePrizeInfo.GiveShopBookId
                    });
                list.Add(new Hi_Ajax_Game.PrizeData
                    {
                        prizeId       = gamePrizeInfo.PrizeId,
                        prize         = gamePrizeInfo.Prize,
                        prizeType     = gamePrizeInfo.PrizeGrade.ToString(),
                        prizeCount    = gamePrizeInfo.PrizeRate,
                        prizeName     = GameHelper.GetPrizeName(gamePrizeInfo.PrizeType, prizeFullName),
                        PrizeFullName = prizeFullName
                    });
                gamePrizeInfo2 = gamePrizeListsByGameId.FirstOrDefault((GamePrizeInfo p) => p.PrizeGrade == PrizeGrade.二等奖);
                prizeFullName  = GameHelper.GetPrizeFullName(new PrizeResultViewInfo
                    {
                        PrizeType      = gamePrizeInfo2.PrizeType,
                        GivePoint      = gamePrizeInfo2.GivePoint,
                        GiveCouponId   = gamePrizeInfo2.GiveCouponId,
                        GiveShopBookId = gamePrizeInfo2.GiveShopBookId
                    });
                list.Add(new Hi_Ajax_Game.PrizeData
                    {
                        prizeId       = gamePrizeInfo2.PrizeId,
                        prize         = gamePrizeInfo2.Prize,
                        prizeType     = gamePrizeInfo2.PrizeGrade.ToString(),
                        prizeCount    = gamePrizeInfo2.PrizeRate,
                        prizeName     = GameHelper.GetPrizeName(gamePrizeInfo2.PrizeType, prizeFullName),
                        PrizeFullName = prizeFullName
                    });
                break;
            }

            case 3:
            {
                gamePrizeInfo = gamePrizeListsByGameId.FirstOrDefault((GamePrizeInfo p) => p.PrizeGrade == PrizeGrade.一等奖);
                string prizeFullName = GameHelper.GetPrizeFullName(new PrizeResultViewInfo
                    {
                        PrizeType      = gamePrizeInfo.PrizeType,
                        GivePoint      = gamePrizeInfo.GivePoint,
                        GiveCouponId   = gamePrizeInfo.GiveCouponId,
                        GiveShopBookId = gamePrizeInfo.GiveShopBookId
                    });
                list.Add(new Hi_Ajax_Game.PrizeData
                    {
                        prizeId       = gamePrizeInfo.PrizeId,
                        prize         = gamePrizeInfo.Prize,
                        prizeType     = gamePrizeInfo.PrizeGrade.ToString(),
                        prizeCount    = gamePrizeInfo.PrizeRate,
                        prizeName     = GameHelper.GetPrizeName(gamePrizeInfo.PrizeType, prizeFullName),
                        PrizeFullName = prizeFullName
                    });
                gamePrizeInfo2 = gamePrizeListsByGameId.FirstOrDefault((GamePrizeInfo p) => p.PrizeGrade == PrizeGrade.二等奖);
                prizeFullName  = GameHelper.GetPrizeFullName(new PrizeResultViewInfo
                    {
                        PrizeType      = gamePrizeInfo2.PrizeType,
                        GivePoint      = gamePrizeInfo2.GivePoint,
                        GiveCouponId   = gamePrizeInfo2.GiveCouponId,
                        GiveShopBookId = gamePrizeInfo2.GiveShopBookId
                    });
                list.Add(new Hi_Ajax_Game.PrizeData
                    {
                        prizeId       = gamePrizeInfo2.PrizeId,
                        prize         = gamePrizeInfo2.Prize,
                        prizeType     = gamePrizeInfo2.PrizeGrade.ToString(),
                        prizeCount    = gamePrizeInfo2.PrizeRate,
                        prizeName     = GameHelper.GetPrizeName(gamePrizeInfo2.PrizeType, prizeFullName),
                        PrizeFullName = prizeFullName
                    });
                gamePrizeInfo3 = gamePrizeListsByGameId.FirstOrDefault((GamePrizeInfo p) => p.PrizeGrade == PrizeGrade.等奖);
                prizeFullName  = GameHelper.GetPrizeFullName(new PrizeResultViewInfo
                    {
                        PrizeType      = gamePrizeInfo3.PrizeType,
                        GivePoint      = gamePrizeInfo3.GivePoint,
                        GiveCouponId   = gamePrizeInfo3.GiveCouponId,
                        GiveShopBookId = gamePrizeInfo3.GiveShopBookId
                    });
                list.Add(new Hi_Ajax_Game.PrizeData
                    {
                        prizeId       = gamePrizeInfo3.PrizeId,
                        prize         = gamePrizeInfo3.Prize,
                        prizeType     = gamePrizeInfo3.PrizeGrade.ToString(),
                        prizeCount    = gamePrizeInfo3.PrizeRate,
                        prizeName     = GameHelper.GetPrizeName(gamePrizeInfo3.PrizeType, prizeFullName),
                        PrizeFullName = prizeFullName
                    });
                break;
            }

            case 4:
            {
                gamePrizeInfo = gamePrizeListsByGameId.FirstOrDefault((GamePrizeInfo p) => p.PrizeGrade == PrizeGrade.一等奖);
                string prizeFullName = GameHelper.GetPrizeFullName(new PrizeResultViewInfo
                    {
                        PrizeType      = gamePrizeInfo.PrizeType,
                        GivePoint      = gamePrizeInfo.GivePoint,
                        GiveCouponId   = gamePrizeInfo.GiveCouponId,
                        GiveShopBookId = gamePrizeInfo.GiveShopBookId
                    });
                list.Add(new Hi_Ajax_Game.PrizeData
                    {
                        prizeId       = gamePrizeInfo.PrizeId,
                        prize         = gamePrizeInfo.Prize,
                        prizeType     = gamePrizeInfo.PrizeGrade.ToString(),
                        prizeCount    = gamePrizeInfo.PrizeRate,
                        prizeName     = GameHelper.GetPrizeName(gamePrizeInfo.PrizeType, prizeFullName),
                        PrizeFullName = prizeFullName
                    });
                gamePrizeInfo2 = gamePrizeListsByGameId.FirstOrDefault((GamePrizeInfo p) => p.PrizeGrade == PrizeGrade.二等奖);
                prizeFullName  = GameHelper.GetPrizeFullName(new PrizeResultViewInfo
                    {
                        PrizeType      = gamePrizeInfo2.PrizeType,
                        GivePoint      = gamePrizeInfo2.GivePoint,
                        GiveCouponId   = gamePrizeInfo2.GiveCouponId,
                        GiveShopBookId = gamePrizeInfo2.GiveShopBookId
                    });
                list.Add(new Hi_Ajax_Game.PrizeData
                    {
                        prizeId       = gamePrizeInfo2.PrizeId,
                        prize         = gamePrizeInfo2.Prize,
                        prizeType     = gamePrizeInfo2.PrizeGrade.ToString(),
                        prizeCount    = gamePrizeInfo2.PrizeRate,
                        prizeName     = GameHelper.GetPrizeName(gamePrizeInfo2.PrizeType, prizeFullName),
                        PrizeFullName = prizeFullName
                    });
                gamePrizeInfo3 = gamePrizeListsByGameId.FirstOrDefault((GamePrizeInfo p) => p.PrizeGrade == PrizeGrade.等奖);
                prizeFullName  = GameHelper.GetPrizeFullName(new PrizeResultViewInfo
                    {
                        PrizeType      = gamePrizeInfo3.PrizeType,
                        GivePoint      = gamePrizeInfo3.GivePoint,
                        GiveCouponId   = gamePrizeInfo3.GiveCouponId,
                        GiveShopBookId = gamePrizeInfo3.GiveShopBookId
                    });
                list.Add(new Hi_Ajax_Game.PrizeData
                    {
                        prizeId       = gamePrizeInfo3.PrizeId,
                        prize         = gamePrizeInfo3.Prize,
                        prizeType     = gamePrizeInfo3.PrizeGrade.ToString(),
                        prizeCount    = gamePrizeInfo3.PrizeRate,
                        prizeName     = GameHelper.GetPrizeName(gamePrizeInfo3.PrizeType, prizeFullName),
                        PrizeFullName = prizeFullName
                    });
                gamePrizeInfo4 = gamePrizeListsByGameId.FirstOrDefault((GamePrizeInfo p) => p.PrizeGrade == PrizeGrade.四等奖);
                prizeFullName  = GameHelper.GetPrizeFullName(new PrizeResultViewInfo
                    {
                        PrizeType      = gamePrizeInfo4.PrizeType,
                        GivePoint      = gamePrizeInfo4.GivePoint,
                        GiveCouponId   = gamePrizeInfo4.GiveCouponId,
                        GiveShopBookId = gamePrizeInfo4.GiveShopBookId
                    });
                list.Add(new Hi_Ajax_Game.PrizeData
                    {
                        prizeId       = gamePrizeInfo4.PrizeId,
                        prize         = gamePrizeInfo4.Prize,
                        prizeType     = gamePrizeInfo4.PrizeGrade.ToString(),
                        prizeCount    = gamePrizeInfo4.PrizeRate,
                        prizeName     = GameHelper.GetPrizeName(gamePrizeInfo4.PrizeType, prizeFullName),
                        PrizeFullName = prizeFullName
                    });
                break;
            }
            }
            gameData.prizeLists = list;
            IsoDateTimeConverter isoDateTimeConverter = new IsoDateTimeConverter();

            isoDateTimeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            context.Response.Write(JsonConvert.SerializeObject(gameData, Formatting.Indented, new JsonConverter[]
            {
                isoDateTimeConverter
            }));
        }