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)); } }
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)); } }
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)); } }
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()); } }