Пример #1
0
 public void Delete(long uid)
 {
     ExceptionHelper.ThrowIfNotId(uid, "uid");
     if (IsEnabled)
     {
         _LazyFollowUpRecord.Value.isEnabled = false;
         _LazyFollowUpRecord.Value.updated   = DateTime.Now;
         _LazyFollowUpRecord.Value.updater   = uid;
         _FollowUpRecordRepository.SaveChanges();
     }
 }
Пример #2
0
        public IFollowUpRecordService Add(long uid, long administrator, string content, FollowUpRecordKinds kind)
        {
            ExceptionHelper.ThrowIfNotId(uid, "uid");
            ExceptionHelper.ThrowIfNotId(administrator, "administrator");
            ExceptionHelper.ThrowIfNullOrEmpty(content, "content");
            var entity = new Data.FollowUpRecord
            {
                created       = DateTime.Now,
                uid           = uid,
                kind          = kind,
                content       = content,
                administrator = administrator,
                isEnabled     = true,
                updated       = DateTime.Now,
                updater       = administrator,
            };

            _FollowUpRecordRepository.Add(entity);
            _FollowUpRecordRepository.SaveChanges();
            return(CreateService(entity.rid));
        }