Exemplo n.º 1
0
        public string RendHtml()
        {
            XmlNode       node = TagsHelper.FindCommentNode(this.CommentId, "article");
            StringBuilder sb   = new StringBuilder();

            if (node != null)
            {
                sb.AppendFormat("<div class=\"article cssEdite\" type=\"article\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                this.RenderHeader(node, sb);
                sb.AppendLine("<div class=\"article_bd\">");
                if (!string.IsNullOrEmpty(node.Attributes["AdImage"].Value))
                {
                    sb.AppendFormat("<div class=\"article_ad\"><img src=\"{0}\" /></div>", node.Attributes["AdImage"].Value).AppendLine();
                }
                int result = 0;
                int num2   = 0;
                int.TryParse(node.Attributes["CategoryId"].Value, out result);
                int.TryParse(node.Attributes["MaxNum"].Value, out num2);
                IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(result, num2);
                if ((articleList != null) && (articleList.Count > 0))
                {
                    sb.AppendLine("<div class=\"article_list\">");
                    sb.AppendLine("<ul>");
                    foreach (ArticleInfo info in articleList)
                    {
                        sb.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { info.ArticleId }), info.Title).AppendLine();
                    }
                    sb.AppendLine("</ul>");
                    sb.AppendLine("</div>");
                }
                sb.AppendLine("</div>");
                sb.AppendLine("</div>");
            }
            return(sb.ToString());
        }
Exemplo n.º 2
0
        protected override void AttachChildControls()
        {
            int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
            this.txtCategoryName = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtCategoryName");
            this.txtCategoryId   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtCategoryId");
            this.keyWord         = this.Page.Request.QueryString["keyWord"];
            if (!string.IsNullOrWhiteSpace(this.keyWord))
            {
                this.keyWord = this.keyWord.Trim();
            }
            this.rptArticles   = (VshopTemplatedRepeater)this.FindControl("rptArticles");
            this.txtTotalPages = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            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;
            }
            ArticleQuery articleQuery = new ArticleQuery();

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["CategoryId"]))
            {
                int value = 0;
                if (int.TryParse(this.Page.Request.QueryString["CategoryId"], out value))
                {
                    ArticleCategoryInfo articleCategory = CommentBrowser.GetArticleCategory(value);
                    if (articleCategory != null)
                    {
                        PageTitle.AddSiteNameTitle(articleCategory.Name);
                        articleQuery.CategoryId    = new int?(value);
                        this.txtCategoryId.Value   = value.ToString();
                        this.txtCategoryName.Value = articleCategory.Name;
                    }
                    else
                    {
                        PageTitle.AddSiteNameTitle("文章分类搜索页");
                    }
                }
            }
            articleQuery.Keywords  = this.keyWord;
            articleQuery.PageIndex = pageIndex;
            articleQuery.PageSize  = pageSize;
            articleQuery.SortBy    = "AddedDate";
            articleQuery.SortOrder = SortAction.Desc;
            DbQueryResult articleList = CommentBrowser.GetArticleList(articleQuery);

            this.rptArticles.DataSource = articleList.Data;
            this.rptArticles.DataBind();
            int totalRecords = articleList.TotalRecords;

            this.txtTotalPages.SetWhenIsNotNull(totalRecords.ToString());
        }
Exemplo n.º 3
0
 private void InitDataByTheme()
 {
     switch (SettingsManager.GetMasterSettings(true).VTheme.ToLower())
     {
     case "underwear":    //内衣
         this.ShopName = (Literal)this.FindControl("ShopName");
         if (Globals.GetCurrentDistributorId() != 0)
         {
             this.ShopName.Text = DistributorsBrower.GetDistributorInfo(Globals.GetCurrentDistributorId()).StoreName;
         }
         if (this.imglogo.ImageUrl.Equals("/Utility/pics/headLogo.jpg"))
         {
             this.imglogo.ImageUrl = "/Templates/vshop/underwear/images/LOGO.jpg";
         }
         this.rptCategories1            = (VshopTemplatedRepeater)this.FindControl("rptCategories1");
         this.rptCategories1.DataSource = CategoryBrowser.GetCategoriesByPruductType(4, 2);   //根据ProductType查询分类
         this.rptCategories1.DataBind();
         this.rptCategories2            = (VshopTemplatedRepeater)this.FindControl("rptCategories2");
         this.rptCategories3            = (VshopTemplatedRepeater)this.FindControl("rptCategories3");
         this.rptCategories3.DataSource = CategoryBrowser.GetCategoriesByPruductType(12, 1);   //根据ProductType查询分类
         this.rptCategories3.DataBind();
         this.rptCategories4            = (VshopTemplatedRepeater)this.FindControl("rptCategories4");
         this.rptCategories4.DataSource = CategoryBrowser.GetCategoriesByPruductType(11, 4);   //根据ProductType查询分类
         this.rptCategories4.DataBind();
         this.rptProductqqg = (VshopTemplatedRepeater)this.FindControl("rptProductqqg");
         ProductQuery query = new ProductQuery
         {
             PageSize  = 6,
             PageIndex = 1,
             SortBy    = "ShowSaleCounts",
             SortOrder = SortAction.Desc,
             TypeId    = 2
         };
         this.rptProductqqg.DataSource = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query).Data;
         this.rptProductqqg.DataBind();
         DataTable dt = ProductBrowser.GetHomeProductTop(0, ProductInfo.ProductTop.New);
         this.ProductCount = (Literal)this.FindControl("ProductCount");
         ProductCount.Text = dt.Rows[0][0] + "";
         this.Gonggao      = (Literal)this.FindControl("Gonggao");
         IList <ArticleInfo> artlist = CommentBrowser.GetArticleList(4, 1);
         if (artlist.Count > 0)
         {
             this.Gonggao.Text = artlist[0].Content;
         }
         this.Erweima = (Literal)this.FindControl("Erweima");
         if (Globals.GetCurrentDistributorId() == 0)
         {
             this.Erweima.Text = "<li><a href='QRcode.aspx?ReferralId='><i><img src='/Templates/vshop/underwear/images/iconfont-erweima.png' /></i><p>二维码</p></a></li>";
         }
         else
         {
             this.Erweima.Text = "<li><a href='QRcode.aspx?ReferralId=" + Globals.GetCurrentDistributorId() + "'><i><img src='/Templates/vshop/underwear/images/iconfont-erweima.png' /></i><p>二维码</p></a></li>";
         }
         break;
     }
     ;
 }
Exemplo n.º 4
0
 protected void Category_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
     {
         int                 categoryId  = (int)DataBinder.Eval(e.Item.DataItem, "cateGoryId");
         Repeater            repeater    = (Repeater)e.Item.FindControl("rep_article");
         IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, 0x3e8);
         if (((articleList != null) && (articleList.Count > 0)) && (repeater != null))
         {
             repeater.DataSource = articleList;
             repeater.DataBind();
         }
     }
 }
Exemplo n.º 5
0
 protected void Category_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         int                 num         = (int)DataBinder.Eval(e.Item.DataItem, "cateGoryId");
         Repeater            repeater    = (Repeater)e.Item.FindControl("rep_article");
         IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(num, 1000);
         if (articleList != null && articleList.Count > 0 && repeater != null)
         {
             repeater.DataSource = articleList;
             repeater.DataBind();
         }
     }
 }
Exemplo n.º 6
0
        void BindList()
        {
            ArticleQuery articleQuery = new ArticleQuery();

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["CategoryId"]))
            {
                int result = 0;
                if (int.TryParse(this.Page.Request.QueryString["CategoryId"], out result))
                {
                    articleQuery.CategoryId = new int?(result);
                }
            }
            articleQuery.PageIndex = this.pager.PageIndex;
            articleQuery.SortBy    = "AddedDate";
            articleQuery.SortOrder = SortAction.Desc;
            DbQueryResult articleList = CommentBrowser.GetArticleList(articleQuery);

            this.rptArticles.DataSource = articleList.Data;
            this.rptArticles.DataBind();
            this.pager.TotalRecords = articleList.TotalRecords;
        }
Exemplo n.º 7
0
 public string GetModelJson(HttpContext context)
 {
     if (context.Request.Form["categoryId"] != null)
     {
         int categoryId = default(int);
         if (!int.TryParse(context.Request.Form["categoryId"].ToString(), out categoryId))
         {
             return("{\"status\":1,\"list\":[],\"page\":\"\"}");
         }
         IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, 1000);
         if (articleList != null && articleList.Count > 0)
         {
             string str = "{\"status\":1,";
             str  = str + this.GetGoodsListJson(articleList, context) + ",";
             str += "\"page\":\"\"";
             return(str + "}");
         }
         return("{\"status\":1,\"list\":[],\"page\":\"\"}");
     }
     return("{\"status\":1,\"list\":[],\"page\":\"\"}");
 }
Exemplo n.º 8
0
        public string RendHtml()
        {
            string        arg           = this.IsDelayedLoading ? "data-url" : "src";
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "article");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"article cssEdite\" type=\"article\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                this.RenderHeader(xmlNode, stringBuilder);
                stringBuilder.AppendLine("<div class=\"article_bd\">");
                if (!string.IsNullOrEmpty(xmlNode.Attributes["AdImage"].Value))
                {
                    stringBuilder.AppendFormat("<div class=\"article_ad\"><img {1}=\"{0}\" /></div>", Globals.GetImageServerUrl("http://", xmlNode.Attributes["AdImage"].Value), arg).AppendLine();
                }
                int categoryId = 0;
                int maxNum     = 0;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out maxNum);
                IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, maxNum);
                if (articleList != null && articleList.Count > 0)
                {
                    stringBuilder.AppendLine("<div class=\"article_list\">");
                    stringBuilder.AppendLine("<ul>");
                    foreach (ArticleInfo item in articleList)
                    {
                        stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", base.GetRouteUrl("ArticleDetails", new
                        {
                            articleId = item.ArticleId
                        }), item.Title).AppendLine();
                    }
                    stringBuilder.AppendLine("</ul>");
                    stringBuilder.AppendLine("</div>");
                }
                stringBuilder.AppendLine("</div>");
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
Exemplo n.º 9
0
 protected override void OnLoad(EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         XmlNode node      = CommentBrowser.GetArticleSubjectDocument().SelectSingleNode("root/Subject[SubjectId='" + this.SubjectId + "']");
         int?    maxNum    = null;
         string  innerText = string.Empty;
         string  keyWords  = string.Empty;
         if (node != null)
         {
             innerText = node.SelectSingleNode("Categories").InnerText;
             if (!string.IsNullOrEmpty(innerText))
             {
                 innerText = "(" + innerText + ")";
             }
             maxNum   = new int?(int.Parse(node.SelectSingleNode("MaxNum").InnerText));
             keyWords = node.SelectSingleNode("Keywords").InnerText;
         }
         base.DataSource = CommentBrowser.GetArticleList(maxNum, innerText, keyWords);
         base.DataBind();
     }
 }
Exemplo n.º 10
0
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "article");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"article cssEdite\" type=\"article\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                this.RenderHeader(xmlNode, stringBuilder);
                stringBuilder.AppendLine("<div class=\"article_bd\">");
                if (!string.IsNullOrEmpty(xmlNode.Attributes["AdImage"].Value))
                {
                    stringBuilder.AppendFormat("<div class=\"article_ad\"><img src=\"{0}\" /></div>", xmlNode.Attributes["AdImage"].Value).AppendLine();
                }
                int categoryId = 0;
                int maxNum     = 0;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out maxNum);
                IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, maxNum);
                if (articleList != null && articleList.Count > 0)
                {
                    stringBuilder.AppendLine("<div class=\"article_list\">");
                    stringBuilder.AppendLine("<ul>");
                    foreach (ArticleInfo current in articleList)
                    {
                        stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[]
                        {
                            current.ArticleId
                        }), current.Title).AppendLine();
                    }
                    stringBuilder.AppendLine("</ul>");
                    stringBuilder.AppendLine("</div>");
                }
                stringBuilder.AppendLine("</div>");
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
Exemplo n.º 11
0
        private void BindList(string CateId)
        {
            ArticleQuery articleQuery = new ArticleQuery();

            if (!string.IsNullOrEmpty(CateId))
            {
                int value = 0;
                if (int.TryParse(CateId, out value))
                {
                    articleQuery.CategoryId = value;
                }
            }
            articleQuery.PageIndex = this.pager.PageIndex;
            articleQuery.PageSize  = this.pager.PageSize;
            articleQuery.SortBy    = "AddedDate";
            articleQuery.SortOrder = SortAction.Desc;
            articleQuery.IsRelease = true;
            DbQueryResult articleList = CommentBrowser.GetArticleList(articleQuery);

            this.rptArticles.DataSource = articleList.Data;
            this.rptArticles.DataBind();
            this.pager.TotalRecords = articleList.TotalRecords;
        }
Exemplo n.º 12
0
        public void ProcessRequest(HttpContext context)
        {
            string text = context.Request["actionName"];
            string s    = string.Empty;
            int    num;

            switch (text)
            {
            case "Topic":
            {
                IList <TopicInfo> appTopics = VShopHelper.GetAppTopics();
                s = JsonConvert.SerializeObject(appTopics);
                break;
            }

            case "Vote":
            {
                DataTable value4 = VshopBrowser.GetVoteByIsShowWX().Tables[0];
                s = JsonConvert.SerializeObject(value4);
                break;
            }

            case "Category":
            {
                var value = from item in CatalogHelper.GetMainCategories()
                            select new
                {
                    CateId   = item.CategoryId,
                    CateName = item.Name
                };
                s = JsonConvert.SerializeObject(value);
                break;
            }

            case "Activity":
            {
                string a      = context.Request["client"].ToNullString().ToLower();
                Array  values = Enum.GetValues(typeof(LotteryActivityType));
                if (a == "app")
                {
                    values = Enum.GetValues(typeof(AppLotteryActivityType));
                }
                List <EnumJson> list2 = new List <EnumJson>();
                foreach (Enum item in values)
                {
                    EnumJson enumJson3 = new EnumJson();
                    enumJson3.Name  = item.ToShowText();
                    enumJson3.Value = item.ToString();
                    list2.Add(enumJson3);
                }
                s = JsonConvert.SerializeObject(list2);
                break;
            }

            case "ActivityList":
            {
                string value2 = context.Request.Form["acttype"];
                LotteryActivityType lotteryActivityType = (LotteryActivityType)Enum.Parse(typeof(LotteryActivityType), value2);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    var value3 = from item in VShopHelper.GetAllActivity()
                                 select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                    s = JsonConvert.SerializeObject(value3);
                }
                else
                {
                    IList <LotteryActivityInfo> lotteryActivityByType = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                    s = JsonConvert.SerializeObject(lotteryActivityByType);
                }
                break;
            }

            case "ArticleCategory":
            {
                IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    List <EnumJson> list3 = new List <EnumJson>();
                    foreach (ArticleCategoryInfo item2 in articleMainCategories)
                    {
                        EnumJson enumJson4 = new EnumJson();
                        enumJson4.Name = item2.Name;
                        EnumJson enumJson5 = enumJson4;
                        num             = item2.CategoryId;
                        enumJson5.Value = num.ToString();
                        list3.Add(enumJson4);
                    }
                    s = JsonConvert.SerializeObject(list3);
                }
                break;
            }

            case "ArticleList":
            {
                int categoryId = 0;
                if (context.Request.Form["categoryId"] != null)
                {
                    int.TryParse(context.Request.Form["categoryId"].ToString(), out categoryId);
                }
                IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, 1000);
                List <EnumJson>     list        = new List <EnumJson>();
                foreach (ArticleInfo item3 in articleList)
                {
                    EnumJson enumJson = new EnumJson();
                    enumJson.Name = item3.Title;
                    EnumJson enumJson2 = enumJson;
                    num             = item3.ArticleId;
                    enumJson2.Value = num.ToString();
                    list.Add(enumJson);
                }
                s = JsonConvert.SerializeObject(list);
                break;
            }
            }
            context.Response.Write(s);
        }
Exemplo n.º 13
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;
            }
        }
Exemplo n.º 14
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;
            }
        }
Exemplo n.º 15
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;
            }
        }
Exemplo n.º 16
0
        protected override void AttachChildControls()
        {
            this.rptArticleCategorys = (WapTemplatedRepeater)this.FindControl("rpt_ArticleCategory");
            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");
            int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
            this.txtCategoryName = (HtmlInputHidden)this.FindControl("txtCategoryName");
            this.txtCategoryId   = (HtmlInputHidden)this.FindControl("txtCategoryId");
            this.keyWord         = this.Page.Request.QueryString["keyWord"].ToNullString();
            if (!string.IsNullOrWhiteSpace(this.keyWord))
            {
                this.keyWord = HttpUtility.UrlDecode(HttpUtility.UrlDecode(this.keyWord)).Trim();
            }
            this.rptArticles   = (WapTemplatedRepeater)this.FindControl("rptArticles");
            this.txtTotalPages = (HtmlInputHidden)this.FindControl("txtTotal");
            int pageIndex = default(int);

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

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 20;
            }
            SiteSettings siteSettings = HiContext.Current.SiteSettings;

            this.hdAppId.Value = siteSettings.WeixinAppId;
            ArticleQuery articleQuery = new ArticleQuery();

            this.hdDesc.Value   = siteSettings.SiteDescription;
            this.hdTitle.Value  = siteSettings.SiteName;
            this.hdLink.Value   = Globals.FullPath(HttpContext.Current.Request.Url.ToString());
            this.hdImgUrl.Value = Globals.FullPath(siteSettings.LogoUrl);
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["CategoryId"]))
            {
                int value = 0;
                if (int.TryParse(this.Page.Request.QueryString["CategoryId"], out value))
                {
                    ArticleCategoryInfo articleCategory = CommentBrowser.GetArticleCategory(value);
                    if (articleCategory != null)
                    {
                        this.hdDesc.Value   = (string.IsNullOrEmpty(articleCategory.Description) ? articleCategory.Description : articleCategory.Name);
                        this.hdImgUrl.Value = (string.IsNullOrEmpty(articleCategory.IconUrl) ? Globals.FullPath(siteSettings.DefaultProductImage) : (articleCategory.IconUrl.Contains("http://") ? articleCategory.IconUrl : ("http://" + HttpContext.Current.Request.Url.Host + articleCategory.IconUrl)));
                        this.hdTitle.Value  = articleCategory.Name;
                        PageTitle.AddSiteNameTitle(articleCategory.Name + "-文章列表");
                        articleQuery.CategoryId    = value;
                        this.txtCategoryId.Value   = value.ToString();
                        this.txtCategoryName.Value = articleCategory.Name;
                    }
                    else
                    {
                        PageTitle.AddSiteNameTitle("文章列表");
                    }
                }
            }
            articleQuery.Keywords  = this.keyWord;
            articleQuery.PageIndex = pageIndex;
            articleQuery.PageSize  = pageSize;
            articleQuery.SortBy    = "AddedDate";
            articleQuery.SortOrder = SortAction.Desc;
            articleQuery.IsRelease = true;
            int           num         = 0;
            DbQueryResult articleList = CommentBrowser.GetArticleList(articleQuery);

            this.rptArticles.DataSource = articleList.Data;
            this.rptArticles.DataBind();
            num = articleList.TotalRecords;
            this.txtTotalPages.SetWhenIsNotNull(num.ToString());
            IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();

            this.rptArticleCategorys.DataSource = articleMainCategories;
            this.rptArticleCategorys.DataBind();
        }
Exemplo n.º 17
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            string text = context.Request.Form["actionName"];
            string s    = string.Empty;
            string key;

            switch (key = text)
            {
            case "Topic":
            {
                System.Collections.Generic.IList <TopicInfo> value = VShopHelper.Gettopics();
                s = JsonConvert.SerializeObject(value);
                break;
            }

            case "Vote":
            {
                System.Data.DataSet votes = StoreHelper.GetVotes();
                s = JsonConvert.SerializeObject(votes);
                break;
            }

            case "Category":
            {
                var value2 =
                    from item in CatalogHelper.GetMainCategories()
                    select new
                {
                    CateId   = item.CategoryId,
                    CateName = item.Name
                };
                s = JsonConvert.SerializeObject(value2);
                break;
            }

            case "Activity":
            {
                System.Array values = System.Enum.GetValues(typeof(LotteryActivityType));
                System.Collections.Generic.List <VsiteHandler.EnumJson> list = new System.Collections.Generic.List <VsiteHandler.EnumJson>();
                foreach (System.Enum @enum in values)
                {
                    list.Add(new VsiteHandler.EnumJson
                        {
                            Name  = @enum.ToShowText(),
                            Value = @enum.ToString()
                        });
                }
                s = JsonConvert.SerializeObject(list);
                break;
            }

            case "ActivityList":
            {
                string value3 = context.Request.Form["acttype"];
                LotteryActivityType lotteryActivityType = (LotteryActivityType)System.Enum.Parse(typeof(LotteryActivityType), value3);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    var value4 =
                        from item in VShopHelper.GetAllActivity()
                        select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                    s = JsonConvert.SerializeObject(value4);
                }
                else
                {
                    System.Collections.Generic.IList <LotteryActivityInfo> lotteryActivityByType = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                    s = JsonConvert.SerializeObject(lotteryActivityByType);
                }
                break;
            }

            case "ArticleCategory":
            {
                System.Collections.Generic.IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    System.Collections.Generic.List <VsiteHandler.EnumJson> list2 = new System.Collections.Generic.List <VsiteHandler.EnumJson>();
                    foreach (ArticleCategoryInfo current in articleMainCategories)
                    {
                        list2.Add(new VsiteHandler.EnumJson
                            {
                                Name  = current.Name,
                                Value = current.CategoryId.ToString()
                            });
                    }
                    s = JsonConvert.SerializeObject(list2);
                }
                break;
            }

            case "ArticleList":
            {
                int categoryId = 0;
                if (context.Request.Form["categoryId"] != null)
                {
                    int.TryParse(context.Request.Form["categoryId"].ToString(), out categoryId);
                }
                System.Collections.Generic.IList <ArticleInfo>          articleList = CommentBrowser.GetArticleList(categoryId, 1000);
                System.Collections.Generic.List <VsiteHandler.EnumJson> list3       = new System.Collections.Generic.List <VsiteHandler.EnumJson>();
                foreach (ArticleInfo current2 in articleList)
                {
                    list3.Add(new VsiteHandler.EnumJson
                        {
                            Name  = current2.Title,
                            Value = current2.ArticleId.ToString()
                        });
                }
                s = JsonConvert.SerializeObject(list3);
                break;
            }
            }
            context.Response.Write(s);
        }