void MCustomerListDialog::newCustomer()
{
- MCustomerDialog cd(MCustomer(),this);
+ MCustomerDialog cd(MOCustomer(),this);
if(cd.exec()==QDialog::Accepted)
updateList(cd.getCustomer().id());
}
/****************************************************************/
-MCustomerDialog::MCustomerDialog(MCustomer c,QWidget*par)
+MCustomerDialog::MCustomerDialog(MOCustomer c,QWidget*par)
:QDialog(par),m_cust(c)
{
if(m_cust.isValid())
connect(p,SIGNAL(clicked()),this,SLOT(reject()));
}
-MCustomer MCustomerDialog::getCustomer()
+MOCustomer MCustomerDialog::getCustomer()
{
//copy data from input fields
m_cust.setname(m_name->text());
#include <QList>
#include "MOCustomerInfo.h"
+#include "MOCustomer.h"
class QListView;
class QStandardItemModel;
class QTextEdit;
class QLabel;
-#include"customer.h"
/**edit a specific customer*/
class MCustomerDialog:public QDialog
{
Q_OBJECT
public:
/**creates a new customer dialog*/
- MCustomerDialog(MCustomer,QWidget*);
+ MCustomerDialog(MOCustomer,QWidget*);
/**returns the customer as currently entered*/
- MCustomer getCustomer();
+ MOCustomer getCustomer();
private slots:
/**internal: save data*/
void save();
private:
- MCustomer m_cust;
+ MOCustomer m_cust;
QLineEdit*m_name;
QTextEdit*m_addr,*m_cont,*m_comm;
QLabel*m_mail;
+++ /dev/null
-//
-// C++ Interface: customer
-//
-// Description:
-//
-//
-// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2008
-//
-// Copyright: See README/COPYING files that come with this distribution
-//
-//
-
-#ifndef MAGICSMOKE_CUSTOMER_H
-#define MAGICSMOKE_CUSTOMER_H
-
-#include <QString>
-
-#include "MOCustomer.h"
-
-/**this class expands on MOCustomer to add some convenience methods*/
-class MCustomer:public MOCustomer
-{
- public:
- /**creates an empty/invalid customer*/
- MCustomer(){}
- /**fetches customer from the Database*/
- MCustomer(qint64);
- /**copies a customer*/
- MCustomer(const MCustomer&c):MOCustomer(c){}
- MCustomer(const MOCustomer&c):MOCustomer(c){}
-
- /**copies a customer*/
- MCustomer& operator=(const MCustomer&c){MOCustomer::operator=(c);return *this;}
- MCustomer& operator=(const MOCustomer&c){MOCustomer::operator=(c);return *this;}
-
- /**returns whether the customer is valid*/
- bool isValid();
-
- /**returns the address of the customer*/
- QString address(int i=0);
-};
-
-#endif
HEADERS += \
iface/msinterface.h \
- iface/sslexception.h \
- iface/customer.h
-
+ iface/sslexception.h
SOURCES += \
iface/msinterface.cpp \
- iface/sslexception.cpp \
- iface/customer.cpp
+ iface/sslexception.cpp
INCLUDEPATH += ./iface
\ No newline at end of file
cartmodel->clear();
cartmodel->setHorizontalHeaderLabels(QStringList()<<tr("Amount")<<tr("Title")<<tr("Start Time"));
//clear customer
- customer=MCustomer();
+ customer=MOCustomer();
cartcustomer->setText("");
//clear address/comment
cartaddr->setPlainText("");
#include <QMainWindow>
#include <QTimer>
-#include "customer.h"
+#include "MOCustomer.h"
class QAction;
class QCheckBox;
QTextEdit *cartaddr,*cartcomment;
QComboBox*cartship;
//cart
- MCustomer customer;
+ MOCustomer customer;
};
/**Helper class for shopping cart: allow editing amount, but nothing else*/
#include <QMainWindow>
#include <QTimer>
-#include "customer.h"
-
class QAction;
class QCheckBox;
class QComboBox;
//
//
-#include "customer.h"
+#include "MOCustomer.h"
#include "msinterface.h"
-MCustomer::MCustomer(qint64 i)
+MOCustomer::MOCustomer(qint64 i)
{
MTGetCustomer gc=req->queryGetCustomer(i);
if(gc.stage()==gc.Success)
operator=(gc.getcustomer().value());
}
-bool MCustomer::isValid()
-{
- //TODO: reconsider isValid
- return id()>-1;
-}
-
-QString MCustomer::address(int i)
+QString MOCustomer::address(int i)
{
if(i<0)return "";
QList<MOAddress>adrs=addresses();
if(adr.name().isNull())ret=name();
else ret=adr.name().value();
ret+="\n";
-// if(!adr.company().isNull())ret+=adr.company().value()+"\n";
if(!adr.addr1().isNull())ret+=adr.addr1().value()+"\n";
if(!adr.addr2().isNull())ret+=adr.addr2().value()+"\n";
if(!adr.city().isNull())ret+=adr.city().value()+"\n";
//
//
-#ifndef MAGICSMOKE_MOCUSTOMER_H
-#define MAGICSMOKE_MOCUSTOMER_H
+#ifndef MAGICSMOKE_MOCUSTOMERI_H
+#define MAGICSMOKE_MOCUSTOMERI_H
#include "MOCustomerInfoAbstract.h"
class MOCustomerInfo:public MOCustomerInfoAbstract
wext/MORole.h \
wext/MOTicket.h \
wext/MOAddress.h \
- wext/MOEvent.h
+ wext/MOEvent.h \
+ wext/MOCustomer.h
SOURCES += \
wext/MOCustomerInfo.cpp \
wext/MOOrder.cpp \
wext/MOTicket.cpp \
wext/MOAddress.cpp \
- wext/MOEvent.cpp
\ No newline at end of file
+ wext/MOEvent.cpp \
+ wext/MOCustomer.cpp
\ No newline at end of file
</Mapping>
</Class>
<Class name="Customer">
+ <Abstract lang="qt"/>
<Property name="id" type="int"/>
<Property name="title" type="string"/>
<Property name="firstname" type="string"/>