protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["articleId"], out this.articleId))
     {
         base.GotoResourceNotFound();
     }
     this.litArticleAddedDate   = (FormatedTimeLabel)this.FindControl("litArticleAddedDate");
     this.litArticleContent     = (Literal)this.FindControl("litArticleContent");
     this.litArticleDescription = (Literal)this.FindControl("litArticleDescription");
     this.litArticleTitle       = (Literal)this.FindControl("litArticleTitle");
     this.lblFront      = (Label)this.FindControl("lblFront");
     this.lblNext       = (Label)this.FindControl("lblNext");
     this.lblFrontTitle = (Label)this.FindControl("lblFrontTitle");
     this.lblNextTitle  = (Label)this.FindControl("lblNextTitle");
     this.aFront        = (HtmlAnchor)this.FindControl("front");
     this.aNext         = (HtmlAnchor)this.FindControl("next");
     this.ariticlative  = (Common_ArticleRelative)this.FindControl("list_Common_ArticleRelative");
     if (!this.Page.IsPostBack)
     {
         ArticleInfo article = CommentBrowser.GetArticle(this.articleId);
         if ((article != null) && article.IsRelease)
         {
             PageTitle.AddSiteNameTitle(article.Title, HiContext.Current.Context);
             if (!string.IsNullOrEmpty(article.MetaKeywords))
             {
                 MetaTags.AddMetaKeywords(article.MetaKeywords, HiContext.Current.Context);
             }
             if (!string.IsNullOrEmpty(article.MetaDescription))
             {
                 MetaTags.AddMetaDescription(article.MetaDescription, HiContext.Current.Context);
             }
             this.litArticleTitle.Text       = article.Title;
             this.litArticleDescription.Text = article.Description;
             string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { this.articleId });
             this.litArticleContent.Text   = article.Content.Replace("href=\"#\"", "href=\"" + str + "\"");
             this.litArticleAddedDate.Time = article.AddedDate;
             ArticleInfo info2 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Front", article.CategoryId);
             if ((info2 != null) && (info2.ArticleId > 0))
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible   = true;
                     this.aFront.HRef        = Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { info2.ArticleId });
                     this.lblFrontTitle.Text = info2.Title;
                 }
             }
             else if (this.lblFront != null)
             {
                 this.lblFront.Visible = false;
             }
             ArticleInfo info3 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Next", article.CategoryId);
             if ((info3 != null) && (info3.ArticleId > 0))
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible   = true;
                     this.aNext.HRef        = Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { info3.ArticleId });
                     this.lblNextTitle.Text = info3.Title;
                 }
             }
             else if (this.lblNext != null)
             {
                 this.lblNext.Visible = false;
             }
             this.ariticlative.DataSource = CommentBrowser.GetArticlProductList(this.articleId);
             this.ariticlative.DataBind();
         }
     }
 }
Example #2
0
        protected void Restore()
        {
            TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id);

            this.txtBannerDesc.Text    = tplCfgById.ShortDesc;
            this.ddlType.SelectedValue = tplCfgById.LocationType.ToString();
            this.littlepic.Src         = tplCfgById.ImageUrl;
            this.fmSrc.Value           = tplCfgById.ImageUrl;
            switch (tplCfgById.LocationType)
            {
            case LocationType.Topic:
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.DataSource     = VShopHelper.Gettopics();
                this.ddlSubType.DataTextField  = "Title";
                this.ddlSubType.DataValueField = "TopicId";
                this.ddlSubType.DataBind();
                this.ddlSubType.SelectedValue = tplCfgById.Url;
                break;

            case (LocationType)1:
            case LocationType.Home:
            case LocationType.ShoppingCart:
            case LocationType.OrderCenter:
            case LocationType.VipCard:
            case LocationType.GroupBuy:
                break;

            case LocationType.Brand:
                int BrandId = 0;
                if (tplCfgById != null && !string.IsNullOrEmpty(tplCfgById.Url))
                {
                    int.TryParse(tplCfgById.Url, out BrandId);
                }
                this.dropBrandTypes.Attributes.CssStyle.Remove("display");
                this.dropBrandTypes.DataSource     = ControlProvider.Instance().GetBrandCategories();
                this.dropBrandTypes.DataTextField  = "BrandName";
                this.dropBrandTypes.DataValueField = "BrandId";
                this.dropBrandTypes.DataBind();
                if (BrandId > 0)
                {
                    dropBrandTypes.SelectedValue = BrandId;
                }
                break;

            case LocationType.Category:
                int categoryId = 0;
                if (tplCfgById != null && !string.IsNullOrEmpty(tplCfgById.Url))
                {
                    //string[] str = tplCfgById.Url.Split('?');
                    //if (str.Length > 0)
                    //{
                    //    string[] str1 = (tplCfgById.Url.Split('?')[1]).Split('=');
                    //    int.TryParse(str1[1].ToString(), out categoryId);
                    //}
                    int.TryParse(tplCfgById.Url, out categoryId);
                }
                this.dropCategories.Attributes.CssStyle.Remove("display");
                this.dropCategories.DataSource     = CatalogHelper.GetMainCategories();
                this.dropCategories.DataTextField  = "Name";
                this.dropCategories.DataValueField = "CategoryId";
                this.dropCategories.DataBind();
                if (categoryId > 0)
                {
                    dropCategories.SelectedValue = categoryId;
                }
                break;

            case LocationType.ImportSourceType:
                int importSourceId = 0;
                if (tplCfgById != null && !string.IsNullOrEmpty(tplCfgById.Url))
                {
                    //string[] str = tplCfgById.Url.Split('?');
                    //if (str.Length > 0)
                    //{
                    //    string[] str1 = (tplCfgById.Url.Split('?')[1]).Split('=');
                    //    int.TryParse(str1[1].ToString(), out importSourceId);
                    //}
                    int.TryParse(tplCfgById.Url, out importSourceId);
                }
                this.dropImportSourceType.Attributes.CssStyle.Remove("display");
                this.dropImportSourceType.DataSource     = ImportSourceTypeHelper.GetAllImportSourceTypes();
                this.dropImportSourceType.DataTextField  = "CnArea";
                this.dropImportSourceType.DataValueField = "ImportSourceId";
                this.dropImportSourceType.DataBind();
                if (importSourceId > 0)
                {
                    dropImportSourceType.SelectedValue = importSourceId;
                }
                break;

            case LocationType.Activity:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.BindEnum <EcShop.Entities.VShop.LocationType>("");       //修改1
                this.ddlSubType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0];
                this.ddlThridType.Attributes.CssStyle.Remove("display");
                LotteryActivityType lotteryActivityType = (LotteryActivityType)System.Enum.Parse(typeof(LotteryActivityType), tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0]);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    this.ddlThridType.DataSource =
                        from item in VShopHelper.GetAllActivity()
                        select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                }
                else
                {
                    this.ddlThridType.DataSource = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                }
                this.ddlThridType.DataTextField  = "ActivityName";
                this.ddlThridType.DataValueField = "Activityid";
                this.ddlThridType.DataBind();
                this.ddlThridType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[1];
                return;
            }

            case LocationType.Link:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case LocationType.Phone:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case LocationType.Address:
                this.Tburl.Attributes.CssStyle.Remove("display");
                this.navigateDesc.Attributes.CssStyle.Remove("display");
                this.Tburl.Text = tplCfgById.Url;
                return;

            case LocationType.Article:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                System.Collections.Generic.IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                this.ddlSubType.Items.Clear();
                int num  = 0;
                int num2 = 0;
                if (!string.IsNullOrEmpty(tplCfgById.Url))
                {
                    int num3 = tplCfgById.Url.LastIndexOf('=');
                    int.TryParse(tplCfgById.Url.Substring(num3 + 1), out num);
                }
                if (num > 0)
                {
                    ArticleInfo article = CommentBrowser.GetArticle(num);
                    if (article != null)
                    {
                        num2 = article.CategoryId;
                    }
                }
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    foreach (ArticleCategoryInfo current in articleMainCategories)
                    {
                        this.ddlSubType.Items.Add(new System.Web.UI.WebControls.ListItem(current.Name, current.CategoryId.ToString()));
                    }
                    if (num2 > 0)
                    {
                        this.ddlSubType.SelectedValue = num2.ToString();
                    }
                }
                if (num > 0)
                {
                    this.ddlThridType.Attributes.CssStyle.Remove("display");
                    System.Collections.Generic.IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(num2, 1000);
                    foreach (ArticleInfo current2 in articleList)
                    {
                        this.ddlThridType.Items.Add(new System.Web.UI.WebControls.ListItem(current2.Title, current2.ArticleId.ToString()));
                    }
                    this.ddlThridType.SelectedValue = num.ToString();
                    return;
                }
                break;
            }

            case LocationType.Product:

                this.linkSelectProduct.Attributes.CssStyle.Remove("display");
                this.productName.Attributes.CssStyle.Remove("display");
                this.productid.Value = tplCfgById.Url;
                int result;
                if (int.TryParse(tplCfgById.Url, out result))
                {
                    this.productName.InnerText = ProductHelper.GetProductDetails(result).ProductName;
                }


                break;

            default:
                return;
            }
        }
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["articleId"], out this.articleId))
            {
                base.GotoResourceNotFound("");
            }
            this.hdAppId               = (HtmlInputHidden)this.FindControl("hdAppId");
            this.hdTitle               = (HtmlInputHidden)this.FindControl("hdTitle");
            this.hdDesc                = (HtmlInputHidden)this.FindControl("hdDesc");
            this.hdImgUrl              = (HtmlInputHidden)this.FindControl("hdImgUrl");
            this.hdLink                = (HtmlInputHidden)this.FindControl("hdLink");
            this.txtCatgoryId          = (HtmlInputHidden)this.FindControl("txtCatgoryId");
            this.litArticleAddedDate   = (FormatedTimeLabel)this.FindControl("litArticleAddedDate");
            this.litArticleContent     = (Literal)this.FindControl("litArticleContent");
            this.litArticleDescription = (Literal)this.FindControl("litArticleDescription");
            this.litArticleTitle       = (Literal)this.FindControl("litArticleTitle");
            this.lblFront              = (Label)this.FindControl("lblFront");
            this.lblNext               = (Label)this.FindControl("lblNext");
            this.lblFrontTitle         = (Label)this.FindControl("lblFrontTitle");
            this.lblNextTitle          = (Label)this.FindControl("lblNextTitle");
            this.aFront                = (HtmlAnchor)this.FindControl("front");
            this.aNext        = (HtmlAnchor)this.FindControl("next");
            this.ariticlative = (Common_ArticleRelative)this.FindControl("list_Common_ArticleRelative");
            SiteSettings siteSettings = HiContext.Current.SiteSettings;

            this.hdAppId.Value = siteSettings.WeixinAppId;
            if (!this.Page.IsPostBack)
            {
                ArticleInfo article = CommentBrowser.GetArticle(this.articleId);
                if (article?.IsRelease ?? false)
                {
                    this.hdDesc.Value   = (string.IsNullOrEmpty(article.Description) ? article.Title : article.Title);
                    this.hdImgUrl.Value = (string.IsNullOrEmpty(article.IconUrl) ? Globals.FullPath(siteSettings.DefaultProductImage) : (article.IconUrl.Contains("http://") ? article.IconUrl : ("http://" + HttpContext.Current.Request.Url.Host + article.IconUrl)));
                    this.hdLink.Value   = Globals.FullPath(HttpContext.Current.Request.Url.ToString());
                    this.hdTitle.Value  = article.Title;
                    ArticleHelper.AddHits(this.articleId);
                    if (this.txtCatgoryId != null)
                    {
                        this.txtCatgoryId.Value = article.CategoryId.ToString();
                    }
                    PageTitle.AddSiteNameTitle(article.Title);
                    if (!string.IsNullOrEmpty(article.Meta_Keywords))
                    {
                        MetaTags.AddMetaKeywords(article.Meta_Keywords, HiContext.Current.Context);
                    }
                    if (!string.IsNullOrEmpty(article.Meta_Description))
                    {
                        MetaTags.AddMetaDescription(article.Meta_Description, HiContext.Current.Context);
                    }
                    this.litArticleTitle.Text       = article.Title;
                    this.litArticleDescription.Text = article.Description;
                    string str = HiContext.Current.HostPath + base.GetRouteUrl("ArticleDetails", new
                    {
                        this.articleId
                    });
                    this.litArticleContent.Text   = article.Content.Replace("href=\"#\"", "href=\"" + str + "\"");
                    this.litArticleAddedDate.Time = article.AddedDate;
                    ArticleInfo frontOrNextArticle = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Front", article.CategoryId);
                    if (frontOrNextArticle != null && frontOrNextArticle.ArticleId > 0)
                    {
                        if (this.lblFront != null)
                        {
                            this.lblFront.Visible   = true;
                            this.aFront.HRef        = "ArticleDetails.aspx?ArticleId=" + frontOrNextArticle.ArticleId;
                            this.lblFrontTitle.Text = frontOrNextArticle.Title;
                        }
                    }
                    else if (this.lblFront != null)
                    {
                        this.lblFront.Visible = false;
                    }
                    ArticleInfo frontOrNextArticle2 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Next", article.CategoryId);
                    if (frontOrNextArticle2 != null && frontOrNextArticle2.ArticleId > 0)
                    {
                        if (this.lblNext != null)
                        {
                            this.lblNext.Visible   = true;
                            this.aNext.HRef        = "ArticleDetails.aspx?ArticleId=" + frontOrNextArticle2.ArticleId;
                            this.lblNextTitle.Text = frontOrNextArticle2.Title;
                        }
                    }
                    else if (this.lblNext != null)
                    {
                        this.lblNext.Visible = false;
                    }
                }
            }
        }
Example #4
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["articleId"], out this.articleId))
            {
                base.GotoResourceNotFound("");
            }
            this.txtCatgoryId          = (HtmlInputHidden)this.FindControl("txtCatgoryId");
            this.litArticleAddedDate   = (FormatedTimeLabel)this.FindControl("litArticleAddedDate");
            this.litArticleContent     = (Literal)this.FindControl("litArticleContent");
            this.litArticleDescription = (Literal)this.FindControl("litArticleDescription");
            this.litArticleTitle       = (Literal)this.FindControl("litArticleTitle");
            this.lblFront      = (Label)this.FindControl("lblFront");
            this.lblNext       = (Label)this.FindControl("lblNext");
            this.lblFrontTitle = (Label)this.FindControl("lblFrontTitle");
            this.lblNextTitle  = (Label)this.FindControl("lblNextTitle");
            this.aFront        = (HtmlAnchor)this.FindControl("front");
            this.aNext         = (HtmlAnchor)this.FindControl("next");
            this.ariticlative  = (Common_ArticleRelative)this.FindControl("list_Common_ArticleRelative");
            if (!this.Page.IsPostBack)
            {
                ArticleInfo article = CommentBrowser.GetArticle(this.articleId);
                if ((article != null) && article.IsRelease)
                {
                    if (this.txtCatgoryId != null)
                    {
                        this.txtCatgoryId.Value = article.CategoryId.ToString();
                    }
                    PageTitle.AddSiteNameTitle(article.Title);
                    if (!string.IsNullOrEmpty(article.MetaKeywords))
                    {
                        MetaTags.AddMetaKeywords(article.MetaKeywords, HiContext.Current.Context);
                    }
                    if (!string.IsNullOrEmpty(article.MetaDescription))
                    {
                        MetaTags.AddMetaDescription(article.MetaDescription, HiContext.Current.Context);
                    }
                    this.litArticleTitle.Text       = article.Title;
                    this.litArticleDescription.Text = article.Description;
                    string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { this.articleId });
                    this.litArticleContent.Text   = article.Content.Replace("href=\"#\"", "href=\"" + str + "\"");
                    this.litArticleAddedDate.Time = article.AddedDate;
                    ArticleInfo info2 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Front", article.CategoryId);
                    if ((info2 != null) && (info2.ArticleId > 0))
                    {
                        if (this.lblFront != null)
                        {
                            this.lblFront.Visible   = true;
                            this.aFront.HRef        = "ArticleDetails.aspx?ArticleId=" + info2.ArticleId;
                            this.lblFrontTitle.Text = info2.Title;
                        }
                    }
                    else if (this.lblFront != null)
                    {
                        this.lblFront.Visible = false;
                    }
                    ArticleInfo info3 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Next", article.CategoryId);
                    if ((info3 != null) && (info3.ArticleId > 0))
                    {
                        if (this.lblNext != null)
                        {
                            this.lblNext.Visible   = true;
                            this.aNext.HRef        = "ArticleDetails.aspx?ArticleId=" + info3.ArticleId;
                            this.lblNextTitle.Text = info3.Title;
                        }
                    }
                    else if (this.lblNext != null)
                    {
                        this.lblNext.Visible = false;
                    }


                    //如果该文章绑定了优惠券,则自动领取优惠券
                    if (article.CouponId > 0)
                    {
                        MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                        if (!CouponHelper.CheckUserIsCoupon(currentMember.UserId, article.CouponId))
                        {
                            //如果还没有领取过,开始领取优惠券
                            int    number;
                            string claimCode = string.Empty;
                            claimCode += article.CouponId + "|" + currentMember.UserId;
                            claimCode  = claimCode.PadLeft(15, 'w');//w代表文章列表获取的
                            CouponItemInfo item = new CouponItemInfo();
                            System.Collections.Generic.IList <CouponItemInfo> listCouponItem = new System.Collections.Generic.List <CouponItemInfo>();
                            item = new CouponItemInfo(article.CouponId, claimCode, new int?(currentMember.UserId), currentMember.UserName, currentMember.Email, System.DateTime.Now);
                            listCouponItem.Add(item);
                            CouponHelper.SendClaimCodes(article.CouponId, listCouponItem);
                            this.Page.Response.Write("<script>alert('恭喜您成功领取了一张优惠券!')</script>");
                        }
                        else
                        {
                            //this.Page.Response.Write("<script>alert('请勿重复领取!')</script>");
                        }
                    }
                }
            }
        }
Example #5
0
        protected void Restore()
        {
            TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id);

            this.txtNavigateDesc.Text  = tplCfgById.ShortDesc;
            this.ddlType.SelectedValue = tplCfgById.LocationType.ToString();
            if (!tplCfgById.ImageUrl.ToLower().Contains("storage/master/navigate"))
            {
                this.iconpath = tplCfgById.ImageUrl;
            }
            this.littlepic.Src = tplCfgById.ImageUrl;
            this.fmSrc.Value   = tplCfgById.ImageUrl;
            switch (tplCfgById.LocationType)
            {
            case EcShop.Entities.VShop.LocationType.Topic:
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.DataSource     = VShopHelper.Gettopics();
                this.ddlSubType.DataTextField  = "Title";
                this.ddlSubType.DataValueField = "TopicId";
                this.ddlSubType.DataBind();
                this.ddlSubType.SelectedValue = tplCfgById.Url;
                break;

            case (EcShop.Entities.VShop.LocationType) 1:
            case EcShop.Entities.VShop.LocationType.Home:
            case EcShop.Entities.VShop.LocationType.Category:
            case EcShop.Entities.VShop.LocationType.ShoppingCart:
            case EcShop.Entities.VShop.LocationType.OrderCenter:
            case EcShop.Entities.VShop.LocationType.VipCard:
            case EcShop.Entities.VShop.LocationType.GroupBuy:
            case EcShop.Entities.VShop.LocationType.Brand:
                break;

            case EcShop.Entities.VShop.LocationType.Activity:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.BindEnum <EcShop.Entities.AliOH.LocationType>("");//修改1
                this.ddlSubType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0];
                this.ddlThridType.Attributes.CssStyle.Remove("display");
                LotteryActivityType lotteryActivityType = (LotteryActivityType)System.Enum.Parse(typeof(LotteryActivityType), tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0]);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    this.ddlThridType.DataSource =
                        from item in VShopHelper.GetAllActivity()
                        select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                }
                else
                {
                    this.ddlThridType.DataSource = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                }
                this.ddlThridType.DataTextField  = "ActivityName";
                this.ddlThridType.DataValueField = "Activityid";
                this.ddlThridType.DataBind();
                this.ddlThridType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[1];
                return;
            }

            case EcShop.Entities.VShop.LocationType.Link:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case EcShop.Entities.VShop.LocationType.Phone:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case EcShop.Entities.VShop.LocationType.Address:
                this.Tburl.Attributes.CssStyle.Remove("display");
                this.navigateDesc.Attributes.CssStyle.Remove("display");
                this.Tburl.Text = tplCfgById.Url;
                return;

            case EcShop.Entities.VShop.LocationType.Article:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                System.Collections.Generic.IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                this.ddlSubType.Items.Clear();
                int num  = 0;
                int num2 = 0;
                if (!string.IsNullOrEmpty(tplCfgById.Url))
                {
                    int num3 = tplCfgById.Url.LastIndexOf('=');
                    int.TryParse(tplCfgById.Url.Substring(num3 + 1), out num);
                }
                if (num > 0)
                {
                    ArticleInfo article = CommentBrowser.GetArticle(num);
                    if (article != null)
                    {
                        num2 = article.CategoryId;
                    }
                }
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    foreach (ArticleCategoryInfo current in articleMainCategories)
                    {
                        this.ddlSubType.Items.Add(new System.Web.UI.WebControls.ListItem(current.Name, current.CategoryId.ToString()));
                    }
                    if (num2 > 0)
                    {
                        this.ddlSubType.SelectedValue = num2.ToString();
                    }
                }
                if (num > 0)
                {
                    this.ddlThridType.Attributes.CssStyle.Remove("display");
                    System.Collections.Generic.IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(num2, 1000);
                    foreach (ArticleInfo current2 in articleList)
                    {
                        this.ddlThridType.Items.Add(new System.Web.UI.WebControls.ListItem(current2.Title, current2.ArticleId.ToString()));
                    }
                    this.ddlThridType.SelectedValue = num.ToString();
                    return;
                }
                break;
            }

            default:
                return;
            }
        }
Example #6
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["articleId"], out this.articleId))
     {
         base.GotoResourceNotFound("");
     }
     this.txtCatgoryId          = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtCatgoryId");
     this.litArticleAddedDate   = (FormatedTimeLabel)this.FindControl("litArticleAddedDate");
     this.litArticleContent     = (System.Web.UI.WebControls.Literal) this.FindControl("litArticleContent");
     this.litArticleDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litArticleDescription");
     this.litArticleTitle       = (System.Web.UI.WebControls.Literal) this.FindControl("litArticleTitle");
     this.lblFront      = (System.Web.UI.WebControls.Label) this.FindControl("lblFront");
     this.lblNext       = (System.Web.UI.WebControls.Label) this.FindControl("lblNext");
     this.lblFrontTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblFrontTitle");
     this.lblNextTitle  = (System.Web.UI.WebControls.Label) this.FindControl("lblNextTitle");
     this.aFront        = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("front");
     this.aNext         = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("next");
     this.ariticlative  = (Common_ArticleRelative)this.FindControl("list_Common_ArticleRelative");
     if (!this.Page.IsPostBack)
     {
         ArticleInfo article = CommentBrowser.GetArticle(this.articleId);
         if (article != null && article.IsRelease)
         {
             if (this.txtCatgoryId != null)
             {
                 this.txtCatgoryId.Value = article.CategoryId.ToString();
             }
             PageTitle.AddSiteNameTitle(article.Title);
             if (!string.IsNullOrEmpty(article.MetaKeywords))
             {
                 MetaTags.AddMetaKeywords(article.MetaKeywords, HiContext.Current.Context);
             }
             if (!string.IsNullOrEmpty(article.MetaDescription))
             {
                 MetaTags.AddMetaDescription(article.MetaDescription, HiContext.Current.Context);
             }
             this.litArticleTitle.Text       = article.Title;
             this.litArticleDescription.Text = article.Description;
             string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[]
             {
                 this.articleId
             });
             this.litArticleContent.Text   = article.Content.Replace("href=\"#\"", "href=\"" + str + "\"");
             this.litArticleAddedDate.Time = article.AddedDate;
             ArticleInfo frontOrNextArticle = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Front", article.CategoryId);
             if (frontOrNextArticle != null && frontOrNextArticle.ArticleId > 0)
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible   = true;
                     this.aFront.HRef        = "/WapShop/ArticleDetails.aspx?ArticleId=" + frontOrNextArticle.ArticleId;
                     this.lblFrontTitle.Text = frontOrNextArticle.Title;
                 }
             }
             else
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible = false;
                 }
             }
             ArticleInfo frontOrNextArticle2 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Next", article.CategoryId);
             if (frontOrNextArticle2 != null && frontOrNextArticle2.ArticleId > 0)
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible   = true;
                     this.aNext.HRef        = "/WapShop/ArticleDetails.aspx?ArticleId=" + frontOrNextArticle2.ArticleId;
                     this.lblNextTitle.Text = frontOrNextArticle2.Title;
                     return;
                 }
             }
             else
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible = false;
                 }
             }
         }
     }
 }
Example #7
0
        protected void Restore()
        {
            TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id);

            this.txtBannerDesc.Text    = tplCfgById.ShortDesc;
            this.ddlType.SelectedValue = tplCfgById.LocationType.ToString();
            this.littlepic.Src         = tplCfgById.ImageUrl;
            this.fmSrc.Value           = tplCfgById.ImageUrl;
            switch (tplCfgById.LocationType)
            {
            case EcShop.Entities.VShop.LocationType.Home:
            case EcShop.Entities.VShop.LocationType.Category:
            case EcShop.Entities.VShop.LocationType.ShoppingCart:
            case EcShop.Entities.VShop.LocationType.OrderCenter:
            case EcShop.Entities.VShop.LocationType.VipCard:
            case EcShop.Entities.VShop.LocationType.GroupBuy:
            case EcShop.Entities.VShop.LocationType.Brand:
                break;

            case EcShop.Entities.VShop.LocationType.Link:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case EcShop.Entities.VShop.LocationType.Phone:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case EcShop.Entities.VShop.LocationType.Address:
                this.Tburl.Attributes.CssStyle.Remove("display");
                this.navigateDesc.Attributes.CssStyle.Remove("display");
                this.Tburl.Text = tplCfgById.Url;
                return;

            case EcShop.Entities.VShop.LocationType.Article:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                System.Collections.Generic.IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                this.ddlSubType.Items.Clear();
                int num  = 0;
                int num2 = 0;
                if (!string.IsNullOrEmpty(tplCfgById.Url))
                {
                    int num3 = tplCfgById.Url.LastIndexOf('=');
                    int.TryParse(tplCfgById.Url.Substring(num3 + 1), out num);
                }
                if (num > 0)
                {
                    ArticleInfo article = CommentBrowser.GetArticle(num);
                    if (article != null)
                    {
                        num2 = article.CategoryId;
                    }
                }
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    foreach (ArticleCategoryInfo current in articleMainCategories)
                    {
                        this.ddlSubType.Items.Add(new System.Web.UI.WebControls.ListItem(current.Name, current.CategoryId.ToString()));
                    }
                    if (num2 > 0)
                    {
                        this.ddlSubType.SelectedValue = num2.ToString();
                    }
                }
                if (num > 0)
                {
                    this.ddlThridType.Attributes.CssStyle.Remove("display");
                    System.Collections.Generic.IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(num2, 1000);
                    foreach (ArticleInfo current2 in articleList)
                    {
                        this.ddlThridType.Items.Add(new System.Web.UI.WebControls.ListItem(current2.Title, current2.ArticleId.ToString()));
                    }
                    this.ddlThridType.SelectedValue = num.ToString();
                }
                break;
            }

            default:
                return;
            }
        }
Example #8
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(base.GetParameter("articleId", false), out this.articleId))
     {
         base.GotoResourceNotFound();
     }
     this.litArticleAddedDate   = (FormatedTimeLabel)this.FindControl("litArticleAddedDate");
     this.litArticleContent     = (Literal)this.FindControl("litArticleContent");
     this.litArticleDescription = (Literal)this.FindControl("litArticleDescription");
     this.litArticleTitle       = (Literal)this.FindControl("litArticleTitle");
     this.lblFront      = (Label)this.FindControl("lblFront");
     this.lblNext       = (Label)this.FindControl("lblNext");
     this.lblFrontTitle = (Label)this.FindControl("lblFrontTitle");
     this.lblNextTitle  = (Label)this.FindControl("lblNextTitle");
     this.aFront        = (HtmlAnchor)this.FindControl("front");
     this.aNext         = (HtmlAnchor)this.FindControl("next");
     this.ariticlative  = (Common_ArticleRelative)this.FindControl("list_Common_ArticleRelative");
     if (!this.Page.IsPostBack)
     {
         ArticleInfo article = CommentBrowser.GetArticle(this.articleId);
         if (article?.IsRelease ?? false)
         {
             ArticleHelper.AddHits(this.articleId);
             PageTitle.AddSiteNameTitle(article.Title);
             if (!string.IsNullOrEmpty(article.Meta_Keywords))
             {
                 MetaTags.AddMetaKeywords(article.Meta_Keywords, HiContext.Current.Context);
             }
             if (!string.IsNullOrEmpty(article.Meta_Description))
             {
                 MetaTags.AddMetaDescription(article.Meta_Description, HiContext.Current.Context);
             }
             this.litArticleTitle.Text       = article.Title;
             this.litArticleDescription.Text = article.Description;
             string str = HiContext.Current.HostPath + base.GetRouteUrl("ArticleDetails", new
             {
                 this.articleId
             });
             this.litArticleContent.Text   = article.Content.Replace("href=\"#\"", "href=\"" + str + "\"");
             this.litArticleAddedDate.Time = article.AddedDate;
             ArticleInfo frontOrNextArticle = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Front", article.CategoryId);
             if (frontOrNextArticle != null && frontOrNextArticle.ArticleId > 0)
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible = true;
                     this.aFront.HRef      = base.GetRouteUrl("ArticleDetails", new
                     {
                         articleId = frontOrNextArticle.ArticleId
                     });
                     this.lblFrontTitle.Text = frontOrNextArticle.Title;
                 }
             }
             else if (this.lblFront != null)
             {
                 this.lblFront.Visible = false;
             }
             ArticleInfo frontOrNextArticle2 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Next", article.CategoryId);
             if (frontOrNextArticle2 != null && frontOrNextArticle2.ArticleId > 0)
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible = true;
                     this.aNext.HRef      = base.GetRouteUrl("ArticleDetails", new
                     {
                         articleId = frontOrNextArticle2.ArticleId
                     });
                     this.lblNextTitle.Text = frontOrNextArticle2.Title;
                 }
             }
             else if (this.lblNext != null)
             {
                 this.lblNext.Visible = false;
             }
             this.ariticlative.DataSource = CommentBrowser.GetArticlProductList(this.articleId);
             this.ariticlative.DataBind();
         }
     }
 }