Data classes and services for number series and seasons. Fixed release

build.
This commit is contained in:
2016-06-23 15:49:42 +02:00
committed by Rokos Josef
parent a8f4ad4a04
commit b927921fb3
17 changed files with 453 additions and 5 deletions
+34
View File
@@ -0,0 +1,34 @@
#include "seasonservice.h"
#include "core-odb.hxx"
SeasonService::SeasonService()
{
}
QSharedPointer<Season> SeasonService::active()
{
QList<QSharedPointer<Season> > seasons = all("active = 1");
if (seasons.count() > 0)
{
return seasons[0];
}
return QSharedPointer<Season>();
}
void SeasonService::activate(QSharedPointer<Season> season)
{
Transaction tx;
foreach (QSharedPointer<Season> ses, all()) {
ses->setActive(false);
update(ses);
}
season->setActive(true);
update(season);
tx.commit();
}