Esempio n. 1
0
        public HttpResponseMessage FinalizarEmprestimo(int codigo)
        {
            try
            {
                var retornoModel = new EmprestimoViewModel();

                if (codigo > 0)
                {
                    var emprestimo = _emprestimoService.RecuperarPorId(codigo);
                    if (emprestimo != null)
                    {
                        _emprestimoBusiness.FinalizarEmprestimo(codigo);
                    }
                }

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, retornoModel);
                return(response);
            }
            catch (Exception ex)
            {
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message);
                return(response);
            }
        }