Ejemplo n.º 1
0
        public IActionResult Salvar3(CurriculoViewModel curriculo, string id)
        {
            try
            {
                if (curriculo.experiencia1Ate == null)
                {
                    curriculo.experiencia1Ate = "";
                }

                if (curriculo.experiencia1Desde == null)
                {
                    curriculo.experiencia1Desde = "";
                }
                if (curriculo.experiencia2Ate == null)
                {
                    curriculo.experiencia2Ate = "";
                }
                if (curriculo.experiencia2Desde == null)
                {
                    curriculo.experiencia2Desde = "";
                }
                if (curriculo.experiencia3Ate == null)
                {
                    curriculo.experiencia3Ate = "";
                }
                if (curriculo.experiencia3Desde == null)
                {
                    curriculo.experiencia3Desde = "";
                }
                if (curriculo.experiencia2 == null)
                {
                    curriculo.experiencia2 = "";
                }
                if (curriculo.experiencia3 == null)
                {
                    curriculo.experiencia3 = "";
                }
                if (curriculo.experiencia1 == null)
                {
                    curriculo.experiencia1 = "";
                }

                CurriculoDAO dao = new CurriculoDAO();
                if (curriculo.cpf == null)
                {
                    curriculo.cpf = id;
                }

                if (dao.Consulta(curriculo.cpf) == null)
                {
                    dao.Inserir3(curriculo);
                    CurriculoViewModel Select = dao.Consulta(id);
                    return(View("CadastroIdiomas", Select));
                }

                else
                {
                    dao.Inserir3(curriculo);
                    CurriculoViewModel Select = dao.Consulta(id);
                    return(View("CadastroEditarIdiomas", Select));
                }
            }
            catch (Exception erro)
            {
                return(View("Error", new ErrorViewModel(erro.ToString())));
            }
        }