示例#1
0
        public ActionResult Create(SiteNews model)
        {
            var flag = TryValidateModel(model);

            if (flag)
            {
                model.PublishDate = DateTime.Now.ToString("yyyy-MM-dd hh:mm");
                siteNewsRepository.Add(model);
                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
示例#2
0
 public Task <RunResult <DetailedNews> > GetNewsArticleDetailsAsync(SiteNews news)
 {
     return(GetNewsArticleDetailsAsync(news.SiteID, (int)news.ID));
 }
示例#3
0
 public RunResult <DetailedNews> GetNewsArticleDetails(SiteNews news)
 {
     return(GetNewsArticleDetails(news.SiteID, (int)news.ID));
 }