Exemple #1
0
//----------------------------------------------------------------------------------------------------------------

        public GuardarDatoAcademicoResponse GuardarDatoAcademico(DatoAcademico datoAcademico)
        {
            try
            {
                var _datoAcademico = _context.DatosAcademicos.Find(datoAcademico.DatoAcademicoId);
                if (_datoAcademico == null)
                {
                    _context.DatosAcademicos.Add(datoAcademico);
                    _context.SaveChanges();
                    return(new GuardarDatoAcademicoResponse(datoAcademico));
                }

                return(new GuardarDatoAcademicoResponse("El Dato Academico ya se encuentra Registrado"));
            }
            catch (Exception e)
            {
                return(new GuardarDatoAcademicoResponse("Ocurrieron algunos Errores:" + e.Message));
            }
        }
Exemple #2
0
//----------------------------------------------------------------------------------------------------------------

        public GuardarAspiranteResponse GuardarAspirante(Aspirante aspirante)
        {
            try
            {
                var _aspirante = _context.Aspirantes.Find(aspirante.Correo);
                if (_aspirante == null)
                {
                    _context.Aspirantes.Add(aspirante);
                    _context.SaveChanges();
                    return(new GuardarAspiranteResponse(aspirante));
                }

                return(new GuardarAspiranteResponse("El aspirante ya se encuentra Registrado"));
            }
            catch (Exception e)
            {
                return(new GuardarAspiranteResponse("Ocurrieron algunos Errores:" + e.Message));
            }
        }
Exemple #3
0
//----------------------------------------------------------------------------------------------------------------
        public GuardarHojaDeVidaResponse GuardarHojaDeVida(HojaDeVida hojaDeVida)
        {
            try
            {
                var _hojaDeVida = _context.HojasDeVida.Find(hojaDeVida.HojaDeVidaId);
                if (_hojaDeVida == null)
                {
                    _context.HojasDeVida.Add(hojaDeVida);
                    _context.SaveChanges();
                    return(new GuardarHojaDeVidaResponse(hojaDeVida));
                }

                return(new GuardarHojaDeVidaResponse("La hojaDeVida ya se encuentra Registrado"));
            }
            catch (Exception e)
            {
                return(new GuardarHojaDeVidaResponse("Ocurrieron algunos Errores:" + e.Message));
            }
        }
//----------------------------------------------------------------------------------------------------------------

        public GuardarDatoLaboralResponse GuardarDatoLaboral(DatoLaboral datoLaboral)
        {
            try
            {
                var _datoLaboral = _context.DatosLaborales.Find(datoLaboral.DatoLaboralId);
                if (_datoLaboral == null)
                {
                    _context.DatosLaborales.Add(datoLaboral);
                    _context.SaveChanges();
                    return(new GuardarDatoLaboralResponse(datoLaboral));
                }

                return(new GuardarDatoLaboralResponse("El Dato Laboral ya se encuentra Registrado"));
            }
            catch (Exception e)
            {
                return(new GuardarDatoLaboralResponse("Ocurrieron algunos Errores:" + e.Message));
            }
        }