public void AddNotice(NoticeInfo noticeInfo) { try { NoticeEntity entity = new NoticeEntity(); entity.Id = Guid.NewGuid().ToString("N"); entity.Name = noticeInfo.Name; entity.Title = noticeInfo.Title; entity.IsHasDetail = noticeInfo.IsHasDetail; entity.Message = noticeInfo.Message; entity.IsForeRed = noticeInfo.IsForeRed; entity.IsForeBold = noticeInfo.IsForeBold; entity.StartTime = noticeInfo.StartTime; entity.EndTime = noticeInfo.EndTime; entity.IsEnd = noticeInfo.IsEnd; NoticeManager manager = new NoticeManager(DbAccess); manager.AddNotice(entity); noticeInfo.Id = entity.Id; } catch (Exception ex) { throw HandleException("Notice", "Add", ex); } }
public void ModifyNotice(NoticeEntity entity) { entity.UpdateTime = DateTime.Now; persistence.Modify(entity); }
public void AddNotice(NoticeEntity entity) { entity.CreateTime = DateTime.Now; entity.UpdateTime = DateTime.Now; persistence.Add(entity); }