public IActionResult BuscarCNPJ(int pedidoId, Orcamento orcamento) { TempPedido.pedidoId = pedidoId; try { orcamento.Cnpj = orcamento.Cnpj.Replace(".", "").Replace("/", "").Replace("-", ""); string url = "https://www.receitaws.com.br/v1/cnpj/" + orcamento.Cnpj; WebClient client = new WebClient(); orcamento = JsonConvert.DeserializeObject <Orcamento>(client.DownloadString(url)); TempPedido.SetOrcamento(orcamento); } catch (Exception) { } return(RedirectToAction("Create", "Orcamento")); }