Exemplo n.º 1
0
        public static void TestingTXBeginEnd()
        {
            //https://msdn.microsoft.com/en-us/library/dn456843(v=vs.113).aspx
            using (var context = new SQLContexto())
            {
                using (var dbContextTransaction = context.Database.BeginTransaction())
                {
                    try
                    {
                        context.Database.ExecuteSqlCommand($"SELECT * FROM Companias");

                        var consulta = context.Companias;
                        foreach (var i in consulta)
                        {
                            i.Calificacion = 100000;
                        }
                        context.SaveChanges();
                        dbContextTransaction.Commit();
                    }
                    catch
                    {
                        dbContextTransaction.Rollback();
                    }
                }
            }
        }
Exemplo n.º 2
0
        public bool AgregarCandidato(Candidato Candidato)
        {
            Candidato.Direccion.Codigo = Guid.NewGuid();
            Candidato.Contacto.Codigo  = Guid.NewGuid();

            try
            {
                //Si una de las tres operaciones sale mal, se hace rollback de todas las del bloque
                using (SQLContexto contexto = new SQLContexto())
                {
                    CandidatoRepo candidatoRepo = new CandidatoRepo(contexto);
                    DireccionRepo direccionRepo = new DireccionRepo(contexto);
                    ContactoRepo  contactoRepo  = new ContactoRepo(contexto);

                    direccionRepo.Insertar(Candidato.Direccion);
                    contactoRepo.Insertar(Candidato.Contacto);
                    candidatoRepo.Insertar(Candidato);
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 3
0
 public bool ModificarPosicion(Posicion Posicion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         PosicionRepo posicionRepo = new PosicionRepo(contexto);
         return(posicionRepo.Actualizar(Posicion));
     }
 }
Exemplo n.º 4
0
 public List <Perfil> TraerPerfiles()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         PerfilRepo perfilRepo = new PerfilRepo(contexto);
         return(perfilRepo.TraerTodo());
     }
 }
Exemplo n.º 5
0
 public bool Agregar(Usuario Usuario)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.Insertar(Usuario));
     }
 }
Exemplo n.º 6
0
 public List <Usuario> TraerPorPuesto(EPuesto Puesto)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.TraerPorPuesto(Puesto));
     }
 }
 private Posicion HidratarPosicion(ProcesoSeleccion procesoSeleccion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         PosicionRepo posicionRepo = new PosicionRepo(contexto);
         return(posicionRepo.Traer(procesoSeleccion.Posicion));
     }
 }
 private Candidato HidratarCandidato(ProcesoSeleccion procesoSeleccion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         CandidatoRepo candidatoRepo = new CandidatoRepo(contexto);
         return(candidatoRepo.Traer(procesoSeleccion.Candidato));
     }
 }
 public bool AgregarProcesoSeleccion(ProcesoSeleccion ProcesoSeleccion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ProcesoSeleccionRepo procesoSeleccionRepo = new ProcesoSeleccionRepo(contexto);
         return(procesoSeleccionRepo.Insertar(ProcesoSeleccion));
     }
 }
Exemplo n.º 10
0
 public bool AgregarEducacion(Educacion Educacion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         EducacionRepo educacionRepo = new EducacionRepo(contexto);
         return(educacionRepo.Insertar(Educacion));
     }
 }
Exemplo n.º 11
0
 public List <Oficina> TraerTodo()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         OficinaRepo oficinaRepo = new OficinaRepo(contexto);
         return(oficinaRepo.TraerTodo());
     }
 }
Exemplo n.º 12
0
 private ProcesoSeleccion HidratarProcesoSeleccion(Entrevista entrevista)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ProcesoSeleccionRepo procesoSeleccionRepo = new ProcesoSeleccionRepo(contexto);
         return(procesoSeleccionRepo.Traer(entrevista.ProcesoSeleccion));
     }
 }
Exemplo n.º 13
0
 private Usuario HidratarUsuario(Entrevista entrevista)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.Traer(entrevista.Entrevistador));
     }
 }
Exemplo n.º 14
0
 public List <Entrevista> TraerEntrevistas()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         EntrevistaRepo entrevistaRepo = new EntrevistaRepo(contexto);
         return(entrevistaRepo.TraerTodo());
     }
 }
Exemplo n.º 15
0
        //public IEnumerable<Candidato> TraerCandidatosRecomendados(string Codigo)
        //{
        //    return this.analyticsRepo.TraerCandidatosRecomendados(new Guid(Codigo));
        //}

        public List <Equipo> TraerEquipos()
        {
            using (SQLContexto contexto = new SQLContexto())
            {
                EquipoRepo equipoRepo = new EquipoRepo(contexto);
                return(equipoRepo.TraerTodo());
            }
        }
Exemplo n.º 16
0
 public bool ModificarEntrevista(Entrevista Entrevista)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         EntrevistaRepo entrevistaRepo = new EntrevistaRepo(contexto);
         return(entrevistaRepo.Actualizar(Entrevista));
     }
 }
Exemplo n.º 17
0
 public List <ProcesoSeleccion> TraerProcesosSeleccion()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ProcesoSeleccionRepo procesoSeleccionRepo = new ProcesoSeleccionRepo(contexto);
         return(procesoSeleccionRepo.TraerTodo());
     }
 }
Exemplo n.º 18
0
 public bool ModificarEducacion(Educacion Educacion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         EducacionRepo educacionRepo = new EducacionRepo(contexto);
         return(educacionRepo.Actualizar(Educacion));
     }
 }
Exemplo n.º 19
0
 public bool ModificarProcesoSeleccion(ProcesoSeleccion ProcesoSeleccion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ProcesoSeleccionRepo procesoSeleccionRepo = new ProcesoSeleccionRepo(contexto);
         return(procesoSeleccionRepo.Actualizar(ProcesoSeleccion));
     }
 }
Exemplo n.º 20
0
 public bool AgregarExperiencia(Experiencia Experiencia)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ExperienciaRepo experienciaRepo = new ExperienciaRepo(contexto);
         return(experienciaRepo.Insertar(Experiencia));
     }
 }
Exemplo n.º 21
0
 private Usuario HidratarReclutador(ProcesoSeleccion procesoSeleccion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.Traer(procesoSeleccion.Reclutador));
     }
 }
Exemplo n.º 22
0
 public bool ModificarExperiencia(Experiencia Experiencia)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ExperienciaRepo experienciaRepo = new ExperienciaRepo(contexto);
         return(experienciaRepo.Actualizar(Experiencia));
     }
 }
Exemplo n.º 23
0
 public bool AgregarEntrevista(Entrevista Entrevista)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         EntrevistaRepo entrevistaRepo = new EntrevistaRepo(contexto);
         return(entrevistaRepo.Insertar(Entrevista));
     }
 }
Exemplo n.º 24
0
 public bool AgregarTecnologia(Tecnologia Tecnologia)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         TecnologiaRepo tecnologiaRepo = new TecnologiaRepo(contexto);
         return(tecnologiaRepo.Insertar(Tecnologia));
     }
 }
Exemplo n.º 25
0
 public List <Usuario> TraerTodo()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.TraerTodo());
     }
 }
Exemplo n.º 26
0
 public List <Tecnologia> Traer()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         TecnologiaRepo tecnologiaRepo = new TecnologiaRepo(contexto);
         return(tecnologiaRepo.TraerTodo());
     }
 }
Exemplo n.º 27
0
 public bool Modificar(Usuario Usuario)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.Actualizar(Usuario));
     }
 }
Exemplo n.º 28
0
 public bool Modificar(Tecnologia Tecnologia)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         TecnologiaRepo tecnologiaRepo = new TecnologiaRepo(contexto);
         return(tecnologiaRepo.Actualizar(Tecnologia));
     }
 }
Exemplo n.º 29
0
 public bool ModificarPerfil(Perfil Perfil)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         PerfilRepo perfilRepo = new PerfilRepo(contexto);
         return(perfilRepo.Actualizar(Perfil));
     }
 }
Exemplo n.º 30
0
        //private AnalyticsRepo analyticsRepo = new AnalyticsRepo();

        public List <Posicion> TraerPosiciones()
        {
            using (SQLContexto contexto = new SQLContexto())
            {
                PosicionRepo posicionRepo = new PosicionRepo(contexto);
                return(posicionRepo.TraerTodo());
            }
        }