Exemple #1
0
        internal void ConfigurePage(
            SiteSection section,
            Pages page,
            PageTitle title,
            PageSubTitle subTitle,
            PageDescription description,
            NavControlPath controlPath,
            Banner banner,
            bool showMap,
            PageKeyWords keyWords)
        {
            SetBanner(banner);
            Page.Title = title.Value;
            subTitleText.Text = subTitle.Value;
            SetMetaData(description, keyWords);
            ShowMap(showMap);

            if (controlPath.Value != string.Empty)
            {
                Control navControl = LoadControl(controlPath.Value);
                navControl.ID = "navBar";
                SidePanel1.AddControl(navControl);
            }

            SetNavBars(section, page);
        }
 internal void ConfigurePage(
     SiteSection section,
     Pages page,
     PageTitle title,
     PageSubTitle subTitle,
     PageDescription description,
     NavControlPath controlPath,
     Banner banner,
     bool showMap)
 {
     Default master = this.Master as Default;
     master.ConfigurePage(section, page, title, subTitle, description, controlPath, banner, showMap);
 }
Exemple #3
0
 internal void ConfigurePage(
     SiteSection section,
     Pages page,
     PageTitle title,
     PageSubTitle subTitle,
     PageDescription description,
     NavControlPath controlPath,
     Banner banner,
     bool showMap)
 {
     ConfigurePage(section, page, title, subTitle, description, controlPath, banner, showMap,
         new PageKeyWords("Recording Rehearsal Blackpool Lancashire Fylde Studio Rooms Drum School Academy Music"));
 }
        /// <summary>
        /// Process the request
        /// </summary>
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            if (this.ClientContext == null)
            {
                LogWarning("Invalid client context, configure the service to run again");
                return;
            }

            string pageFileName = PageTitle.Replace(" ", string.Empty);

            if (pageFileName.IndexOf("aspx") <= -1)
            {
                pageFileName = String.Format("{0}.aspx", pageFileName);
            }



            var context = this.ClientContext;
            var web     = context.Web;

            context.Load(web);
            context.ExecuteQuery();
            string webRelativeUrl = web.ServerRelativeUrl;

            ListCollection     allLists   = web.Lists;
            IEnumerable <List> foundLists = context.LoadQuery(allLists.Where(list => list.Title == ListTitle)
                                                              .Include(wl => wl.Id, wl => wl.Title, wl => wl.RootFolder.ServerRelativeUrl));

            context.ExecuteQuery();
            List webPartList = foundLists.FirstOrDefault();

            var wikiPageUrl = web.AddWikiPage(SitePagesLibraryTitle, pageFileName);

            context.ExecuteQuery();
            if (string.IsNullOrEmpty(wikiPageUrl))
            {
                wikiPageUrl = string.Format("{0}/{1}", SitePagesRelativeUrl, pageFileName);
            }

            var listUrl = webPartList.RootFolder.ServerRelativeUrl;
            var pageUrl = string.Format("{0}/{1}", webRelativeUrl, wikiPageUrl);


            var views = webPartList.Views;

            ClientContext.Load(views);
            ClientContext.ExecuteQueryRetry();

            var viewFound = false;

            foreach (var view in views.Where(w => w.Hidden))
            {
                LogVerbose("View {0} with title {1} and hidden status:{2} and server relative url:{3}", view.Id, view.Title, view.Hidden, view.ServerRelativeUrl);
                if (view.ServerRelativeUrl.ToUpper() == pageUrl.ToUpper())
                {
                    viewFound = true;
                }
            }

            var thisview = webPartList.GetViewByName(WebPartViewTitle);

            webPartList.Context.Load(thisview, tv => tv.Id, tv => tv.ServerRelativeUrl, tv => tv.HtmlSchemaXml, tv => tv.RowLimit, tv => tv.JSLink, tv => tv.ViewFields, tv => tv.ViewQuery, tv => tv.Aggregations);
            webPartList.Context.ExecuteQueryRetry();
            Guid viewID = thisview.Id;

            if (!viewFound)
            {
                // change layout to header and two column
                web.AddLayoutToWikiPage(SitePagesRelativeUrl, OfficeDevPnP.Core.WikiPageLayout.OneColumn, pageFileName);
                web.AddHtmlToWikiPage(SitePagesRelativeUrl, "<div>This is a provisioning TEST!!!</div>", pageFileName, 1, 1);

                // get markup and place on page
                var           xlstMarkup = webPartList.GetXsltWebPartXML(pageUrl, WebPartTitle, viewID);
                WebPartEntity wpe        = new WebPartEntity();
                wpe.WebPartXml   = xlstMarkup;
                wpe.WebPartTitle = WebPartTitle;
                wpe.WebPartIndex = 1;
                web.AddWebPartToWikiPage(SitePagesRelativeUrl, wpe, pageFileName, 1, 1, true, false);

                // Hidden View was created for this
                views = webPartList.Views;
                ClientContext.Load(views);
                ClientContext.ExecuteQueryRetry();
            }

            // Get View Markup
            var viewHtml = thisview.HtmlSchemaXml;
            var viewXdoc = XDocument.Parse(viewHtml);

            foreach (var view in views.Where(w => w.Hidden && w.ServerRelativeUrl == pageUrl))
            {
                LogVerbose("Found View {0} with title {1} and hidden status:{2} and server relative url:{3}", view.Id, view.Title, view.Hidden, view.ServerRelativeUrl);
                var vview     = viewXdoc.Root.Element("Query");
                var toolbar   = viewXdoc.Root.Element("Toolbar");
                var aggregate = viewXdoc.Root.Element("Aggregations");
                if (aggregate != null)
                {
                    view.Aggregations = aggregate.ToString(SaveOptions.DisableFormatting);
                }

                view.ViewFields.RemoveAll();
                foreach (var vf in thisview.ViewFields)
                {
                    view.ViewFields.Add(vf);
                }
                view.RowLimit     = thisview.RowLimit;
                view.Toolbar      = "<Toolbar Type=\"None\"/>";
                view.ViewQuery    = thisview.ViewQuery;
                view.JSLink       = thisview.JSLink;
                view.Aggregations = thisview.Aggregations;

                view.Update();
                ClientContext.ExecuteQueryRetry();
            }
        }
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("下级分销商");
            this.litMysubMember = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubMember");
            this.litMysubFirst  = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubFirst");
            this.litMysubSecond = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubSecond");
            int currentMemberUserId             = Globals.GetCurrentMemberUserId(false);
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            this.litUserId      = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId");
            this.litUserId.Text = userIdDistributors.UserId.ToString();
            DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);

            if (distributorsSubStoreNum != null || distributorsSubStoreNum.Rows.Count > 0)
            {
                this.litMysubMember.Text = distributorsSubStoreNum.Rows[0]["memberCount"].ToString();
                this.litMysubFirst.Text  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                this.litMysubSecond.Text = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
            }
            else
            {
                this.litMysubMember.Text = "0";
                this.litMysubFirst.Text  = "0";
                this.litMysubSecond.Text = "0";
            }
            this.rpdistributor = (VshopTemplatedRepeater)this.FindControl("rpdistributor");
            this.hiddTotal     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddTotal");
            DistributorsQuery distributorsQuery = new DistributorsQuery();

            distributorsQuery.PageIndex = 0;
            distributorsQuery.PageSize  = 10;
            DistributorsInfo currentDistributors = DistributorsBrower.GetCurrentDistributors(Globals.GetCurrentMemberUserId(false), true);

            if (currentDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                distributorsQuery.GradeId = 2;
                int gradeId = 0;
                if (int.TryParse(this.Page.Request.QueryString["gradeId"], out gradeId))
                {
                    distributorsQuery.GradeId = gradeId;
                }
                distributorsQuery.ReferralPath = currentDistributors.UserId.ToString();
                distributorsQuery.UserId       = currentDistributors.UserId;
                string text = this.Page.Request.QueryString["sort"];
                if (string.IsNullOrWhiteSpace(text))
                {
                    text = "CreateTime";
                }
                string text2 = this.Page.Request.QueryString["order"];
                if (string.IsNullOrWhiteSpace(text2))
                {
                    text2 = "desc";
                }
                int       num = 0;
                DataTable downDistributors = DistributorsBrower.GetDownDistributors(distributorsQuery, out num, text, text2);
                this.hiddTotal.Value          = num.ToString();
                this.rpdistributor.DataSource = downDistributors;
                this.rpdistributor.DataBind();
            }
        }
Exemple #6
0
        protected override void AttachChildControls()
        {
            this.hidUploadImages    = (HtmlInputHidden)this.FindControl("hidUploadImages");
            this.hidErrorMsg        = (HtmlInputHidden)this.FindControl("hidErrorMsg");
            this.hidOldImages       = (HtmlInputHidden)this.FindControl("hidOldImages");
            this.txtRefundId        = (HtmlInputHidden)this.FindControl("txtRefundId");
            this.txtOrderId         = (Literal)this.FindControl("txtOrderId");
            this.txtRefundMoney     = (Literal)this.FindControl("txtRefundMoney");
            this.txtRefundType      = (Literal)this.FindControl("txtRefundType");
            this.txtReturnReason    = (Literal)this.FindControl("txtReturnReason");
            this.txtMemo            = (Literal)this.FindControl("txtMemo");
            this.txtAfterSaleId     = (Literal)this.FindControl("litAfterSaleId");
            this.txtAdminRemark     = (Literal)this.FindControl("txtAdminRemark");
            this.txtRefuseReason    = (Literal)this.FindControl("txtRefuseReason");
            this.litStep            = (Literal)this.FindControl("litStep");
            this.litStatus          = (Literal)this.FindControl("litStatus");
            this.litBankName        = (Literal)this.FindControl("litBankName");
            this.litBankAccountName = (Literal)this.FindControl("litBankAccountName");
            this.litBankAccountNo   = (Literal)this.FindControl("litBankAccountNo");
            this.bankRow1           = (HtmlGenericControl)this.FindControl("bankRow1");
            this.bankRow2           = (HtmlGenericControl)this.FindControl("bankRow2");
            this.bankRow3           = (HtmlGenericControl)this.FindControl("bankRow3");
            this.AdminRemarkRow     = (HtmlGenericControl)this.FindControl("AdminRemarkRow");
            this.liRefundPassword   = (HtmlGenericControl)this.FindControl("liRefundPassword");
            this.txtRefundPassword  = (Literal)this.FindControl("txtRefundPassword");
            this.products           = (Common_OrderItem_AfterSales)this.FindControl("Common_OrderItemAfterSales");
            int refundId = 0;

            int.TryParse(HttpContext.Current.Request.QueryString["RefundId"], out refundId);
            RefundInfo refundInfo = TradeHelper.GetRefundInfo(refundId);

            if (refundInfo == null)
            {
                this.ShowError("错误的退款信息");
            }
            else
            {
                if (refundInfo.IsServiceProduct)
                {
                    this.txtRefundPassword.Text   = refundInfo.ValidCodes;
                    this.liRefundPassword.Visible = true;
                }
                else
                {
                    this.liRefundPassword.Visible = false;
                }
                this.litStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)refundInfo.HandleStatus, 0);
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(refundInfo.OrderId);
                if (orderInfo == null || orderInfo.UserId != HiContext.Current.UserId)
                {
                    this.ShowMessage("退款订单不存在或者不属于当前用户的订单", false, "", 1);
                    return;
                }
                HtmlInputHidden htmlInputHidden = this.txtRefundId;
                int             refundId2       = refundInfo.RefundId;
                htmlInputHidden.Value     = refundId2.ToString();
                this.txtOrderId.Text      = refundInfo.OrderId;
                this.txtRefundMoney.Text  = refundInfo.RefundAmount.F2ToString("f2");
                this.txtRefundType.Text   = EnumDescription.GetEnumDescription((Enum)(object)refundInfo.RefundType, 0);
                this.txtMemo.Text         = refundInfo.UserRemark;
                this.txtReturnReason.Text = refundInfo.RefundReason;
                if (!string.IsNullOrEmpty(refundInfo.AdminRemark))
                {
                    this.txtAdminRemark.Text = refundInfo.AdminRemark;
                    if (this.AdminRemarkRow != null)
                    {
                        this.AdminRemarkRow.Visible = true;
                    }
                }
                else if (this.AdminRemarkRow != null)
                {
                    this.AdminRemarkRow.Visible = false;
                }
                Literal literal = this.txtAfterSaleId;
                refundId2    = refundInfo.RefundId;
                literal.Text = refundId2.ToString();
                if (orderInfo != null)
                {
                    this.products.order      = orderInfo;
                    this.products.DataSource = orderInfo.LineItems.Values;
                    this.products.DataBind();
                }
                DateTime dateTime  = refundInfo.AgreedOrRefusedTime.HasValue ? refundInfo.AgreedOrRefusedTime.Value : refundInfo.ApplyForTime;
                DateTime dateTime2 = refundInfo.FinishTime.HasValue ? refundInfo.FinishTime.Value : dateTime;
                string   text      = "<ul>";
                refundInfo.AdminRemark = (string.IsNullOrEmpty(refundInfo.AdminRemark) ? "" : ("备注:" + refundInfo.AdminRemark));
                DateTime applyForTime;
                if (refundInfo.HandleStatus == RefundStatus.Applied)
                {
                    string str    = text;
                    string text2  = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format = this.timeTemplate;
                    applyForTime = refundInfo.ApplyForTime;
                    text         = str + text2.Replace("{time}", string.Format(format, applyForTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "退款申请中");
                    text        += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                                   .Replace("{StatusText}", "商家同意退款");
                    text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                            .Replace("{StatusText}", "退款完成");
                }
                else if (refundInfo.HandleStatus == RefundStatus.Refunded)
                {
                    string str2    = text;
                    string text3   = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format2 = this.timeTemplate;
                    applyForTime = refundInfo.ApplyForTime;
                    text         = str2 + text3.Replace("{time}", string.Format(format2, applyForTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "退款申请中");
                    text        += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, refundInfo.AdminRemark))
                                   .Replace("{StatusText}", "商家同意退款");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime2.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                            .Replace("{StatusText}", "退款完成");
                }
                else if (refundInfo.HandleStatus == RefundStatus.Refused)
                {
                    string str3    = text;
                    string text4   = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format3 = this.timeTemplate;
                    applyForTime = refundInfo.ApplyForTime;
                    text         = str3 + text4.Replace("{time}", string.Format(format3, applyForTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "退款申请中");
                    text        += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, refundInfo.AdminRemark))
                                   .Replace("{StatusText}", "商家拒绝退款");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                            .Replace("{StatusText}", "退款失败");
                }
                text += "</ul>";
                this.litStep.Text = text;
                if (refundInfo.RefundType == RefundTypes.InBankCard)
                {
                    this.bankRow1.Visible        = true;
                    this.bankRow2.Visible        = true;
                    this.bankRow3.Visible        = true;
                    this.litBankName.Text        = refundInfo.BankName;
                    this.litBankAccountName.Text = refundInfo.BankAccountName;
                    this.litBankAccountNo.Text   = refundInfo.BankAccountNo;
                }
            }
            PageTitle.AddSiteNameTitle("退款详情");
        }
        protected override void AttachChildControls()
        {
            this.litShipTo       = (System.Web.UI.WebControls.Literal) this.FindControl("litShipTo");
            this.litIsUseBalance = (System.Web.UI.WebControls.Literal) this.FindControl("litIsUseBalance");
            this.litCellPhone    = (System.Web.UI.WebControls.Literal) this.FindControl("litCellPhone");
            this.litAddress      = (System.Web.UI.WebControls.Literal) this.FindControl("litAddress");
            this.litShowMes      = (System.Web.UI.WebControls.Literal) this.FindControl("litShowMes");
            this.GetUserCoupons  = MemberProcessor.GetUserCoupons();
            this.rptCartProducts = (VshopTemplatedRepeater)this.FindControl("rptCartProducts");
            this.rptCartProducts.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.rptCartProducts_ItemDataBound);
            this.litOrderTotal          = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderTotal");
            this.litPointNumber         = (System.Web.UI.WebControls.Literal) this.FindControl("litPointNumber");
            this.litUseMembersPointShow = (System.Web.UI.WebControls.Literal) this.FindControl("litUseMembersPointShow");
            this.litDisplayPointNumber  = (System.Web.UI.WebControls.Literal) this.FindControl("litDisplayPointNumber");
            this.litDisplayPoint        = (System.Web.UI.WebControls.Literal) this.FindControl("litDisplayPoint");
            this.BalanceCanPayMoney     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("BalanceCanPayMoney");
            this.groupbuyHiddenBox      = (System.Web.UI.HtmlControls.HtmlInputControl) this.FindControl("groupbuyHiddenBox");
            this.rptAddress             = (VshopTemplatedRepeater)this.FindControl("rptAddress");
            this.selectShipTo           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("selectShipTo");
            this.MembersPointMoney      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("MembersPointMoney");
            this.regionId      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("regionId");
            this.litAddAddress = (System.Web.UI.WebControls.Literal) this.FindControl("litAddAddress");

            if (Globals.GetCurrentDistributorId() == CurrentMemberInfo.UserId)
            {
                base.GotoResourceNotFound("站点管理员无法在自己店内购买!");
                return;
            }
            if (Globals.GetCurrentDistributorId() == 0)//CurrentMemberInfo.ReferralUserId ==0  &&
            {
                base.GotoResourceNotFound("请先扫码关注站点后再下单!");
                return;
            }


            System.Collections.Generic.IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses();
            this.rptAddress.DataSource = from item in shippingAddresses
                                         orderby item.IsDefault
                                         select item;

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

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["startDate"]))
            {
                this.SendStartDate = DateTime.Parse(this.Page.Request.QueryString["startDate"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["quantityPerDay"]))
            {
                this.QuantityPerDay = Convert.ToInt32(this.Page.Request.QueryString["quantityPerDay"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["sendDays"]))
            {
                this.SendDays = Convert.ToInt32(this.Page.Request.QueryString["sendDays"]);
            }


            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());
            }
            this.litAddAddress.Text = "<li><a href='/Vshop/AddShippingAddress.aspx?returnUrl=" + Globals.UrlEncode(System.Web.HttpContext.Current.Request.Url.ToString()) + "'>新增收货地址</a></li>";
            if (shippingAddresses == null || shippingAddresses.Count == 0)
            {
                this.Page.Response.Redirect(Globals.ApplicationPath + "/Vshop/AddShippingAddress.aspx?returnUrl=" + Globals.UrlEncode(System.Web.HttpContext.Current.Request.Url.ToString()));
            }
            else
            {
                System.Collections.Generic.List <ShoppingCartInfo> list = new System.Collections.Generic.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");
                        list = ShoppingCartProcessor.GetListShoppingCart(this.productSku, this.buyAmount, bargainDetialId, 0);
                    }
                    else
                    {
                        int num  = this.buyAmount;
                        int num2 = Globals.RequestQueryNum("limitedTimeDiscountId");
                        if (num2 > 0)
                        {
                            bool flag = true;
                            LimitedTimeDiscountInfo discountInfo = LimitedTimeDiscountHelper.GetDiscountInfo(num2);
                            if (discountInfo == null)
                            {
                                flag = false;
                            }
                            if (flag)
                            {
                                if (MemberHelper.CheckCurrentMemberIsInRange(discountInfo.ApplyMembers, discountInfo.DefualtGroup, discountInfo.CustomGroup, this.CurrentMemberInfo.UserId))
                                {
                                    if (discountInfo.LimitNumber != 0)
                                    {
                                        int limitedTimeDiscountUsedNum = ShoppingCartProcessor.GetLimitedTimeDiscountUsedNum(num2, this.productSku, 0, this.CurrentMemberInfo.UserId, false);
                                        if (this.buyAmount > discountInfo.LimitNumber - limitedTimeDiscountUsedNum)
                                        {
                                            num = discountInfo.LimitNumber - limitedTimeDiscountUsedNum;
                                        }
                                    }
                                }
                                else
                                {
                                    num2 = 0;
                                }
                            }
                            else
                            {
                                num2 = 0;
                            }
                        }
                        if (num2 > 0)
                        {
                            ShoppingCartProcessor.RemoveLineItem(this.productSku, 0, num2);
                        }
                        if (num == 0 && num2 > 0)
                        {
                            num  = this.buyAmount;
                            num2 = 0;
                        }
                        list = ShoppingCartProcessor.GetListShoppingCart(SendStartDate, QuantityPerDay, SendDays, this.productSku, num, 0, num2);
                    }
                }
                else
                {
                    list = ShoppingCartProcessor.GetOrderSummitCart();
                }
                if (list == null)
                {
                    System.Web.HttpContext.Current.Response.Write("<script>alert('商品已下架或没有需要结算的订单!');location.href='/Vshop/ShoppingCart.aspx'</script>");
                }
                else
                {
                    if (list.Count > 1)
                    {
                        this.litShowMes.Text = "<div style=\"color: #F60; \"><img  src=\"/Utility/pics/u77.png\">您所购买的商品不支持同一个物流规则发货,系统自动拆分成多个子订单处理</div>";
                    }
                    this.rptCartProducts.DataSource = list;
                    this.rptCartProducts.DataBind();
                    decimal d    = 0m;
                    decimal num3 = 0m;
                    decimal d2   = 0m;
                    int     num4 = 0;
                    foreach (ShoppingCartInfo current in list)
                    {
                        num4 += current.GetPointNumber;
                        d    += current.Total;
                        num3 += current.Exemption;
                        d2   += current.ShipCost;
                    }
                    decimal d3   = num3;
                    decimal num5 = d - d3;
                    if (num5 <= 0m)
                    {
                        num5 = 0m;
                    }
                    num5 = decimal.Round(num5, 2);
                    this.litOrderTotal.Text = num5.ToString("F2");
                    if (num4 == 0)
                    {
                        this.litDisplayPointNumber.Text = "style=\"display:none;\"";
                    }
                    this.litPointNumber.Text = num4.ToString();
                    int          num6           = this.CurrentMemberInfo.Points - num4;
                    SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                    decimal      num7;
                    if (num5 * masterSettings.PointToCashRate > this.CurrentMemberInfo.Points)
                    {
                        if (num6 > masterSettings.PonitToCash_MaxAmount * masterSettings.PointToCashRate)
                        {
                            num7 = masterSettings.PonitToCash_MaxAmount;
                            num6 = (int)masterSettings.PonitToCash_MaxAmount * masterSettings.PointToCashRate;
                        }
                        else
                        {
                            num7 = num6 / masterSettings.PointToCashRate;
                        }
                    }
                    else
                    {
                        num7 = masterSettings.PonitToCash_MaxAmount;
                        if (num7 > num5)
                        {
                            num7 = num5;
                        }
                        num7 = decimal.Round(num7, 2);
                        num6 = (int)(num7 * masterSettings.PointToCashRate);
                    }
                    if (num6 <= 0)
                    {
                        num6 = 0;
                        num7 = 0m;
                    }
                    this.MembersPointMoney.Value = num7.ToString("F2");
                    if (num6 > 0)
                    {
                        this.litUseMembersPointShow.Text = string.Concat(new object[]
                        {
                            "<input type='hidden' id='hdCanUsePoint' value='",
                            num6,
                            "'/><input type='hidden' id='hdCanUsePointMoney' value='",
                            num7.ToString("F2"),
                            "'/><div class=\"prompt-text pull-left\" id=\"divUseMembersPointShow\">可用<span  id=\"usepointnum\">",
                            num6,
                            "</span>积分抵 <span class=\"colorr\">¥<span  id=\"usepointmoney\">",
                            num7.ToString("F2"),
                            "</span></span>元</div><div class=\"switch pull-right\" id=\"mySwitchUseMembersPoint\"><input  type=\"checkbox\" /></div>"
                        });
                    }
                    else
                    {
                        this.litUseMembersPointShow.Text = "<input type='hidden' id='hdCanUsePoint' value='0'/><input type='hidden' id='hdCanUsePointMoney' value='0'/><div class=\"prompt-text pull-left\" id=\"divUseMembersPointShow\">可用<span  id=\"usepointnum\">0</span>积分 <span  id=\"usepointmoney\" style=\"display:none\">" + num7.ToString("F2") + "</span></div><div class=\"switch pull-right\" id=\"mySwitchUseMembersPoint\" style=\"display:none\"><input type=\"checkbox\" disabled /></div>";
                    }
                    decimal d4;
                    if (num5 > this.CurrentMemberInfo.AvailableAmount)
                    {
                        d4 = this.CurrentMemberInfo.AvailableAmount;
                        this.BalanceCanPayMoney.Value = this.CurrentMemberInfo.AvailableAmount.ToString("F2");
                    }
                    else
                    {
                        d4 = num5;
                        this.BalanceCanPayMoney.Value = num5.ToString("F2");
                    }
                    if (this.CurrentMemberInfo.AvailableAmount > 0m && masterSettings.EnableBalancePayment)
                    {
                        this.litIsUseBalance.Text = string.Concat(new string[]
                        {
                            "<div class=\"prompt-text pull-left\">余额支付 <span class=\"colorr\">¥<span id=\"spCanpayMoney\">",
                            d4.ToString("F2"),
                            "</span></span>(可用 ¥<span id=\"spAvailableAmount\">",
                            this.CurrentMemberInfo.AvailableAmount.ToString("F2"),
                            "</span>)</div><div class=\"switch pull-right\" id=\"mySwitchUseBalance\"><input type=\"checkbox\" ",
                            (d4 > 0m) ? "" : " disabled",
                            " /></div></div>"
                        });
                    }
                    else
                    {
                        this.litIsUseBalance.Text = "<div class=\"prompt-text pull-left\"" + (masterSettings.EnableBalancePayment ? "" : " style=\"display:none\"") + ">余额可用 <span class=\"colorr\">¥<span id=\"spCanpayMoney\">0.00</span></span><span id=\"spAvailableAmount\" style=\"display:none\">0.00</span></div><div class=\"switch pull-right\" id=\"mySwitchUseBalance\" style=\"display:none\"><input type=\"checkbox\" disabled /></div></div>";
                    }
                    if (!masterSettings.PonitToCash_Enable)
                    {
                        this.litDisplayPoint.Text = " style=\"display:none;\"";
                    }
                    PageTitle.AddSiteNameTitle("订单确认");
                }
            }
        }
Exemple #8
0
        protected override void AttachChildControls()
        {
            DistributorsInfo nowCurrentDistributors = DistributorsBrower.GetNowCurrentDistributors(Globals.GetCurrentMemberUserId());
            MemberInfo       currentMember          = MemberProcessor.GetCurrentMember();

            if (nowCurrentDistributors.ReferralStatus != 0)
            {
                HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                PageTitle.AddSiteNameTitle("申请提现");
                this.accoutType  = (HtmlSelect)this.FindControl("accoutType");
                this.litmaxmoney = (Literal)this.FindControl("litmaxmoney");
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                if (masterSettings.DrawPayType.Contains("0"))
                {
                    this.accoutType.Items.Add(new ListItem("微信钱包", "0"));
                }
                if (masterSettings.DrawPayType.Contains("1"))
                {
                    this.accoutType.Items.Add(new ListItem("支付宝", "1"));
                }
                if (masterSettings.DrawPayType.Contains("2"))
                {
                    this.accoutType.Items.Add(new ListItem("线下转帐", "2"));
                }
                Literal literal = (Literal)this.FindControl("litAlipayBtn");
                literal.Text = "display:none";
                if (masterSettings.DrawPayType.Contains("3"))
                {
                    literal.Text = "";
                }
                this.txtAccountName       = (HtmlInputText)this.FindControl("txtAccountName");
                this.txtaccount           = (HtmlInputText)this.FindControl("txtaccount");
                this.txtmoney             = (HtmlInputText)this.FindControl("txtmoney");
                this.txtmoneyweixin       = (HtmlInputText)this.FindControl("txtmoneyweixin");
                this.hidmoney             = (HtmlInputHidden)this.FindControl("hidmoney");
                this.requestcommission    = (HtmlAnchor)this.FindControl("requestcommission");
                this.requestcommission1   = (HtmlAnchor)this.FindControl("requestcommission1");
                this.txtaccount.Value     = nowCurrentDistributors.RequestAccount;
                this.txtAccountName.Value = currentMember.RealName;
                this.litmaxmoney.Text     = nowCurrentDistributors.ReferralBlance.ToString("F2");
                decimal result = 0M;
                if (decimal.TryParse(SettingsManager.GetMasterSettings(false).MentionNowMoney, out result) && (result > 0M))
                {
                    this.txtmoney.Attributes["placeholder"]       = "请输入大于等于" + result + "元的金额";
                    this.txtmoneyweixin.Attributes["placeholder"] = "最低提现金额" + result + "元的金额";
                    this.hidmoney.Value = result.ToString();
                }
                if (DistributorsBrower.IsExitsCommionsRequest())
                {
                    this.requestcommission.Disabled   = true;
                    this.requestcommission.InnerText  = "您的申请正在审核当中";
                    this.requestcommission1.Disabled  = true;
                    this.requestcommission1.InnerText = "您的申请正在审核当中";
                    literal.Text = "display:none";
                    Literal literal2 = (Literal)this.FindControl("litWechatBtn");
                    literal2.Text = "display:none";
                }
                else
                {
                    this.requestcommission.Attributes.Add("onclick", "return RequestCommissions(3)");
                    this.requestcommission1.Attributes.Add("onclick", "return RequestCommissions(1)");
                }
            }
        }
Exemple #9
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("分销中心");
            int currentMemberUserId             = Globals.GetCurrentMemberUserId();
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            if (userIdDistributors == null)
            {
                System.Web.HttpContext.Current.Response.Redirect("DistributorRegCheck.aspx");
            }
            else if (userIdDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                this.imglogo = (System.Web.UI.WebControls.Image) this.FindControl("image");
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                this.litStroeName      = (System.Web.UI.WebControls.Literal) this.FindControl("litStroeName");
                this.litStroeName.Text = userIdDistributors.StoreName;
                this.litrGradeName     = (System.Web.UI.WebControls.Literal) this.FindControl("litrGradeName");
                DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId);
                if (distributorGradeInfo != null)
                {
                    this.litrGradeName.Text = distributorGradeInfo.Name;
                }
                this.litReferralBlance      = (System.Web.UI.WebControls.Literal) this.FindControl("litReferralBlance");
                this.litReferralBlance.Text = userIdDistributors.ReferralBlance.ToString("F2");
                this.litUserId         = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId");
                this.litUserId1        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId1");
                this.litUserId2        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId2");
                this.litUserId3        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId3");
                this.litUserId4        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId4");
                this.litUserId.Text    = userIdDistributors.UserId.ToString();
                this.litUserId1.Text   = userIdDistributors.UserId.ToString();
                this.litUserId2.Text   = userIdDistributors.UserId.ToString();
                this.litUserId3.Text   = userIdDistributors.UserId.ToString();
                this.litUserId4.Text   = userIdDistributors.UserId.ToString();
                this.litTodayOrdersNum = (System.Web.UI.WebControls.Literal) this.FindControl("litTodayOrdersNum");
                OrderQuery orderQuery = new OrderQuery();
                orderQuery.UserId           = new int?(currentMemberUserId);
                orderQuery.Status           = OrderStatus.Today;
                this.litTodayOrdersNum.Text = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString();
                this.refrraltotal           = (FormatedMoneyLabel)this.FindControl("refrraltotal");
                this.refrraltotal.Money     = DistributorsBrower.GetUserCommissions(userIdDistributors.UserId, System.DateTime.Now, null, null, null, "");
                this.saletotal       = (FormatedMoneyLabel)this.FindControl("saletotal");
                this.saletotal.Money = userIdDistributors.OrdersTotal;
                this.litMysubMember  = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubMember");
                this.litMysubFirst   = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubFirst");
                this.litMysubSecond  = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubSecond");
                DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);
                if (distributorsSubStoreNum != null || distributorsSubStoreNum.Rows.Count > 0)
                {
                    this.litMysubMember.Text = distributorsSubStoreNum.Rows[0]["memberCount"].ToString();
                    this.litMysubFirst.Text  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                    this.litMysubSecond.Text = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
                }
                else
                {
                    this.litMysubMember.Text = "0";
                    this.litMysubFirst.Text  = "0";
                    this.litMysubSecond.Text = "0";
                }
                this.litProtuctNum      = (System.Web.UI.WebControls.Literal) this.FindControl("litProtuctNum");
                this.litProtuctNum.Text = ProductBrowser.GetProductsNumber(true).ToString();
                orderQuery.Status       = OrderStatus.All;
                this.litOrders          = (System.Web.UI.WebControls.Literal) this.FindControl("litOrders");
                this.litOrders.Text     = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString();
                this.UpClassInfo        = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("UpClassInfo");
                System.Collections.Generic.IList <DistributorGradeInfo> distributorGradeInfos = VShopHelper.GetDistributorGradeInfos();
                DistributorGradeInfo distributorGradeInfo2 = null;
                foreach (DistributorGradeInfo current in distributorGradeInfos)
                {
                    if (!(distributorGradeInfo.CommissionsLimit >= current.CommissionsLimit))
                    {
                        if (distributorGradeInfo2 == null)
                        {
                            distributorGradeInfo2 = current;
                        }
                        else if (distributorGradeInfo2.CommissionsLimit > current.CommissionsLimit)
                        {
                            distributorGradeInfo2 = current;
                        }
                    }
                }
                if (distributorGradeInfo2 == null)
                {
                    this.UpClassInfo.Visible = false;
                }
                else
                {
                    decimal d = distributorGradeInfo2.CommissionsLimit - userIdDistributors.ReferralBlance - userIdDistributors.ReferralRequestBalance;
                    if (d < 0m)
                    {
                        d = 0.01m;
                    }
                    this.UpClassInfo.InnerHtml = string.Concat(new string[]
                    {
                        "再获得<span> ",
                        d.ToString("F2"),
                        " 元</span>佣金升级为 <span>",
                        distributorGradeInfo2.Name,
                        "</span>"
                    });
                }
            }
        }
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("错误的商品信息");
            }
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            this.litProdcutName      = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litSalePrice        = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litSoldCount        = (System.Web.UI.WebControls.Literal) this.FindControl("litSoldCount");
            this.productImage        = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("productImage");
            this.productLink         = (System.Web.UI.WebControls.HyperLink) this.FindControl("productLink");
            this.txtTotal            = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);

            if (productSimpleInfo == null)
            {
                base.GotoResourceNotFound("该件商品已经被管理员删除");
            }
            this.litProdcutName.SetWhenIsNotNull(productSimpleInfo.ProductName);
            this.litSalePrice.SetWhenIsNotNull(productSimpleInfo.MinSalePrice.ToString("F2"));
            this.litShortDescription.SetWhenIsNotNull(productSimpleInfo.ShortDescription);
            this.litSoldCount.SetWhenIsNotNull(productSimpleInfo.ShowSaleCounts.ToString());
            if (!string.IsNullOrEmpty(productSimpleInfo.ThumbnailUrl180))
            {
                this.productImage.Src = productSimpleInfo.ThumbnailUrl180;
            }
            else
            {
                this.productImage.Src = masterSettings.DefaultProductThumbnail5;
            }
            this.productLink.NavigateUrl = "ProductDetails.aspx?ProductId=" + productSimpleInfo.ProductId;
            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 20;
            }
            ProductReviewQuery productReviewQuery = new ProductReviewQuery();

            productReviewQuery.productId = this.productId;
            productReviewQuery.IsCount   = true;
            productReviewQuery.PageIndex = pageIndex;
            productReviewQuery.PageSize  = pageSize;
            productReviewQuery.SortBy    = "ReviewId";
            productReviewQuery.SortOrder = SortAction.Desc;
            this.rptProducts             = (WapTemplatedRepeater)this.FindControl("rptProducts");
            DbQueryResult productReviews = ProductBrowser.GetProductReviews(productReviewQuery);

            this.rptProducts.DataSource = productReviews.Data;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(productReviews.TotalRecords.ToString());
            PageTitle.AddSiteNameTitle("商品评价");
        }
Exemple #11
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["id"], out this.bargainId))
            {
                base.GotoResourceNotFound("");
            }
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (currentMember != null)
            {
                BargainDetialInfo bargainDetialInfo = BargainHelper.GetBargainDetialInfo(this.bargainId, currentMember.UserId);
                if (bargainDetialInfo != null)
                {
                    this.Page.Response.Redirect(string.Concat(new object[] { "InviteBargainDetial.aspx?bargainId=", this.bargainId, "&bargainDetialId=", bargainDetialInfo.Id, "&ReferralId=", this.Page.Request.QueryString["ReferralId"] }));
                }
            }
            this.litProdcutName              = (Literal)this.FindControl("litProdcutName");
            this.litShortDescription         = (Literal)this.FindControl("litShortDescription");
            this.litSalePrice                = (Literal)this.FindControl("litSalePrice");
            this.litFloorPrice               = (Literal)this.FindControl("litFloorPrice");
            this.litFloorPrice1              = (Literal)this.FindControl("litFloorPrice1");
            this.litPurchaseNumber           = (Literal)this.FindControl("litPurchaseNumber");
            this.litParticipantNumber        = (Literal)this.FindControl("litParticipantNumber");
            this.litProductDesc              = (Literal)this.FindControl("litProductDesc");
            this.litProductConsultationTotal = (Literal)this.FindControl("litProductConsultationTotal");
            this.litProductCommentTotal      = (Literal)this.FindControl("litProductCommentTotal");
            this.litStock           = (Literal)this.FindControl("litStock");
            this.litPurcharseNum    = (Literal)this.FindControl("litPurcharseNum");
            this.hiddHasCollected   = (HtmlInputHidden)this.FindControl("hiddHasCollected");
            this.hiddProductId      = (HtmlInputHidden)this.FindControl("hiddProductId");
            this.hiddEndDate        = (HtmlInputHidden)this.FindControl("hiddEndDate");
            this.hiddPurchaseNumber = (HtmlInputHidden)this.FindControl("hiddPurchaseNumber");
            this.skuSelector        = (Common_SKUSelector)this.FindControl("skuSelector");
            this.rptProductImages   = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.hideTitle          = (HtmlInputHidden)this.FindControl("hideTitle");
            this.hideImgUrl         = (HtmlInputHidden)this.FindControl("hideImgUrl");
            this.hideDesc           = (HtmlInputHidden)this.FindControl("hideDesc");
            bool        flag        = false;
            BargainInfo bargainInfo = BargainHelper.GetBargainInfo(this.bargainId);

            if (bargainInfo != null)
            {
                PageTitle.AddSiteNameTitle(bargainInfo.Title);
                this.litFloorPrice.Text        = bargainInfo.FloorPrice.ToString("F2");
                this.litFloorPrice1.Text       = bargainInfo.FloorPrice.ToString("F2");
                this.litSalePrice.Text         = bargainInfo.InitialPrice.ToString("f2");
                this.litPurchaseNumber.Text    = (bargainInfo.ActivityStock - bargainInfo.TranNumber).ToString();
                this.litParticipantNumber.Text = BargainHelper.HelpBargainCount(this.bargainId).ToString();
                this.hiddEndDate.Value         = bargainInfo.EndDate.ToString("yyyy:MM:dd:HH:mm:ss");
                this.hiddPurchaseNumber.Value  = bargainInfo.PurchaseNumber.ToString();
                this.litStock.Text             = bargainInfo.PurchaseNumber.ToString();
                this.litPurcharseNum.Text      = bargainInfo.PurchaseNumber.ToString();
                this.hideTitle.Value           = bargainInfo.Title;
                this.hideDesc.Value            = bargainInfo.Remarks.Replace("\n", " ").Replace("\r", "");
                string activityCover = bargainInfo.ActivityCover;
                string str2          = string.Empty;
                Uri    url           = HttpContext.Current.Request.Url;
                if (!activityCover.StartsWith("http"))
                {
                    str2 = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
                }
                if (bargainInfo.ProductId > 0)
                {
                    this.skuSelector.ProductId = bargainInfo.ProductId;
                    if (currentMember != null)
                    {
                        flag = ProductBrowser.CheckHasCollect(currentMember.UserId, bargainInfo.ProductId);
                    }
                    this.hiddHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
                    ProductInfo productDetails = ProductHelper.GetProductDetails(bargainInfo.ProductId);
                    if (productDetails == null)
                    {
                        this.Context.Response.Write("<script>alert('该商品不存在!');location.href='/default.aspx';</script>");
                        this.Context.Response.End();
                    }
                    else
                    {
                        this.hiddProductId.Value      = bargainInfo.ProductId.ToString();
                        this.litProdcutName.Text      = productDetails.ProductName;
                        this.litShortDescription.Text = bargainInfo.Remarks;
                        this.hideImgUrl.Value         = string.IsNullOrEmpty(productDetails.ThumbnailUrl60) ? (str2 + activityCover) : (str2 + productDetails.ThumbnailUrl60);
                        this.litProductDesc.Text      = productDetails.Description;
                        if (this.rptProductImages != null)
                        {
                            string       locationUrl = "javascript:;";
                            SlideImage[] imageArray  = new SlideImage[] { new SlideImage(productDetails.ImageUrl1, locationUrl), new SlideImage(productDetails.ImageUrl2, locationUrl), new SlideImage(productDetails.ImageUrl3, locationUrl), new SlideImage(productDetails.ImageUrl4, locationUrl), new SlideImage(productDetails.ImageUrl5, locationUrl) };
                            this.rptProductImages.DataSource = from item in imageArray
                                                               where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                               select item;
                            this.rptProductImages.DataBind();
                        }
                        int productConsultationsCount = ProductBrowser.GetProductConsultationsCount(bargainInfo.ProductId, false);
                        this.litProductConsultationTotal.SetWhenIsNotNull(productConsultationsCount.ToString());
                        this.litProductCommentTotal.SetWhenIsNotNull(ProductBrowser.GetProductReviewsCount(bargainInfo.ProductId).ToString());
                    }
                }
            }
        }
        protected override void AttachChildControls()
        {
            this.orderId           = this.Page.Request.QueryString["orderId"];
            this.litShipTo         = (Literal)this.FindControl("litShipTo");
            this.litPhone          = (Literal)this.FindControl("litPhone");
            this.litAddress        = (Literal)this.FindControl("litAddress");
            this.litOrderId        = (Literal)this.FindControl("litOrderId");
            this.litOrderDate      = (Literal)this.FindControl("litOrderDate");
            this.litOrderStatus    = (OrderStatusLabel)this.FindControl("litOrderStatus");
            this.rptOrderProducts  = (VshopTemplatedRepeater)this.FindControl("rptOrderProducts");
            this.litTotalPrice     = (Literal)this.FindControl("litTotalPrice");
            this.litPayTime        = (Literal)this.FindControl("litPayTime");
            this.hlinkGetRedPager  = (HyperLink)this.FindControl("hlinkGetRedPager");
            this.orderStatus       = (HtmlInputHidden)this.FindControl("orderStatus");
            this.txtOrderId        = (HtmlInputHidden)this.FindControl("txtOrderId");
            this.litRemark         = (Literal)this.FindControl("litRemark");
            this.litShipToDate     = (Literal)this.FindControl("litShipToDate");
            this.litShippingCost   = (Literal)this.FindControl("litShippingCost");
            this.litCounponPrice   = (Literal)this.FindControl("litCounponPrice");
            this.litRedPagerAmount = (Literal)this.FindControl("litRedPagerAmount");
            this.litExemption      = (Literal)this.FindControl("litExemption");
            this.litPointToCash    = (Literal)this.FindControl("litPointToCash");
            this.litBuildPrice     = (Literal)this.FindControl("litBuildPrice");
            this.litDisCountPrice  = (Literal)this.FindControl("litDisCountPrice");
            this.litActualPrice    = (Literal)this.FindControl("litActualPrice");
            OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(this.orderId);

            if (orderInfo == null)
            {
                base.GotoResourceNotFound("此订单已不存在");
            }
            this.litShipTo.Text  = orderInfo.ShipTo;
            this.litPhone.Text   = orderInfo.CellPhone;
            this.litAddress.Text = orderInfo.ShippingRegion + orderInfo.Address;
            if (orderInfo.BargainDetialId > 0)
            {
                this.litOrderId.Text = this.orderId + "<span class='text-danger'> 【砍价】</span>";
            }
            else
            {
                this.litOrderId.Text = this.orderId;
            }
            this.litOrderDate.Text = orderInfo.OrderDate.ToString();
            this.litTotalPrice.SetWhenIsNotNull(orderInfo.GetAmount().ToString("F2"));
            this.litOrderStatus.OrderStatusCode = orderInfo.OrderStatus;
            this.litOrderStatus.Gateway         = orderInfo.Gateway;
            this.litPayTime.SetWhenIsNotNull(orderInfo.PayDate.HasValue ? orderInfo.PayDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "");
            OrderRedPagerInfo orderRedPagerInfo = OrderRedPagerBrower.GetOrderRedPagerInfo(this.orderId);

            if ((orderRedPagerInfo != null) && (orderRedPagerInfo.MaxGetTimes > orderRedPagerInfo.AlreadyGetTimes))
            {
                this.hlinkGetRedPager.NavigateUrl = "/vshop/GetRedShare.aspx?orderid=" + this.orderId;
                this.hlinkGetRedPager.Visible     = true;
            }
            this.orderStatus.SetWhenIsNotNull(((int)orderInfo.OrderStatus).ToString());
            this.txtOrderId.SetWhenIsNotNull(this.orderId.ToString());
            decimal couponValue = 0M;

            couponValue = orderInfo.CouponValue;
            if (couponValue > 0M)
            {
                this.litCounponPrice.Text = "-\x00a5" + couponValue.ToString("F2");
            }
            else
            {
                this.litCounponPrice.Text = " \x00a5" + couponValue.ToString("F2").Trim(new char[] { '-' });
            }
            couponValue = orderInfo.RedPagerAmount;
            if (couponValue > 0M)
            {
                this.litRedPagerAmount.Text = "<div><span class=\"span-r-80\">代金券抵扣:</span>- \x00a5" + couponValue.ToString("F2") + "</div>";
            }
            couponValue = orderInfo.GetAdjustCommssion();
            if (couponValue > 0M)
            {
                this.litDisCountPrice.Text = "<div><span class=\"span-r-80\">价格调整:</span>- \x00a5" + couponValue.ToString("F2") + "</div>";
            }
            else
            {
                this.litDisCountPrice.Text = "<div><span class=\"span-r-80\">价格调整:</span> &nbsp;\x00a5" + couponValue.ToString("F2").Trim(new char[] { '-' }) + "</div>";
            }
            couponValue = orderInfo.PointToCash;
            if (couponValue > 0M)
            {
                this.litPointToCash.Text = "<div><span class=\"span-r-80\">积分抵现:</span>- \x00a5" + couponValue.ToString("F2") + "</div>";
            }
            couponValue = orderInfo.DiscountAmount;
            if (couponValue > 0M)
            {
                this.litExemption.Text = "<div><span class=\"span-r-80\">优惠减免:</span>- \x00a5" + couponValue.ToString("F2") + "</div>";
            }
            this.litShippingCost.Text = orderInfo.AdjustedFreight.ToString("F2");
            this.litShipToDate.SetWhenIsNotNull(orderInfo.ShipToDate);
            this.litBuildPrice.SetWhenIsNotNull(orderInfo.GetAmount().ToString("F2"));
            this.litActualPrice.SetWhenIsNotNull(orderInfo.TotalPrice.ToString("F2"));
            this.litRemark.SetWhenIsNotNull(orderInfo.Remark);
            this.rptOrderProducts.DataSource = orderInfo.LineItems.Values;
            this.rptOrderProducts.DataBind();
            PageTitle.AddSiteNameTitle("订单详情");
        }
Exemple #13
0
        protected override void AttachChildControls()
        {
            HiContext current = HiContext.Current;

            PageTitle.AddTitle(current.SiteSettings.SiteName + current.SiteSettings.SiteDescription, HiContext.Current.Context);
        }
Exemple #14
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺推广");
            int num = Globals.RequestQueryNum("ReferralId");

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

            if (userIdDistributors == null)
            {
                this.Page.Response.Redirect("/default.aspx?ReferralId=" + this.userId.ToString());
                this.Page.Response.End();
            }
            else
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                bool         isShowDistributorSelfStoreName = masterSettings.IsShowDistributorSelfStoreName;
                num = userIdDistributors.UserId;
                this.litStroeDesc = (System.Web.UI.WebControls.Literal) this.FindControl("litStroeDesc");
                this.litLinkurl   = (System.Web.UI.WebControls.Literal) this.FindControl("litLinkurl");
                this.litStoreurl  = (System.Web.UI.WebControls.Literal) this.FindControl("litStoreurl");
                string text = Globals.FullPath("/Default.aspx?ReferralId=" + num);
                this.litLinkurl.Text  = text;
                this.litStoreurl.Text = text;
                this.Logoimage        = (System.Web.UI.WebControls.Image) this.FindControl("Logoimage");
                this.storeCode        = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("storeCode");
                this.storeFollowCode  = (System.Web.UI.HtmlControls.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(text) + "&Logo=" + userIdDistributors.Logo;
                if (masterSettings.IsValidationService)
                {
                    this.storeFollowCode.Src = "";
                    ScanInfos scanInfosByUserId = ScanHelp.GetScanInfosByUserId(num, 0, "WX");
                    if (scanInfosByUserId == null)
                    {
                        ScanHelp.CreatNewScan(num, "WX", 0);
                        scanInfosByUserId = ScanHelp.GetScanInfosByUserId(num, 0, "WX");
                    }
                    string text2 = "";
                    if (scanInfosByUserId != null && !string.IsNullOrEmpty(scanInfosByUserId.CodeUrl))
                    {
                        text2 = BarCodeApi.GetQRImageUrlByTicket(scanInfosByUserId.CodeUrl);
                    }
                    else
                    {
                        string token_Message = TokenApi.GetToken_Message(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret);
                        if (TokenApi.CheckIsRightToken(token_Message))
                        {
                            string text3 = BarCodeApi.CreateTicket(token_Message, scanInfosByUserId.Sceneid, "QR_LIMIT_SCENE", "2592000");
                            if (!string.IsNullOrEmpty(text3))
                            {
                                text2 = BarCodeApi.GetQRImageUrlByTicket(text3);
                                scanInfosByUserId.CodeUrl        = text3;
                                scanInfosByUserId.CreateTime     = System.DateTime.Now;
                                scanInfosByUserId.LastActiveTime = System.DateTime.Now;
                                ScanHelp.updateScanInfosCodeUrl(scanInfosByUserId);
                            }
                        }
                    }
                    if (!string.IsNullOrEmpty(text2))
                    {
                        this.storeFollowCode.Src = "/Api/CreatQRCode.ashx?Combin=" + Globals.UrlEncode(text2) + "&Logo=" + userIdDistributors.Logo;
                    }
                    else
                    {
                        this.storeFollowCode.Src = "";
                    }
                }
                this.litStroeName      = (System.Web.UI.WebControls.Literal) this.FindControl("litStroeName");
                this.litStroeName.Text = userIdDistributors.StoreName;
                this.litStroeDesc.Text = userIdDistributors.StoreDescription;
                if (!isShowDistributorSelfStoreName)
                {
                    this.Logoimage.ImageUrl = masterSettings.DistributorLogoPic;
                    this.litStroeName.Text  = masterSettings.SiteName;
                    this.litStroeDesc.Text  = masterSettings.ShopIntroduction;
                    this.storeCode.Src      = "/Api/CreatQRCode.ashx?code=" + Globals.UrlEncode(text) + "&Logo=" + masterSettings.DistributorLogoPic;
                }
            }
        }
Exemple #15
0
        protected override void AttachChildControls()
        {
            string s    = HttpContext.Current.Request.QueryString.Get("m");
            string str2 = HttpContext.Current.Request.QueryString.Get("type");

            this.ltGetTotal                      = (Literal)this.FindControl("ltGetTotal");
            this.ltOrderAmountCanUse             = (Literal)this.FindControl("ltOrderAmountCanUse");
            this.ltExpiryTime                    = (Literal)this.FindControl("ltExpiryTime");
            this.ltRedPagerActivityName          = (Literal)this.FindControl("ltRedPagerActivityName");
            this.ltRedPagerActivityNameForOrders = (Literal)this.FindControl("ltRedPagerActivityNameForOrders");
            this.ltRedPagerLimit                 = (Literal)this.FindControl("ltRedPagerLimit");
            this.ltErrorMessage                  = (Literal)this.FindControl("ltErrorMessage");
            this.divNoLogin                      = (Panel)this.FindControl("divNoLogin");
            this.divNoNum    = (Panel)this.FindControl("divNoNum");
            this.divSuccess  = (Panel)this.FindControl("divSuccess");
            this.divError    = (Panel)this.FindControl("divError");
            this.hdCondition = (HtmlInputHidden)this.FindControl("hdCondition");
            this.hlinkLogin  = (HyperLink)this.FindControl("hlinkLogin");
            switch (str2)
            {
            case "1":
            case "5":
            {
                int result = 0;
                int.TryParse(s, out result);
                if (result > 0)
                {
                    int num2 = 0;
                    int.TryParse(HttpContext.Current.Request["id"], out num2);
                    ShareActivityInfo act = ShareActHelper.GetAct(num2);
                    if (act != null)
                    {
                        CouponInfo coupon = CouponHelper.GetCoupon(act.CouponId);
                        this.ltGetTotal.Text          = coupon.CouponValue.ToString("F2").Replace(".00", "");
                        this.ltOrderAmountCanUse.Text = coupon.ConditionValue.ToString("F2").Replace(".00", "");
                        this.hdCondition.SetWhenIsNotNull(coupon.ConditionValue.ToString("F2").Replace(".00", ""));
                        this.ltExpiryTime.Text = coupon.EndDate.ToString("yyyy-MM-dd");
                        if (str2 == "5")
                        {
                            this.ltRedPagerActivityName.Text = "该券已经到你的钱包了</div><div class='get-red-explain'><a href='/Vshop/MyCouponLists.aspx'>点击查看</a>";
                        }
                        else
                        {
                            this.ltRedPagerActivityName.Text = coupon.CouponName ?? "";
                        }
                        if (coupon.IsAllProduct)
                        {
                            this.ltRedPagerLimit.Text = "该券可用于任意商品的抵扣";
                        }
                        else
                        {
                            string couponProductIds = CouponHelper.GetCouponProductIds(act.CouponId);
                            this.ltRedPagerLimit.Text = "该券可用于部分商品的抵扣</div><div class='get-red-explain'><a href='/ProductList.aspx?pIds='" + couponProductIds + ">查看商品</a>";
                        }
                        this.divSuccess.Visible = true;
                    }
                }
                PageTitle.AddSiteNameTitle("成功获取优惠券");
                return;
            }

            default:
            {
                string str5 = str2;
                if (str5 != null)
                {
                    if (!(str5 == "-1"))
                    {
                        if (str5 == "-2")
                        {
                            this.ltErrorMessage.Text = s;
                            this.divError.Visible    = true;
                            break;
                        }
                        if (str5 == "-4")
                        {
                            this.divNoLogin.Visible = true;
                            break;
                        }
                        if (str5 == "-3")
                        {
                            this.divNoNum.Visible = true;
                            break;
                        }
                    }
                    else
                    {
                        int num3 = 0;
                        int.TryParse(HttpContext.Current.Request["id"], out num3);
                        ShareActivityInfo info3 = ShareActHelper.GetAct(num3);
                        if (info3 != null)
                        {
                            CouponInfo info4 = CouponHelper.GetCoupon(info3.CouponId);
                            this.ltRedPagerActivityNameForOrders.Text = info4.CouponName;
                            string str4 = string.Concat(new object[] { "http://", Globals.DomainName, Globals.ApplicationPath, "/Vshop/GetRedPager.aspx?id=", num3.ToString(), "&userid=", Globals.GetCurrentMemberUserId() });
                            this.hlinkLogin.NavigateUrl = "/Vshop/UserLogin.aspx?returnUrl=" + HttpContext.Current.Server.UrlEncode(str4 + "&" + this.getopenid());
                            this.divNoLogin.Visible     = true;
                        }
                        else
                        {
                            HttpContext.Current.Response.Redirect("/Vshop/");
                            HttpContext.Current.Response.End();
                        }
                    }
                }
                break;
            }
            }
            PageTitle.AddSiteNameTitle("获取优惠券");
        }
 protected override void AttachChildControls()
 {
     this.dropRegions = (RegionSelector)this.FindControl("dropRegions");
     PageTitle.AddSiteNameTitle("添加收货地址");
 }
Exemple #17
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                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.litMemberGradeInfo    = (Literal)this.FindControl("litMemberGradeInfo");
            this.litMarketPrice        = (Literal)this.FindControl("litMarketPrice");
            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.specialHideShow       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("specialHideShow");
            ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);

            this.litproductid.Value = this.productId.ToString();
            if (product == null)
            {
                base.GotoResourceNotFound("重复购买失败!该商品不存在或已下架");
            }
            if (!string.IsNullOrEmpty(product.MainCategoryPath))
            {
                DataTable allFull = ProductBrowser.GetAllFull(int.Parse(product.MainCategoryPath.Split(new char[] { '|' })[0].ToString()));
                this.litActivities.Text = "<div class=\"price clearfix\"><span class=\"title\">促销活动:</span><div class=\"all-action\">";
                if (allFull.Rows.Count > 0)
                {
                    for (int i = 0; i < allFull.Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            object text = this.litActivities.Text;
                            this.litActivities.Text = string.Concat(new object[] { text, "<div class=\"action\"><span class=\"purchase\"><a href=\"/Vshop/ActivityDetail.aspx?ActivitiesId=", allFull.Rows[i]["ActivitiesId"], "&CategoryId=", allFull.Rows[i]["ActivitiesType"], "\">", allFull.Rows[i]["ActivitiesName"].ToString(), "满", decimal.Parse(allFull.Rows[i]["MeetMoney"].ToString()).ToString("0"), "减", decimal.Parse(allFull.Rows[i]["ReductionMoney"].ToString()).ToString("0"), "</a>&nbsp;&nbsp;</span></div>" });
                        }
                        else
                        {
                            object obj3 = this.litActivities.Text;
                            this.litActivities.Text = string.Concat(new object[] { obj3, "<div class=\"action actionnone\"><span class=\"purchase\"><a href=\"/Vshop/ActivityDetail.aspx?ActivitiesId=", allFull.Rows[i]["ActivitiesId"], "&CategoryId=", allFull.Rows[i]["ActivitiesType"], "\">", allFull.Rows[i]["ActivitiesName"].ToString(), "满", decimal.Parse(allFull.Rows[i]["MeetMoney"].ToString()).ToString("0"), "减", decimal.Parse(allFull.Rows[i]["ReductionMoney"].ToString()).ToString("0"), "</a>&nbsp;&nbsp;</span></div>" });
                        }
                    }
                    this.litActivities.Text = this.litActivities.Text + "</div><em>&nbsp;more</em></div>";
                }
                else
                {
                    this.litActivities.Text = "";
                }
            }
            //传递爽爽挝啡的特殊名到前端,前端用jquery进行相应的功能隐藏
            if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.AutoShipping)
            {
                specialHideShow.Value = "sswk";//爽爽挝啡
            }
            else if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.CouponRecharge)
            {
                if (product.ProductName == "会员充值")
                {
                    specialHideShow.Value = "JZ";//轿子洗衣
                }
            }

            if (!string.IsNullOrEmpty(this.litActivities.Text) && (product == null))
            {
                base.GotoResourceNotFound("此商品已不存在");
            }
            Uri u1 = HttpContext.Current.Request.UrlReferrer;

            if (product.SaleStatus != ProductSaleStatus.OnSale && (u1 == null || u1.ToString().ToLower().IndexOf("admin") == -1))
            {
                base.GotoResourceNotFound("此商品已下架");//20160505,增加处理,后台查看商品时允许显示
            }
            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 = product.MinSalePrice.ToString("F2");
            string currentMemberGradeName = (MemberProcessor.GetCurrentMember() == null) ? "" :
                                            string.Format("<span style='font-size:12px; background:#F90; color:#FFF; border-radius:3px; padding:3px 5px; margin-right:5px;'>{0}</span>"
                                                          , Hidistro.ControlPanel.Members.MemberHelper.GetMemberGrade(MemberProcessor.GetCurrentMember().GradeId).Name);

            this.litMemberGradeInfo.Text = currentMemberGradeName;
            //九信渐佳需求:如果是通过后台代理商点击商品链接跳转到此页面,显示成本价。
            //判断当前登陆的用户是不是代理商;
            ManagerInfo currentManager = ManagerHelper.GetCurrentManager();

            if (currentManager != null && ManagerHelper.GetRole(currentManager.RoleId).RoleName == "代理商")
            {
                //是代理商就显示成本价
                this.litSalePrice.Text = "¥" + product.MinCostPrice.ToString("F2");
            }
            else
            {
                //不是就显示原价
                this.litSalePrice.Text = "¥" + product.MinSalePrice.ToString("F2");
            }

            if (product.MarketPrice.HasValue)
            {
                this.litMarketPrice.SetWhenIsNotNull(product.MarketPrice.GetValueOrDefault(0M).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         = product.Stock.ToString();
            this.skuSelector.ProductId = this.productId;
            if (this.expandAttr != null)
            {
                this.expandAttr.ProductId = this.productId;
            }
            if (this.linkDescription != null)
            {
                this.linkDescription.NavigateUrl = "/Vshop/ProductDescription.aspx?productId=" + this.productId;
            }
            this.litConsultationsCount.SetWhenIsNotNull(ProductBrowser.GetProductConsultationsCount(this.productId, false).ToString());
            this.litReviewsCount.SetWhenIsNotNull(ProductBrowser.GetProductReviewsCount(this.productId).ToString());
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();
            bool       flag          = false;

            if (currentMember != null)
            {
                flag = ProductBrowser.CheckHasCollect(currentMember.UserId, this.productId);
            }
            this.litHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
            ProductBrowser.UpdateVisitCounts(this.productId);
            PageTitle.AddSiteNameTitle("商品详情");
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
            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 });
        }
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("申请提现");
     this.lblBanlance        = (Literal)this.FindControl("lblBanlance");
     this.lblLastDrawTime    = (Literal)this.FindControl("lblLastDrawTime");
     this.lblminDraws        = (Literal)this.FindControl("lblminDraws");
     this.CanDrawRequestType = (HtmlInputHidden)this.FindControl("CanDrawRequestType");
     this.requestBalance     = (HtmlInputHidden)this.FindControl("requestBalance");
     if (!this.Page.IsPostBack)
     {
         int        num  = 0;
         MemberInfo user = HiContext.Current.User;
         if (!user.IsOpenBalance || string.IsNullOrEmpty(user.TradePassword))
         {
             this.Page.Response.Redirect(string.Format("/{1}/OpenBalance?ReturnUrl={0}", HttpContext.Current.Request.Url, "AppShop"));
         }
         SiteSettings masterSettings = SettingsManager.GetMasterSettings();
         if (this.lblminDraws != null)
         {
             this.lblminDraws.Text = masterSettings.MinimumSingleShot.F2ToString("f2");
         }
         if (this.lblBanlance != null)
         {
             this.lblBanlance.Text = MemberProcessor.GetUserUseSplittin(HiContext.Current.UserId).F2ToString("f2");
         }
         if (this.lblLastDrawTime != null)
         {
             SplittinDrawInfo myRecentlySplittinDraws = MemberProcessor.GetMyRecentlySplittinDraws();
             if (myRecentlySplittinDraws != null)
             {
                 this.lblLastDrawTime.Text = myRecentlySplittinDraws.RequestDate.ToString("yyyy-MM-dd HH:mm:ss");
                 if (myRecentlySplittinDraws.AuditStatus == 1)
                 {
                     this.requestBalance.Value = "1";
                 }
             }
             else
             {
                 this.lblLastDrawTime.Text = "您还没有提现记录";
             }
         }
         bool flag = masterSettings.EnableBulkPaymentWeixin;
         bool enableBulkPaymentAliPay = masterSettings.EnableBulkPaymentAliPay;
         if (masterSettings.EnableBulkPaymentWeixin)
         {
             if (user.MemberOpenIds == null)
             {
                 flag = false;
             }
             else
             {
                 MemberOpenIdInfo memberOpenIdInfo = user.MemberOpenIds.FirstOrDefault((MemberOpenIdInfo item) => item.OpenIdType.ToLower() == "hishop.plugins.openid.weixin");
                 if (memberOpenIdInfo == null)
                 {
                     flag = false;
                 }
             }
         }
         if (masterSettings.SplittinDraws_CashToDeposit)
         {
             num++;
         }
         if (masterSettings.SplittinDraws_CashToBankCard)
         {
             num += 2;
         }
         if (flag && masterSettings.SplittinDraws_CashToWeiXin)
         {
             num += 4;
         }
         if (enableBulkPaymentAliPay && masterSettings.SplittinDraws_CashToALiPay)
         {
             num += 8;
         }
         this.CanDrawRequestType.Value = num.ToString();
     }
 }
Exemple #19
0
        public PageTitle GetTitle()
        {
            PageTitle pageTitle = new PageTitle(titlelement.GetText());

            return(pageTitle);
        }
        protected override void AttachChildControls()
        {
            this.hidHasTradePassword = (HtmlInputHidden)this.FindControl("hidHasTradePassword");
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            this.orderId              = this.Page.Request.QueryString["orderId"];
            this.spandemo             = (HtmlGenericControl)this.FindControl("spandemo");
            this.litBalanceAmount     = (Literal)this.FindControl("litBalanceAmount");
            this.liBalanceAmount      = (HtmlGenericControl)this.FindControl("liBalanceAmount");
            this.hidExpressStatus     = (HtmlInputHidden)this.FindControl("hidExpressStatus");
            this.litInvoiceType       = (Literal)this.FindControl("litInvoiceType");
            this.litRegisterAddress   = (Literal)this.FindControl("litRegisterAddress");
            this.litRegisterTel       = (Literal)this.FindControl("litRegisterTel");
            this.litOpenBank          = (Literal)this.FindControl("litOpenBank");
            this.litBankName          = (Literal)this.FindControl("litBankName");
            this.litReceiveName       = (Literal)this.FindControl("litReceiveName");
            this.litReceiveMobbile    = (Literal)this.FindControl("litReceiveMobbile");
            this.litReceiveEmail      = (Literal)this.FindControl("litReceiveEmail");
            this.litReceiveRegionName = (Literal)this.FindControl("litReceiveRegionName");
            this.litReceiveAddress    = (Literal)this.FindControl("litReceiveAddress");
            this.spandemo.Visible     = masterSettings.IsDemoSite;
            this.LoadAllControls();
            this.order = ShoppingProcessor.GetOrderInfo(this.orderId);
            if (this.order == null || this.order.UserId != HiContext.Current.UserId)
            {
                base.GotoResourceNotFound("此订单已不存在");
            }
            if (this.order.ParentOrderId != "0" && this.order.ParentOrderId != "-1" && this.order.OrderStatus == OrderStatus.WaitBuyerPay)
            {
                this.order   = ShoppingProcessor.GetOrderInfo(this.order.ParentOrderId);
                this.orderId = this.order.OrderId;
            }
            if (this.hidHasTradePassword != null && HiContext.Current.User.UserId > 0)
            {
                this.hidHasTradePassword.Value = (string.IsNullOrWhiteSpace(HiContext.Current.User.TradePassword) ? "0" : "1");
            }
            else
            {
                this.hidHasTradePassword.Value = "0";
            }
            if ((this.order.OrderStatus == OrderStatus.SellerAlreadySent || this.order.OrderStatus == OrderStatus.Finished) && this.order.ShippingModeId != -2)
            {
                if (!string.IsNullOrEmpty(this.order.ExpressCompanyAbb) && !string.IsNullOrEmpty(this.order.ShipOrderNumber))
                {
                    this.hidExpressStatus.Value = "2";
                }
                else
                {
                    this.hidExpressStatus.Value = "1";
                }
            }
            this.BindOrderInfo();
            if (!masterSettings.OpenMultStore && masterSettings.IsOpenPickeupInStore && this.order.SupplierId == 0 && this.order.ShippingModeId == -2)
            {
                this.litGetGoodsRemark.Text  = masterSettings.PickeupInStoreRemark;
                this.divStoreAddress.Visible = false;
            }
            else
            {
                this.divPickUpRemark.Visible = false;
            }
            if (this.order.CountDownBuyId > 0)
            {
                this.paymenttypeselect.OrderSalesPromotion = Common_AppPaymentTypeSelect.EnumOrderSalesPromotion.CountDownBuy;
            }
            if (!string.IsNullOrEmpty(this.order.InvoiceTitle))
            {
                UserInvoiceDataInfo userInvoiceDataInfo = this.order.InvoiceInfo;
                if (userInvoiceDataInfo == null)
                {
                    userInvoiceDataInfo = new UserInvoiceDataInfo
                    {
                        InvoiceType           = this.order.InvoiceType,
                        InvoiceTaxpayerNumber = this.order.InvoiceTaxpayerNumber,
                        InvoiceTitle          = this.order.InvoiceTitle
                    };
                }
                this.litInvoiceType.SetWhenIsNotNull(EnumDescription.GetEnumDescription((Enum)(object)this.order.InvoiceType, 0));
                this.litRegisterAddress.SetWhenIsNotNull(userInvoiceDataInfo.RegisterAddress.ToNullString());
                this.litRegisterTel.SetWhenIsNotNull(userInvoiceDataInfo.RegisterTel.ToNullString());
                this.litOpenBank.SetWhenIsNotNull(userInvoiceDataInfo.OpenBank.ToNullString());
                this.litBankName.SetWhenIsNotNull(userInvoiceDataInfo.BankAccount.ToNullString());
                this.litReceiveName.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveName.ToNullString());
                if (this.order.InvoiceType != InvoiceType.Enterprise)
                {
                    this.litReceiveMobbile.SetWhenIsNotNull(userInvoiceDataInfo.ReceivePhone.ToNullString());
                    if (this.order.InvoiceType != InvoiceType.VATInvoice)
                    {
                        this.litReceiveEmail.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveEmail.ToNullString());
                    }
                }
                this.litReceiveRegionName.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveRegionName.ToNullString());
                this.litReceiveAddress.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveAddress.ToNullString());
            }
            this.paymenttypeselect.IsFireGroup  = (this.order.FightGroupId > 0);
            this.litFightGroupStatusLabel.Order = this.order;
            this.SetOperatorsStatus();
            this.BindStoreInfo();
            this.rptOrderProducts = (Common_MemberOrderProducts)this.FindControl("Common_MemberOrderProducts");
            this.rptOrderProducts.ItemDataBound += this.rptOrderProducts_ItemDataBound;
            var dataSource = (from i in (from i in this.order.LineItems.Values
                                         select new
            {
                i.SupplierId,
                i.SupplierName
            }).Distinct()
                              orderby i.SupplierId
                              select i).ToList();

            this.rptOrderProducts.DataSource = dataSource;
            this.rptOrderProducts.orderInfo  = this.order;
            this.rptOrderProducts.DataBind();
            IList <OrderGiftInfo> gifts = this.order.Gifts;

            if (gifts.Count() > 0)
            {
                this.rptCartGifts.DataSource = gifts;
                this.rptCartGifts.DataBind();
            }
            else
            {
                this.divGifts.Visible = false;
            }
            this.divProducts.Visible          = (this.order.LineItems.Count > 0);
            this.rptPromotionGifts.DataSource = from a in this.order.Gifts
                                                where a.PromoteType > 0
                                                select a;

            this.rptPromotionGifts.DataBind();
            PageTitle.AddSiteNameTitle("订单详情");
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageTitle title = PageTitle;

        title.TitleText = HTMLHelper.HTMLEncode(string.Format(GetString("board.unsubscription"), (unsubscription.SubscriptionSubject != null) ? ScriptHelper.GetString(unsubscription.SubscriptionSubject.BoardDisplayName) : null));;
    }
Exemple #22
0
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("夺宝记录");
 }
Exemple #23
0
        protected override void AttachChildControls()
        {
            string a = this.Page.Request["action"].ToNullString().ToLower();

            if (a == "register")
            {
                PageTitle.AddSiteNameTitle("登录");
            }
            else
            {
                PageTitle.AddSiteNameTitle("注册");
            }
            this.hidIsAuth              = (HtmlInputHidden)this.FindControl("hid_IsAuth");
            this.hidAuthMsg             = (HtmlInputHidden)this.FindControl("hid_AuthMsg");
            this.hidOpenIdType          = (HtmlInputHidden)this.FindControl("hid_OpenIdType");
            this.hidOpenId              = (HtmlInputHidden)this.FindControl("hid_OpenId");
            this.hidToken               = (HtmlInputHidden)this.FindControl("hid_Token");
            this.hidRealName            = (HtmlInputHidden)this.FindControl("hid_RealName");
            this.hidUserId              = (HtmlInputHidden)this.FindControl("hid_UserId");
            this.hidEmail               = (HtmlInputHidden)this.FindControl("hid_Email");
            this.hidIsNeedValidateEmail = (HiddenField)this.FindControl("hidIsNeedValidateEmail");
            this.hidIsOpenGeetest       = (HiddenField)this.FindControl("hidIsOpenGeetest");
            this.client              = (HtmlInputHidden)this.FindControl("client");
            this.client.Value        = base.ClientType.ToString().ToLower();
            this.smsenable           = (HiddenField)this.FindControl("smsenable");
            this.emailenable         = (HiddenField)this.FindControl("emailenable");
            this.txtUserName         = (HtmlInputText)this.FindControl("txtUserName");
            this.txtRegisterUserName = (HtmlInputText)this.FindControl("txtRegisterUserName");
            this.forgetPassword      = (HtmlAnchor)this.FindControl("forgetPassword");
            this.divRealName         = (HtmlGenericControl)this.FindControl("divRealName");
            this.divBirthday         = (HtmlGenericControl)this.FindControl("divBirthday");
            this.divSex              = (HtmlGenericControl)this.FindControl("divSex");
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            this.hidIsNeedValidateEmail.Value = (masterSettings.IsNeedValidEmail ? "1" : "0");
            this.hidIsOpenGeetest.Value       = (masterSettings.IsOpenGeetest ? "1" : "0");
            this.labNickName  = (Label)this.FindControl("labNickName");
            this.labNickName1 = (Label)this.FindControl("labNickName1");
            this.labNickName2 = (Label)this.FindControl("labNickName2");
            this.userPicture  = (HtmlImage)this.FindControl("userPicture");
            this.hid_QuickLoginIsForceBindingMobbile       = (HtmlInputHidden)this.FindControl("hid_QuickLoginIsForceBindingMobbile");
            this.hid_QuickLoginIsForceBindingMobbile.Value = (masterSettings.QuickLoginIsForceBindingMobbile ? "true" : "false");
            if (masterSettings.RegistExtendInfo.Contains("RealName"))
            {
                this.divRealName.Visible = true;
            }
            if (masterSettings.RegistExtendInfo.Contains("Sex"))
            {
                this.divSex.Visible = true;
            }
            if (masterSettings.RegistExtendInfo.Contains("Birthday"))
            {
                this.divBirthday.Visible = true;
            }
            if (masterSettings.IsSurportEmail && masterSettings.IsSurportPhone && masterSettings.SMSEnabled && !string.IsNullOrEmpty(masterSettings.SMSSettings))
            {
                this.smsenable.Value   = "true";
                this.emailenable.Value = "true";
                this.txtUserName.Attributes.Add("placeholder", "请输入用户名/邮箱/手机");
                this.txtRegisterUserName.Attributes.Add("placeholder", "邮箱/手机");
                this.forgetPassword.Visible = true;
            }
            else if (!masterSettings.IsSurportEmail && (!masterSettings.IsSurportPhone || !masterSettings.SMSEnabled || string.IsNullOrEmpty(masterSettings.SMSSettings)))
            {
                this.smsenable.Value   = "false";
                this.emailenable.Value = "true";
                this.txtUserName.Attributes.Add("placeholder", "请输入用户名/邮箱");
                this.txtRegisterUserName.Attributes.Add("placeholder", "邮箱");
            }
            else if (masterSettings.IsSurportEmail && (!masterSettings.IsSurportPhone || !masterSettings.SMSEnabled || string.IsNullOrEmpty(masterSettings.SMSSettings)))
            {
                this.smsenable.Value   = "false";
                this.emailenable.Value = "true";
                this.txtUserName.Attributes.Add("placeholder", "请输入用户名/邮箱");
                this.txtRegisterUserName.Attributes.Add("placeholder", "邮箱");
            }
            else if (!masterSettings.IsSurportEmail && masterSettings.IsSurportPhone && masterSettings.SMSEnabled && !string.IsNullOrEmpty(masterSettings.SMSSettings))
            {
                this.smsenable.Value   = "true";
                this.emailenable.Value = "false";
                this.txtUserName.Attributes.Add("placeholder", "请输入用户名/手机");
                this.txtRegisterUserName.Attributes.Add("placeholder", "手机");
            }
            this.openIdType = base.GetParameter("HIGW");
            if (!string.IsNullOrEmpty(this.openIdType))
            {
                this.openIdType = this.openIdType.ToLower().Replace("_", ".");
                OpenIdSettingInfo openIdSettings = MemberProcessor.GetOpenIdSettings(this.openIdType);
                if (openIdSettings == null)
                {
                    this.AuthMsg = "没有找到对应的插件配置信息。";
                }
                else
                {
                    this.IsAuth     = true;
                    this.parameters = new NameValueCollection
                    {
                        this.Page.Request.Form,
                        this.Page.Request.QueryString
                    };
                    OpenIdNotify openIdNotify = OpenIdNotify.CreateInstance(this.openIdType, this.parameters);
                    openIdNotify.Authenticated += this.Notify_Authenticated;
                    openIdNotify.Failed        += this.Notify_Failed;
                    try
                    {
                        openIdNotify.Verify(30000, HiCryptographer.Decrypt(openIdSettings.Settings));
                    }
                    catch (Exception ex)
                    {
                        this.IsAuth  = false;
                        this.AuthMsg = ex.Message;
                    }
                    if (this.hidIsAuth != null)
                    {
                        this.hidIsAuth.Value = this.IsAuth.ToString();
                    }
                    if (this.hidAuthMsg != null)
                    {
                        this.hidAuthMsg.Value = this.AuthMsg;
                    }
                    if (this.hidOpenId != null)
                    {
                        this.hidOpenId.Value = this.openId;
                    }
                    if (this.hidOpenIdType != null)
                    {
                        this.hidOpenIdType.Value = this.openIdType;
                    }
                }
            }
        }
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("");
            }
            this.rptProductImages      = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.litItemParams         = (Literal)this.FindControl("litItemParams");
            this.litProdcutName        = (Literal)this.FindControl("litProdcutName");
            this.litProdcutTag         = (Literal)this.FindControl("litProdcutTag");
            this.litSalePrice          = (Literal)this.FindControl("litSalePrice");
            this.litMarketPrice        = (Literal)this.FindControl("litMarketPrice");
            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.litTemplate           = (HtmlInputHidden)this.FindControl("litTemplate");
            ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);

            if (product != null)
            {
                this.litproductid.Value = this.productId.ToString();
                this.litTemplate.Value  = product.FreightTemplateId.ToString();
                if (product == null)
                {
                    base.GotoResourceNotFound("此商品已不存在");
                }
                if (product.SaleStatus != ProductSaleStatus.OnSale)
                {
                    base.GotoResourceNotFound(ErrorType.前台商品下架, "此商品已下架");
                }
                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";
                }
                string productName    = product.ProductName;
                string productTagName = ProductBrowser.GetProductTagName(this.productId);
                if (!string.IsNullOrEmpty(productTagName))
                {
                    this.litProdcutTag.Text = "<div class='y-shopicon'>" + productTagName.Trim() + "</div>";
                    productTagName          = "<span class='producttag'>【" + HttpContext.Current.Server.HtmlEncode(productTagName) + "】</span>";
                }
                this.litProdcutName.Text = productTagName + productName;
                if (product.MinSalePrice != product.MaxSalePrice)
                {
                    this.litSalePrice.Text = product.MinSalePrice.ToString("F2") + "~" + product.MaxSalePrice.ToString("F2");
                }
                else
                {
                    this.litSalePrice.Text = product.MinSalePrice.ToString("F2");
                }
                if (product.MarketPrice.HasValue && (product.MarketPrice > 0M))
                {
                    this.litMarketPrice.Text = "<del class=\"text-muted font-s\">\x00a5" + product.MarketPrice.Value.ToString("F2") + "</del>";
                }
                this.litShortDescription.Text = product.ShortDescription;
                string description = product.Description;
                if (!string.IsNullOrEmpty(description))
                {
                    description = Regex.Replace(description, "<img[^>]*\\bsrc=('|\")([^'\">]*)\\1[^>]*>", "<img alt='" + HttpContext.Current.Server.HtmlEncode(productName) + "' src='$2' />", RegexOptions.IgnoreCase);
                }
                if (this.litDescription != null)
                {
                    this.litDescription.Text = description;
                }
                this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
                this.litStock.Text         = product.Stock.ToString();
                this.skuSelector.ProductId = this.productId;
                if (this.expandAttr != null)
                {
                    this.expandAttr.ProductId = this.productId;
                }
                if (this.linkDescription != null)
                {
                    this.linkDescription.NavigateUrl = "/Vshop/ProductDescription.aspx?productId=" + this.productId;
                }
                int productConsultationsCount = ProductBrowser.GetProductConsultationsCount(this.productId, false);
                this.litConsultationsCount.SetWhenIsNotNull(productConsultationsCount.ToString());
                this.litReviewsCount.SetWhenIsNotNull(ProductBrowser.GetProductReviewsCount(this.productId).ToString());
                MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                bool       flag          = false;
                if (currentMember != null)
                {
                    flag = ProductBrowser.CheckHasCollect(currentMember.UserId, this.productId);
                }
                this.litHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
                ProductBrowser.UpdateVisitCounts(this.productId);
                PageTitle.AddSiteNameTitle(productName);
                PageTitle.AddSiteDescription(product.ShortDescription);
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                string       objStr         = "";
                if (!string.IsNullOrEmpty(masterSettings.GoodsPic))
                {
                    objStr = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.GoodsPic;
                }
                this.litItemParams.Text = Globals.GetReplaceStr(objStr, "|", "|") + "|" + Globals.GetReplaceStr(masterSettings.GoodsName, "|", "|") + "|" + Globals.GetReplaceStr(masterSettings.GoodsDescription, "|", "|") + "$" + Globals.HostPath(HttpContext.Current.Request.Url).Replace("|", "|") + Globals.GetReplaceStr(product.ImageUrl1, "|", "|") + "|" + Globals.GetReplaceStr(product.ProductName, "|", "|") + "|" + Globals.GetReplaceStr(product.ShortDescription, "|", "|") + "|" + HttpContext.Current.Request.Url.ToString().Replace("|", "|");
            }
            else
            {
                HttpContext.Current.Response.Redirect("/default.aspx");
                HttpContext.Current.Response.End();
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageTitle title = PageTitle;

        passwordPromptElem.TitleText = GetString("chat.password");

        // Script references insertion
        ScriptHelper.RegisterJQuery(Page);
        ChatScriptHelper.RegisterChatNotificationManager(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSScripts/jquery/jquery-resize.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/Scripts/ChatRoomWindow.js");

        // Get information about chat room this window has been opened for.
        int roomID = QueryHelper.GetInteger("windowroomid", 0);

        try
        {
            ChatUserHelper.VerifyChatUserHasJoinRoomRights(roomID);
        }
        catch (ChatServiceException)
        {
            DisplayError();

            return;
        }

        ChatRoomInfo room = ChatRoomInfoProvider.GetChatRoomInfo(roomID);

        if (room == null)
        {
            DisplayError();

            return;
        }

        string pnlChatRoomWindowCssClass = " ChatPopupWindow";

        // Disable irrelevant controls
        if (room.ChatRoomIsOneToOne)
        {
            ChatMessageSendElem.HideUserPicker();
            pnlChatRoomWindowCssClass += " IsOneToOne";

            // Set appropriate window title
            string pageTitle = GetString(room.ChatRoomIsSupport ? "chat.title.support" : "chat.title.privateconversation");
            Page.Header.Title = title.TitleText = pageTitle;
        }
        else
        {
            Page.Header.Title = title.TitleText = room.ChatRoomDisplayName;
        }

        SetWebpartsUp();

        if (room.ChatRoomIsSupport)
        {
            pnlChatRoomWindowCssClass += " IsSupport";
            if (ChatSettingsProvider.IsSupportMailEnabledAndValid)
            {
                pnlSupportSendMail.Visible     = true;
                hplSupportSendMail.NavigateUrl = ChatSettingsProvider.SupportMailDialogURL + "?roomid=" + roomID;
                hplSupportSendMail.Target      = "_blank";
            }
        }
        pnlChatRoomWindow.CssClass += pnlChatRoomWindowCssClass;
        string json = JsonConvert.SerializeObject(
            new
        {
            roomID   = roomID,
            password = room.HasPassword,
            pnlChatRoomPasswordPrompt       = '#' + pnlChatRoomPasswordPrompt.ClientID,
            txtChatRoomPasswordPromptInput  = '#' + txtChatRoomPasswordPromptInput.ClientID,
            btnChatRoomPasswordPromptSubmit = '#' + btnChatRoomPasswordPromptSubmit.ClientID,
            isOneToOne                 = room.IsWhisperRoom,
            isCustomerSupport          = room.ChatRoomIsSupport,
            hplSupportSendMailClientID = room.ChatRoomIsSupport ? '#' + hplSupportSendMail.ClientID : "",
            pnlPasswordPromptError     = '#' + pnlChatRoomsPromptPasswordError.ClientID,
            pnlChatRoomWindow          = '#' + pnlChatRoomWindow.ClientID,
            ChatRoomMessagesClientID   = ChatRoomMessagesElem.ClientID,
            btnClose = "#" + btnCloseWindow.ClientID,
            notificationManagerOptions = new
            {
                eventName   = "newmessage",
                soundFile   = ChatSettingsProvider.EnableSoundLiveChat ? ResolveUrl("~/CMSModules/Chat/CMSPages/Sound/Chat_message.mp3") : String.Empty,
                notifyTitle = GetString("chat.general.newmessages")
            }
        },
            new JsonSerializerSettings {
            StringEscapeHandling = StringEscapeHandling.EscapeHtml
        }
            );


        string startupScript = String.Format("ChatRoomWindow({0});", json);

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatRoomWindow_" + ClientID, startupScript, true);
    }
Exemple #26
0
        protected override void AttachChildControls()
        {
            int num;
            int num2;

            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("");
            }
            this.litProdcutName      = (Literal)this.FindControl("litProdcutName");
            this.litSalePrice        = (Literal)this.FindControl("litSalePrice");
            this.litShortDescription = (Literal)this.FindControl("litShortDescription");
            this.litSoldCount        = (Literal)this.FindControl("litSoldCount");
            this.productImage        = (HtmlImage)this.FindControl("productImage");
            this.productLink         = (HyperLink)this.FindControl("productLink");
            this.txtTotal            = (HtmlInputHidden)this.FindControl("txtTotal");
            this.litPID     = (Literal)this.FindControl("litPID");
            this.litSkuId   = (Literal)this.FindControl("litSkuId");
            this.litItemid  = (Literal)this.FindControl("litItemid");
            this.litOrderId = (Literal)this.FindControl("litOrderId");
            string orderID = this.Page.Request["OrderId"];
            string str2    = "";

            this.litSkuId.Text  = Globals.RequestQueryStr("skuid");
            this.litItemid.Text = Globals.RequestQueryNum("itemid").ToString();
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (!string.IsNullOrEmpty(orderID))
            {
                this.litOrderId.Text = orderID;
                OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(orderID);
                if ((orderInfo != null) && (orderInfo.ReferralUserId > 0))
                {
                    str2 = "&&ReferralId=" + orderInfo.ReferralUserId;
                }
            }
            else
            {
                LineItemInfo latestOrderItemByProductIDAndUserID = ProductBrowser.GetLatestOrderItemByProductIDAndUserID(this.productId, currentMember.UserId);
                if (latestOrderItemByProductIDAndUserID != null)
                {
                    orderID = latestOrderItemByProductIDAndUserID.OrderID;
                    this.Page.Response.Redirect(string.Concat(new object[] { "ProductReview.aspx?OrderId=", orderID, "&ProductId=", latestOrderItemByProductIDAndUserID.ProductId, "&skuid=", latestOrderItemByProductIDAndUserID.SkuId, "&itemid=", latestOrderItemByProductIDAndUserID.ID }));
                    this.Page.Response.End();
                }
                if (Globals.GetCurrentDistributorId() > 0)
                {
                    str2 = "&&ReferralId=" + Globals.GetCurrentDistributorId().ToString();
                }
            }
            ProductInfo product = ProductBrowser.GetProduct(currentMember, this.productId);

            this.litProdcutName.SetWhenIsNotNull(product.ProductName);
            this.litSalePrice.SetWhenIsNotNull(product.MinSalePrice.ToString("F2"));
            this.litShortDescription.SetWhenIsNotNull(product.ShortDescription);
            this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
            this.productImage.Src        = product.ThumbnailUrl180;
            this.litPID.Text             = this.productId.ToString();
            this.productLink.NavigateUrl = "/ProductDetails.aspx?ProductId=" + product.ProductId + str2;
            if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
            {
                num = 1;
            }
            if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
            {
                num2 = 20;
            }
            ProductReviewQuery reviewQuery = new ProductReviewQuery {
                productId = this.productId,
                IsCount   = true,
                PageIndex = num,
                PageSize  = num2,
                SortBy    = "ReviewId",
                SortOrder = SortAction.Desc
            };

            this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            DbQueryResult productReviews = ProductBrowser.GetProductReviews(reviewQuery);

            this.rptProducts.DataSource = productReviews.Data;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(productReviews.TotalRecords.ToString());
            PageTitle.AddSiteNameTitle("商品评价");
        }
Exemple #27
0
        protected override void AttachChildControls()
        {
            HttpCookie cookie2;

            this.rptCategories                = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.rptProducts                  = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptProducts.ItemDataBound   += new RepeaterItemEventHandler(this.rptProducts_ItemDataBound);
            this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound);
            this.img            = (HtmlImage)this.FindControl("imgDefaultBg");
            this.pager          = (Pager)this.FindControl("pager");
            this.litstorename   = (Literal)this.FindControl("litstorename");
            this.litdescription = (Literal)this.FindControl("litdescription");
            this.litattention   = (Literal)this.FindControl("litattention");
            this.imglogo        = (HiImage)this.FindControl("imglogo");
            this.litImgae       = (Literal)this.FindControl("litImgae");
            this.litItemParams  = (Literal)this.FindControl("litItemParams");
            if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"]))
            {
                HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (!((cookie == null) || string.IsNullOrEmpty(cookie.Value)))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + cookie.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 (base.referralId <= 0)
            {
                cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (!((cookie2 == null) || string.IsNullOrEmpty(cookie2.Value)))
                {
                    base.referralId = int.Parse(cookie2.Value);
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            else
            {
                cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (((cookie2 != null) && !string.IsNullOrEmpty(cookie2.Value)) && (this.referralId.ToString() != cookie2.Value))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            IList <BannerInfo> allBanners = new List <BannerInfo>();

            allBanners = VshopBrowser.GetAllBanners();
            foreach (BannerInfo info in allBanners)
            {
                TplCfgInfo info2 = new NavigateInfo {
                    LocationType = info.LocationType,
                    Url          = info.Url
                };
                string loctionUrl = "javascript:";
                if (!string.IsNullOrEmpty(info.Url))
                {
                    loctionUrl = info2.LoctionUrl;
                }
                string text = this.litImgae.Text;
                this.litImgae.Text = text + "<a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a>";
            }
            if (allBanners.Count == 0)
            {
                this.litImgae.Text = "<a id=\"ahref\"  href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\"  /></a>";
            }
            DistributorsInfo userIdDistributors = new DistributorsInfo();

            userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId);
            if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
            {
                PageTitle.AddSiteNameTitle(userIdDistributors.StoreName);
                this.litdescription.Text = userIdDistributors.StoreDescription;
                this.litstorename.Text   = userIdDistributors.StoreName;
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                {
                    this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
                }
                if (!string.IsNullOrEmpty(userIdDistributors.BackImage))
                {
                    this.litImgae.Text = "";
                    foreach (string str2 in userIdDistributors.BackImage.Split(new char[] { '|' }))
                    {
                        if (!string.IsNullOrEmpty(str2))
                        {
                            this.litImgae.Text = this.litImgae.Text + "<a ><img src=\"" + str2 + "\" title=\"\"  /></a>";
                        }
                    }
                }
            }
            this.dtpromotion = ProductBrowser.GetAllFull();
            if (this.rptProducts != null)
            {
                ProductQuery query = new ProductQuery {
                    PageSize  = this.pager.PageSize,
                    PageIndex = this.pager.PageIndex,
                    SortBy    = "DisplaySequence",
                    SortOrder = SortAction.Desc
                };
                DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query);
                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;
            }
            if ((this.Page.Request.UserAgent.ToLower().Contains("alipay") && !string.IsNullOrEmpty(masterSettings.AliPayFuwuGuidePageSet)) && !string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.AliPayFuwuGuidePageSet;
            }
            string str4 = "";

            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string str5 = "";
            string str6 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName;

            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                str5 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0];
            }
            this.litItemParams.Text = str4 + "|" + masterSettings.ShopHomeName + "|" + masterSettings.ShopHomeDescription + "$";
            this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str5, "|好店推荐之", str6, "商城|一个购物赚钱的好去处|", HttpContext.Current.Request.Url });
        }
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["bargainId"], out this.bargainId))
            {
                base.GotoResourceNotFound("");
            }
            int num = int.Parse(this.Page.Request.QueryString["bargainDetialId"]);

            this.litProdcutName              = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litShortDescription         = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litSalePrice                = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litFloorPrice               = (System.Web.UI.WebControls.Literal) this.FindControl("litFloorPrice");
            this.litPurchaseNumber           = (System.Web.UI.WebControls.Literal) this.FindControl("litPurchaseNumber");
            this.litParticipantNumber        = (System.Web.UI.WebControls.Literal) this.FindControl("litParticipantNumber");
            this.litProductDesc              = (System.Web.UI.WebControls.Literal) this.FindControl("litProductDesc");
            this.litProductConsultationTotal = (System.Web.UI.WebControls.Literal) this.FindControl("litProductConsultationTotal");
            this.litProductCommentTotal      = (System.Web.UI.WebControls.Literal) this.FindControl("litProductCommentTotal");
            this.litStock           = (System.Web.UI.WebControls.Literal) this.FindControl("litStock");
            this.litPurcharseNum    = (System.Web.UI.WebControls.Literal) this.FindControl("litPurcharseNum");
            this.hiddHasCollected   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddHasCollected");
            this.hiddProductId      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddProductId");
            this.hiddEndDate        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddEndDate");
            this.hiddPurchaseNumber = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddPurchaseNumber");
            this.rptProductImages   = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.skuSelector        = (Common_SKUSelector)this.FindControl("skuSelector");
            this.hideTitle          = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideTitle");
            this.hideImgUrl         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideImgUrl");
            this.hideDesc           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideDesc");
            MemberInfo        currentMember     = MemberProcessor.GetCurrentMember();
            bool              flag              = false;
            BargainInfo       bargainInfo       = BargainHelper.GetBargainInfo(this.bargainId);
            BargainDetialInfo bargainDetialInfo = BargainHelper.GetBargainDetialInfo(num);

            if (bargainInfo != null)
            {
                PageTitle.AddSiteNameTitle(bargainInfo.Title);
                this.litFloorPrice.Text        = bargainInfo.FloorPrice.ToString("F2");
                this.litPurchaseNumber.Text    = (bargainInfo.ActivityStock - bargainInfo.TranNumber).ToString();
                this.litParticipantNumber.Text = BargainHelper.GetHelpBargainDetialCount(num).ToString();
                this.hiddEndDate.Value         = bargainInfo.EndDate.ToString("yyyy:MM:dd:HH:mm:ss");
                this.hiddPurchaseNumber.Value  = bargainInfo.PurchaseNumber.ToString();
                this.litStock.Text             = bargainInfo.PurchaseNumber.ToString();
                this.litPurcharseNum.Text      = bargainInfo.PurchaseNumber.ToString();
                this.hideTitle.Value           = bargainInfo.Title;
                this.hideDesc.Value            = bargainInfo.Remarks.Replace("\n", " ").Replace("\r", "");
                string     activityCover = bargainInfo.ActivityCover;
                string     str           = string.Empty;
                System.Uri url           = System.Web.HttpContext.Current.Request.Url;
                if (!activityCover.StartsWith("http"))
                {
                    str = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
                }
                if (bargainDetialInfo != null)
                {
                    this.litSalePrice.Text = bargainDetialInfo.Price.ToString("F2");
                }
                if (bargainInfo.ProductId > 0)
                {
                    this.skuSelector.ProductId = bargainInfo.ProductId;
                    if (currentMember != null)
                    {
                        flag = ProductBrowser.CheckHasCollect(currentMember.UserId, bargainInfo.ProductId);
                    }
                    this.hiddHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
                    ProductInfo productDetails = ProductHelper.GetProductDetails(bargainInfo.ProductId);
                    this.hiddProductId.Value      = bargainInfo.ProductId.ToString();
                    this.litProdcutName.Text      = productDetails.ProductName;
                    this.litShortDescription.Text = bargainInfo.Remarks;
                    this.hideImgUrl.Value         = (string.IsNullOrEmpty(productDetails.ThumbnailUrl60) ? (str + activityCover) : (str + productDetails.ThumbnailUrl60));
                    this.litProductDesc.Text      = productDetails.Description;
                    if (this.rptProductImages != null)
                    {
                        string       locationUrl = "javascript:;";
                        SlideImage[] source      = new SlideImage[]
                        {
                            new SlideImage(productDetails.ImageUrl1, locationUrl),
                            new SlideImage(productDetails.ImageUrl2, locationUrl),
                            new SlideImage(productDetails.ImageUrl3, locationUrl),
                            new SlideImage(productDetails.ImageUrl4, locationUrl),
                            new SlideImage(productDetails.ImageUrl5, locationUrl)
                        };
                        this.rptProductImages.DataSource = from item in source
                                                           where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                           select item;
                        this.rptProductImages.DataBind();
                    }
                    int num2 = ProductBrowser.GetProductConsultationsCount(bargainInfo.ProductId, false);
                    this.litProductConsultationTotal.SetWhenIsNotNull(num2.ToString());
                    num2 = ProductBrowser.GetProductReviewsCount(bargainInfo.ProductId);
                    this.litProductCommentTotal.SetWhenIsNotNull(num2.ToString());
                }
            }
        }
Exemple #29
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("关于海美生活");

            WAPHeadName.AddHeadName("关于海美生活");
        }
Exemple #30
0
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     Master.HTMLTitle       = PageTitle.GetMWallTitle(ViewingMember);
     Master.MetaDescription = "Live mobile video broadcasting networking";
     Master.MetaKeywords    = "Live mobile video, live video, mobile video, Live, live, mobile phone, mobile, phone,social, social networking";
 }
Exemple #31
0
 protected override void AttachChildControls()
 {
     this.orderId             = this.Page.Request.QueryString["orderId"];
     this.litOrderId          = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderId");
     this.lbltotalPrice       = (FormatedMoneyLabel)this.FindControl("lbltotalPrice");
     this.litAddDate          = (FormatedTimeLabel)this.FindControl("litAddDate");
     this.lblOrderStatus      = (OrderStatusLabel)this.FindControl("lblOrderStatus");
     this.litCloseReason      = (System.Web.UI.WebControls.Literal) this.FindControl("litCloseReason");
     this.litRemark           = (System.Web.UI.WebControls.Literal) this.FindControl("litRemark");
     this.litShipTo           = (System.Web.UI.WebControls.Literal) this.FindControl("litShipTo");
     this.litRegion           = (System.Web.UI.WebControls.Literal) this.FindControl("litRegion");
     this.litAddress          = (System.Web.UI.WebControls.Literal) this.FindControl("litAddress");
     this.litZipcode          = (System.Web.UI.WebControls.Literal) this.FindControl("litZipcode");
     this.litEmail            = (System.Web.UI.WebControls.Literal) this.FindControl("litEmail");
     this.litPhone            = (System.Web.UI.WebControls.Literal) this.FindControl("litPhone");
     this.litTellPhone        = (System.Web.UI.WebControls.Literal) this.FindControl("litTellPhone");
     this.litShipToDate       = (System.Web.UI.WebControls.Literal) this.FindControl("litShipToDate");
     this.litUserName         = (System.Web.UI.WebControls.Literal) this.FindControl("litUserName");
     this.litUserAddress      = (System.Web.UI.WebControls.Literal) this.FindControl("litUserAddress");
     this.litUserEmail        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserEmail");
     this.litUserPhone        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserPhone");
     this.litUserTellPhone    = (System.Web.UI.WebControls.Literal) this.FindControl("litUserTellPhone");
     this.litUserQQ           = (System.Web.UI.WebControls.Literal) this.FindControl("litUserQQ");
     this.litUserMSN          = (System.Web.UI.WebControls.Literal) this.FindControl("litUserMSN");
     this.litPaymentType      = (System.Web.UI.WebControls.Literal) this.FindControl("litPaymentType");
     this.litModeName         = (System.Web.UI.WebControls.Literal) this.FindControl("litModeName");
     this.plOrderSended       = (System.Web.UI.WebControls.Panel) this.FindControl("plOrderSended");
     this.litRealModeName     = (System.Web.UI.WebControls.Literal) this.FindControl("litRealModeName");
     this.litShippNumber      = (System.Web.UI.WebControls.Literal) this.FindControl("litShippNumber");
     this.litDiscountName     = (System.Web.UI.WebControls.HyperLink) this.FindControl("litDiscountName");
     this.lblAdjustedDiscount = (FormatedMoneyLabel)this.FindControl("lblAdjustedDiscount");
     this.litFreeName         = (System.Web.UI.WebControls.HyperLink) this.FindControl("litFreeName");
     this.plExpress           = (System.Web.UI.WebControls.Panel) this.FindControl("plExpress");
     this.power                      = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("power");
     this.orderItems                 = (Common_OrderManage_OrderItems)this.FindControl("Common_OrderManage_OrderItems");
     this.grdOrderGift               = (System.Web.UI.WebControls.GridView) this.FindControl("grdOrderGift");
     this.plOrderGift                = (System.Web.UI.WebControls.Panel) this.FindControl("plOrderGift");
     this.lblCartMoney               = (FormatedMoneyLabel)this.FindControl("lblCartMoney");
     this.lblBundlingPrice           = (System.Web.UI.WebControls.Literal) this.FindControl("lblBundlingPrice");
     this.litPoints                  = (System.Web.UI.WebControls.Literal) this.FindControl("litPoints");
     this.litSentTimesPointPromotion = (System.Web.UI.WebControls.HyperLink) this.FindControl("litSentTimesPointPromotion");
     this.litWeight                  = (System.Web.UI.WebControls.Literal) this.FindControl("litWeight");
     this.litFree                    = (System.Web.UI.WebControls.Literal) this.FindControl("litFree");
     this.lblFreight                 = (FormatedMoneyLabel)this.FindControl("lblFreight");
     this.lblPayCharge               = (FormatedMoneyLabel)this.FindControl("lblPayCharge");
     this.litCouponValue             = (System.Web.UI.WebControls.Literal) this.FindControl("litCouponValue");
     this.lblDiscount                = (FormatedMoneyLabel)this.FindControl("lblDiscount");
     this.litTotalPrice              = (FormatedMoneyLabel)this.FindControl("litTotalPrice");
     this.lblRefundTotal             = (FormatedMoneyLabel)this.FindControl("lblRefundTotal");
     this.lbRefundMoney              = (System.Web.UI.WebControls.Label) this.FindControl("lbRefundMoney");
     this.plRefund                   = (System.Web.UI.WebControls.Panel) this.FindControl("plRefund");
     this.lblTotalBalance            = (FormatedMoneyLabel)this.FindControl("lblTotalBalance");
     this.litRefundOrderRemark       = (System.Web.UI.WebControls.Literal) this.FindControl("litRefundOrderRemark");
     this.litTax                     = (FormatedMoneyLabel)this.FindControl("litTax");
     this.litInvoiceTitle            = (System.Web.UI.WebControls.Literal) this.FindControl("litInvoiceTitle");
     PageTitle.AddTitle("订单详细页", HiContext.Current.Context);
     if (!this.Page.IsPostBack)
     {
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         if (orderInfo == null || orderInfo.UserId != HiContext.Current.User.UserId)
         {
             this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该订单不存在或者不属于当前用户的订单"));
         }
         else
         {
             this.BindOrderBase(orderInfo);
             this.BindOrderAddress(orderInfo);
             this.BindOrderItems(orderInfo);
             this.BindOrderRefund(orderInfo);
             this.BindOrderReturn(orderInfo);
         }
     }
 }
Exemple #32
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["voteId"], out this.voteId))
            {
                base.GotoResourceNotFound("");
            }
            //设置微信流量其中标头
            VoteInfo voteById = StoreHelper.GetVoteById(this.voteId);

            if (voteById != null && voteById.VoteId > 0)
            {
                PageTitle.AddSiteNameTitle(voteById.VoteName + "结果");
            }

            this.litVoteResult = (Literal)this.FindControl("litVoteResult");
            System.Text.StringBuilder builder = new System.Text.StringBuilder();

            //加载配置模块
            string selectSql = string.Format("Select * From Yihui_Votes_Model Where VoteId={0} order by ModelSN;", voteId);

            selectSql += string.Format("Select * From YiHui_HomePage_Model where PageID in (select VMID from Yihui_Votes_Model where VoteId = {0});", voteId);
            selectSql += string.Format("Select * From YIHui_Votes_Model_Detail where VMID in (select VMID from Yihui_Votes_Model where VoteId = {0}) order by VMID,Scode;", voteId);
            selectSql += string.Format("Select * From YiHui_Votes_Model_Result where VoteId = {0}", voteId);
            DataSet ds = DataBaseHelper.GetDataSet(selectSql);

            DataTable dtvm        = ds.Tables[0];
            DataTable dthpm_Model = ds.Tables[1];
            DataTable dtvm_detail = ds.Tables[2];
            DataTable dtvm_Result = ds.Tables[3];

            int i = 0;

            foreach (DataRow dr in dtvm.Rows)
            {
                if (dr["ModelCode"].ToString() == "XuanXiang")
                {
                    i++;
                    DataRow[] drs = dthpm_Model.Select(string.Format("PageID = '{0}'", dr["VMID"].ToString()), "", DataViewRowState.CurrentRows);
                    if (drs.Length > 0)
                    {
                        string[] strValues = drs[0]["PMContents"].ToString().Split('♦');
                        if (strValues.Length == 3)
                        {
                            builder.AppendFormat("<div id='vote-result{0}' i='{0}' class='vote-result'>", i);
                            builder.Append("<div class='vote-result-con'>");
                            builder.AppendFormat("<div class='vote-result-con-title'><h3>{0}</h3><h4>{1}</h4></div>", strValues[0], strValues[1]);
                            builder.Append("<ul>");
                            DataRow[] drsdetail = dtvm_detail.Select(string.Format("VMID = '{0}'", dr["VMID"].ToString()), "Scode", DataViewRowState.CurrentRows);
                            foreach (DataRow drxm in drsdetail)
                            {
                                DataRow[] drSumResult = dtvm_Result.Select(string.Format("PMID = '{0}'", drs[0]["PMID"].ToString()), "", DataViewRowState.CurrentRows);//当前投票项参与总人数
                                DataRow[] drResult    = dtvm_Result.Select(string.Format("PMID = '{0}' and Result like '%{1},%'", drs[0]["PMID"].ToString(), drxm["Value"].ToString()), "", DataViewRowState.CurrentRows);
                                string    strBl       = "0%";
                                if (drSumResult.Length > 0)
                                {
                                    double dbBl = Convert.ToDouble(drResult.Length) / Convert.ToDouble(drSumResult.Length);
                                    strBl = string.Format("{0:0.00%}", dbBl);
                                }
                                builder.AppendFormat("<li n='{0}'>{1}<div class='progress'><p style='width:{4}'></p><span style='left:{4}'>{4}</span></div></li>", drxm["Scode"].ToString(), drxm["Name"].ToString(), drResult.Length, drSumResult.Length, strBl);
                            }
                            builder.Append("</ul>");
                            builder.Append("</div>");
                            builder.Append("</div>");
                        }
                    }
                }
            }
            this.litVoteResult.Text = builder.ToString();
        }
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("");
            }
            this.rptProductImages    = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.litProdcutName      = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litSalePrice        = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litMarketPrice      = (System.Web.UI.WebControls.Literal) this.FindControl("litMarketPrice");
            this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litDescription      = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
            this.litTaxRate          = (System.Web.UI.WebControls.Literal) this.FindControl("litTaxRate");
            this.litShipping         = (System.Web.UI.WebControls.Literal) this.FindControl("litShipping");
            this.litStock            = (System.Web.UI.WebControls.Literal) this.FindControl("litStock");
            this.litBuyCardinality   = (System.Web.UI.WebControls.Literal) this.FindControl("litBuyCardinality");
            this.litSupplier         = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplier");
            this.lblsmalltitle       = (System.Web.UI.WebControls.Literal) this.FindControl("lblsmalltitle");
            this.litDiscrunt         = (System.Web.UI.WebControls.Literal) this.FindControl("litDiscrunt");
            this.litpropricemsg      = (System.Web.UI.WebControls.Literal) this.FindControl("litpropricemsg");
            this.litProPromration    = (System.Web.UI.WebControls.Literal) this.FindControl("litProPromration");
            this.litOrderPromration  = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderPromration");
            this.litFreeShip         = (System.Web.UI.WebControls.Literal) this.FindControl("litFreeShip");

            this.skuSelector           = (Common_SKUSelector)this.FindControl("skuSelector");
            this.linkDescription       = (System.Web.UI.WebControls.HyperLink) this.FindControl("linkDescription");
            this.expandAttr            = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
            this.litSoldCount          = (System.Web.UI.WebControls.Literal) this.FindControl("litSoldCount");
            this.litConsultationsCount = (System.Web.UI.WebControls.Literal) this.FindControl("litConsultationsCount");
            this.litReviewsCount       = (System.Web.UI.WebControls.Literal) this.FindControl("litReviewsCount");
            this.litHasCollected       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litHasCollected");
            this.hidden_skus           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus");
            this.hidden_BuyCardinality = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_BuyCardinality");
            this.lbUserProductRefer    = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.promote   = (ProductPromote)this.FindControl("ProductPromote");
            this.litCnArea = (System.Web.UI.WebControls.Literal) this.FindControl("litCnArea");
            this.imgIcon   = (HiImage)this.FindControl("imgIcon");
            //this.imgSupplierIcon = (HiImage)this.FindControl("imgSupplierIcon");

            ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, null, null);

            if (productBrowseInfo == null)
            {
                base.GotoResourceNotFound("此商品已不存在");
            }

            if (productBrowseInfo.Product == null)
            {
                base.GotoResourceNotFound("此商品已不存在");
            }
            if (productBrowseInfo.Product.SaleStatus != ProductSaleStatus.OnSale)
            {
                base.GotoResourceNotFound("此商品已下架");
            }
            if (!productBrowseInfo.Product.IsApproved)
            {
                base.GotoResourceNotFound("此商品未审核");
            }


            System.Collections.IEnumerable value =
                from item in productBrowseInfo.Product.Skus
                select item.Value;

            if (this.hidden_skus != null)
            {
                this.hidden_skus.Value = JsonConvert.SerializeObject(value);
            }


            if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
            {
                string text = System.Web.HttpContext.Current.Request.Url.ToString();
                if (text.IndexOf("?") > -1)
                {
                    text = text + "&ReferralUserId=" + HiContext.Current.User.UserId;
                }
                else
                {
                    text = text + "?ReferralUserId=" + HiContext.Current.User.UserId;
                }
                base.RegisterShareScript(productBrowseInfo.Product.ImageUrl4, text, productBrowseInfo.Product.ShortDescription, productBrowseInfo.Product.ProductName);
            }
            if (this.lbUserProductRefer != null)
            {
                this.lbUserProductRefer.product = productBrowseInfo.Product;
            }

            ImportSourceTypeInfo imSourceType = ProductBrowser.GetProductImportSourceType(this.productId);

            if (this.litCnArea != null && imSourceType != null)
            {
                this.litCnArea.Text = imSourceType.CnArea;
            }

            if (this.imgIcon != null && imSourceType != null)
            {
                this.imgIcon.ImageUrl = imSourceType.Icon;
            }

            if (this.rptProductImages != null)
            {
                string       locationUrl = "javascript:;";
                SlideImage[] source      = new SlideImage[]
                {
                    new SlideImage(productBrowseInfo.Product.ImageUrl1, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl2, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl3, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl4, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl5, locationUrl),
                };
                this.rptProductImages.DataSource =
                    from item in source
                    where !string.IsNullOrWhiteSpace(item.ImageUrl)
                    select item;
                this.rptProductImages.DataBind();
            }
            this.litProdcutName.Text = productBrowseInfo.Product.ProductName;
            this.litSalePrice.Text   = productBrowseInfo.Product.MinSalePrice.ToString("F2");
            if (productBrowseInfo.Product.MarketPrice.HasValue)
            {
                this.litMarketPrice.SetWhenIsNotNull(productBrowseInfo.Product.MarketPrice.GetValueOrDefault(0m).ToString("F2"));
            }
            this.litShortDescription.Text = productBrowseInfo.Product.ShortDescription;
            if (this.litDescription != null)
            {
                System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("<script[^>]*?>.*?</script>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.MobblieDescription))
                {
                    this.litDescription.Text = regex.Replace(productBrowseInfo.Product.MobblieDescription, "");
                }
                else
                {
                    if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.Description))
                    {
                        this.litDescription.Text = regex.Replace(productBrowseInfo.Product.Description, "");
                    }
                }
            }
            this.litSoldCount.SetWhenIsNotNull(productBrowseInfo.Product.ShowSaleCounts.ToString());
            this.litStock.Text = productBrowseInfo.Product.Stock.ToString();
            //this.litTaxRate.Text = (productBrowseInfo.Product.TaxRate * 100).ToString("0");

            if (this.litTaxRate != null)
            {
                this.litTaxRate.Text = productBrowseInfo.Product.GetExtendTaxRate();
            }

            if (productBrowseInfo.Product.BuyCardinality > 1)
            {
                this.litBuyCardinality.Text = "起购数:" + productBrowseInfo.Product.BuyCardinality;
            }
            else
            {
                this.litBuyCardinality.Visible = false;
            }
            this.hidden_BuyCardinality.Value = productBrowseInfo.Product.BuyCardinality.ToString();

            //运费模版
            ShippingModeInfo shippingMode = ShoppingProcessor.GetShippingMode(Int32.Parse(productBrowseInfo.Product.TemplateId != null ? productBrowseInfo.Product.TemplateId.ToString() : "0"));

            this.litShipping.Text = shippingMode != null ? shippingMode.TemplateName : "未设置";

            this.skuSelector.ProductId = this.productId;
            if (this.expandAttr != null)
            {
                this.expandAttr.ProductId = this.productId;
            }
            if (this.linkDescription != null)
            {
                this.linkDescription.NavigateUrl = "/Vshop/ProductDescription.aspx?productId=" + this.productId;
            }
            this.litConsultationsCount.SetWhenIsNotNull(productBrowseInfo.ConsultationCount.ToString());
            this.litReviewsCount.SetWhenIsNotNull(productBrowseInfo.ReviewCount.ToString());
            Member member     = HiContext.Current.User as Member;
            int    favoriteId = 0;

            if (member != null)
            {
                favoriteId = ProductBrowser.GetFavoriteId(member.UserId, this.productId);
            }
            this.litHasCollected.SetWhenIsNotNull(favoriteId.ToString());

            if (this.promote != null)
            {
                this.promote.ProductId = this.productId;
            }
            PageTitle.AddSiteNameTitle(productBrowseInfo.Product.ProductName);

            //this.litSupplierName.Text = productBrowseInfo.SupplierName;

            //if (this.imgSupplierIcon != null && productBrowseInfo.SupplierImageUrl != null)
            //{
            //    this.imgSupplierIcon.ImageUrl = productBrowseInfo.SupplierImageUrl;
            //}

            if (productBrowseInfo.Product.SupplierId == null || productBrowseInfo.Product.SupplierId == 0)
            {
                this.litSupplier.Text = "";
            }
            else
            {
                this.litSupplier.Text = "<a class=\"shop-link fix\" href=\"/vshop/SupProductList.aspx?SupplierId=" + productBrowseInfo.Product.SupplierId + "\"><span>进入店铺</span><img src=\"" + productBrowseInfo.SupplierLogo + "\"/>" + productBrowseInfo.SupplierName + "</a>";
            }

            this.lblsmalltitle.Text = productBrowseInfo.Product.ProductTitle;

            //this.litDiscrunt = (System.Web.UI.WebControls.Literal)this.FindControl("litDiscrunt");
            //this.litpropricemsg = (System.Web.UI.WebControls.Literal)this.FindControl("litpropricemsg");
            //显示促销信息
            if (productBrowseInfo.Product.IsPromotion)
            {
                this.litpropricemsg.Text = "<span class=\"pro-pricemsg\">促销价</span>";
            }

            decimal tempMinSalePrice = productBrowseInfo.Product.MinSalePrice;                      //折扣价
            decimal tempMarketPrice  = productBrowseInfo.Product.MarketPrice.GetValueOrDefault(0m); //会员价
            decimal tempDiscrunt     = 1M;

            if (tempMarketPrice > 0)
            {
                tempDiscrunt = (tempMinSalePrice / tempMarketPrice) * 10;
            }
            //显示折扣信息
            if (productBrowseInfo.Product.IsDisplayDiscount)
            {
                this.litDiscrunt.Text = "<span class=\"pro-discrunt\">" + tempDiscrunt.ToString("F2") + "折</span>";
            }


            //PromotionInfo promotionInfo;
            List <OrderPromotionItem>   orderpromotionlist   = new List <OrderPromotionItem>();
            List <ProductPromotionItem> productpromotionlist = new List <ProductPromotionItem>();

            if (member != null)
            {
                //promotionInfo = ProductBrowser.GetProductPromotionInfo(member, productId);
                DataTable dtorderpromotion = ProductBrowser.GetOrderPromotionInfo(member);
                if (dtorderpromotion != null)
                {
                    OrderPromotionItem item = null;
                    foreach (DataRow row in dtorderpromotion.Rows)
                    {
                        item = new OrderPromotionItem();
                        if (row["Name"] != DBNull.Value)
                        {
                            item.Name = (string)row["Name"];
                        }
                        if (row["PromoteType"] != DBNull.Value)
                        {
                            item.PromoteType = (int)row["PromoteType"];
                        }
                        orderpromotionlist.Add(item);
                    }
                }

                DataTable dtproductpromotion = ProductBrowser.GetProductPromotionList(member, productId);
                if (dtproductpromotion != null)
                {
                    ProductPromotionItem item = null;
                    foreach (DataRow row in dtproductpromotion.Rows)
                    {
                        item = new ProductPromotionItem();
                        if (row["Name"] != DBNull.Value)
                        {
                            item.Name = (string)row["Name"];
                        }
                        if (row["PromoteType"] != DBNull.Value)
                        {
                            item.PromoteType = (int)row["PromoteType"];
                        }
                        productpromotionlist.Add(item);
                    }
                }
            }
            else
            {
                //promotionInfo = ProductBrowser.GetAllProductPromotionInfo(productId);
                DataTable dtorderpromotion = ProductBrowser.GetAllOrderPromotionInfo();
                if (dtorderpromotion != null)
                {
                    OrderPromotionItem item = null;
                    foreach (DataRow row in dtorderpromotion.Rows)
                    {
                        item = new OrderPromotionItem();
                        if (row["Name"] != DBNull.Value)
                        {
                            item.Name = (string)row["Name"];
                        }
                        if (row["PromoteType"] != DBNull.Value)
                        {
                            item.PromoteType = (int)row["PromoteType"];
                        }
                        orderpromotionlist.Add(item);
                    }
                }

                DataTable dtproductpromotion = ProductBrowser.GetAllProductPromotionList(productId);

                if (dtproductpromotion != null)
                {
                    ProductPromotionItem item = null;
                    foreach (DataRow row in dtproductpromotion.Rows)
                    {
                        item = new ProductPromotionItem();
                        if (row["Name"] != DBNull.Value)
                        {
                            item.Name = (string)row["Name"];
                        }
                        if (row["PromoteType"] != DBNull.Value)
                        {
                            item.PromoteType = (int)row["PromoteType"];
                        }
                        productpromotionlist.Add(item);
                    }
                }
            }


            //this.litProPromration = (System.Web.UI.WebControls.Literal)this.FindControl("litProPromration");
            //this.litOrderPromration = (System.Web.UI.WebControls.Literal)this.FindControl("litOrderPromration");
            //包邮
            if (orderpromotionlist != null)
            {
                for (int i = 0; i < orderpromotionlist.Count; i++)
                {
                    if (orderpromotionlist[i].PromoteType == 17)
                    {
                        this.litFreeShip.Text = "<div><span style=\"color:#999\">" + orderpromotionlist[i].Name + "</span></div>";
                    }
                    else
                    {
                        this.litOrderPromration.Text = "<span>" + orderpromotionlist[i].Name + "</span>";
                    }
                }
            }
            if (productpromotionlist != null)
            {
                for (int i = 0; i < productpromotionlist.Count; i++)
                {
                    this.litProPromration.Text = "<span>" + productpromotionlist[i].Name + "</span>";
                    break;
                }
            }
        }