public NewsDetailModel(Entity.Entities.Models.News news) : this() { Id = news.Id; News = new NewsManageModel(news); Created = news.Created; CreatedBy = news.CreatedBy; LastUpdate = news.LastUpdate; LastUpdateBy = news.LastUpdateBy; }
public NewsWidget(Entity.Entities.Models.News news) : this() { Id = news.Id; Title = news.Title; Abstract = news.Abstract; Content = news.Content; ImageUrl = news.ImageUrl; DatePosted = news.DateStart ?? (news.LastUpdate ?? news.Created); LastUpdatedBy = news.LastUpdate.HasValue ? news.LastUpdateBy : news.CreatedBy; var newsCategories = news.NewsNewsCategories.Select(nc => nc.NewsCategory).ToList(); Categories = newsCategories.Any() ? newsCategories.Select(c => new NewsCategoryWidget(c)).ToList() : new List <NewsCategoryWidget>(); }
public NewsManageModel(Entity.Entities.Models.News news) : this() { Id = news.Id; Abstract = news.Abstract; Content = news.Content; DateStart = news.DateStart; DateEnd = news.DateEnd; ImageUrl = news.ImageUrl; Title = news.Title; IsHotNews = news.IsHotNews; Status = news.Status; var newsCategoryService = HostContainer.GetInstance <INewsCategoryService>(); StatusList = EnumUtilities.GenerateSelectListItems <NewsEnums.NewsStatus>(); NewsCategories = newsCategoryService.GetNewsCategories(Id); }
internal ResponseModel Delete(Entity.Entities.Models.News news) { return(_newsRepository.Delete(news)); }
internal ResponseModel Insert(Entity.Entities.Models.News news) { return(_newsRepository.Insert(news)); }