use of uk.ac.bbsrc.tgac.miso.core.data.SampleNumberPerProject in project miso-lims by miso-lims.
the class DefaultProjectService method beforeDelete.
@Override
public void beforeDelete(Project object) throws IOException {
fileAttachmentService.beforeDelete(object);
List<LibraryTemplate> templates = libraryTemplateService.listByProject(object.getId());
for (LibraryTemplate template : templates) {
template.getProjects().removeIf(templateProject -> templateProject.getId() == object.getId());
libraryTemplateService.update(template);
}
SampleNumberPerProject sampleNumberPerProject = sampleNumberPerProjectService.getByProject(object);
if (sampleNumberPerProject != null) {
sampleNumberPerProjectService.delete(sampleNumberPerProject);
}
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleNumberPerProject in project miso-lims by miso-lims.
the class Dtos method to.
public static SampleNumberPerProject to(@Nonnull SampleNumberPerProjectDto from) {
SampleNumberPerProject to = new SampleNumberPerProjectImpl();
to.setHighestSampleNumber(from.getHighestSampleNumber());
to.setPadding(from.getPadding());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleNumberPerProject in project miso-lims by miso-lims.
the class DefaultSampleNumberPerProjectService method delete.
@Override
public void delete(SampleNumberPerProject sampleNumberPerProject) throws IOException {
authorizationManager.throwIfNonAdmin();
SampleNumberPerProject updatedSampleNumberPerProject = get(sampleNumberPerProject.getId());
sampleNumberPerProjectDao.delete(updatedSampleNumberPerProject);
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleNumberPerProject in project miso-lims by miso-lims.
the class DefaultSampleNumberPerProjectService method create.
@Override
public Long create(SampleNumberPerProject sampleNumberPerProject, Long projectId) throws IOException {
authorizationManager.throwIfNonAdmin();
User user = authorizationManager.getCurrentUser();
Project project = projectStore.get(projectId);
sampleNumberPerProject.setCreatedBy(user);
sampleNumberPerProject.setUpdatedBy(user);
sampleNumberPerProject.setProject(project);
return sampleNumberPerProjectDao.addSampleNumberPerProject(sampleNumberPerProject);
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleNumberPerProject in project miso-lims by miso-lims.
the class DefaultSampleNumberPerProjectService method update.
@Override
public void update(SampleNumberPerProject sampleNumberPerProject) throws IOException {
authorizationManager.throwIfNonAdmin();
SampleNumberPerProject updatedSampleNumberPerProject = get(sampleNumberPerProject.getId());
// updatedSampleNumberPerProject.setAlias(sampleNumberPerProject.getAlias());
User user = authorizationManager.getCurrentUser();
updatedSampleNumberPerProject.setUpdatedBy(user);
sampleNumberPerProjectDao.update(updatedSampleNumberPerProject);
}
Aggregations