Beispiel #1
0
 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;
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public int Create(NewsInfo Info)
 {
     Info.CreateUser = int.Parse(base.User.Identity.Name);
     return(this._INewsService.Add(Info));
 }