public void deletelocalidad(int id)
 {
     using (NuevoDbContext context = new NuevoDbContext())
     {
         LocalidadDto localidad = context.getLocalidades(true)
                                  .Where(t => t.Id == id)
                                  .FirstOrDefault();
         context.Remove(localidad);
         context.SaveChanges();
     }
 }
Esempio n. 2
0
 public string EliminarEstudio(int id)
 {
     using (NuevoDbContext context = new NuevoDbContext())
     {
         EstudioDto estudio = context.getEstudios(true)
                              .Where(t => t.Id == id)
                              .FirstOrDefault();
         context.Remove(estudio);
         context.SaveChanges();
         return("Registro eliminado con éxito");
     }
 }
Esempio n. 3
0
        public void deleteDenuncia(DenunciaDto DenunciaDto)
        {
            using (NuevoDbContext context = new NuevoDbContext())
            {
                //load task from database
                DenunciaDto denunciaDto = context.getDenuncias(true)
                                          .Where(t => t.DenunciaId == DenunciaDto.DenunciaId)
                                          .FirstOrDefault();

                context.Remove(denunciaDto);
                context.SaveChanges();
            }
        }
Esempio n. 4
0
        public void deleteDenunciante(DenuncianteDto denuncianteDto)
        {
            var usuario = HttpContext.Current.User.Identity.Name;

            using (NuevoDbContext context = new NuevoDbContext())
            {
                //load task from database
                DenuncianteDto existingTest = context.getDenunciantes(true)
                                              .Where(t => t.DenuncianteId == denuncianteDto.DenuncianteId)
                                              .FirstOrDefault();

                context.Remove(existingTest);
                context.SaveChanges();
                var accion = new CommonChangeLoggerDto(DateTime.Now, "DENUNCIANTE", "Se ha eliminado al Denunciante", "Denunciante : " + denuncianteDto.apellido + "," + denuncianteDto.nombre + "," + " dni: " + denuncianteDto.NroDocumento, "ELIMINADO", usuario, denuncianteDto.DenuncianteId);
                context.Add(accion);
                context.SaveChanges();
            }
        }