예제 #1
0
 public BaseObject DeleteNews(int id)
 {
     using (NewsLogic logic = new NewsLogic())
     {
         return(logic.DeleteNews(id));
     }
 }
예제 #2
0
 public BaseObject InsertNews(News news)
 {
     using (NewsLogic logic = new NewsLogic())
     {
         return(logic.InsertNews(news));
     }
 }
예제 #3
0
 public BaseObject UpdateNews(News news)
 {
     using (NewsLogic logic = new NewsLogic())
     {
         return(logic.UpdateNews(news));
     }
 }
예제 #4
0
 public News GetNewsByID(int id)
 {
     using (NewsLogic logic = new NewsLogic())
     {
         return(logic.GetNewsByID(id));
     }
 }
예제 #5
0
 public List <News> GetNewsList(GetReportDataParams param, out int totalCount)
 {
     using (NewsLogic logic = new NewsLogic())
     {
         return(logic.GetNewsList(param, out totalCount));
     }
 }
예제 #6
0
        public ActionResult Home()
        {
            var model = ModelLogic.CreateMasterModel() as MasterModel <Home>;

            model.Content.LatestNewsItem = NewsLogic.GetLatestNewsitem();

            return(CurrentTemplate(model));
        }
        public ActionResult Newsoverview()
        {
            var model = ModelLogic.CreateMasterModel() as MasterModel <Newsoverview>;

            var newsItems = NewsLogic.GetNewsitems(CurrentPage);
            var pager     = Umbraco.GetPager(5, newsItems.Count());

            //Only put the paged items in the list.
            model.Content.NewsItems = newsItems.Skip((pager.CurrentPage - 1) * pager.ItemsPerPage).Take(pager.ItemsPerPage).ToList();
            model.Content.Pager     = pager;

            return(CurrentTemplate(model));
        }
예제 #8
0
 public NewsController(ILogger <NewsController> logger, NewsLogic newsLogic) : base(logger)
 {
     this._newsLogic = newsLogic;
 }