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.
142 lines
2.6 KiB
C++
142 lines
2.6 KiB
C++
#include "addressitem.h"
|
|
#include <define.h>
|
|
|
|
QX_REGISTER_CPP_CAMP(AddressItem)
|
|
|
|
namespace qx {
|
|
template<> void register_class(QxClass<AddressItem>& t) {
|
|
t.setName("AddressItem");
|
|
t.id(&AddressItem::m_id, "id");
|
|
t.data(&AddressItem::m_firstName, "firstName");
|
|
t.data(&AddressItem::m_lastName, "lastName");
|
|
t.data(&AddressItem::m_address, "address");
|
|
t.data(&AddressItem::m_price, "price");
|
|
t.data(&AddressItem::m_owner, "owner");
|
|
t.data(&AddressItem::m_sale, "sale");
|
|
t.data(&AddressItem::m_totalPrice, "totalPrice");
|
|
|
|
t.relationManyToOne(&AddressItem::m_adbItem, "adbItem");
|
|
t.relationManyToOne(&AddressItem::m_campData, "campData");
|
|
t.relationManyToOne(&AddressItem::m_personPrice, "personPrice");
|
|
}
|
|
}
|
|
|
|
AddressItem::AddressItem(QObject *parent) : QObject(parent)
|
|
{
|
|
m_id = 0;
|
|
m_price = 0;
|
|
m_owner = false;
|
|
m_sale = 0;
|
|
m_totalPrice = 0;
|
|
}
|
|
|
|
long AddressItem::id() const
|
|
{
|
|
return m_id;
|
|
}
|
|
|
|
void AddressItem::setId(long id)
|
|
{
|
|
m_id = id;
|
|
}
|
|
|
|
QString AddressItem::firstName() const
|
|
{
|
|
return m_firstName;
|
|
}
|
|
|
|
void AddressItem::setFirstName(const QString &firstName)
|
|
{
|
|
m_firstName = firstName;
|
|
}
|
|
|
|
QString AddressItem::lastName() const
|
|
{
|
|
return m_lastName;
|
|
}
|
|
|
|
void AddressItem::setLastName(const QString &lastName)
|
|
{
|
|
m_lastName = lastName;
|
|
}
|
|
|
|
QString AddressItem::address() const
|
|
{
|
|
return m_address;
|
|
}
|
|
|
|
void AddressItem::setAddress(const QString &address)
|
|
{
|
|
m_address = address;
|
|
}
|
|
|
|
QDecDouble AddressItem::price() const
|
|
{
|
|
return TO_DEC(m_price);
|
|
}
|
|
|
|
void AddressItem::setPrice(QDecDouble price)
|
|
{
|
|
m_price = FROM_DEC(price);
|
|
}
|
|
|
|
QSharedPointer<CampData> AddressItem::campData() const
|
|
{
|
|
return m_campData;
|
|
}
|
|
|
|
void AddressItem::setCampData(const QSharedPointer<CampData> &campData)
|
|
{
|
|
m_campData = campData;
|
|
}
|
|
|
|
PersonPricePtr AddressItem::personPrice() const
|
|
{
|
|
return m_personPrice;
|
|
}
|
|
|
|
void AddressItem::setPersonPrice(const PersonPricePtr &personPrice)
|
|
{
|
|
m_personPrice = personPrice;
|
|
}
|
|
|
|
AddressbookDataPtr AddressItem::adbItem() const
|
|
{
|
|
return m_adbItem;
|
|
}
|
|
|
|
void AddressItem::setAdbItem(const AddressbookDataPtr &adbItem)
|
|
{
|
|
m_adbItem = adbItem;
|
|
}
|
|
|
|
bool AddressItem::owner() const
|
|
{
|
|
return m_owner;
|
|
}
|
|
|
|
void AddressItem::setOwner(bool owner)
|
|
{
|
|
m_owner = owner;
|
|
}
|
|
|
|
QDecDouble AddressItem::totalPrice() const
|
|
{
|
|
return TO_DEC(m_totalPrice);
|
|
}
|
|
|
|
void AddressItem::setTotalPrice(QDecDouble totalPrice)
|
|
{
|
|
m_totalPrice = FROM_DEC(totalPrice);
|
|
}
|
|
|
|
QDecDouble AddressItem::sale() const
|
|
{
|
|
return TO_DEC(m_sale);
|
|
}
|
|
|
|
void AddressItem::setSale(QDecDouble sale)
|
|
{
|
|
m_sale = FROM_DEC(sale);
|
|
}
|