Implemented first page of camp wizard.
This commit is contained in:
@@ -5,6 +5,7 @@ AddressItem::AddressItem(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_id = 0;
|
||||
m_price = 0;
|
||||
m_owner = false;
|
||||
}
|
||||
|
||||
int AddressItem::id() const
|
||||
@@ -86,3 +87,13 @@ void AddressItem::setAdbItem(const AddressbookDataPtr &adbItem)
|
||||
{
|
||||
m_adbItem = adbItem;
|
||||
}
|
||||
|
||||
bool AddressItem::owner() const
|
||||
{
|
||||
return m_owner;
|
||||
}
|
||||
|
||||
void AddressItem::setOwner(bool owner)
|
||||
{
|
||||
m_owner = owner;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ class AddressItem : public QObject
|
||||
Q_PROPERTY(QString lastName READ lastName WRITE setLastName)
|
||||
Q_PROPERTY(QString address READ address WRITE setAddress)
|
||||
Q_PROPERTY(QDecDouble price READ price WRITE setPrice)
|
||||
Q_PROPERTY(bool owner READ owner WRITE setOwner)
|
||||
|
||||
public:
|
||||
explicit AddressItem(QObject *parent = 0);
|
||||
@@ -48,6 +49,9 @@ public:
|
||||
AddressbookDataPtr adbItem() const;
|
||||
void setAdbItem(const AddressbookDataPtr &adbItem);
|
||||
|
||||
bool owner() const;
|
||||
void setOwner(bool owner);
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
#pragma db id auto
|
||||
@@ -60,6 +64,7 @@ private:
|
||||
#pragma db not_null
|
||||
QWeakPointer<CampData> m_campData;
|
||||
PersonPricePtr m_personPrice;
|
||||
bool m_owner;
|
||||
};
|
||||
|
||||
#endif // ADDRESSITEM_H
|
||||
|
||||
@@ -84,6 +84,11 @@ void CampData::addServiceItem(ServiceItemPtr serviceItem)
|
||||
m_services.append(serviceItem);
|
||||
}
|
||||
|
||||
void CampData::removeServiceItem(ServiceItemPtr serviceItem)
|
||||
{
|
||||
m_services.removeOne(serviceItem);
|
||||
}
|
||||
|
||||
QOdbList<AddressItemPtr> CampData::people() const
|
||||
{
|
||||
return m_people;
|
||||
@@ -99,6 +104,11 @@ void CampData::addPerson(AddressItemPtr person)
|
||||
m_people.append(person);
|
||||
}
|
||||
|
||||
void CampData::removePerson(AddressItemPtr person)
|
||||
{
|
||||
m_people.removeOne(person);
|
||||
}
|
||||
|
||||
QDecDouble CampData::totalPrice() const
|
||||
{
|
||||
return TO_DEC(m_totalPrice);
|
||||
|
||||
@@ -48,10 +48,12 @@ public:
|
||||
QOdbList<QSharedPointer<ServiceItem> > services() const;
|
||||
void setServices(const QOdbList<QSharedPointer<ServiceItem> > &services);
|
||||
void addServiceItem(ServiceItemPtr serviceItem);
|
||||
void removeServiceItem(ServiceItemPtr serviceItem);
|
||||
|
||||
QOdbList<AddressItemPtr> people() const;
|
||||
void setPeople(const QOdbList<AddressItemPtr> &people);
|
||||
void addPerson(AddressItemPtr person);
|
||||
void removePerson(AddressItemPtr person);
|
||||
|
||||
QDecDouble totalPrice() const;
|
||||
void setTotalPrice(QDecDouble totalPrice);
|
||||
|
||||
Reference in New Issue
Block a user