add, edit, delete and assign themes to dates

This commit is contained in:
Jottyfan
2023-12-16 22:51:27 +01:00
parent 5356e51f09
commit 0999d41d64
13 changed files with 505 additions and 29 deletions

View File

@ -0,0 +1,50 @@
package de.jottyfan.bico.modules.subject;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import de.jottyfan.bico.db.tables.records.TSourceRecord;
import de.jottyfan.bico.db.tables.records.TSubjectRecord;
import de.jottyfan.bico.db.tables.records.VLessonRecord;
/**
*
* @author jotty
*
*/
@Service
public class SubjectService {
@Autowired
private SubjectRepository repository;
public List<VLessonRecord> getSubjects() {
return repository.getSubjects();
}
public TSubjectRecord getSubject(Integer pkSubject) {
return repository.getSubject(pkSubject);
}
public List<TSourceRecord> getSources() {
return repository.getSources();
}
public void save(TSubjectRecord bean) {
if (bean.getPkSubject() == null) {
repository.addSubject(bean);
} else {
repository.updateSubject(bean);
}
}
public TSubjectRecord getBeanIfDeletable(Integer pkSubject) {
return repository.getBeanIfDeletable(pkSubject);
}
public void removeSubject(Integer pkSubject) {
repository.removeSubject(pkSubject);
}
}