// GET: Orcamento/Details/5
        public ActionResult Details(int id)
        {
            var itemValor          = _gerenciadorDeItemValor.BuscarPorId(id);
            var itemValorViewModel = Mapeador.Mapear <ItemValor, ItemValorViewModel>(itemValor);

            return(View(itemValorViewModel));
        }
Example #2
0
        // GET: Details
        public HttpResponseMessage Get(int id)
        {
            HttpResponseMessage response;

            try
            {
                var itemValor = _gerenciadorDeItemValor.BuscarPorId(id);

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

            return(response);
        }
Example #3
0
        // GET: Orcamento
        public ActionResult Index(int id)
        {
            var itemSubValores        = _gerenciadorDeItemSubValor.BuscaPorValor(id);
            var itemSubValorViewModel = Mapeador.Mapear <IEnumerable <ItemSubValor>, IEnumerable <ItemSubValorViewModel> >(itemSubValores);

            ViewBag.ItemValorId = id;
            ViewBag.OrcamentoId = (itemSubValorViewModel.Count() == 0) ? _gerenciadorDeItemValor.BuscarPorId(id).Orcamento.ID : itemSubValorViewModel.First().ItemValor.Orcamento.Id;

            return(View(itemSubValorViewModel));
        }