コード例 #1
0
ファイル: HelpList.cs プロジェクト: skybluebin007/JW-Shop
        protected override void PageLoad()
        {
            base.PageLoad();
            topNav = 8;

            helpClassList = ArticleClassBLL.ReadChilds(ArticleClass.Help);

            id = RequestHelper.GetQueryString <int>("id");


            if (id == int.MinValue && helpClassList.Count > 0)
            {
                id = helpClassList[0].Id;
            }

            if (id > 0)
            {
                if (ArticleClassBLL.Read(id).ParentId == 2)
                {
                    fatherID = id;
                    artId    = ArticleClassBLL.ReadChilds(id)[0].Id;
                }
                else
                {
                    fatherID = ArticleClassBLL.Read(id).ParentId;
                    artId    = id;
                }
                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.ClassId = "|" + artId.ToString() + "|";
                articleList           = ArticleBLL.SearchList(articleSearch);
            }

            Title = "帮助中心";
        }
コード例 #2
0
        protected override void PageLoad()
        {
            base.PageLoad();
            ArticleSearchInfo article = new ArticleSearchInfo();

            article.ClassID = "|" + 1 + "|";
            article.IsTop   = 1;
            int count = -2147483648;

            this.topArticleList = ArticleBLL.SearchArticleList(1, 15, article, ref count);
            int queryString = RequestHelper.GetQueryString <int>("Page");

            if (queryString < 1)
            {
                queryString = 1;
            }
            int pageSize = 20;

            count            = 0;
            article.ClassID  = "|" + 1 + "|";
            this.articleList = ArticleBLL.SearchArticleList(queryString, pageSize, article, ref count);
            this.commonPagerClass.CurrentPage = queryString;
            this.commonPagerClass.PageSize    = pageSize;
            this.commonPagerClass.Count       = count;
            base.Title = "ÐÂÎÅ×ÊѶ";
        }
コード例 #3
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            int articleID = RequestHelper.GetQueryString <int>("ID");

            if (articleID == 1)
            {
                topNav = 6;
            }
            article = ArticleBLL.Read(articleID);

            if (article.ClassId != string.Empty)
            {
                article.ClassId = article.ClassId.Substring(1);
                articleClassID  = Convert.ToInt32(article.ClassId.Substring(0, article.ClassId.IndexOf('|')));

                ArticleSearchInfo aSearch = new ArticleSearchInfo();
                aSearch.ClassId = "|" + articleClassID + "|";
                articleList     = ArticleBLL.SearchList(aSearch);
            }

            Title       = article.Title;
            Keywords    = (article.Keywords == string.Empty) ? article.Title : article.Keywords;
            Description = (article.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(article.Content), 200) : article.Summary;
        }
コード例 #4
0
        protected override void PageLoad()
        {
            base.Title = "°ïÖúÖÐÐÄ";
            base.PageLoad();

            if (string.IsNullOrEmpty(searchKey))
            {
                this.id = RequestHelper.GetQueryString <int>("ID");
                if ((this.id == -2147483648) && (base.helpClassList.Count > 0))
                {
                    this.id = ArticleClassBLL.ReadArticleClassChildList(base.helpClassList[0].ID)[0].ID;
                }
                if (this.id > 0)
                {
                    ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                    articleSearch.ClassID = "|" + this.id.ToString() + "|";
                    this.articleList      = ArticleBLL.SearchArticleList(articleSearch);
                }
            }
            else
            {
                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.Condition = "([Keywords] like '%" + searchKey + "%' Or [Title] like '%" + searchKey + "%')";
                this.articleList        = ArticleBLL.SearchArticleList(articleSearch);
            }
        }
コード例 #5
0
ファイル: Article.aspx.cs プロジェクト: xuefuruanjian/ems
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("ReadArticle", PowerCheckType.Single);
         foreach (ArticleClassInfo info in ArticleClassBLL.ReadArticleClassNamedList())
         {
             this.ArticleClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|"));
         }
         this.ArticleClassID.Items.Insert(0, new ListItem("ËùÓзÖÀà", string.Empty));
         this.Title.Text          = RequestHelper.GetQueryString <string>("Title");
         this.ArticleClassID.Text = RequestHelper.GetQueryString <string>("ClassID");
         this.IsTop.Text          = RequestHelper.GetQueryString <string>("IsTop");
         this.classID             = RequestHelper.GetQueryString <string>("ClassID");
         if (this.classID != string.Empty)
         {
             this.classID = ArticleClassBLL.ReadArticleClassFullFatherID(Convert.ToInt32(this.classID.Replace("|", string.Empty)));
             this.classID = this.classID.Substring(1, this.classID.Length - 2);
             if (this.classID.IndexOf('|') > -1)
             {
                 this.classID = this.classID.Substring(0, this.classID.IndexOf('|'));
             }
         }
         ArticleSearchInfo article = new ArticleSearchInfo();
         article.Title   = RequestHelper.GetQueryString <string>("Title");
         article.ClassID = RequestHelper.GetQueryString <string>("ClassID");
         article.IsTop   = RequestHelper.GetQueryString <int>("IsTop");
         base.BindControl(ArticleBLL.SearchArticleList(base.CurrentPage, base.PageSize, article, ref this.Count), this.RecordList, this.MyPager);
     }
 }
コード例 #6
0
 /// <summary>
 /// 绑定关联产品,配件,文章
 /// </summary>
 /// <param name="product"></param>
 protected void BindRelation(ProductInfo product)
 {
     if (product.RelationArticle != string.Empty)
     {
         ArticleSearchInfo articleSearch = new ArticleSearchInfo();
         articleSearch.InArticleId = product.RelationArticle;
         Article.DataSource        = ArticleBLL.SearchList(articleSearch);
         Article.DataTextField     = "Title";
         Article.DataValueField    = "ID";
         Article.DataBind();
     }
     if (product.RelationProduct != string.Empty)
     {
         ProductSearchInfo productSearch = new ProductSearchInfo();
         productSearch.InProductId = product.RelationProduct;
         Product.DataSource        = ProductBLL.SearchList(productSearch);
         Product.DataTextField     = "Name";
         Product.DataValueField    = "ID";
         Product.DataBind();
     }
     if (product.Accessory != string.Empty)
     {
         ProductSearchInfo productSearch = new ProductSearchInfo();
         productSearch.InProductId = product.Accessory;
         Accessory.DataSource      = ProductBLL.SearchList(productSearch);
         Accessory.DataTextField   = "Name";
         Accessory.DataValueField  = "ID";
         Accessory.DataBind();
     }
 }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadArticle", PowerCheckType.Single);
                foreach (ArticleClassInfo articleClass in ArticleClassBLL.ReadNamedList())
                {
                    ArticleClassID.Items.Add(new ListItem(articleClass.Name, "|" + articleClass.Id + "|"));
                }
                ArticleClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));
                Title.Text          = RequestHelper.GetQueryString <string>("Title");
                ArticleClassID.Text = RequestHelper.GetQueryString <string>("ClassID");
                IsTop.Text          = RequestHelper.GetQueryString <string>("IsTop");
                //页签的判断
                classID = RequestHelper.GetQueryString <string>("ClassID");
                if (classID != string.Empty)
                {
                    classID = ArticleClassBLL.ReadFullParentId(Convert.ToInt32(classID.Replace("|", string.Empty)));
                    classID = classID.Substring(1, classID.Length - 2);
                    if (classID.IndexOf('|') > -1)
                    {
                        classID = classID.Substring(0, classID.IndexOf('|'));
                    }
                }

                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.Title   = RequestHelper.GetQueryString <string>("Title");
                articleSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID");
                articleSearch.IsTop   = RequestHelper.GetQueryString <int>("IsTop");

                BindControl(ArticleBLL.SearchList(CurrentPage, PageSize, articleSearch, ref Count), RecordList, MyPager);
            }
        }
コード例 #8
0
ファイル: ProductAdd.aspx.cs プロジェクト: xuefuruanjian/ems
        protected void BindRelation(ProductInfo product)
        {
            ProductSearchInfo info2;

            if (product.RelationArticle != string.Empty)
            {
                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.InArticleID   = product.RelationArticle;
                this.Article.DataSource     = ArticleBLL.SearchArticleList(articleSearch);
                this.Article.DataTextField  = "Title";
                this.Article.DataValueField = "ID";
                this.Article.DataBind();
            }
            if (product.RelationProduct != string.Empty)
            {
                info2                       = new ProductSearchInfo();
                info2.InProductID           = product.RelationProduct;
                this.Product.DataSource     = ProductBLL.SearchProductList(info2);
                this.Product.DataTextField  = "Name";
                this.Product.DataValueField = "ID";
                this.Product.DataBind();
            }
            if (product.Accessory != string.Empty)
            {
                info2                         = new ProductSearchInfo();
                info2.InProductID             = product.Accessory;
                this.Accessory.DataSource     = ProductBLL.SearchProductList(info2);
                this.Accessory.DataTextField  = "Name";
                this.Accessory.DataValueField = "ID";
                this.Accessory.DataBind();
            }
        }
コード例 #9
0
        /// <summary>
        /// 搜索关联文章
        /// </summary>
        private void SearchRelationArticle()
        {
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();

            articleSearch.Title   = RequestHelper.GetQueryString <string>("ArticleTitle");
            articleSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID");
            articleList           = ArticleBLL.SearchList(articleSearch);
        }
コード例 #10
0
        /// <summary>
        /// 根据帮助分类类型获取URL
        /// </summary>
        /// <param name="articleClass"></param>
        /// <returns></returns>
        public static string GetHelpClassUrl(ArticleClassInfo articleClass)
        {
            string           url      = "";
            ArticleClassInfo tmpCLass = new ArticleClassInfo();

            if (ArticleClassBLL.ReadChilds(articleClass.Id).Count > 0 && Read(articleClass.Id).ShowType != 5)
            {
                tmpCLass = ArticleClassBLL.ReadChilds(articleClass.Id)[0]; //如果是父级分类则取第一个子分类的URL
            }
            else
            {
                tmpCLass = articleClass;//如果不是父级分类则取当前分类的URL
            }
            switch (tmpCLass.ShowType)
            {
            case 5:    //链接URL
                url = string.IsNullOrEmpty(tmpCLass.Description) ? "/" : tmpCLass.Description;
                break;

            case 4:    //父级分类
            {
                List <ArticleClassInfo> childlist = ReadChilds(articleClass.Id);
                if (childlist.Count > 0)
                {
                    url = GetHelpClassUrl(childlist[0]);
                }
                else
                {
                    url = "/";
                }
            }
            break;

            case 2:    //文章列表
                url = "/Help-C" + tmpCLass.Id + ".html";
                break;

            case 1:    //单文章
            default:
            {
                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.ClassId = "|" + tmpCLass.Id + "|";
                List <ArticleInfo> articleList = ArticleBLL.SearchList(articleSearch);
                if (articleList.Count > 0)
                {
                    url = "/HelpDetail-I" + articleList[0].Id + ".html";
                }
                else
                {
                    url = "/Help-C" + tmpCLass.Id + ".html";
                }
            }
            break;
            }
            return(url);
        }
コード例 #11
0
 public static List <ArticleInfo> ReadBottomList()
 {
     if (CacheHelper.Read(cacheKey) == null)
     {
         ArticleSearchInfo articleSearch = new ArticleSearchInfo();
         articleSearch.ClassId = "|3|";
         CacheHelper.Write(cacheKey, dal.SearchList(articleSearch));
     }
     return((List <ArticleInfo>)CacheHelper.Read(cacheKey));
 }
コード例 #12
0
        protected override void PageLoad()
        {
            base.PageLoad();
            articleClassID = RequestHelper.GetQueryString <int>("ID");
            keywords       = RequestHelper.GetQueryString <string>("Keywords");
            if (articleClassID <= 0)
            {
                articleClassID = 64;                   //默认竞网快报
            }
            thisClass = ArticleClassBLL.Read(articleClassID);

            int topClassID = 0;

            ArticleClassBLL.GetTopClassID(articleClassID, ref topClassID);
            topNav = topClassID;

            topClass = ArticleClassBLL.Read(topClassID);


            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }

            int count = int.MinValue;
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();

            if (string.IsNullOrEmpty(keywords))
            {
                articleSearch.ClassId = "|" + articleClassID + "|";
            }
            else
            {
                //articleSearch.Key = keywords;
                articleSearch.Title = keywords;
                //articleSearch.Keywords = keywords;
                //articleSearch.InClassId = "38,44,47";//只搜索 指定的分类
            }
            articleList = ArticleBLL.SearchList(1, pageSize, articleSearch, ref count);


            //SEO
            if (string.IsNullOrEmpty(keywords))
            {
                Title = thisClass.Name;
            }
            else
            {
                Title = "搜索结果";
            }
            Keywords    = thisClass.Name;
            Description = thisClass.Description;
        }
コード例 #13
0
ファイル: ArticleDAL.cs プロジェクト: xuefuruanjian/ems
 public void PrepareCondition(MssqlCondition mssqlCondition, ArticleSearchInfo articleSearch)
 {
     mssqlCondition.Add("[Title]", articleSearch.Title, ConditionType.Like);
     mssqlCondition.Add("[ClassID]", articleSearch.ClassID, ConditionType.Like);
     mssqlCondition.Add("[IsTop]", articleSearch.IsTop, ConditionType.Equal);
     mssqlCondition.Add("[Author]", articleSearch.Author, ConditionType.Like);
     mssqlCondition.Add("[Resource]", articleSearch.Resource, ConditionType.Like);
     mssqlCondition.Add("[Keywords]", articleSearch.Keywords, ConditionType.Like);
     mssqlCondition.Add("[Date]", articleSearch.StartDate, ConditionType.MoreOrEqual);
     mssqlCondition.Add("[Date]", articleSearch.EndDate, ConditionType.LessOrEqual);
     mssqlCondition.Add("[ID]", articleSearch.InArticleID, ConditionType.In);
     mssqlCondition.Add(articleSearch.Condition);
 }
コード例 #14
0
        protected override void PageLoad()
        {
            base.PageLoad();

            //每日快报
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();

            articleSearch.ClassID = "|29|";
            this.newsList         = ArticleBLL.SearchArticleList(1, 12, articleSearch, ref base.Count);

            //证书
            certList = PostPassBLL.GetTheLatestPostCert(10);
        }
コード例 #15
0
ファイル: NewsAjax.cs プロジェクト: skybluebin007/JW-Shop
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();

            ArticleSearchInfo articleSearch = new ArticleSearchInfo();

            id = RequestHelper.GetQueryString <int>("ID");
            if (id <= 0)
            {
                id = 64;
            }
            curArticleClass = ArticleClassBLL.Read(id);

            articleSearch.ClassId = "|" + curArticleClass.Id + "|";
            //articleSearch.IsTop = (int)BoolType.True;
            int count = int.MinValue;

            topArticleList = ArticleBLL.SearchList(1, 15, articleSearch, ref count);

            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int pageSize = 20;

            count = 0;
            if (id > 0)
            {
                articleSearch.ClassId = "|" + id + "|";
            }
            articleList = ArticleBLL.SearchList(currentPage, pageSize, articleSearch, ref count);

            //commonPagerClass.Init(currentPage, pageSize, count, !string.IsNullOrEmpty(isMobile));

            commonPagerClass.CurrentPage = currentPage;
            commonPagerClass.PageSize    = pageSize;
            commonPagerClass.Count       = count;
            commonPagerClass.FirstPage   = "<<首页";
            commonPagerClass.PreviewPage = "<<上一页";
            commonPagerClass.NextPage    = "下一页>>";
            commonPagerClass.LastPage    = "末页>>";
            commonPagerClass.ListType    = false;
            commonPagerClass.DisCount    = false;
            commonPagerClass.PrenextType = true;

            //Title = "新闻资讯";
        }
コード例 #16
0
ファイル: ArticleDAL.cs プロジェクト: xuefuruanjian/ems
        public List <ArticleInfo> SearchArticleList(ArticleSearchInfo articleSearch)
        {
            MssqlCondition mssqlCondition = new MssqlCondition();

            this.PrepareCondition(mssqlCondition, articleSearch);
            List <ArticleInfo> articleList = new List <ArticleInfo>();

            SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@condition", SqlDbType.NVarChar) };
            pt[0].Value = mssqlCondition.ToString();
            using (SqlDataReader reader = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "SearchArticleList", pt))
            {
                this.PrepareArticleModel(reader, articleList);
            }
            return(articleList);
        }
コード例 #17
0
ファイル: Bussiness.cs プロジェクト: xuefuruanjian/ems
        protected override void PageLoad()
        {
            if (StringHelper.CompareSingleString(base.ParentCompanyID, "667"))
            {
                Response.Redirect("/");
            }
            base.PageLoad();
            base.CheckUserPower("PostStudy", PowerCheckType.Single);
            //最新一条信息
            int[] classIDArray = new int[] { 33, 37, 38 };
            foreach (int item in classIDArray)
            {
                ArticleInfo article = ArticleBLL.ReadFirstAtricle(item);
                if (article.Date >= DateTime.Now.AddDays(-7))
                {
                    articleDc.Add(item, article);
                }
            }

            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.IsNew = 1;
            //productSearch.IsTop = 1;
            productSearch.IsSale = 1;
            int count = -2147483648;

            this.newProductList = ProductBLL.SearchProductList(1, 10, productSearch, ref count);

            //每日快报
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();

            articleSearch.ClassID = "|29|";
            this.newsList         = ArticleBLL.SearchArticleList(1, 12, articleSearch, ref base.Count);

            //证书
            certList = PostPassBLL.GetTheLatestPostCert(10);


            attributeRecordList = AttributeRecordBLL.ReadList("1,2,3", ProductBLL.ReadProductIdStr(this.newProductList));
            int studyPostID = int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId"));
            //this.studyPost = PostBLL.ReadPost(studyPostID);
            string postCourseID = PostBLL.ReadPostCourseID(base.UserCompanyID, studyPostID);

            companyBrandID   = CookiesHelper.ReadCookieValue("UserCompanyBrandID");
            passPostCourseID = string.IsNullOrEmpty(postCourseID) ? "" : TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, postCourseID, 1));
        }
コード例 #18
0
        protected override void PageLoad()
        {
            base.PageLoad();
            articleClassID = RequestHelper.GetQueryString <int>("ID");

            if (articleClassID <= 0)
            {
                articleClassID = 46;                     //默认企业动态
            }
            thisClass = ArticleClassBLL.Read(articleClassID);

            int topClassID = 0;

            ArticleClassBLL.GetTopClassID(articleClassID, ref topClassID);
            topNav = topClassID;

            topClass = ArticleClassBLL.Read(topClassID);


            navList = ArticleClassBLL.ReadArticleClassFullFatherID(articleClassID);


            int count = int.MinValue;
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();

            //if (string.IsNullOrEmpty(keywords))
            articleSearch.ClassId = "|" + articleClassID + "|";
            //else
            //{
            //    //articleSearch.Key = keywords;
            //    articleSearch.Title = keywords;
            //    //articleSearch.Keywords = keywords;
            //    articleSearch.InClassId = "38,44,46,47";
            //}
            articleList = ArticleBLL.SearchList(1, 4, articleSearch, ref count);

            //if (string.IsNullOrEmpty(keywords)) commonPagerClass.URL = "/article-C" + articleClassID + "-P$Page.html";
            //else commonPagerClass.URL = "/article/Keyword/" + keywords + "-P$Page.html";


            //SEO
            Title       = thisClass.Name;
            Keywords    = thisClass.Name;
            Description = thisClass.Description;
        }
コード例 #19
0
ファイル: ArticleDAL.cs プロジェクト: xuefuruanjian/ems
        public List <ArticleInfo> SearchArticleList(int currentPage, int pageSize, ArticleSearchInfo articleSearch, ref int count)
        {
            List <ArticleInfo>  articleList = new List <ArticleInfo>();
            ShopMssqlPagerClass class2      = new ShopMssqlPagerClass();

            class2.TableName   = ShopMssqlHelper.TablePrefix + "Article";
            class2.Fields      = "[ID],[Title],[ClassID],[IsTop],[Author],[Resource],[Keywords],[Url],[Photo],[Summary],[Content],[Date]";
            class2.CurrentPage = currentPage;
            class2.PageSize    = pageSize;
            class2.OrderField  = "[ID]";
            class2.OrderType   = OrderType.Desc;
            this.PrepareCondition(class2.MssqlCondition, articleSearch);
            class2.Count = count;
            count        = class2.Count;
            using (SqlDataReader reader = class2.ExecuteReader())
            {
                this.PrepareArticleModel(reader, articleList);
            }
            return(articleList);
        }
コード例 #20
0
ファイル: Help.cs プロジェクト: skybluebin007/JW-Shop
        protected override void PageLoad()
        {
            base.PageLoad();

            helpClassList = ArticleClassBLL.ReadArticleClassChildList(ArticleClass.Help);

            id = RequestHelper.GetQueryString <int>("id");
            if (id == int.MinValue && helpClassList.Count > 0)
            {
                id = ArticleClassBLL.ReadArticleClassChildList(helpClassList[0].ID)[0].ID;
            }

            if (id > 0)
            {
                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.ClassID = "|" + id.ToString() + "|";
                articleList           = ArticleBLL.SearchArticleList(articleSearch);
            }

            Title = "帮助中心";
        }
コード例 #21
0
ファイル: ArticleDetail.cs プロジェクト: xuefuruanjian/ems
        protected override void PageLoad()
        {
            base.PageLoad();
            int queryString = RequestHelper.GetQueryString <int>("ID");

            this.article = ArticleBLL.ReadArticle(queryString);
            if (this.article.ClassID != string.Empty)
            {
                this.article.ClassID = this.article.ClassID.Substring(1);
                this.articleClassID  = Convert.ToInt32(this.article.ClassID.Substring(0, this.article.ClassID.IndexOf('|')));
            }
            ArticleSearchInfo article = new ArticleSearchInfo();

            switch (this.articleClassID)
            {
            case 1:
            {
                article.ClassID = "|" + 1 + "|";
                article.IsTop   = 1;
                int count = -2147483648;
                this.topArticleList = ArticleBLL.SearchArticleList(1, 15, article, ref count);
                break;
            }

            case 3:
            {
                int id = RequestHelper.GetQueryString <int>("ProductID");
                this.product = ProductBLL.ReadProduct(id);
                if (this.product.RelationArticle != string.Empty)
                {
                    article.InArticleID     = this.product.RelationArticle;
                    this.productArticleList = ArticleBLL.SearchArticleList(article);
                }
                break;
            }
            }
            base.Title       = this.article.Title;
            base.Keywords    = (this.article.Keywords == string.Empty) ? this.article.Title : this.article.Keywords;
            base.Description = (this.article.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(this.article.Content), 200) : this.article.Summary;
        }
コード例 #22
0
        public static ArticleInfo ReadFirstAtricle(int classID)
        {
            if (FirstArticleDc == null || !FirstArticleDc.ContainsKey(classID))
            {
                int page     = 1;
                int pageSize = 1;
                int count    = 0;
                if (FirstArticleDc == null)
                {
                    FirstArticleDc = new Dictionary <int, ArticleInfo>();
                }

                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.ClassID = "|" + classID + "|";
                List <ArticleInfo> articleList = ArticleBLL.SearchArticleList(page, pageSize, articleSearch, ref count);
                if (articleList.Count > 0)
                {
                    FirstArticleDc.Add(classID, articleList[0]);
                }
            }
            return(FirstArticleDc[classID]);
        }
コード例 #23
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            int articleID = RequestHelper.GetQueryString <int>("ID");

            if (articleID == 60)
            {
                topNav = 6;
                int counts = 0;
                if ((ArticleBLL.SearchList(1, 1, new ArticleSearchInfo {
                    ClassId = "|60|"
                }, ref counts).Count > 0))
                {
                    articleID = ArticleBLL.SearchList(1, 1, new ArticleSearchInfo {
                        ClassId = "|60|"
                    }, ref counts)[0].Id;
                }
            }
            article = ArticleBLL.Read(articleID);
            ArticleInfo tmp = article;

            tmp.ViewCount = tmp.ViewCount + 1;

            ArticleBLL.Update(tmp);

            thisClass = ArticleClassBLL.Read(ArticleClassBLL.GetLastClassID(article.ClassId));

            int topClassID = ArticleClassBLL.GetTopClassID(article.ClassId);

            topNav = topClassID;

            topClass = ArticleClassBLL.Read(topClassID);

            if (thisClass.Id == 60)
            {
                topNav = 6;
            }

            string theArticleClassID = article.ClassId;
            int    lastClassID       = int.MinValue;

            if (theArticleClassID != string.Empty)
            {
                theArticleClassID = theArticleClassID.Substring(1);
                lastClassID       = Convert.ToInt32(theArticleClassID.Substring(0, theArticleClassID.IndexOf('|')));
            }

            navList = ArticleClassBLL.ReadArticleClassFullFatherID(ArticleClassBLL.GetLastClassID(article.ClassId));
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();


            List <ArticleInfo> nextPreList = new List <ArticleInfo>();

            if (ArticleBLL.SearchListRowNumber(" ID =" + article.Id + "").Count > 0)
            {
                ArticleInfo thisArtInfo = ArticleBLL.SearchListRowNumber(" ID =" + article.Id + "")[0];
                nextPreList = ArticleBLL.SearchListRowNumber(" [ClassID] Like'%" + article.ClassId + "%' and [RowNumber]>" + thisArtInfo.RowNumber + " Order by RowNumber asc");


                if (nextPreList.Count > 0)
                {
                    NextNews  = "<a href=\"/articledetail-I" + nextPreList[0].Id + ".html\" title=\"" + nextPreList[0].Title + "\">" + StringHelper.Substring(nextPreList[0].Title, 20) + "</a>";
                    NextNewsM = "<a href=\"/mobile/articledetail-I" + nextPreList[0].Id + ".html\" title=\"" + nextPreList[0].Title + "\">" + StringHelper.Substring(nextPreList[0].Title, 13) + "</a>";
                }

                nextPreList = ArticleBLL.SearchListRowNumber(" ClassID Like'%" + article.ClassId + "%' and RowNumber<" + thisArtInfo.RowNumber + " Order by RowNumber desc");
                if (nextPreList.Count > 0)
                {
                    PreNews  = "<a href=\"/articledetail-I" + nextPreList[0].Id + ".html\" title=\"" + nextPreList[0].Title + "\">" + StringHelper.Substring(nextPreList[0].Title, 20) + "</a>";
                    PreNewsM = "<a href=\"/mobile/articledetail-I" + nextPreList[0].Id + ".html\" title=\"" + nextPreList[0].Title + "\">" + StringHelper.Substring(nextPreList[0].Title, 13) + "</a>";
                }
            }

            //SEO
            Title       = article.Title;
            Keywords    = (article.Keywords == string.Empty) ? article.Title : article.Keywords;
            Description = (article.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(article.Content), 200) : article.Summary;
        }
コード例 #24
0
        protected override void PageLoad()
        {
            base.PageLoad();
            int articleClassID = RequestHelper.GetQueryString <int>("ID");

            keywords = RequestHelper.GetQueryString <string>("Keywords");
            if (articleClassID <= 0)
            {
                articleClassID = 2;                   //默认企业动态
            }
            thisClass = ArticleClassBLL.Read(articleClassID);

            int topClassID = 0;

            ArticleClassBLL.GetTopClassID(articleClassID, ref topClassID);
            topNav = topClassID;

            topClass = ArticleClassBLL.Read(topClassID);

            //ArticleClassBLL.ReadChilds();
            navList = ArticleClassBLL.ReadArticleClassFullFatherID(articleClassID);

            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int pageSize = 4;

            if (RequestHelper.RawUrl.ToLower().IndexOf("/mobile") > -1)
            {
                pageSize = 4;                                                      //手机端每页4条
            }
            int count = int.MinValue;
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();

            if (string.IsNullOrEmpty(keywords))
            {
                articleSearch.ClassId = "|" + articleClassID + "|";
            }
            else
            {
                //articleSearch.Key = keywords;
                articleSearch.Title = keywords;
                //articleSearch.Keywords = keywords;
                articleSearch.InClassId = "38,44,47";//只搜索 企业动态  养老政策  安华公益
            }
            articleList = ArticleBLL.SearchList(currentPage, pageSize, articleSearch, ref count);

            if (string.IsNullOrEmpty(keywords))
            {
                commonPagerClass.URL = "/article-C" + articleClassID + "-P$Page.html";
            }
            else
            {
                commonPagerClass.URL = "/article/Keyword/" + keywords + "-P$Page.html";
            }
            commonPagerClass.CurrentPage   = currentPage;
            commonPagerClass.PageSize      = pageSize;
            commonPagerClass.Count         = count;
            commonPagerClass.FirstLastType = true;
            commonPagerClass.FirstPage     = "首页";
            commonPagerClass.LastPage      = "尾页";
            //SEO
            if (string.IsNullOrEmpty(keywords))
            {
                Title = thisClass.Name;
            }
            else
            {
                Title = "搜索结果";
            }
            Keywords    = thisClass.Name;
            Description = thisClass.Description;
        }
コード例 #25
0
ファイル: ProductDetail.cs プロジェクト: xuefuruanjian/ems
        protected override void PageLoad()
        {
            base.PageLoad();
            int queryString = RequestHelper.GetQueryString <int>("ID");

            this.product = ProductBLL.ReadProduct(queryString);
            if (this.product.IsSale == 0)
            {
                ScriptHelper.Alert("该产品未上市,不能查看");
            }
            ProductBLL.ChangeProductViewCount(queryString, 1);
            this.userGradeList      = UserGradeBLL.ReadUserGradeCacheList();
            this.memberPriceList    = MemberPriceBLL.ReadMemberPriceByProduct(queryString);
            this.currentMemberPrice = (this.product.MarketPrice * UserGradeBLL.ReadUserGradeCache(base.GradeID).Discount) / 100M;
            foreach (MemberPriceInfo info in this.memberPriceList)
            {
                if (info.GradeID == base.GradeID)
                {
                    this.currentMemberPrice = info.Price;
                    break;
                }
            }
            this.currentMemberPrice = Math.Round(this.currentMemberPrice, 2);
            ProductPhotoInfo item = new ProductPhotoInfo();

            item.Name  = this.product.Name;
            item.Photo = this.product.Photo;
            this.productPhotoList.Add(item);
            this.productPhotoList.AddRange(ProductPhotoBLL.ReadProductPhotoByProduct(queryString));
            this.strHistoryProduct = base.Server.UrlDecode(CookiesHelper.ReadCookieValue("HistoryProduct"));
            string strProductID = (this.product.RelationProduct + "," + this.product.Accessory + "," + this.strHistoryProduct).Replace(",,", ",");

            if (strProductID.StartsWith(","))
            {
                strProductID = strProductID.Substring(1);
            }
            if (strProductID.EndsWith(","))
            {
                strProductID = strProductID.Substring(0, strProductID.Length - 1);
            }
            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.InProductID = strProductID;
            this.tempProductList      = ProductBLL.SearchProductList(productSearch);
            if (strProductID != string.Empty)
            {
                this.tempMemberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
            }
            this.attributeRecordList = AttributeRecordBLL.ReadAttributeRecordByProduct(queryString);
            TagsSearchInfo tags = new TagsSearchInfo();

            tags.ProductID       = queryString;
            this.productTagsList = TagsBLL.SearchTagsList(tags);
            if (this.product.RelationArticle != string.Empty)
            {
                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.InArticleID = this.product.RelationArticle;
                this.productArticleList   = ArticleBLL.SearchArticleList(articleSearch);
            }
            this.standardRecordList = StandardRecordBLL.ReadStandardRecordByProduct(this.product.ID, this.product.StandardType);
            if ((this.standardRecordList.Count > 0) && (this.product.StandardType == 1))
            {
                string[] strArray = this.standardRecordList[0].StandardIDList.Split(new char[] { ',' });
                for (int i = 0; i < strArray.Length; i++)
                {
                    StandardInfo info6     = StandardBLL.ReadStandardCache(Convert.ToInt32(strArray[i]));
                    string[]     strArray2 = info6.ValueList.Split(new char[] { ',' });
                    string[]     strArray3 = info6.PhotoList.Split(new char[] { ',' });
                    string       str2      = string.Empty;
                    string       str3      = string.Empty;
                    for (int j = 0; j < strArray2.Length; j++)
                    {
                        foreach (StandardRecordInfo info7 in this.standardRecordList)
                        {
                            string[] strArray4 = info7.ValueList.Split(new char[] { ',' });
                            if (strArray2[j] == strArray4[i])
                            {
                                str2 = str2 + strArray2[j] + ",";
                                str3 = str3 + strArray3[j] + ",";
                                goto Label_043B;
                            }
                        }
                        Label_043B :;
                    }
                    if (str2 != string.Empty)
                    {
                        str2 = str2.Substring(0, str2.Length - 1);
                        str3 = str3.Substring(0, str3.Length - 1);
                    }
                    info6.ValueList = str2;
                    info6.PhotoList = str3;
                    this.standardList.Add(info6);
                }
                foreach (StandardRecordInfo info7 in this.standardRecordList)
                {
                    object standardRecordValueList = this.standardRecordValueList;
                    this.standardRecordValueList = string.Concat(new object[] { standardRecordValueList, info7.ProductID, ",", info7.ValueList, "|" });
                }
            }
            if (ShopConfig.ReadConfigInfo().ProductStorageType == 1)
            {
                this.leftStorageCount = this.product.TotalStorageCount - this.product.OrderCount;
            }
            else
            {
                this.leftStorageCount = this.product.ImportVirtualStorageCount;
            }
            base.Title       = this.product.Name;
            base.Keywords    = (this.product.Keywords == string.Empty) ? this.product.Name : this.product.Keywords;
            base.Description = (this.product.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(this.product.Introduction), 200) : this.product.Summary;
        }
コード例 #26
0
 public static List <ArticleInfo> SearchList(int currentPage, int pageSize, ArticleSearchInfo searchInfo, ref int count)
 {
     return(dal.SearchList(currentPage, pageSize, searchInfo, ref count));
 }
コード例 #27
0
        protected override void PageLoad()
        {
            if (!StringHelper.CompareSingleString(base.ParentCompanyID, "667") && base.UserID > 0)
            {
                Response.Redirect("/Bussiness.aspx");//User/CourseCenter.aspx
            }
            base.PageLoad();
            //ArticleSearchInfo article = new ArticleSearchInfo();
            //article.ClassID = "|" + 1.ToString() + "|";
            int count = -2147483648;
            //this.newsList = ArticleBLL.SearchArticleList(1, 7, article, ref count);
            ProductSearchInfo product = new ProductSearchInfo();

            product.IsNew = 1;
            //product.IsTop = 1;
            product.IsSale      = 1;
            count               = -2147483648;
            this.newProductList = ProductBLL.SearchProductList(1, 15, product, ref count);
            //product.IsTop = 1;
            //product.IsSale = 1;
            //product.MarketPrice = 0;
            //count = -2147483648;
            //this.freeProductList = ProductBLL.SearchProductList(1, 6, product, ref count);
            //product = new ProductSearchInfo();
            //product.IsHot = 1;
            //product.IsTop = 1;
            //product.IsSale = 1;
            //count = -2147483648;
            //this.hotProductList = ProductBLL.SearchProductList(1, 10, product, ref count);
            //product = new ProductSearchInfo();
            //product.IsSpecial = 1;
            //product.IsTop = 1;
            //product.IsSale = 1;
            //count = -2147483648;
            //this.specialProductList = ProductBLL.SearchProductList(product); //ProductBLL.SearchProductList(1, 10, product, ref count);
            //List<ProductInfo> list = new List<ProductInfo>();
            //list.AddRange(this.newProductList);
            //list.AddRange(this.hotProductList);
            //list.AddRange(this.specialProductList);
            //string strProductID = string.Empty;
            //foreach (ProductInfo info3 in list)
            //{
            //    if (strProductID == string.Empty)
            //    {
            //        strProductID = info3.ID.ToString();
            //    }
            //    else
            //    {
            //        strProductID = strProductID + "," + info3.ID.ToString();
            //    }
            //}
            //if (strProductID != string.Empty)
            //{
            //    this.memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
            //}
            //this.textLinkList = LinkBLL.ReadLinkCacheListByClass(1);
            //this.pictureLinkList = LinkBLL.ReadLinkCacheListByClass(2);

            attributeRecordList = AttributeRecordBLL.ReadList("1,2,3", ProductBLL.ReadProductIdStr(this.newProductList));

            //每日快报
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();

            articleSearch.ClassID = "|29|";
            this.newsList         = ArticleBLL.SearchArticleList(1, 12, articleSearch, ref base.Count);

            //证书
            certList = PostPassBLL.GetTheLatestPostCert(10);
        }
コード例 #28
0
        protected override void PageLoad()
        {
            base.PageLoad();
            int articleClassID = RequestHelper.GetQueryString <int>("ID");

            sera_Keywords = RequestHelper.GetQueryString <string>("kw");
            if (articleClassID <= 0)
            {
                articleClassID = 46;                     //默认企业动态
            }
            thisClass = ArticleClassBLL.Read(articleClassID);
            if (thisClass.ShowType == 1)
            {
                if (ArticleBLL.SearchList(new ArticleSearchInfo {
                    ClassId = "|" + articleClassID + "|"
                }).Count > 0)
                {
                    if (RequestHelper.RawUrl.ToLower().IndexOf("/mobile/") >= 0)
                    {
                        Response.Redirect("/HZ/Mobile/Product.aspx?id=" + ArticleBLL.SearchList(new ArticleSearchInfo {
                            ClassId = "|" + articleClassID + "|"
                        })[0].Id);
                    }
                    else
                    {
                        Response.Redirect("/HZ/Product.aspx?id=" + ArticleBLL.SearchList(new ArticleSearchInfo {
                            ClassId = "|" + articleClassID + "|"
                        })[0].Id);
                    }
                    Response.End();
                }
            }
            int topClassID = 0;

            ArticleClassBLL.GetTopClassID(articleClassID, ref topClassID);
            topNav = topClassID;
            switch (articleClassID)
            {
            case 54: topNav = 2;
                break;

            case 55: topNav = 3;
                break;

            case 56: topNav = 4;
                break;

            case 57: topNav = 5;
                break;

            default:
                break;
            }
            topClass = ArticleClassBLL.Read(topClassID);


            navList = ArticleClassBLL.ReadArticleClassFullFatherID(articleClassID);

            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int pageSize = 9;

            if (RequestHelper.RawUrl.ToLower().IndexOf("/mobile") > -1)
            {
                pageSize = 4;                                                        //手机端每页4条
            }
            int count = int.MinValue;
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();

            if (string.IsNullOrEmpty(sera_Keywords))
            {
                articleSearch.ClassId = "|" + articleClassID + "|";
            }
            else
            {
                //articleSearch.Keywords = keywords;
                articleSearch.Title = sera_Keywords;
                //articleSearch.Keywords = sera_Keywords;
                //articleSearch.InClassId = "58,54,55,56,57";
                articleSearch.ClassId = "|58|";
                #region 添加搜索历史记录


                var historySearch = CookiesHelper.ReadCookieValue("HistorySearch");
                if (("," + historySearch + ",").IndexOf("," + Server.UrlDecode(sera_Keywords) + ",") == -1)
                {
                    if (historySearch == "")
                    {
                        historySearch = Server.UrlDecode(sera_Keywords);
                    }
                    else
                    {
                        historySearch = Server.UrlDecode(sera_Keywords) + "," + historySearch;
                    }
                    if (historySearch.ToString().IndexOf(",") > -1)
                    {
                        if (historySearch.Split(',').Length > 8)
                        {
                            historySearch = historySearch.Substring(0, historySearch.LastIndexOf(","));
                        }
                    }
                    CookiesHelper.AddCookie("HistorySearch", historySearch, 3, TimeType.Day);
                }
                #endregion
            }
            articleList = ArticleBLL.SearchList(currentPage, pageSize, articleSearch, ref count);

            //if (string.IsNullOrEmpty(keywords)) commonPagerClass.URL = "/article-C" + articleClassID + "-P$Page.html";
            //else commonPagerClass.URL = "/article/Keyword/" + keywords + "-P$Page.html";
            commonPagerClass.URL           = "/picture-C" + articleClassID + "-P$Page.html";
            commonPagerClass.CurrentPage   = currentPage;
            commonPagerClass.PageSize      = pageSize;
            commonPagerClass.Count         = count;
            commonPagerClass.FirstLastType = true;
            commonPagerClass.FirstPage     = "首页";
            commonPagerClass.LastPage      = "尾页";

            //SEO
            Title       = thisClass.Name;
            Keywords    = thisClass.Name;
            Description = thisClass.Description;
        }
コード例 #29
0
 public static List <ArticleInfo> SearchList(ArticleSearchInfo searchInfo)
 {
     return(dal.SearchList(searchInfo));
 }
コード例 #30
0
ファイル: NewsDetail.cs プロジェクト: skybluebin007/JW-Shop
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            int articleID = RequestHelper.GetQueryString <int>("ID");

            article = ArticleBLL.Read(articleID);
            ArticleInfo tmp = article;

            tmp.ViewCount = tmp.ViewCount + 1;

            ArticleBLL.Update(tmp);

            #region 微信分享
            Hashtable    ht  = new Hashtable();
            WechatCommon wxs = new WechatCommon();
            ht        = wxs.getSignPackage();
            timestamp = ht["timestamp"].ToString();
            nonce     = ht["nonceStr"].ToString();
            signature = ht["signature"].ToString();
            url       = ht["url"].ToString();

            WeChatImg = "http://" + HttpContext.Current.Request.Url.Host + article.Photo;
            title     = article.Title;
            desc      = (article.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(article.Content), 200) : article.Summary;
            #endregion

            thisClass = ArticleClassBLL.Read(ArticleClassBLL.GetLastClassID(article.ClassId));

            int topClassID = ArticleClassBLL.GetTopClassID(article.ClassId);
            topNav = topClassID;

            topClass = ArticleClassBLL.Read(topClassID);



            string theArticleClassID = article.ClassId;
            int    lastClassID       = int.MinValue;
            if (theArticleClassID != string.Empty)
            {
                theArticleClassID = theArticleClassID.Substring(1);
                lastClassID       = Convert.ToInt32(theArticleClassID.Substring(0, theArticleClassID.IndexOf('|')));
            }

            navList = ArticleClassBLL.ReadArticleClassFullFatherID(ArticleClassBLL.GetLastClassID(article.ClassId));
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();


            List <ArticleInfo> nextPreList = new List <ArticleInfo>();
            if (ArticleBLL.SearchListRowNumber(" ID =" + article.Id + "").Count > 0)
            {
                ArticleInfo thisArtInfo = ArticleBLL.SearchListRowNumber(" ID =" + article.Id + "")[0];
                nextPreList = ArticleBLL.SearchListRowNumber(" [ClassID] Like'%" + article.ClassId + "%' and [RowNumber]>" + thisArtInfo.RowNumber + " Order by RowNumber asc");


                if (nextPreList.Count > 0)
                {
                    NextNewsM = "<a href=\"/mobile/Newsdetail.html?id=" + nextPreList[0].Id + "\" title=\"" + nextPreList[0].Title + "\" class=\"nextLink\">" + "下一篇:" + StringHelper.Substring(nextPreList[0].Title, 13) + "</a>";
                }

                nextPreList = ArticleBLL.SearchListRowNumber(" ClassID Like'%" + article.ClassId + "%' and RowNumber<" + thisArtInfo.RowNumber + " Order by RowNumber desc");
                if (nextPreList.Count > 0)
                {
                    PreNewsM = "<a href=\"/mobile/Newsdetail.html?id=" + nextPreList[0].Id + "\" title=\"" + nextPreList[0].Title + "\" class=\"prevLink\">" + "上一篇:" + StringHelper.Substring(nextPreList[0].Title, 13) + "</a>";
                }
            }

            //SEO
            Title       = article.Title;
            Keywords    = (article.Keywords == string.Empty) ? article.Title : article.Keywords;
            Description = (article.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(article.Content), 200) : article.Summary;
        }