Example #1
0
 public GenericCommandResult AtualizarOrdem([FromBody] AtualizarOrdemSistemaCommand command,
                                            [FromServices] SistemaHandler handler,
                                            [FromServices] ISistemaRepository sistema_repository)
 {
     return((GenericCommandResult)handler.Handle(new AtualizarOrdemSistemaCommand(command.SistemasOrdem,
                                                                                  sistema_repository)));
 }
Example #2
0
 public GenericCommandResult Listar([FromServices] SistemaHandler handler)
 {
     return((GenericCommandResult)handler.Handle(new ListarSistemaCommand
     {
         IdFirebase = HttpContext.User.Identities.FirstOrDefault().Claims.FirstOrDefault(c => c.Type.Contains("user_id")).Value
     }));
 }
Example #3
0
 public GenericCommandResult ListarItens([FromQuery] Guid idSistema, [FromServices] SistemaHandler handler)
 {
     return((GenericCommandResult)handler.Handle(new ListarItensSistemaCommand
     {
         IdSistema = idSistema
     }));
 }
Example #4
0
 public GenericCommandResult AtivarDesativar([FromBody] AtivarDesativarSistemaCommand command,
                                             [FromServices] SistemaHandler handler,
                                             [FromServices] ISistemaRepository sistema_repository)
 {
     return((GenericCommandResult)handler.Handle(new AtivarDesativarSistemaCommand(command.IdSistema,
                                                                                   command.Ativo,
                                                                                   sistema_repository)));
 }
Example #5
0
 public GenericCommandResult Iniciar([FromBody] CriarSistemaCommand command, [FromServices] SistemaHandler handler, [FromServices] IEstabelecimentoRepository estabelecimentoRepository)
 {
     return((GenericCommandResult)handler.Handle(new CriarSistemaCommand(
                                                     HttpContext.User.Identities.FirstOrDefault().Claims.FirstOrDefault(c => c.Type.Contains("user_id")).Value,
                                                     command.Nome,
                                                     command.Descricao,
                                                     command.ItensSistema,
                                                     estabelecimentoRepository
                                                     )));
 }
Example #6
0
 public GenericCommandResult AlterarItemSistema([FromBody] AlterarItemSistemaCommand command,
                                                [FromServices] SistemaHandler handler,
                                                [FromServices] IUnidadeMedidaRepository unidade_medida_repository,
                                                [FromServices] ISistemaItemRepository sistema_item_repository)
 {
     return((GenericCommandResult)handler.Handle(new AlterarItemSistemaCommand(command.IdItemSistema,
                                                                               command.Nome,
                                                                               command.Descricao,
                                                                               command.IdUnidadeMedida,
                                                                               unidade_medida_repository,
                                                                               sistema_item_repository)));
 }
Example #7
0
 public GenericCommandResult Alterar([FromBody] AtualizarSistemaCommand command,
                                     [FromServices] SistemaHandler handler,
                                     [FromServices] ISistemaRepository sistema_repository)
 {
     return((GenericCommandResult)handler.Handle(new AtualizarSistemaCommand(
                                                     HttpContext.User.Identities.FirstOrDefault().Claims.FirstOrDefault(c => c.Type.Contains("user_id")).Value,
                                                     command.Id,
                                                     command.Nome,
                                                     command.Descricao,
                                                     command.Ativo,
                                                     command.ItensSistema
                                                     )));
 }