public List <ViewTableTipoAdjunto> listarTipoAdjuntos() { List <ViewTableTipoAdjunto> lstTAdjuntos = new List <ViewTableTipoAdjunto>(); try { using (var context = new SIGHUContext()) { lstTAdjuntos = (from a in context.TIPO_ADJUNTO select new ViewTableTipoAdjunto { IdTAdjunto = a.IdTAdjunto, CodTitulo = a.CodTitulo, Nombre = a.Nombre, Activo = a.Activo, Grupo = a.GRUPO_ADJUNTO.NombreGrupo }).ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstTAdjuntos); }
public UsuarioMostrar Ingresar(string usuario, string password) { UsuarioMostrar user = new UsuarioMostrar(); try { using (var context = new SIGHUContext()) { user = (from u in context.USUARIO where u.LoginUsuario == usuario && u.PasswordUsuario == password && u.Activo == 1 select new UsuarioMostrar { IdUsuario = u.IdUsuario, NombresMostrar = u.PERSONA.NombreP + " " + u.PERSONA.ApellidoP, IdPerfil = u.IdPerfil, Perfil = u.PERFILES.Perfil, FotoPerfil = u.PERSONA.FotoPerfil }).FirstOrDefault(); return(user); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public List <ViewListAdjuntos> listarAdjuntos(int id) { List <ViewListAdjuntos> lstAdjuntos = new List <ViewListAdjuntos>(); try { using (var context = new SIGHUContext()) { lstAdjuntos = (from la in context.ADJUNTOS where la.IdPersona == id orderby la.TIPO_ADJUNTO.CodTitulo select new ViewListAdjuntos { idAdjunto = la.IdAdjunto, Codigo = la.TIPO_ADJUNTO.CodTitulo, Tipo = la.TIPO_ADJUNTO.Nombre, Nombre = la.RutaAdjunto }).ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstAdjuntos); }
public List <ViewTableUsuario> listarUsuarios() { List <ViewTableUsuario> lstUsuarios = new List <ViewTableUsuario>(); try { using (var context = new SIGHUContext()) { lstUsuarios = (from u in context.USUARIO select new ViewTableUsuario { IdUsuario = u.IdUsuario, NumDoc = u.PERSONA.NumeroDoc, Nombres = u.PERSONA.NombreP + " " + u.PERSONA.ApellidoP, Usuario = u.LoginUsuario, Activo = u.Activo }).ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstUsuarios); }
public ViewTipoAdjunto traeTipoAdjunto(int id) { ViewTipoAdjunto tipo = new ViewTipoAdjunto(); try { using (var context = new SIGHUContext()) { tipo = (from t in context.TIPO_ADJUNTO where t.IdTAdjunto == id select new ViewTipoAdjunto { IdTipo = t.IdTAdjunto, grupoAdjunto = t.IdGrupo, CodTitulo = t.CodTitulo, Nombre = t.Nombre }).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(tipo); }
public List <viewListContratos> listarContratos() { List <viewListContratos> lstContratos = new List <viewListContratos>(); try { using (var context = new SIGHUContext()) { lstContratos = (from c in context.PERSONA_HAS_CARGO orderby c.IdPersona select new viewListContratos { NumDoc = c.PERSONA.NumeroDoc, Nombres = c.PERSONA.NombreP + " " + c.PERSONA.ApellidoP, Cargo = c.CARGO.NombreC, Contrato = c.IdPersonaHasCargo, Actual = c.actual }).ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstContratos); }
public void guardaAdjunto() { try { var context = new SIGHUContext(); context.Entry(this).State = System.Data.Entity.EntityState.Added; context.SaveChanges(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void delAdjunto(int id) { try { var context = new SIGHUContext(); context.Database.ExecuteSqlCommand("DELETE FROM ADJUNTOS WHERE IdAdjunto = " + id); context.SaveChanges(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void editarGrupo() { try { using (var context = new SIGHUContext()) { context.Entry(this).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void ingresaVehiculo() { try { using (var context = new SIGHUContext()) { context.Entry(this).State = System.Data.Entity.EntityState.Added; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public List <VEHICULO> ddVehiculos() { List <VEHICULO> lstVehiculos = new List <VEHICULO>(); try { using (var context = new SIGHUContext()) { lstVehiculos = context.VEHICULO.ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstVehiculos); }
public VEHICULO traeVehiculo(int id) { VEHICULO vehiculo = new VEHICULO(); try { using (var context = new SIGHUContext()) { vehiculo = context.VEHICULO.Where(v => v.IdVehiculo == id).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(vehiculo); }
public List <VESTUARIO> ddVestuario() { List <VESTUARIO> lstVestuario = new List <VESTUARIO>(); try { using (var context = new SIGHUContext()) { lstVestuario = context.VESTUARIO.ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstVestuario); }
public List <PERFILES> ddPerfiles() { List <PERFILES> lstPerfiles = new List <PERFILES>(); try { using (var context = new SIGHUContext()) { lstPerfiles = context.PERFILES.Where(p => p.Activo == 1).ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstPerfiles); }
public List <ARMA> ddArmas() { List <ARMA> lstArmas = new List <ARMA>(); try { using (var context = new SIGHUContext()) { lstArmas = context.ARMA.ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstArmas); }
public VESTUARIO traeVestuario(int id) { VESTUARIO vestuario = new VESTUARIO(); try { using (var context = new SIGHUContext()) { vestuario = context.VESTUARIO.Where(v => v.IdVestuario == id).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(vestuario); }
public List <EMPRESA> ddEmpresas() { List <EMPRESA> lstEmpresas = new List <EMPRESA>(); try { using (var context = new SIGHUContext()) { lstEmpresas = context.EMPRESA.ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstEmpresas); }
public List <CARGO> listarCargos() { List <CARGO> lstCargo = new List <CARGO>(); try { using (var context = new SIGHUContext()) { lstCargo = context.CARGO.ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstCargo); }
public PERSONA traePersona(int id) { PERSONA persona = new PERSONA(); try { using (var context = new SIGHUContext()) { persona = context.PERSONA.Where(p => p.IdPersona == id).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(persona); }
public List <PERSONA> listarPersonas() { List <PERSONA> lstPersonas = new List <PERSONA>(); try { using (var context = new SIGHUContext()) { lstPersonas = context.PERSONA.ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstPersonas); }
public List <CARGO> ddCargos() { List <CARGO> lstCargos = new List <CARGO>(); try { using (var context = new SIGHUContext()) { lstCargos = context.CARGO.Where(c => c.Activo == 1).ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstCargos); }
public ARMA traeArma(int id) { ARMA arma = new ARMA(); try { using (var context = new SIGHUContext()) { arma = context.ARMA.Where(a => a.IdArma == id).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(arma); }
public List <GRUPO_ADJUNTO> listarGrupos() { List <GRUPO_ADJUNTO> lstGrupos = new List <GRUPO_ADJUNTO>(); try { using (var context = new SIGHUContext()) { lstGrupos = context.GRUPO_ADJUNTO.ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstGrupos); }
public List <GRUPO_ADJUNTO> ddGrupos() { List <GRUPO_ADJUNTO> lstGrupos = new List <GRUPO_ADJUNTO>(); try { using (var context = new SIGHUContext()) { lstGrupos = context.GRUPO_ADJUNTO.Where(g => g.Activo == 1).OrderBy(g => g.NombreGrupo).ToList(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(lstGrupos); }
public void activaUsuario(int id) { USUARIO usuario = new USUARIO(); try { using (var context = new SIGHUContext()) { usuario = context.USUARIO.Where(u => u.IdUsuario == id).FirstOrDefault(); usuario.Activo = 1; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public GRUPO_ADJUNTO traeGrupo(int id) { GRUPO_ADJUNTO grupo = new GRUPO_ADJUNTO(); try { using (var context = new SIGHUContext()) { grupo = (from g in context.GRUPO_ADJUNTO where g.IdGrupo == id select g).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(grupo); }
public ADJUNTOS traeNomArchivo(int id) { ADJUNTOS adjunto = new ADJUNTOS(); try { using (var context = new SIGHUContext()) { adjunto = (from a in context.ADJUNTOS where a.IdAdjunto == id select a).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(adjunto); }
public CARGO traeCargo(int id) { CARGO cargo = new CARGO(); try { using (var context = new SIGHUContext()) { cargo = (from c in context.CARGO where c.IdCargo == id select c).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(cargo); }
public EMPRESA traeEmpresa(int id) { EMPRESA empresa = new EMPRESA(); try { using (var context = new SIGHUContext()) { empresa = (from e in context.EMPRESA where e.IdEmpresa == id select e).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(empresa); }
public List <MENU> listarMenu(int id) { List <MENU> lstMenu = new List <MENU>(); try { using (var context = new SIGHUContext()) { lstMenu = (from m in context.MENU where m.Activo == 1 && m.Perfil == id select m).ToList(); } return(lstMenu); } catch (Exception ex) { throw new Exception(ex.Message); } }