|
|
|
#include "dialog.h"
|
|
|
|
#include "ui_dialog.h"
|
|
|
|
|
|
|
|
#include <core.h>
|
|
|
|
|
|
|
|
#include "data/person.h"
|
|
|
|
#include "accommodationservice.h"
|
|
|
|
|
|
|
|
#include "acform.h"
|
|
|
|
|
|
|
|
#include "accommodation-odb.hxx"
|
|
|
|
|
|
|
|
Dialog::Dialog(QWidget *parent) :
|
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::Dialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
Dialog::~Dialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Dialog::setData(QSharedPointer<Person> data)
|
|
|
|
{
|
|
|
|
m_data = data;
|
|
|
|
|
|
|
|
AcForm *form = new AcForm(this);
|
|
|
|
form->setEntity(data);
|
|
|
|
ui->verticalLayout->addWidget(form);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Dialog::on_buttonBox_accepted()
|
|
|
|
{
|
|
|
|
IPlugin *plugin = Context::instance().plugins().at(0);
|
|
|
|
QSharedPointer<Person> p(new Person());
|
|
|
|
|
|
|
|
p->setFirstName(ui->lineEdit->text());
|
|
|
|
p->setLastName(ui->lineEdit_2->text());
|
|
|
|
|
|
|
|
AccommodationService *service = (AccommodationService*)plugin->service<Person>();
|
|
|
|
service->pokus(p);
|
|
|
|
}
|