Example #1
0
        public ActionResult Delete(int id, OrcamentoViewModel orcamentoViewModel)
        {
            try
            {
                var orcamento = _gerenciadorDeOrcamento.BuscarPorId(id);
                _gerenciadorDeOrcamento.Excluir(orcamento);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #2
0
        // POST: Delete
        public HttpResponseMessage Delete(int id)
        {
            HttpResponseMessage response;

            try
            {
                var orcamento = _gerenciadorDeOrcamento.BuscarPorId(id);
                _gerenciadorDeOrcamento.Excluir(orcamento);

                response = Request.CreateResponse(HttpStatusCode.OK, orcamento);
            }
            catch (Exception ex)
            {
                response = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex);
            }

            return(response);
        }
 public void Excluir()
 {
     _orcamentoServiceMock.Setup(x => x.Delete(It.IsAny <Orcamento>()));
     _orcamentoServiceMock.Setup(x => x.Save());
     _gerenciadorDeOrcamento.Excluir(OrcamentoStub.Despesa());
 }