コード例 #1
0
        private ListNews SearchNews(SearchNewsRequest request)
        {
            var     total     = 0;
            var     ds        = _newsDa.Search(request, ref total);
            var     lstNew    = CBO.Fill2ListFromDataSet <News>(ds, typeof(News));
            decimal totalPage = Math.Ceiling(((decimal)total / (decimal)ConfigInfo.RecordOnPage));
            var     paging    = HtmlControllHelpers.WritePaging(totalPage, request.CurrentPage, total, ConfigInfo.RecordOnPage, "Tin tức");
            var     listNews  = new ListNews
            {
                Start       = request.Start,
                Collection  = lstNew,
                Paging      = paging,
                TotalRecord = total,
                TotalPage   = totalPage,
                CurrentPage = request.CurrentPage
            };

            return(listNews);
        }
コード例 #2
0
        public IEnumerable <DataStructure.News> Search(IConnectionHandler connectionHandler, string text)
        {
            var newsDa = new NewsDA(connectionHandler);

            return(newsDa.Search(text));
        }