Ejemplo n.º 1
0
        /// <summary>
        /// 删除公告
        /// </summary>
        /// <param name="announcementId">公告Id</param>
        public void Delete(long announcementId)
        {
            Announcement announcement = Get(announcementId);

            announcementRepository.Delete(announcement);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新公告
 /// </summary>
 /// <param name="announcement">公告实体</param>
 public void Update(Announcement announcement)
 {
     announcement.LastModified = DateTime.UtcNow;
     announcementRepository.Update(announcement);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 创建公告
 /// </summary>
 /// <param name="announcement">公告实体</param>
 public void Create(Announcement announcement)
 {
     announcementRepository.Insert(announcement);
     announcement.DisplayOrder = announcement.Id;
     announcementRepository.Update(announcement);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 新建实体时使用
        /// </summary>
        public static Announcement New()
        {
            Announcement announcement = new Announcement()
            {
                Subject = string.Empty,
                SubjectStyle = string.Empty,
                Body = string.Empty,
                HyperLinkUrl = string.Empty,
                ReleaseDate = DateTime.UtcNow,
                ExpiredDate = DateTime.UtcNow,
                LastModified = DateTime.UtcNow,
                CreatDate = DateTime.UtcNow.ToLocalTime()

            };
            return announcement;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 创建公告
 /// </summary>
 /// <param name="announcement">公告实体</param>
 public void Create(Announcement announcement)
 {
     announcementRepository.Insert(announcement);
     announcement.DisplayOrder = announcement.Id;
     announcementRepository.Update(announcement);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 更新公告
 /// </summary>
 /// <param name="announcement">公告实体</param>
 public void Update(Announcement announcement)
 {
     announcement.LastModified = DateTime.UtcNow;
     announcementRepository.Update(announcement);
 }