示例#1
0
        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());
            }
        }
示例#2
0
 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());
     }
 }
示例#3
0
 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());
     }
 }
示例#4
0
 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());
     }
 }
示例#5
0
 public void saveListaLocalIged(List <LocalIged> listaLocalIged)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.LocalIged.AddRange(listaLocalIged);
         _context.SaveChanges();
     }
 }
示例#6
0
 public IEnumerable <Iged> ObtenerListaUgeles()
 {
     using (var _context = new rendugelDBContext())
     {
         var item = _context.Iged.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList();
         return(item);
     }
 }
示例#7
0
 public void updateManagerUnidadEjecutora(UnidadEjecutora unidadEjecutora)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.UnidadEjecutora.Update(unidadEjecutora);
         _context.SaveChanges();
     }
 }
示例#8
0
 public void saveListaPersonal(List <Personal> listaPersonal)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.Personal.AddRange(listaPersonal);
         _context.SaveChanges();
     }
 }
示例#9
0
 public void updateIgedBasicos(IgedBasicos igedBasicos)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.IgedBasicos.Update(igedBasicos);
         _context.SaveChanges();
     }
 }
示例#10
0
 public void saveListaIgedRegistroDetalle(List <IgedRegistroDetalle> listaIgedRegistroDetalle)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.IgedRegistroDetalle.AddRange(listaIgedRegistroDetalle);
         _context.SaveChanges();
     }
 }
示例#11
0
 public DocumentoSuspension ObtenerDocumentoSuspensionPorId(int idDocumentoSuspension)
 {
     using (var _context = new rendugelDBContext())
     {
         //var item = 0;
         return(_context.DocumentoSuspension.Where(x => x.IdDocumentoSuspension == idDocumentoSuspension).FirstOrDefault());
     }
 }
示例#12
0
 public void SaveListaPersonalMedioContacto(List <PersonalMedioContacto> listaPersonalMedioContacto)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.PersonalMedioContacto.AddRange(listaPersonalMedioContacto);
         _context.SaveChanges();
     }
 }
示例#13
0
 public void UpdatePersonalMedioContacto(PersonalMedioContacto personalMedioContacto)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.PersonalMedioContacto.Update(personalMedioContacto);
         _context.SaveChanges();
     }
 }
示例#14
0
 public Iged ObtenerIgedPorId(int idIged)
 {
     using (var _context = new rendugelDBContext())
     {
         //var item = 0;
         return(_context.Iged.Where(x => x.IdIged == idIged).FirstOrDefault());
     }
 }
示例#15
0
 public IEnumerable <NaturalezaEvento> ObtenerListaNaturalezaActoAdministrativo()
 {
     using (var _context = new rendugelDBContext())
     {
         var item = _context.NaturalezaEvento.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList();
         return(item);
     }
 }
示例#16
0
 public void updateIgedRegistroDetalle(IgedRegistroDetalle igedRegistroDetalle)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.IgedRegistroDetalle.Update(igedRegistroDetalle);
         _context.SaveChanges();
     }
 }
示例#17
0
 public IEnumerable <EventoRegistral> ObtenerListaEventoRegistral()
 {
     using (var _context = new rendugelDBContext())
     {
         var item = _context.EventoRegistral.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList();
         return(item);
     }
 }
示例#18
0
 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());
     }
 }
示例#19
0
 public IEnumerable <Ubigeo> ObtenerListaLocalidad()
 {
     using (var _context = new rendugelDBContext())
     {
         var item = _context.Ubigeo.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList();
         return(item);
     }
 }
示例#20
0
 public void saveListaIgedBasicos(List <IgedBasicos> listaIgedBasicos)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.IgedBasicos.AddRange(listaIgedBasicos);
         _context.SaveChanges();
     }
 }
示例#21
0
 public IEnumerable <TipoDocumento> ObtenerListaTipoDocumento()
 {
     using (var _context = new rendugelDBContext())
     {
         var item = _context.TipoDocumento.Where(x => x.EsActivo == true & x.EsBorrado == false).ToList();
         return(item);
     }
 }
示例#22
0
 public void updatePersonal(Personal personal)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.Personal.Update(personal);
         _context.SaveChanges();
     }
 }
示例#23
0
 public void updateLocalIged(LocalIged localIged)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.LocalIged.Update(localIged);
         _context.SaveChanges();
     }
 }
示例#24
0
 public void updateDependenciaUnidadEjecutora(DependeciaUnidadEjecutora dependenciaUnidadEjecutora)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.DependeciaUnidadEjecutora.Update(dependenciaUnidadEjecutora);
         _context.SaveChanges();
     }
 }
示例#25
0
 public DocumentoTem ObtenerDocumentoPorId(int idDocumentoTem)
 {
     using (var _context = new rendugelDBContext())
     {
         //var item = 0;
         return(_context.DocumentoTem.Where(x => x.IdDocumentoTem == idDocumentoTem).FirstOrDefault());
     }
 }
示例#26
0
 public void updateIgedMedioContacto(IgedMedioContacto igedMedioContacto)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.IgedMedioContacto.Update(igedMedioContacto);
         _context.SaveChanges();
     }
 }
示例#27
0
 public void saveListaIgedMedioContacto(List <IgedMedioContacto> listaIgedMedioContacto)
 {
     using (var _context = new rendugelDBContext())
     {
         _context.IgedMedioContacto.AddRange(listaIgedMedioContacto);
         _context.SaveChanges();
     }
 }
示例#28
0
 public DocumentoDirector ObtenerDocumentoDirectorPorId(int id)
 {
     using (var _context = new rendugelDBContext())
     {
         //var item = 0;
         return(_context.DocumentoDirector.Where(x => x.IdDocumentoDirector == id).FirstOrDefault());
     }
 }
示例#29
0
        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);
        }
示例#30
0
 public void updateDocumento(DocumentoTem documentoTem)
 {
     using (var _context = new rendugelDBContext())
     {
         //var item = 0;
         _context.DocumentoTem.Update(documentoTem);
         _context.SaveChanges();
     }
 }