Exemple #1
0
 public IActionResult ObterProfissionalPorCelula(int situacao, int idCelula)
 {
     try
     {
         var profissionalEacessoService = new ProfissionalEacessoService(_connectionStrings.Value.EacessoConnection);
         var resultBD = profissionalEacessoService.ObterProfissionalPorCelula(situacao, idCelula);
         return(Ok(new { dados = resultBD, notifications = "", success = true }));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
Exemple #2
0
 public IActionResult Obtertodos(int situacao, string filtro)
 {
     try
     {
         var profissionalEacessoService = new ProfissionalEacessoService(_connectionStrings.Value.EacessoConnection);
         var resultBD = profissionalEacessoService.ObterProfissionaisFiltrados(filtro, situacao);
         var resultVM = Mapper.Map <List <MultiselectViewModel> >(resultBD);
         return(Ok(new { dados = resultVM, notifications = "", success = true }));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
Exemple #3
0
 public IActionResult ObterPorId(int id)
 {
     try
     {
         var profissionalEacessoService = new ProfissionalEacessoService(_connectionStrings.Value.EacessoConnection);
         var resultBD = profissionalEacessoService.ObterProfissionalPorId(id);
         var resultVM = Mapper.Map <ProfissionalEAcessoMultiSelectVM>(resultBD);
         return(Ok(new { dados = resultVM, notifications = "", success = true }));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
Exemple #4
0
        public IActionResult ObterRepassePorId(int id, string data)
        {
            try
            {
                var dataFormatada = DateTime.Parse(data);
                var profissionalEacessoService = new ProfissionalEacessoService(_connectionStrings.Value.EacessoConnection);
                var result = new SolicitarRepasseVM();
                //var resultRepasse = _repasseService.ObterRepassePorIdPorDataComDescricaoParcelada(id, dataFormatada);
                var resultRepasse = _repasseService.ObterRepassePorIdPorData(id, dataFormatada);
                result = Mapper.Map <SolicitarRepasseVM>(resultRepasse);
                result.VezesRepitidas = 1;//resultRepasse.RepasseFilhos.Count + 1;
                var resultProfissional = profissionalEacessoService.ObterProfissionalPorId(resultRepasse.IdProfissional);
                result.Profissional = resultProfissional;

                return(Ok((new { dados = result, notifications = "", success = true })));
            }
            catch (Exception e)
            {
                return(BadRequest());
            }
        }