コード例 #1
0
        public void Delete(int id)
        {
            BllTask item = repository.GetById(id);

            item.IsDeleted = true;

            repository.Update(item);

            BllAction action = actionRepository.Create(new BllAction
            {
                ActionId = (int)BllActionEnum.Delete,
                TaskId   = item.Id
            });

            WorkerManager.AddWork(new DeleteTask(item.Id, repository, action.Id, actionRepository), item.UserId);
        }
コード例 #2
0
        public void Update(BllTask item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            repository.Update(item);

            BllAction action = actionRepository.Create(new BllAction
            {
                ActionId = (int)BllActionEnum.Update,
                TaskId   = item.Id
            });

            WorkerManager.AddWork(new UpdateTask(item.Id, repository, action.Id, actionRepository), item.UserId);
        }
コード例 #3
0
        public BllTask Add(BllTask item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            BllTask result = repository.Create(item);

            BllAction action = actionRepository.Create(new BllAction
            {
                ActionId = (int)BllActionEnum.Add,
                TaskId   = result.Id
            });

            WorkerManager.AddWork(new AddTask(result, repository, action.Id, actionRepository), result.UserId);

            return(result);
        }