Пример #1
0
        // GET: Enderecos/Details/5
        public ActionResult Details(int id)
        {
            var endereco          = _enderecoApp.GetById(id);
            var enderecoViewModel = Mapper.Map <Endereco, EnderecoViewModel>(endereco);

            return(View(enderecoViewModel));
        }
Пример #2
0
        // GET: api/Endereco/5
        public EnderecoViewModel Get(int id)
        {
            var endereco          = _enderecoApp.GetById(id);
            var enderecoViewModel = Mapper.Map <Endereco, EnderecoViewModel>(endereco);

            return(enderecoViewModel);
        }
Пример #3
0
        public ActionResult FornecedorInfo(string CNPJ)
        {
            var fornecedorViewModel = Mapper.Map <Fornecedor, FornecedorViewModel>(_fornecedorApp.BuscarPorCnpj(CNPJ).SingleOrDefault());
            var enderecoViewModel   = Mapper.Map <Endereco, EnderecoViewModel>(_enderecoApp.GetById(fornecedorViewModel.EnderecoId));

            fornecedorViewModel.Endereco = enderecoViewModel;
            return(PartialView(fornecedorViewModel));
        }
Пример #4
0
        // GET: Endereco/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Endereco endereco = _app.GetById(id);

            if (endereco == null)
            {
                return(HttpNotFound());
            }
            return(View(endereco));
        }
Пример #5
0
        public ActionResult EditEnderecoCliente(int id)
        {
            var endereco = _enderecoAppService.GetById((int)id);

            if (endereco == null)
            {
                return(NotFound());
            }


            ViewBag.UF           = new SelectList(_estadoAppService.GetAll().OrderBy(e => e.UF), "UF", "Nome");
            ViewBag.CidadeId     = new SelectList(_cidadeAppService.GetAll().OrderBy(e => e.UF), "CidadeId", "Nome");
            ViewBag.TipoEndereco = new SelectList(Enum.GetValues(typeof(TipoEnderecoViewModel)));

            return(PartialView(endereco));
        }
Пример #6
0
        // GET: AutoInfracao/Details
        public ActionResult Details(AutoInfracaoViewModel autoInfracao)
        {
            var processoViewModel   = Mapper.Map <Processo, ProcessoViewModel>(_processoApp.GetById(autoInfracao.ProcessoId));
            var fornecedorViewModel = Mapper.Map <Fornecedor, FornecedorViewModel>(_fornecedorApp.GetById(processoViewModel.FornecedorId));
            var enderecoViewModel   = Mapper.Map <Endereco, EnderecoViewModel>(_enderecoApp.GetById(fornecedorViewModel.EnderecoId));

            fornecedorViewModel.Endereco = enderecoViewModel;
            processoViewModel.Fornecedor = fornecedorViewModel;
            autoInfracao.processo        = processoViewModel;
            return(View(autoInfracao));
        }
Пример #7
0
 public ActionResult <string> GetById(int id)
 {
     try
     {
         return(Ok(_enderecoAppService.GetById(id)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #8
0
 public Endereco Get(int id)
 {
     return(_enderecoAppService.GetById(id));
 }