public ActionResult IncluirServico(Servicos servicoObj)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _repositorio = new ServicoRepositorio();

                    if (_repositorio.AdicionarServico(servicoObj))
                    {
                        ViewBag.Mensagem = "O serviço foi cadastrado com sucesso!";
                    }
                }


                ViewBag.dadosServico = _repositorio.ObterServicos();
                ModelState.Clear();
                return(RedirectToAction("ObterServicos", _repositorio.ObterServicos()));
            }
            catch (Exception e)
            {
                var ja = e.Message;
                return(View("ObterServicos"));
            }
        }
        public ActionResult ConsultarServicos()
        {
            _repositorio = new ServicoRepositorio();

            ViewBag.dadosServico = _repositorio.ObterServicos();
            ModelState.Clear();
            return(View(_repositorio.ObterServicos()));
        }
        public ActionResult EditarServico(int id, Servicos servicoObj)
        {
            try
            {
                _repositorio = new ServicoRepositorio();
                _repositorio.AtualizarServico(servicoObj);

                return(RedirectToAction("ObterServicos", _repositorio.ObterServicos()));
            }
            catch (Exception e)
            {
                var ja = e.Message;
                return(View("ObterServicos", _repositorio.ObterServicos()));
            }
        }
 public ActionResult EditarServico(int id)
 {
     _repositorio = new ServicoRepositorio();
     return(View(_repositorio.ObterServicos().Find(t => t.ServicoId == id)));
 }