public IEnumerable <EEventoRegistral> ObtenerEventosColaterales(int codEvento) { using (var _context = new rendugelDBContext()) { var item = from a in _context.EventosDesencadenados join b in _context.EventoRegistral on a.IdEventoOriginal equals b.IdEventoRegistral join c in _context.EventoRegistral on a.IdEventoColateral equals c.IdEventoRegistral join d in _context.NaturalezaEvento on c.IdNaturaleza equals d.IdNaturaleza where b.CodEvento == codEvento & a.EsActivo == true & a.EsBorrado == false & b.EsActivo == true & b.EsBorrado == false & c.EsActivo == true & c.EsBorrado == false & d.EsActivo == true & d.EsBorrado == false select new EEventoRegistral { IdEventoRegistral = c.IdEventoRegistral, CodEvento = c.CodEvento ?? default(int), DescEvento = c.DescEvento, Naturaleza = new ENaturaleza { IdNaturaleza = d.IdNaturaleza, CodNaturaleza = d.CodNaturaleza, DescNaturaleza = d.DescNaturaleza } }; return(item.ToList()); } }
public IEnumerable <EIged> ObtenerListaUgelesInvolucradas(int IdDre, int IdUgel) { using (var _context = new rendugelDBContext()) { //var item = _context.Iged.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList(); var item = from a in _context.Iged join b in _context.IgedBasicos on a.IdIged equals b.IdIged join c in _context.TipoIged on a.IdTipoIged equals c.IdTipoIged where c.CodTipoIged == 2 & b.IdDre == IdDre & a.IdIged != IdUgel //crear enumerado & a.EsActivo == true & a.EsBorrado == false & b.EsActivo == true & b.EsBorrado == false & c.EsActivo == true & c.EsBorrado == false select new EIged { IdIged = a.IdIged, CodIged = a.CodIged, NomIged = b.NomIged, CodTipoIged = c.CodTipoIged, IdTipoIged = c.IdTipoIged }; return(item.ToList()); } }
public IEnumerable <EIged> ObtenerListaCDIgedPorCodTipoIged(int codTipoIged) { using (var _context = new rendugelDBContext()) { //var item = _context.Iged.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList(); var item = from a in _context.Iged join b in _context.IgedBasicos on a.IdIged equals b.IdIged join c in _context.TipoIged on a.IdTipoIged equals c.IdTipoIged where c.CodTipoIged == codTipoIged & a.EsActivo == true & a.EsBorrado == false & b.EsActivo == true & b.EsBorrado == false & c.EsActivo == true & c.EsBorrado == false select new EIged { IdIged = a.IdIged, CodIged = a.CodIged, NomIged = b.NomIged, CodTipoIged = c.CodTipoIged, IdTipoIged = c.IdTipoIged }; return(item.ToList()); } }
public IEnumerable <EIged> ObtenerListaUgelesInvolucradasPorUgel(int IdUgel) { using (var _context = new rendugelDBContext()) { var item = from a in _context.IgedBasicos join b in _context.IgedBasicos on a.IdDre equals b.IdDre join c in _context.Iged on b.IdIged equals c.IdIged join d in _context.TipoIged on c.IdTipoIged equals d.IdTipoIged where a.IdIged == IdUgel & d.CodTipoIged == 2 & b.IdIged != IdUgel //crear enumerado & a.EsActivo == true & a.EsBorrado == false & b.EsActivo == true & b.EsBorrado == false & c.EsActivo == true & c.EsBorrado == false select new EIged { IdIged = b.IdIged, CodIged = c.CodIged, NomIged = b.NomIged, CodTipoIged = d.CodTipoIged, IdTipoIged = d.IdTipoIged }; return(item.ToList()); } }
public void saveListaLocalIged(List <LocalIged> listaLocalIged) { using (var _context = new rendugelDBContext()) { _context.LocalIged.AddRange(listaLocalIged); _context.SaveChanges(); } }
public IEnumerable <Iged> ObtenerListaUgeles() { using (var _context = new rendugelDBContext()) { var item = _context.Iged.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList(); return(item); } }
public void updateManagerUnidadEjecutora(UnidadEjecutora unidadEjecutora) { using (var _context = new rendugelDBContext()) { _context.UnidadEjecutora.Update(unidadEjecutora); _context.SaveChanges(); } }
public void saveListaPersonal(List <Personal> listaPersonal) { using (var _context = new rendugelDBContext()) { _context.Personal.AddRange(listaPersonal); _context.SaveChanges(); } }
public void updateIgedBasicos(IgedBasicos igedBasicos) { using (var _context = new rendugelDBContext()) { _context.IgedBasicos.Update(igedBasicos); _context.SaveChanges(); } }
public void saveListaIgedRegistroDetalle(List <IgedRegistroDetalle> listaIgedRegistroDetalle) { using (var _context = new rendugelDBContext()) { _context.IgedRegistroDetalle.AddRange(listaIgedRegistroDetalle); _context.SaveChanges(); } }
public DocumentoSuspension ObtenerDocumentoSuspensionPorId(int idDocumentoSuspension) { using (var _context = new rendugelDBContext()) { //var item = 0; return(_context.DocumentoSuspension.Where(x => x.IdDocumentoSuspension == idDocumentoSuspension).FirstOrDefault()); } }
public void SaveListaPersonalMedioContacto(List <PersonalMedioContacto> listaPersonalMedioContacto) { using (var _context = new rendugelDBContext()) { _context.PersonalMedioContacto.AddRange(listaPersonalMedioContacto); _context.SaveChanges(); } }
public void UpdatePersonalMedioContacto(PersonalMedioContacto personalMedioContacto) { using (var _context = new rendugelDBContext()) { _context.PersonalMedioContacto.Update(personalMedioContacto); _context.SaveChanges(); } }
public Iged ObtenerIgedPorId(int idIged) { using (var _context = new rendugelDBContext()) { //var item = 0; return(_context.Iged.Where(x => x.IdIged == idIged).FirstOrDefault()); } }
public IEnumerable <NaturalezaEvento> ObtenerListaNaturalezaActoAdministrativo() { using (var _context = new rendugelDBContext()) { var item = _context.NaturalezaEvento.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList(); return(item); } }
public void updateIgedRegistroDetalle(IgedRegistroDetalle igedRegistroDetalle) { using (var _context = new rendugelDBContext()) { _context.IgedRegistroDetalle.Update(igedRegistroDetalle); _context.SaveChanges(); } }
public IEnumerable <EventoRegistral> ObtenerListaEventoRegistral() { using (var _context = new rendugelDBContext()) { var item = _context.EventoRegistral.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList(); return(item); } }
public DocumentoRegistro ObtenerDocumentoRegistroPorIdRegistroIdDocumento(int idRegistro, int idDocumento) { using (var _context = new rendugelDBContext()) { //var item = 0; return(_context.DocumentoRegistro.Where(x => x.IdDocumento == idDocumento && x.IdRegistro == idRegistro && x.EsActivo == true && x.EsBorrado == false).FirstOrDefault()); } }
public IEnumerable <Ubigeo> ObtenerListaLocalidad() { using (var _context = new rendugelDBContext()) { var item = _context.Ubigeo.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList(); return(item); } }
public void saveListaIgedBasicos(List <IgedBasicos> listaIgedBasicos) { using (var _context = new rendugelDBContext()) { _context.IgedBasicos.AddRange(listaIgedBasicos); _context.SaveChanges(); } }
public IEnumerable <TipoDocumento> ObtenerListaTipoDocumento() { using (var _context = new rendugelDBContext()) { var item = _context.TipoDocumento.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList(); return(item); } }
public void updatePersonal(Personal personal) { using (var _context = new rendugelDBContext()) { _context.Personal.Update(personal); _context.SaveChanges(); } }
public void updateLocalIged(LocalIged localIged) { using (var _context = new rendugelDBContext()) { _context.LocalIged.Update(localIged); _context.SaveChanges(); } }
public void updateDependenciaUnidadEjecutora(DependeciaUnidadEjecutora dependenciaUnidadEjecutora) { using (var _context = new rendugelDBContext()) { _context.DependeciaUnidadEjecutora.Update(dependenciaUnidadEjecutora); _context.SaveChanges(); } }
public DocumentoTem ObtenerDocumentoPorId(int idDocumentoTem) { using (var _context = new rendugelDBContext()) { //var item = 0; return(_context.DocumentoTem.Where(x => x.IdDocumentoTem == idDocumentoTem).FirstOrDefault()); } }
public void updateIgedMedioContacto(IgedMedioContacto igedMedioContacto) { using (var _context = new rendugelDBContext()) { _context.IgedMedioContacto.Update(igedMedioContacto); _context.SaveChanges(); } }
public void saveListaIgedMedioContacto(List <IgedMedioContacto> listaIgedMedioContacto) { using (var _context = new rendugelDBContext()) { _context.IgedMedioContacto.AddRange(listaIgedMedioContacto); _context.SaveChanges(); } }
public DocumentoDirector ObtenerDocumentoDirectorPorId(int id) { using (var _context = new rendugelDBContext()) { //var item = 0; return(_context.DocumentoDirector.Where(x => x.IdDocumentoDirector == id).FirstOrDefault()); } }
public ResponseService elimarRegistro(int idRegistro) { ResponseService response = new ResponseService(); Registro registroEliminar = new Registro(); DateTime fechaHoy = DateTime.Now; string usuario = "40615837"; using (var _context = new rendugelDBContext()) using (var dbContextTransaction = _context.Database.BeginTransaction()) { try{ registroEliminar = _context.Registro.Where(x => x.IdRegistro == idRegistro) .FirstOrDefault(); if (registroEliminar is null) { response.ResultValid = true; response.MensajePrincipal = "El registro que desea eliman no existe"; return(response); } registroEliminar.EsActivo = false; registroEliminar.EsBorrado = true; registroEliminar.UsuActualizacion = usuario; registroEliminar.FechaActualizacion = fechaHoy; _context.Registro.Update(registroEliminar); //_context.SaveChanges(); List <IgedRegistroDetalle> detalles = new List <IgedRegistroDetalle>(); detalles = _context.IgedRegistroDetalle .Where(x => x.IdRegistro == idRegistro).ToList(); foreach (IgedRegistroDetalle detalleEliminar in detalles) { detalleEliminar.EsActivo = false; detalleEliminar.EsBorrado = true; detalleEliminar.UsuActualizacion = usuario; detalleEliminar.FechaActualizacion = fechaHoy; _context.IgedRegistroDetalle.Update(detalleEliminar); //_context.SaveChanges(); } _context.SaveChanges(); dbContextTransaction.Commit(); response.ResultValid = true; response.MensajePrincipal = "Los datos se eliminaron correctamente"; response.idRegistro = idRegistro; } catch (Exception e) { dbContextTransaction.Rollback(); response.ResultValid = true; response.MensajePrincipal = e.Message; } } return(response); }
public void updateDocumento(DocumentoTem documentoTem) { using (var _context = new rendugelDBContext()) { //var item = 0; _context.DocumentoTem.Update(documentoTem); _context.SaveChanges(); } }