Exemple #1
0
        public async Task <IActionResult> AlterarDefinicao(int TrabalhoId, [FromServices] ITrabalhoService trabalhoService)
        {
            var definicao = await trabalhoService.ObterTrabalhoRelatorioPorId(TrabalhoId);

            definicao.Gatilhos.GatilhoSimples.DataInicio = DateTime.Now.AddDays(1);

            return(Ok(await trabalhoService.AlterarDefinicaoTrabalho(TrabalhoId, definicao)));
        }
Exemple #2
0
        public async Task <IActionResult> IniciarTrabalho([FromServices] ITrabalhoService trabalhoService)
        {
            var lista = new TrabalhoListaIdsDto();

            lista.TrabalhoIds = (await trabalhoService.ObterTrabalhosRelatorios()).TrabalhoResumos.Select(x => x.Id);

            return(Ok(await trabalhoService.InciarTrabalhos(lista)));
        }
Exemple #3
0
        public async Task <IActionResult> AtualizarTrabalhoEmLote([FromServices] ITrabalhoService trabalhoService)
        {
            var ids = (await trabalhoService.ObterTrabalhosRelatorios()).TrabalhoResumos.Select(x => x.Id);

            return(Ok(await trabalhoService.AtualizarTrabalhosEmLote(ids, false, new TrabalhoDefinicaoDto
            {
                Descricao = "Descricao modificada"
            })));
        }
Exemple #4
0
        public async Task <IActionResult> ObterTrabalhosPorFiltro([FromServices] ITrabalhoService trabalhoService)
        {
            var filtro = new TrabalhoFiltroDto
            {
                Ascendente = true,
                Limite     = 2
            };

            var model = new TrabalhoModelDto();

            return(Ok(await trabalhoService.ObterTrabalhosRelatorios(filtro, model)));
        }
Exemple #5
0
 public async Task <IActionResult> ObterEstadoTrabalho(int TrabalhoId, [FromServices] ITrabalhoService trabalhoService)
 {
     return(Ok(await trabalhoService.ObterTrabalhoEstado(TrabalhoId)));
 }
Exemple #6
0
 public async Task <IActionResult> ObterTrabalhos(int TrabalhoId, [FromServices] ITrabalhoService trabalhoService)
 {
     return(Ok(await trabalhoService.ObterTrabalhoRelatorioPorId(TrabalhoId)));
 }
Exemple #7
0
 public async Task <IActionResult> ObterTrabalhos([FromServices] ITrabalhoService trabalhoService)
 {
     return(Ok(await trabalhoService.ObterTrabalhosRelatorios()));
 }
Exemple #8
0
 public async Task <IActionResult> ObterTrabalhosInformandoRelatorio([FromServices] ITrabalhoService trabalhoService)
 {
     return(Ok(await trabalhoService.ObterTrabalhosRelatorios("/temp")));
 }
Exemple #9
0
        public async Task <IActionResult> AgendarTrabalhos([FromBody] object trabalhoDefinicaoJson, [FromServices] ITrabalhoService trabalhoService)
        {
            var trabalhoDefinicaoDto = JsonConvert.DeserializeObject <TrabalhoDefinicaoDto>(trabalhoDefinicaoJson.ToString());

            return(Ok(await trabalhoService.AgendarTrabalhoRelatorio(trabalhoDefinicaoDto)));
        }
Exemple #10
0
 public async Task <IActionResult> DeletarTrabalhosPorListaId([FromQuery] IEnumerable <int> ids, [FromServices] ITrabalhoService trabalhoService)
 {
     return(Ok(await trabalhoService.DeletarTrabalhosPorListaId(ids)));
 }
Exemple #11
0
 public async Task <IActionResult> DeletarTrabalhoPorId(int trabalhoId, [FromServices] ITrabalhoService trabalhoService)
 {
     return(Ok(await trabalhoService.DeletarTrabalhoPorId(trabalhoId)));
 }