Exemplo n.º 1
0
 public static ORM.Action GetOrmEntity(this BllAction bllEntity)
 {
     return(new ORM.Action()
     {
         Id = bllEntity.Id,
         TaskId = bllEntity.TaskId,
         ActionId = bllEntity.ActionId
     });
 }
Exemplo n.º 2
0
        public BllAction Create(BllAction e)
        {
            if (e == null)
            {
                throw new ArgumentNullException(nameof(e));
            }

            var result = context.Set <Action>().Add(e.GetOrmEntity());

            context.SaveChanges();

            return(result.GetBllEntity());
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
 public BllAction Update(BllAction entity)
 {
     return(entity);
 }