public NewsEntity(NewsInfo Info) { this.ID = Info.ID; this.Title = Info.Title; this.Content = Info.Content; this.Type = Info.Type; this.CreateUser = Info.CreateUser; this.CreateDate = Info.CreateDate; this.IsDelete = Info.IsDelete; }
public int Add(NewsInfo News) { var entity = new NewsEntity(News); entity.IsDelete = false; entity.CreateDate = DateTime.Now; this._DB.Add(entity); _NotifySrv.Send(new { Head = "新闻公告", Title = entity.Title, Content = ReplaceHtmlTag(entity.Content, 100), }); //foreach (var attachID in News.AttachIDs) //{ // AddAttach(entity.ID, attachID); //} return(entity.ID); }
public int Create(NewsInfo Info) { Info.CreateUser = int.Parse(base.User.Identity.Name); return(this._INewsService.Add(Info)); }