add, edit, delete and assign themes to dates
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user