#include "acform.h"
#include "ui_acform.h"
#include <QList>

#include "accommodation-odb.hxx"

AcForm::AcForm(QWidget *parent) :
    AutoForm<Person>(parent),
    ui(new Ui::AcForm)
{
    ui->setupUi(this);

    registerBinding(ui->firstName);
    registerBinding(ui->lastName);
}

AcForm::~AcForm()
{
    delete ui;
}

void AcForm::registerCombos()
{
    QList<ComboData> cbData;
    Service<Address> srv;
    foreach (QSharedPointer<Address> adr, srv.all()) {
        cbData.append(ComboData(adr));
    }

    registerBinding(ui->address, cbData);
}
