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.

34 lines
642 B
C++

#include "dialog.h"
#include "ui_dialog.h"
#include <core.h>
#include "data/person.h"
#include "accommodationservice.h"
#include "accommodation-odb.hxx"
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
}
Dialog::~Dialog()
{
delete ui;
}
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->save(p);
}