customerentrydialog.h

00001 /*********************************************************************************
00002 **
00003 **   $Id: //depot/WorkInProgress/ah2/AcctSelect.h#1 $
00004 **   Copyright (c) 2004 Joe Croft <joe@croftj.net>
00005 **   
00006 **   This file is part of ah3.
00007 **
00008 **   ah3 is free software; you can redistribute it and/or modify
00009 **   it under the terms of the GNU General Public License as published by
00010 **   the Free Software Foundation; either version 2 of the License, or
00011 **   (at your option) any later version.
00012 **
00013 **   Foobar is distributed in the hope that it will be useful,
00014 **   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 **   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 **   GNU General Public License for more details.
00017 **
00018 **   You should have received a copy of the GNU General Public License
00019 **   along with Foobar; if not, write to the Free Software
00020 **   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 //      connect(ui.selectCustomerBtn, SIGNAL(clicked()), this, SLOT(haveSelectCustomerBtn()));
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

Generated on Tue Sep 11 07:00:01 2007 for Ah3 Invoicing and Inventory System for Repair Shops by  doxygen 1.5.0