You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
844 B
C++

#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);
}