Commit 368e6a3b authored by Martin Straka's avatar Martin Straka Committed by Karel Slaný

Refactor box operations on new isds structures

parent 9c863468
......@@ -135,7 +135,6 @@ SOURCES += \
src/net/isds_session.cpp \
src/net/isds_wrapper.cpp \
src/net/net_layer.cpp \
src/net/xml_layer.cpp \
src/qml_interaction/image_provider.cpp \
src/qml_interaction/interaction_filesystem.cpp \
src/qml_interaction/interaction_zfo_file.cpp \
......@@ -173,6 +172,11 @@ SOURCES += \
src/xml/xml_download_message.cpp \
src/xml/xml_download_message_author.cpp \
src/xml/xml_download_message_list.cpp \
src/xml/xml_find_databox.cpp \
src/xml/xml_find_databox_fulltext.cpp \
src/xml/xml_get_db_owner_info.cpp \
src/xml/xml_get_db_user_info.cpp \
src/xml/xml_login.cpp \
src/xml/xml_mark_message_as_read.cpp \
src/xml/xml_parse_zfo.cpp \
src/xml/xml_send_message.cpp \
......@@ -232,7 +236,6 @@ HEADERS += \
src/net/isds_session.h \
src/net/isds_wrapper.h \
src/net/net_layer.h \
src/net/xml_layer.h \
src/qml_interaction/image_provider.h \
src/qml_interaction/interaction_filesystem.h \
src/qml_interaction/interaction_zfo_file.h \
......@@ -272,6 +275,11 @@ HEADERS += \
src/xml/xml_download_message.h \
src/xml/xml_download_message_author.h \
src/xml/xml_download_message_list.h \
src/xml/xml_find_databox.h \
src/xml/xml_find_databox_fulltext.h \
src/xml/xml_get_db_owner_info.h \
src/xml/xml_get_db_user_info.h \
src/xml/xml_login.h \
src/xml/xml_mark_message_as_read.h \
src/xml/xml_parse_zfo.h \
src/xml/xml_send_message.h \
......
......@@ -22,6 +22,7 @@
*/
#include "src/common.h"
#include "src/datovka_shared/isds/type_conversion.h"
#include "src/global.h"
#include "src/isds/isds_conversion.h"
#include "src/models/accountmodel.h"
......@@ -31,75 +32,78 @@
#include "src/sqlite/zfo_db.h"
QString DbWrapper::createAccountInfoStringForQml(
const DbWrapper::AccountInfo &accountInfo)
const Isds::DbOwnerInfo &dbOwnerInfo)
{
QString dbInfo(divStart);
dbInfo.append(strongInfoLine(tr("Data box ID"), accountInfo.dbID));
dbInfo.append(strongInfoLine(tr("Data box type"), accountInfo.dbType));
if (!accountInfo.ic.isEmpty()) {
dbInfo.append(strongInfoLine(tr("IČ"), accountInfo.ic));
dbInfo.append(strongInfoLine(tr("Data box ID"), dbOwnerInfo.dbID()));
dbInfo.append(strongInfoLine(tr("Data box type"),
Isds::dbType2Str(dbOwnerInfo.dbType())));
if (!dbOwnerInfo.ic().isEmpty()) {
dbInfo.append(strongInfoLine(tr("IČ"), dbOwnerInfo.ic()));
}
if (!accountInfo.pnFirstName.isEmpty()) {
if (!dbOwnerInfo.personName().firstName().isEmpty()) {
dbInfo.append(strongInfoLine(tr("Given name"),
accountInfo.pnFirstName));
dbOwnerInfo.personName().firstName()));
}
if (!accountInfo.pnMiddleName.isEmpty()) {
if (!dbOwnerInfo.personName().middleName().isEmpty()) {
dbInfo.append(strongInfoLine(tr("Middle name"),
accountInfo.pnMiddleName));
dbOwnerInfo.personName().middleName()));
}
if (!accountInfo.pnLastName.isEmpty()) {
if (!dbOwnerInfo.personName().lastName().isEmpty()) {
dbInfo.append(strongInfoLine(tr("Surname"),
accountInfo.pnLastName));
dbOwnerInfo.personName().lastName()));
}
if (!accountInfo.pnLastNameAtBirth.isEmpty()) {
if (!dbOwnerInfo.personName().lastNameAtBirth().isEmpty()) {
dbInfo.append(strongInfoLine(tr("Surname at birth"),
accountInfo.pnLastNameAtBirth));
dbOwnerInfo.personName().lastNameAtBirth()));
}
if (!accountInfo.biDate.isEmpty()) {
if (!dbOwnerInfo.birthInfo().date().toString().isEmpty()) {
dbInfo.append(strongInfoLine(tr("Date of birth"),
accountInfo.biDate));
dbOwnerInfo.birthInfo().date().toString()));
}
if (!accountInfo.biCity.isEmpty()) {
if (!dbOwnerInfo.birthInfo().city().isEmpty()) {
dbInfo.append(strongInfoLine(tr("City of birth"),
accountInfo.biCity));
dbOwnerInfo.birthInfo().city()));
}
if (!accountInfo.biCounty.isEmpty()) {
if (!dbOwnerInfo.birthInfo().county().isEmpty()) {
dbInfo.append(strongInfoLine(tr("County of birth"),
accountInfo.biCounty));
dbOwnerInfo.birthInfo().county()));
}
if (!accountInfo.biState.isEmpty()) {
if (!dbOwnerInfo.birthInfo().state().isEmpty()) {
dbInfo.append(strongInfoLine(tr("State of birth"),
accountInfo.biState));
dbOwnerInfo.birthInfo().state()));
}
if (!accountInfo.firmName.isEmpty()) {
if (!dbOwnerInfo.firmName().isEmpty()) {
dbInfo.append(strongInfoLine(tr("Company name"),
accountInfo.firmName));
dbOwnerInfo.firmName()));
}
dbInfo.append(strongInfoLine(tr("Street of residence"),
accountInfo.adStreet));
dbOwnerInfo.address().street()));
dbInfo.append(strongInfoLine(tr("Number in street"),
accountInfo.adNumberInStreet));
dbOwnerInfo.address().numberInStreet()));
dbInfo.append(strongInfoLine(tr("Number in municipality"),
accountInfo.adNumberInMunicipality));
dbOwnerInfo.address().numberInMunicipality()));
dbInfo.append(strongInfoLine(tr("Zip code"),
accountInfo.adZipCode));
dbOwnerInfo.address().zipCode()));
dbInfo.append(strongInfoLine(tr("City of residence"),
accountInfo.adCity));
if (!accountInfo.adState.isEmpty()) {
dbOwnerInfo.address().city()));
if (!dbOwnerInfo.address().state().isEmpty()) {
dbInfo.append(strongInfoLine(tr("State of residence"),
accountInfo.adState));
dbOwnerInfo.address().state()));
}
if (!accountInfo.nationality.isEmpty()) {
if (!dbOwnerInfo.nationality().isEmpty()) {
dbInfo.append(strongInfoLine(tr("Nationality"),
accountInfo.nationality));
dbOwnerInfo.nationality()));
}
dbInfo.append(strongInfoLine(tr("Databox state"),
IsdsConversion::dbStateToText(accountInfo.dbState)));
IsdsConversion::dbStateToText(dbOwnerInfo.dbState())));
dbInfo.append(strongInfoLine(tr("Effective OVM"),
(accountInfo.dbEffectiveOVM) ? tr("Yes") : tr("No")));
(dbOwnerInfo.dbEffectiveOVM() == Isds::Type::BOOL_TRUE)
? tr("Yes") : tr("No")));
dbInfo.append(strongInfoLine(tr("Open addressing"),
(accountInfo.dbOpenAddressing) ? tr("Yes") : tr("No")));
(dbOwnerInfo.dbOpenAddressing() == Isds::Type::BOOL_TRUE)
? tr("Yes") : tr("No")));
dbInfo.append(divEnd);
......@@ -249,22 +253,24 @@ bool DbWrapper::insertPwdExpirationToDb(const QString &userName,
}
}
bool DbWrapper::insertAccountInfoToDb(const DbWrapper::AccountInfo &accountInfo)
bool DbWrapper::insertAccountInfoToDb(const QString &userName,
const Isds::DbOwnerInfo &dbOwnerInfo)
{
if (GlobInstcs::accountDbPtr != Q_NULLPTR) {
return GlobInstcs::accountDbPtr->insertAccountInfoIntoDb(
accountInfo);
userName, dbOwnerInfo);
} else {
Q_ASSERT(0);
return false;
}
}
bool DbWrapper::insertUserInfoToDb(const DbWrapper::UserInfo &userInfo)
bool DbWrapper::insertUserInfoToDb(const QString &userName,
const Isds::DbUserInfo &dbUserInfo)
{
if (GlobInstcs::accountDbPtr != Q_NULLPTR) {
return GlobInstcs::accountDbPtr->insertUserInfoIntoDb(
userInfo);
return GlobInstcs::accountDbPtr->insertUserInfoIntoDb(userName,
dbUserInfo);
} else {
Q_ASSERT(0);
return false;
......
......@@ -26,7 +26,7 @@
#include <QCoreApplication> /* Q_DECLARE_TR_FUNCTIONS */
#include "src/datovka_shared/isds/message_interface.h"
#include "src/qml_interaction/message_envelope.h"
#include "src/datovka_shared/isds/box_interface.h"
#include "src/sqlite/message_db_container.h"
#include "src/sqlite/file_db_container.h"
......@@ -38,75 +38,15 @@ class DbWrapper {
Q_DECLARE_TR_FUNCTIONS(DbWrapper)
public:
/*!
* @brief Holds information about an account and owner of databox.
*/
class AccountInfo {
public:
QString key;
QString dbID;
QString dbType;
QString ic;
QString pnFirstName;
QString pnMiddleName;
QString pnLastName;
QString pnLastNameAtBirth;
QString firmName;
QString biDate;
QString biCity;
QString biCounty;
QString biState;
QString adCity;
QString adStreet;
QString adNumberInStreet;
QString adNumberInMunicipality;
QString adZipCode;
QString adState;
QString nationality;
QString identifier;
QString registryCode;
int dbState;
bool dbEffectiveOVM;
bool dbOpenAddressing;
};
/*!
* @brief Holds information about an user and password expiration date.
*/
class UserInfo {
public:
QString key;
QString pnFirstName;
QString pnMiddleName;
QString pnLastName;
QString pnLastNameAtBirth;
QString adCity;
QString adStreet;
QString adNumberInStreet;
QString adNumberInMunicipality;
QString adZipCode;
QString adState;
QString biDate;
QString userType;
int userPrivils;
QString ic;
QString firmName;
QString caStreet;
QString caCity;
QString caZipCode;
QString caState;
QString _pwdExpDate;
};
/*!
* @brief Create account info text for QML.
*
* @param[in] accountInfo account info struct.
* @param[in] dbOwnerInfo account info struct.
* @return account info string.
*/
static
QString createAccountInfoStringForQml(
const DbWrapper::AccountInfo &accountInfo);
const Isds::DbOwnerInfo &dbOwnerInfo);
/*!
* @brief Insert messagelist to db.
......@@ -158,20 +98,24 @@ public:
/*!
* @brief Insert account info to db.
*
* @param[in] accountInfo Account info struct.
* @param[in] userName Account username string.
* @param[in] dbOwnerInfo Account info struct.
* @return true if success.
*/
static
bool insertAccountInfoToDb(const DbWrapper::AccountInfo &accountInfo);
bool insertAccountInfoToDb(const QString &userName,
const Isds::DbOwnerInfo &dbOwnerInfo);
/*!
* @brief Insert user info to db.
*
* @param[in] userInfo User info struct.
* @param[in] userName Account username string.
* @param[in] dbUserInfo User info struct.
* @return true if success.
*/
static
bool insertUserInfoToDb(const DbWrapper::UserInfo &userInfo);
bool insertUserInfoToDb(const QString &userName,
const Isds::DbUserInfo &dbUserInfo);
/*!
* @brief Update author info to db.
......
......@@ -37,9 +37,9 @@
#include "src/models/accountmodel.h"
#include "src/models/databoxmodel.h"
#include "src/models/messagemodel.h"
#include "src/net/db_wrapper.h"
#include "src/net/isds_const.h"
#include "src/net/isds_wrapper.h"
#include "src/net/xml_layer.h"
#include "src/qml_interaction/message_envelope.h"
#include "src/settings.h"
#include "src/sqlite/zfo_db.h"
......@@ -54,6 +54,8 @@
#include "src/worker/task_import_zfo.h"
#include "src/worker/task_keep_alive.h"
#include "src/worker/task_send_sms.h"
#include "src/xml/xml_base.h"
#include "src/xml/xml_login.h"
IsdsWrapper::IsdsWrapper(QObject *parent)
: QObject(parent),
......@@ -1213,10 +1215,10 @@ bool IsdsWrapper::loginToIsds(IsdsSession::IsdsContext &ctx)
QByteArray xmlDataOut;
/* Send SOAP request */
success = m_netLayer.createLoginRequest(ctx, LOGIN_SERVICE,
XmlLayer::xmlCreateLoginPingSoapRequest(), xmlDataOut);
Xml::xmlCreateLoginPingSoapRequest(), xmlDataOut);
if (ctx.login_method != USERNAME_PWD_TOTP) {
success = XmlLayer::parseLoginResponse(xmlDataOut, ctx.last_isds_msg);
success = Xml::parseDmStatusFromXml(xmlDataOut, ctx.last_isds_msg);
}
/* Login was not succesfull */
......@@ -1251,9 +1253,9 @@ void IsdsWrapper::runSmsLoginPhase(IsdsSession::IsdsContext &ctx,
QByteArray xmlDataOut;
/* Send SOAP request */
success = m_netLayer.secondTotpLoginRequest(ctx,
XmlLayer::xmlCreateLoginPingSoapRequest(), xmlDataOut);
Xml::xmlCreateLoginPingSoapRequest(), xmlDataOut);
success = XmlLayer::parseLoginResponse(xmlDataOut, ctx.last_isds_msg);
success = Xml::parseDmStatusFromXml(xmlDataOut, ctx.last_isds_msg);
if (!success) {
ctx.pass_phrase = "";
......
This diff is collapsed.
/*
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#pragma once
#include <QCoreApplication> /* Q_DECLARE_TR_FUNCTIONS */
#include <QXmlStreamReader>
#include "src/models/databoxmodel.h"
#include "src/net/db_wrapper.h"
/*
* Class XmlLayer realizes XML layer of SOAP.
* Class creates SOAP request and parse SOAP responses.
*/
class XmlLayer {
Q_DECLARE_TR_FUNCTIONS(XmlLayer)
public:
/*!
* @brief Create find databox info soap request.
*
* @param[in] dbID Databox ID.
* @param[in] dbType Databox type.
* @return Soap request string as byte array.
*/
static
QByteArray xmlCreateFindDataBoxSoapRequest(const QString &dbID,
const QString &dbType);
/*!
* @brief Create get password expiration soap request.
*
* @return Soap request string as byte array.
*/
static
QByteArray xmlCreateGetPasswordInfoSoapRequest(void);
/*!
* @brief Create get info about databox owner and his box soap request.
*
* @return Soap request string as byte array.
*/
static
QByteArray xmlCreateGetOwnerInfoFromLoginSoapRequest(void);
/*!
* @brief Create get user info from login soap request.
*
* @return Soap request string as byte array.
*/
static
QByteArray xmlCreateGetUserInfoFromLoginSoapRequest(void);
/*!
* @brief Create change password OTP soap request.
*
* @param[in] dbOTPType OTP method string (see ISDS manual).
* @param[in] oldPwd Old password string.
* @param[in] newPwd New password string..
* @return Soap request string as byte array.
*/
static
QByteArray xmlCreateChangePasswordOTPSoapRequest(
const QString &dbOTPType, const QString &oldPwd,
const QString &newPwd);
/*!
* @brief Create change ISDS password soap request.
*
* @param[in] oldPwd Old password string.
* @param[in] newPwd New password string.
* @return Soap request string as byte array.
*/
static
QByteArray xmlCreateChangeISDSPasswordSoapRequest(
const QString &oldPwd, const QString &newPwd);
/*!
* @brief Create ISDS search databoxs soap request.
*
* @param[in] searchText Search phrase.
* @param[in] searchType Search Type string.
* @param[in] searchScope Search Databox Type string.
* @param[in] page Page number.
* @param[in] pageSize Number of items into the page.
* @param[in] highlighting True if result will be highlighting.
* @return Soap request string as byte array.
*/
static
QByteArray xmlCreateISDSSearch2SoapRequest(
const QString &searchText, const QString &searchType,
const QString &searchScope, int page, int pageSize,
bool highlighting);
/*!
* @brief Create login/ping soap request.
*
* @return Soap request string as byte array.
*/
static
QByteArray xmlCreateLoginPingSoapRequest(void);
/*!
* @brief Create send SMS soap request.
*
* @return Soap request string as byte array.
*/
static
QByteArray xmlCreateSendSMSSoapRequest(void);
/*!
* @brief Create SOAP envelope over xml data.
*
* @param[in] xmlContent Content body.
* @return Xml SOAP content with envelope as bytearray.
*/
static
QByteArray xmlCreateSoapEnvelope(const QString &xmlContent);
/*!
* @brief Parse dmStatus from XML response.
*
* @param[in] xmlData Xml data for parsing.
* @param[out] txt Error description if something failed.
* @return true if login success.
*/
static
bool parseDmStatusFromXml(const QByteArray &xmlData, QString &txt);
/*!
* @brief Parse dbStatus from XML response.
*
* @param[in] xmlData Xml Data for parsing.
* @param[out] txt Error description if something failed.
* @return true if login success.
*/
static
bool parseDbStatusFromXml(const QByteArray &xmlData, QString &txt);
/*!
* @brief Parse loginResponse XML.
*
* @param[in] xmlData Xml Data for parsing.
* @param[out] txt Error description if something failed.
* @return true if login success.
*/
static
bool parseLoginResponse(const QByteArray &xmlData, QString &txt);
/*!
* @brief Parse getOwnerInfoFromLogin XML.
*
* @param[in] xmlData Xml Data for parsing.
* @param[out] accountInfo Account info structures.
* @param[out] txt Error description if something failed.
* @return true if success.
*/
static
bool parseGetOwnerInfoFromLogin(const QByteArray &xmlData,
DbWrapper::AccountInfo &accountInfo, QString &txt);
/*!
* @brief Parse getOwnerInfoFromLogin XML.
*
* @param[in] xmlData Xml Data for parsing.
* @param[out] userInfo User info structure.
* @param[out] txt Error description if something failed.
* @return true if success.
*/
static
bool parseGetUserInfoFromLogin(const QByteArray &xmlData,
DbWrapper::UserInfo &userInfo, QString &txt);
/*!
* @brief Parse user password xml data.
*
* @param[in] xmlData Xml Data for parsing.
* @param[out] expirDate Expiration date of password.
* @param[out] txt Error description if something failed.
* @return true if success.
*/
static
bool parseGetPasswordInfo(const QByteArray &xmlData,
QString &expirDate, QString &txt);
/*!
* @brief Parse owner xml data.
*
* @param[in] xml Xml Data for parsing.
* @param[out] accountInfo Account info structures.
* @return true if success.
*/
static
bool dbOwnerInfoParse(QXmlStreamReader &xml,
DbWrapper::AccountInfo &accountInfo);
/*!
* @brief Parse user xml data.
*
* @param[in] xml Xml Data for parsing.
* @param[out] userInfo User info structure.
* @param[out] txt Error description if something failed.
* @return true if success.
*/
static
bool dbUserInfoParse(QXmlStreamReader &xml,
DbWrapper::UserInfo &userInfo);
/*!
* @brief Parse idsd search 2 xml.
*
* @param[in] xmlData Xml Data for parsing.
* @param[out] dbList List of databoxes.
* @param[out] totalCount Total number of databoxes.
* @param[out] currentCount Number o databoxes on the current page.
* @param[out] position Number of page.
* @param[out] lastPage True if search result are last page.
* @param[out] txt Error description if something failed.
* @return true if success.
*/
static
bool parseISDSSearch2SoapResponse(const QByteArray &xmlData,
QList<DataboxModelEntry> &dbList, int &totalCount, int &currentCount,
int &position, bool &lastPage, QString &txt);
/*!
* @brief Parse databox xml data.
*
* @param[in] xml Xml Data for parsing.
* @return Databox model data.
*/
static
DataboxModelEntry parseDataboxData(QXmlStreamReader &xml);
/*!
* @brief Parse find databox info xml data.
*
* @param[in] xmlData Xml Data for parsing.
* @param[out] dbInfo Databox info.
* @param[out] txt Error description if something failed.
* @return true if success.
*/
static
bool parseFindDataBoxSoapResponse(const QByteArray &xmlData,
QString &dbInfo, QString &txt);
private:
/*!
* @brief Private constructor.
*/
XmlLayer(void);
};
......@@ -29,6 +29,7 @@
#include <QSqlRecord>
#include "src/common.h"
#include "src/datovka_shared/isds/type_conversion.h"
#include "src/io/filesystem.h"
#include "src/isds/isds_conversion.h"
#include "src/sqlite/account_db.h"
......@@ -317,8 +318,8 @@ fail:
return QString();
}
bool AccountDb::insertAccountInfoIntoDb(
const DbWrapper::AccountInfo &accountData)
bool AccountDb::insertAccountInfoIntoDb(const QString &userName,
const Isds::DbOwnerInfo &dbOwnerInfo)
{
QSqlQuery query(m_db);
QString queryStr;
......@@ -336,15 +337,11 @@ bool AccountDb::insertAccountInfoIntoDb(
query.lastError().text().toUtf8().constData();
goto fail;
}
query.bindValue(":key", accountData.key);
query.bindValue(":key", userName);
if (query.exec() && query.isActive()) {
query.first();
if (query.isValid()) {
if (query.value(0).toInt() != 0) {
update = true;
} else {
update = false;
}
update = (query.value(0).toInt() != 0);
}
} else {
qCritical() << "Cannot execute SQL query:" <<
......@@ -393,31 +390,37 @@ bool AccountDb::insertAccountInfoIntoDb(
goto fail;
}
query.bindValue(":key", accountData.key);
query.bindValue(":dbID", accountData.dbID);
query.bindValue(":dbType", accountData.dbType);
query.bindValue(":ic", accountData.ic);
query.bindValue(":pnFirstName", accountData.pnFirstName);
query.bindValue(":pnMiddleName", accountData.pnMiddleName);
query.bindValue(":pnLastName", accountData.pnLastName);
query.bindValue(":pnLastNameAtBirth", accountData.pnLastNameAtBirth);
query.bindValue(":firmName", accountData.firmName);
query.bindValue(":biDate", accountData.biDate);
query.bindValue(":biCity", accountData.biCity);
query.bindValue(":biCounty", accountData.biCounty);
query.bindValue(":biState", accountData.biState);
query.bindValue(":adCity", accountData.adCity);
query.bindValue(":adStreet", accountData.adStreet);
query.bindValue(":adNumberInStreet", accountData.adNumberInStreet);
query.bindValue(":adNumberInMunicipality", accountData.adNumberInMunicipality);
query.bindValue(":adZipCode", accountData.adZipCode);
query.bindValue(":adState", accountData.adState);
query.bindValue(":nationality", accountData.nationality);
query.bindValue(":identifier", accountData.identifier);
query.bindValue(":registryCode", accountData.registryCode);
query.bindValue(":dbState", accountData.dbState);
query.bindValue(":dbEffectiveOVM", accountData.dbEffectiveOVM);
query.bindValue(":dbOpenAddressing", accountData.dbOpenAddressing);
query.bindValue(":key", userName);
query.bindValue(":dbID", dbOwnerInfo.dbID());
query.bindValue(":dbType", Isds::dbType2StrVariant(dbOwnerInfo.dbType()));
query.bindValue(":ic", dbOwnerInfo.ic());
query.bindValue(":pnFirstName", dbOwnerInfo.personName().firstName());
query.bindValue(":pnMiddleName", dbOwnerInfo.personName().middleName());
query.bindValue(":pnLastName", dbOwnerInfo.personName().lastName());
query.bindValue(":pnLastNameAtBirth",
dbOwnerInfo.personName().lastNameAtBirth());
query.bindValue(":firmName", dbOwnerInfo.firmName());
query.bindValue(":biDate", qDateToDbFormat(dbOwnerInfo.birthInfo().date()));
query.bindValue(":biCity", dbOwnerInfo.birthInfo().city());
query.bindValue(":biCounty", dbOwnerInfo.birthInfo().county());
query.bindValue(":biState", dbOwnerInfo.birthInfo().state());
query.bindValue(":adCity", dbOwnerInfo.address().city());
query.bindValue(":adStreet", dbOwnerInfo.address().street());
query.bindValue(":adNumberInStreet",
dbOwnerInfo.address().numberInStreet());
query.bindValue(":adNumberInMunicipality",
dbOwnerInfo.address().numberInMunicipality());
query.bindValue(":adZipCode", dbOwnerInfo.address().zipCode());
query.bindValue(":adState", dbOwnerInfo.address().state());
query.bindValue(":nationality", dbOwnerInfo.nationality());
query.bindValue(":identifier", dbOwnerInfo.identifier());
query.bindValue(":registryCode", dbOwnerInfo.registryCode());
query.bindValue(":dbState",
Isds::dbState2Variant(dbOwnerInfo.dbState()));
query.bindValue(":dbEffectiveOVM",
Isds::nilBool2Variant(dbOwnerInfo.dbEffectiveOVM()));
query.bindValue(":dbOpenAddressing",
Isds::nilBool2Variant(dbOwnerInfo.dbOpenAddressing()));
if (query.exec()) {
return true;
......@@ -430,7 +433,8 @@ fail:
return false;
}
bool AccountDb::insertUserInfoIntoDb(const DbWrapper::UserInfo &userData)
bool AccountDb::insertUserInfoIntoDb(const QString &userName,
const Isds::DbUserInfo &dbUserInfo)
{
QSqlQuery query(m_db);
QString queryStr;