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(); } } } }
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; } }
public bool ModificarPosicion(Posicion Posicion) { using (SQLContexto contexto = new SQLContexto()) { PosicionRepo posicionRepo = new PosicionRepo(contexto); return(posicionRepo.Actualizar(Posicion)); } }
public List <Perfil> TraerPerfiles() { using (SQLContexto contexto = new SQLContexto()) { PerfilRepo perfilRepo = new PerfilRepo(contexto); return(perfilRepo.TraerTodo()); } }
public bool Agregar(Usuario Usuario) { using (SQLContexto contexto = new SQLContexto()) { UsuarioRepo usuarioRepo = new UsuarioRepo(contexto); return(usuarioRepo.Insertar(Usuario)); } }
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)); } }
public bool AgregarEducacion(Educacion Educacion) { using (SQLContexto contexto = new SQLContexto()) { EducacionRepo educacionRepo = new EducacionRepo(contexto); return(educacionRepo.Insertar(Educacion)); } }
public List <Oficina> TraerTodo() { using (SQLContexto contexto = new SQLContexto()) { OficinaRepo oficinaRepo = new OficinaRepo(contexto); return(oficinaRepo.TraerTodo()); } }
private ProcesoSeleccion HidratarProcesoSeleccion(Entrevista entrevista) { using (SQLContexto contexto = new SQLContexto()) { ProcesoSeleccionRepo procesoSeleccionRepo = new ProcesoSeleccionRepo(contexto); return(procesoSeleccionRepo.Traer(entrevista.ProcesoSeleccion)); } }
private Usuario HidratarUsuario(Entrevista entrevista) { using (SQLContexto contexto = new SQLContexto()) { UsuarioRepo usuarioRepo = new UsuarioRepo(contexto); return(usuarioRepo.Traer(entrevista.Entrevistador)); } }
public List <Entrevista> TraerEntrevistas() { using (SQLContexto contexto = new SQLContexto()) { EntrevistaRepo entrevistaRepo = new EntrevistaRepo(contexto); return(entrevistaRepo.TraerTodo()); } }
//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()); } }
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)); } }
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)); } }
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)); } }
public bool AgregarTecnologia(Tecnologia Tecnologia) { using (SQLContexto contexto = new SQLContexto()) { TecnologiaRepo tecnologiaRepo = new TecnologiaRepo(contexto); return(tecnologiaRepo.Insertar(Tecnologia)); } }
public List <Usuario> TraerTodo() { using (SQLContexto contexto = new SQLContexto()) { UsuarioRepo usuarioRepo = new UsuarioRepo(contexto); return(usuarioRepo.TraerTodo()); } }
public List <Tecnologia> Traer() { using (SQLContexto contexto = new SQLContexto()) { TecnologiaRepo tecnologiaRepo = new TecnologiaRepo(contexto); return(tecnologiaRepo.TraerTodo()); } }
public bool Modificar(Usuario Usuario) { using (SQLContexto contexto = new SQLContexto()) { UsuarioRepo usuarioRepo = new UsuarioRepo(contexto); return(usuarioRepo.Actualizar(Usuario)); } }
public bool Modificar(Tecnologia Tecnologia) { using (SQLContexto contexto = new SQLContexto()) { TecnologiaRepo tecnologiaRepo = new TecnologiaRepo(contexto); return(tecnologiaRepo.Actualizar(Tecnologia)); } }
public bool ModificarPerfil(Perfil Perfil) { using (SQLContexto contexto = new SQLContexto()) { PerfilRepo perfilRepo = new PerfilRepo(contexto); return(perfilRepo.Actualizar(Perfil)); } }
//private AnalyticsRepo analyticsRepo = new AnalyticsRepo(); public List <Posicion> TraerPosiciones() { using (SQLContexto contexto = new SQLContexto()) { PosicionRepo posicionRepo = new PosicionRepo(contexto); return(posicionRepo.TraerTodo()); } }