00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef CUSTOMERENTRYDIALOG_H
00025 #define CUSTOMERENTRYDIALOG_H
00026
00027 # include <QDialog>
00028 # include "QcjData/QcjDataStatics.h"
00029 # include "QcjData/QcjDataConfigure.h"
00030 # include "ui_customerentrydialog.h"
00031
00032 class CustomerEntryDialog : public QDialog
00033 {
00034 Q_OBJECT
00035
00036 public:
00037 CustomerEntryDialog(bool setSelect = false, QWidget *parent = 0) : QDialog(parent)
00038 {
00039 printf("CustomerEntryDialog::CustomerEntryDialog(): Enter\n");
00040 fflush(stdout);
00041 ui.setupUi(this);
00042 if ( setSelect )
00043 ui.selectCustomerBtn->setText("Select");
00044 else
00045 ui.selectCustomerBtn->setText("Done");
00046 ui.searchCustomerBtn->setDefault(true);
00047 printf("CustomerEntryDialog::CustomerEntryDialog(): Exit\n");
00048 fflush(stdout);
00049 };
00050
00051 void setDatabase()
00052 {
00053 ui.customerForm->setDatabase();
00054 ui.customerTable->setDatabase();
00055 connect(ui.searchCustomerBtn, SIGNAL(clicked()), this, SLOT(haveSearchCustomerBtn()));
00056 connect(ui.clearFilterBtn, SIGNAL(clicked()), this, SLOT(haveClearCustomerBtn()));
00057 connect(ui.selectCustomerBtn, SIGNAL(clicked()), this, SLOT(haveSelectCustomerBtn()));
00058 connect(ui.deleteCustomerBtn, SIGNAL(clicked()), this, SLOT(haveDeleteCustomerBtn()));
00059 connect(ui.viewVehiclesBtn, SIGNAL(clicked()), this, SLOT(haveViewVehiclesBtn()));
00060
00061 ui.customerTable->refresh();
00062 };
00063
00064 protected slots:
00065 void haveDeleteCustomerBtn();
00066 void haveSearchCustomerBtn();
00067 void haveClearCustomerBtn();
00068 void haveSelectCustomerBtn()
00069 {
00070 QString xmldef = ui.customerForm->readXmlDef();
00071 QString index = pFormDef->getIndexField(xmldef);
00072 done(ui.customerForm->getFieldValue(index).toInt());
00073 };
00074 void haveViewVehiclesBtn();
00075
00076 private:
00077 Ui::CustomerEntryDialog ui;
00078 };
00079
00080 #endif