Exemple #1
0
        public IActionResult Cadastrar(Projeto p, int idCliente)
        {
            p.cliente = _clienteDAO.BuscarClientePorId(idCliente);
            //try
            //{
            //    //url do receitaws.com.br
            //    string url = "http://localhost:64154/api/Projeto/Cadastrar/" + p.ProjetoId;
            //    WebClient client = new WebClient();
            //    client.Encoding = System.Text.Encoding.UTF8;
            //    String teste= client.Upload(url,p.Nome);
            //    return RedirectToAction("ListagemProjeto");
            //}
            //catch (WebException e)
            //{
            //    TempData["Erro"] = e.Message;
            //}


            _projetoDAO.CadastrarProjeto(p);

            return(RedirectToAction("ListagemProjetos"));
        }