public IActionResult Edit(int id)
        {
            if (id == 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                try
                {
                    Servico servico = _servicoRepository.ObterServicoPorId(id);

                    return(View(servico));
                }
                catch (Exception ex)
                {
                    return(BadRequest($"Erro: {ex.Message}"));
                }
            }
        }
Beispiel #2
0
 public IActionResult GetValor(int id)
 {
     return(new JsonResult(_servicoRepository.ObterServicoPorId(id)));
 }