예제 #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();
                    }
                }
            }
        }
예제 #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;
            }
        }
예제 #3
0
 public bool ModificarPosicion(Posicion Posicion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         PosicionRepo posicionRepo = new PosicionRepo(contexto);
         return(posicionRepo.Actualizar(Posicion));
     }
 }
예제 #4
0
 public List <Perfil> TraerPerfiles()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         PerfilRepo perfilRepo = new PerfilRepo(contexto);
         return(perfilRepo.TraerTodo());
     }
 }
예제 #5
0
 public bool Agregar(Usuario Usuario)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.Insertar(Usuario));
     }
 }
예제 #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));
     }
 }
예제 #10
0
 public bool AgregarEducacion(Educacion Educacion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         EducacionRepo educacionRepo = new EducacionRepo(contexto);
         return(educacionRepo.Insertar(Educacion));
     }
 }
예제 #11
0
 public List <Oficina> TraerTodo()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         OficinaRepo oficinaRepo = new OficinaRepo(contexto);
         return(oficinaRepo.TraerTodo());
     }
 }
예제 #12
0
 private ProcesoSeleccion HidratarProcesoSeleccion(Entrevista entrevista)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ProcesoSeleccionRepo procesoSeleccionRepo = new ProcesoSeleccionRepo(contexto);
         return(procesoSeleccionRepo.Traer(entrevista.ProcesoSeleccion));
     }
 }
예제 #13
0
 private Usuario HidratarUsuario(Entrevista entrevista)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.Traer(entrevista.Entrevistador));
     }
 }
예제 #14
0
 public List <Entrevista> TraerEntrevistas()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         EntrevistaRepo entrevistaRepo = new EntrevistaRepo(contexto);
         return(entrevistaRepo.TraerTodo());
     }
 }
예제 #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());
            }
        }
 public bool ModificarEntrevista(Entrevista Entrevista)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         EntrevistaRepo entrevistaRepo = new EntrevistaRepo(contexto);
         return(entrevistaRepo.Actualizar(Entrevista));
     }
 }
 public List <ProcesoSeleccion> TraerProcesosSeleccion()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ProcesoSeleccionRepo procesoSeleccionRepo = new ProcesoSeleccionRepo(contexto);
         return(procesoSeleccionRepo.TraerTodo());
     }
 }
예제 #18
0
 public bool ModificarEducacion(Educacion Educacion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         EducacionRepo educacionRepo = new EducacionRepo(contexto);
         return(educacionRepo.Actualizar(Educacion));
     }
 }
 public bool ModificarProcesoSeleccion(ProcesoSeleccion ProcesoSeleccion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ProcesoSeleccionRepo procesoSeleccionRepo = new ProcesoSeleccionRepo(contexto);
         return(procesoSeleccionRepo.Actualizar(ProcesoSeleccion));
     }
 }
예제 #20
0
 public bool AgregarExperiencia(Experiencia Experiencia)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ExperienciaRepo experienciaRepo = new ExperienciaRepo(contexto);
         return(experienciaRepo.Insertar(Experiencia));
     }
 }
 private Usuario HidratarReclutador(ProcesoSeleccion procesoSeleccion)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.Traer(procesoSeleccion.Reclutador));
     }
 }
예제 #22
0
 public bool ModificarExperiencia(Experiencia Experiencia)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         ExperienciaRepo experienciaRepo = new ExperienciaRepo(contexto);
         return(experienciaRepo.Actualizar(Experiencia));
     }
 }
 public bool AgregarEntrevista(Entrevista Entrevista)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         EntrevistaRepo entrevistaRepo = new EntrevistaRepo(contexto);
         return(entrevistaRepo.Insertar(Entrevista));
     }
 }
예제 #24
0
 public bool AgregarTecnologia(Tecnologia Tecnologia)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         TecnologiaRepo tecnologiaRepo = new TecnologiaRepo(contexto);
         return(tecnologiaRepo.Insertar(Tecnologia));
     }
 }
예제 #25
0
 public List <Usuario> TraerTodo()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.TraerTodo());
     }
 }
예제 #26
0
 public List <Tecnologia> Traer()
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         TecnologiaRepo tecnologiaRepo = new TecnologiaRepo(contexto);
         return(tecnologiaRepo.TraerTodo());
     }
 }
예제 #27
0
 public bool Modificar(Usuario Usuario)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         UsuarioRepo usuarioRepo = new UsuarioRepo(contexto);
         return(usuarioRepo.Actualizar(Usuario));
     }
 }
예제 #28
0
 public bool Modificar(Tecnologia Tecnologia)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         TecnologiaRepo tecnologiaRepo = new TecnologiaRepo(contexto);
         return(tecnologiaRepo.Actualizar(Tecnologia));
     }
 }
예제 #29
0
 public bool ModificarPerfil(Perfil Perfil)
 {
     using (SQLContexto contexto = new SQLContexto())
     {
         PerfilRepo perfilRepo = new PerfilRepo(contexto);
         return(perfilRepo.Actualizar(Perfil));
     }
 }
예제 #30
0
        //private AnalyticsRepo analyticsRepo = new AnalyticsRepo();

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