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(); } }
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"); } }
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(); } }
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(); } }