Beispiel #1
0
        public void ArticleDetailPage()
        {
            DAL.article artDal = new DAL.article();
            int         aid    = MyCommFun.RequestInt("aid");

            Model.article article = artDal.GetModel(aid);
            if (article != null)
            {
                this.Document.SetValue("model", article);
            }
        }
Beispiel #2
0
        public void ArticleDetailPage()
        {
            DAL.article artDal = new DAL.article();
            int         aid    = MyCommFun.RequestInt("aid");

            Model.article article = artDal.GetModel(aid);
            if (article != null)
            {
                this.Document.SetValue("model", article);
                this.Document.SetValue("fxTitle", article.title);
                this.Document.SetValue("fxDesc", article.zhaiyao);
                this.Document.SetValue("fxPic", MyCommFun.ImgAddHttp(article.img_url));
            }
        }
Beispiel #3
0
        /// <summary>
        /// 信息详情页面
        /// </summary>
        public void ArticleDetailPage()
        {
            DAL.article artDal = new DAL.article();
            int         aid    = MyCommFun.RequestInt("id");

            if (aid == 0)
            {
                var article_id = this.Document.GetChildTagById("article_id");
                if (article_id != null && article_id.Attributes["value"] != null)
                {
                    aid = MyCommFun.Obj2Int(article_id.Attributes["value"].Value.ToString());
                }
            }

            Model.article article = artDal.GetModel(aid);
            if (article != null)
            {
                this.Document.SetValue("model", article);
            }
        }
Beispiel #4
0
 private void Bind()
 {
     BLL.article        bll = new BLL.article();
     Model.article_news model;
     if (Request.QueryString["type"] != null)
     {
         model = new DAL.article().GetModel(id);
         lblDatetime.Visible = false;
     }
     else
     {
         model = bll.GetNewsModel(id);
     }
     if (model != null)
     {
         lblTitle.Text    = model.title;
         lblDatetime.Text = "發佈日期: " + model.add_time.ToString("yyyy-MM-dd");
         lblFrom.Text     = "來源:" + model.from;
         lblContent.Text  = model.content;
     }
 }
Beispiel #5
0
 public article()
 {
     dal = new DAL.article(sysConfig.sysdatabaseprefix);
 }
Beispiel #6
0
        /// <summary>
        /// 列表页面独有的数据
        /// </summary>
        public void ArticleClassPage()
        {
            int category_id = 0;
            int channel_id  = 0;

            category_id = MyCommFun.RequestInt("cid");

            if (category_id == 0)
            {
                var categoryid = this.Document.GetChildTagById("categoryid");
                category_id = MyCommFun.Obj2Int(categoryid.Attributes["value"].Value.ToString());
            }
            var channelid = this.Document.GetChildTagById("channel_id");

            channel_id = MyCommFun.Obj2Int(channelid.Attributes["value"].Value.ToString());


            //--=====begin: 将这个列表(文章类别)的基本信息展示出来 ====--
            DAL.article_category   cateDal  = new DAL.article_category("dt_");
            Model.article_category category = cateDal.GetModel(category_id);
            this.Document.SetValue("category", category);
            //--=====end: 将这个列表(文章类别)的基本信息展示出来 ====--

            Tag    orderByTag = this.Document.GetChildTagById("norderby");
            string orderby    = orderByTag.Attributes["value"].Value.ToString();

            Tag    pagesizeTag = this.Document.GetChildTagById("npagesize");
            string pagesizeStr = pagesizeTag.Attributes["value"].Value.ToString();

            int currPage    = 1;                              //当前页面
            int recordCount = 0;                              //总记录数
            int totPage     = 1;                              //总页数
            int pageSize    = MyCommFun.Str2Int(pagesizeStr); //每页的记录数

            if (pageSize <= 0)
            {
                pageSize = 10;
            }
            if (MyCommFun.RequestInt("page") > 0)
            {
                currPage = MyCommFun.RequestInt("page");
            }

            DataSet artlist = new DataSet();

            if (category_id != 0)
            {
                DAL.article artDal = new DAL.article();
                artlist = artDal.GetList("hotnews", category_id, pageSize, currPage, "channel_id=" + channel_id, orderby, out recordCount);
                if (artlist != null && artlist.Tables.Count > 0 && artlist.Tables[0].Rows.Count > 0)
                {
                    DataRow dr;
                    for (int i = 0; i < artlist.Tables[0].Rows.Count; i++)
                    {
                        dr = artlist.Tables[0].Rows[i];
                        if (dr["link_url"] == null || dr["link_url"].ToString().Trim().Length <= 0)
                        {
                            dr["link_url"] = "/portalpage/weixin_news_detail.aspx?id=" + dr["id"].ToString();
                        }

                        artlist.AcceptChanges();
                    }

                    totPage = recordCount / pageSize;
                    int yushu = recordCount % pageSize;
                    if (yushu > 0)
                    {
                        totPage += 1;
                    }
                    if (totPage < 1)
                    {
                        totPage = 1;
                    }
                }
                if (currPage > totPage)
                {
                    currPage = totPage;
                }
            }
            else
            {
                currPage    = 1;
                recordCount = 0;
                totPage     = 1;
            }
            this.Document.SetValue("totPage", totPage);   //总页数
            this.Document.SetValue("currPage", currPage); //当前页
            this.Document.SetValue("newslist", artlist);  //文章列表

            string beforePageStr = "";                    //上一页
            string nextPageStr   = "";                    //下一页
            string bgrey         = "c-p-grey";
            string ngrey         = "c-p-grey";

            if (currPage <= 1)
            {
                beforePageStr = "javascript:;";
                bgrey         = "c-p-grey";
            }
            else
            {
                beforePageStr = MyCommFun.ChangePageNum(MyCommFun.getTotalUrl(), (currPage - 1));
                beforePageStr = "href=\"" + beforePageStr + "\"";
                bgrey         = "";
            }

            if (currPage >= totPage)
            {
                nextPageStr = "javascript:;";
                ngrey       = " c-p-grey";
            }
            else
            {
                nextPageStr = MyCommFun.ChangePageNum(MyCommFun.getTotalUrl(), (currPage + 1));
                nextPageStr = "href=\"" + nextPageStr + "\"";
                ngrey       = "";
            }
            this.Document.SetValue("bpage", beforePageStr); //上一页
            this.Document.SetValue("npage", nextPageStr);   //下一页
            this.Document.SetValue("bgrey", bgrey);         //上一页灰色的样式
            this.Document.SetValue("ngrey", ngrey);         //下一页灰色的样式
        }
Beispiel #7
0
        private readonly Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(); //���վ��������Ϣ

        #endregion Fields

        #region Constructors

        public article()
        {
            dal = new DAL.article(siteConfig.sysdatabaseprefix);
        }
Beispiel #8
0
 public article()
 {
     dal = new DAL.article("dt_");
 }
Beispiel #9
0
        /// <summary>
        /// 列表页面独有的数据
        /// </summary>
        public void ArticleClassPage()
        {
            int category_id = 0;
            int channel_id = 0;
            category_id = MyCommFun.RequestInt("cid");

            if (category_id == 0)
            {
                var categoryid = this.Document.GetChildTagById("categoryid");
                category_id = MyCommFun.Obj2Int(categoryid.Attributes["value"].Value.ToString());
            }
            var channelid = this.Document.GetChildTagById("channel_id");
            channel_id = MyCommFun.Obj2Int(channelid.Attributes["value"].Value.ToString());

            //--=====begin: 将这个列表(文章类别)的基本信息展示出来 ====--
            DAL.article_category cateDal = new DAL.article_category("dt_");
            Model.article_category category = cateDal.GetModel(category_id);
            this.Document.SetValue("category", category);
            //--=====end: 将这个列表(文章类别)的基本信息展示出来 ====--

            Tag orderByTag = this.Document.GetChildTagById("norderby");
            string orderby = orderByTag.Attributes["value"].Value.ToString();

            Tag pagesizeTag = this.Document.GetChildTagById("npagesize");
            string pagesizeStr = pagesizeTag.Attributes["value"].Value.ToString();

            int currPage = 1;//当前页面
            int recordCount = 0;//总记录数
            int totPage = 1;//总页数
            int pageSize = MyCommFun.Str2Int(pagesizeStr);//每页的记录数
            if (pageSize <= 0)
            {
                pageSize = 10;
            }
            if (MyCommFun.RequestInt("page") > 0)
            {
                currPage = MyCommFun.RequestInt("page");
            }

            DataSet artlist = new DataSet();
            if (category_id != 0)
            {

                DAL.article artDal = new DAL.article();
                artlist = artDal.GetList("hotnews", category_id, pageSize, currPage, "channel_id=" + channel_id, orderby, out recordCount);
                if (artlist != null && artlist.Tables.Count > 0 && artlist.Tables[0].Rows.Count > 0)
                {
                    DataRow dr;
                    for (int i = 0; i < artlist.Tables[0].Rows.Count; i++)
                    {
                        dr = artlist.Tables[0].Rows[i];
                        if (dr["link_url"] == null || dr["link_url"].ToString().Trim().Length <= 0)
                        {
                            dr["link_url"] = "/portalpage/weixin_news_detail.aspx?id=" + dr["id"].ToString();
                        }

                        artlist.AcceptChanges();
                    }

                    totPage = recordCount / pageSize;
                    int yushu = recordCount % pageSize;
                    if (yushu > 0)
                    {
                        totPage += 1;
                    }
                    if (totPage < 1)
                    {
                        totPage = 1;
                    }
                }
                if (currPage > totPage)
                {
                    currPage = totPage;
                }
            }
            else
            {
                currPage = 1;
                recordCount = 0;
                totPage = 1;
            }
            this.Document.SetValue("totPage", totPage);//总页数
            this.Document.SetValue("currPage", currPage);//当前页
            this.Document.SetValue("newslist", artlist);//文章列表

            string beforePageStr = ""; //上一页
            string nextPageStr = ""; //下一页
            string bgrey = "c-p-grey";
            string ngrey = "c-p-grey";
            if (currPage <= 1)
            {
                beforePageStr = "javascript:;";
                bgrey = "c-p-grey";
            }
            else
            {
                beforePageStr = MyCommFun.ChangePageNum(MyCommFun.getTotalUrl(), (currPage - 1));
                beforePageStr = "href=\"" + beforePageStr + "\"";
                bgrey = "";
            }

            if (currPage >= totPage)
            {
                nextPageStr = "javascript:;";
                ngrey = " c-p-grey";
            }
            else
            {
                nextPageStr = MyCommFun.ChangePageNum(MyCommFun.getTotalUrl(), (currPage + 1));
                nextPageStr = "href=\"" + nextPageStr + "\"";
                ngrey = "";
            }
            this.Document.SetValue("bpage", beforePageStr);//上一页
            this.Document.SetValue("npage", nextPageStr);//下一页
            this.Document.SetValue("bgrey", bgrey);//上一页灰色的样式
            this.Document.SetValue("ngrey", ngrey);//下一页灰色的样式
        }
Beispiel #10
0
        /// <summary>
        /// 信息详情页面
        /// </summary>
        public void ArticleDetailPage()
        {
            DAL.article artDal = new DAL.article();
            int aid = MyCommFun.RequestInt("id");
            if (aid == 0)
            {
                var article_id = this.Document.GetChildTagById("article_id");
                if (article_id != null && article_id.Attributes["value"]!=null)
                {
                    aid = MyCommFun.Obj2Int(article_id.Attributes["value"].Value.ToString());
                }
            }

            Model.article article = artDal.GetModel(aid);
            if (article != null)
            {
                this.Document.SetValue("model", article);
            }
        }
Beispiel #11
0
        /// <summary>
        /// 列表页面独有的数据
        /// </summary>
        public void ArticleClassPage()
        {
            int category_id = MyCommFun.RequestInt("cid");

            //--=====begin: 将这个列表(文章类别)的基本信息展示出来 ====--
            Model.article_category category = tDal.GetCategoryByWid(wid, category_id);
            this.Document.SetValue("category", category);

            this.Document.SetValue("fxTitle", category.title);
            this.Document.SetValue("fxDesc", category.content);
            this.Document.SetValue("fxPic", MyCommFun.ImgAddHttp(category.img_url));

            //--=====end: 将这个列表(文章类别)的基本信息展示出来 ====--

            Tag    orderByTag = this.Document.GetChildTagById("norderby");
            string orderby    = orderByTag.Attributes["value"].Value.ToString();

            Tag    pagesizeTag = this.Document.GetChildTagById("npagesize");
            string pagesizeStr = pagesizeTag.Attributes["value"].Value.ToString();

            int currPage    = 1;                              //当前页面
            int recordCount = 0;                              //总记录数
            int totPage     = 1;                              //总页数
            int pageSize    = MyCommFun.Str2Int(pagesizeStr); //每页的记录数

            if (pageSize <= 0)
            {
                pageSize = 10;
            }
            if (MyCommFun.RequestInt("page") > 0)
            {
                currPage = MyCommFun.RequestInt("page");
            }

            DataSet artlist = new DataSet();

            if (category_id != 0)
            {
                DAL.article artDal = new DAL.article();
                artlist = artDal.GetList("news", category_id, pageSize, currPage, "wid=" + wid, orderby, out recordCount);
                if (artlist != null && artlist.Tables.Count > 0 && artlist.Tables[0].Rows.Count > 0)
                {
                    DataRow dr;
                    for (int i = 0; i < artlist.Tables[0].Rows.Count; i++)
                    {
                        dr = artlist.Tables[0].Rows[i];
                        if (dr["link_url"] != null && dr["link_url"].ToString().Trim().Length > 0)
                        {
                            dr["link_url"] = MyCommFun.urlAddOpenid(dr["link_url"].ToString().Trim(), openid);
                        }
                        else
                        {
                            dr["link_url"] = MyCommFun.urlAddOpenid("detail.aspx?wid=" + wid + "&aid=" + dr["id"].ToString(), openid);
                        }
                        artlist.AcceptChanges();
                    }

                    totPage = recordCount / pageSize;
                    int yushu = recordCount % pageSize;
                    if (yushu > 0)
                    {
                        totPage += 1;
                    }
                    if (totPage < 1)
                    {
                        totPage = 1;
                    }
                }
                if (currPage > totPage)
                {
                    currPage = totPage;
                }
            }
            else
            {
                currPage    = 1;
                recordCount = 0;
                totPage     = 1;
            }
            this.Document.SetValue("totPage", totPage);   //总页数
            this.Document.SetValue("currPage", currPage); //当前页
            this.Document.SetValue("newslist", artlist);  //文章列表

            string beforePageStr = "";                    //上一页
            string nextPageStr   = "";                    //下一页
            string bgrey         = "c-p-grey";
            string ngrey         = "c-p-grey";

            if (currPage <= 1)
            {
                beforePageStr = "";
                bgrey         = "disabled";
            }
            else
            {
                beforePageStr = MyCommFun.ChangePageNum(MyCommFun.getTotalUrl(), (currPage - 1));
                beforePageStr = "href=\"" + beforePageStr + "\"";
                bgrey         = "";
            }

            if (currPage >= totPage)
            {
                nextPageStr = "";
                ngrey       = "disabled";
            }
            else
            {
                nextPageStr = MyCommFun.ChangePageNum(MyCommFun.getTotalUrl(), (currPage + 1));
                nextPageStr = "href=\"" + nextPageStr + "\"";
                ngrey       = "";
            }
            this.Document.SetValue("bpage", beforePageStr); //上一页
            this.Document.SetValue("npage", nextPageStr);   //下一页
            this.Document.SetValue("bgrey", bgrey);         //上一页灰色的样式
            this.Document.SetValue("ngrey", ngrey);         //下一页灰色的样式
        }
Beispiel #12
0
 public article()
 {
     dal       = new DAL.article(siteConfig.sysdatabaseprefix);
     albumsDal = new DAL.article_albums(siteConfig.sysdatabaseprefix);
 }
 public void ArticleDetailPage()
 {
     DAL.article artDal = new DAL.article();
     int aid = MyCommFun.RequestInt("aid");
     Model.article article = artDal.GetModel(aid);
     if (article != null)
     {
         this.Document.SetValue("model", article);
     }
 }