Exemplo n.º 1
0
        public void BindingData()
        {
            bool           enableCache = (CDHelper.Config.EnableCache == "true");
            List <Article> result      = null;

            string       type  = StateMgr.ConvertEnumToStr(EnumLibrary.ArticleType.Article);
            ArticleQuery query = new ArticleQuery();

            query.AccountID = AccountID;
            query.EnumState = type;
            query.OrderKeys = "ID";
            List <Article> articleList = ArticleHelper.QueryArtilcesByAll(query, 0, 5, null);

            if (articleList != null)
            {
                foreach (Article article in articleList)
                {
                    if (article.Title.Length > 25)
                    {
                        article.Title = article.Title.Substring(0, 25) + "...";
                    }
                }
            }
            result = articleList;

            DataGridView.DataSource = result;
            DataGridView.DataBind();
        }