wopartentry.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 WOPARTENTRY_H
00025 #define WOPARTENTRY_H
00026 
00027 # include <QDialog>
00028 # include "QcjData/QcjDataStatics.h"
00029 # include "QcjData/QcjDataConfigure.h"
00030 # include "ui_wopartentry.h"
00031 
00032 class WoPartEntry : public QDialog
00033 {
00034    Q_OBJECT
00035 
00036 public:
00037    WoPartEntry(int wo, QWidget *parent = 0) : QDialog(parent)
00038    {
00039       printf("WoPartEntry::WoPartEntry(): Enter\n");
00040       fflush(stdout);
00041       ui.setupUi(this);
00042       workorder = wo;
00043       connect(ui.newPartBtn, SIGNAL(clicked()), this, SLOT(haveNewRequest()));
00044       printf("WoPartEntry::WoPartEntry(): Exit\n");
00045       fflush(stdout);
00046    };
00047 
00048    void setDatabase() 
00049    {
00050       ui.woPartsForm->setDatabase();
00051       ui.woPartsTable->setDatabase();
00052       QString filter = "workorder = " + QString::number(workorder);
00053       ui.woPartsTable->setFilter(filter);
00054       ui.woPartsTable->refresh();
00055       ui.woPartsTable->seek(0);
00056       connect(ui.lookupPartBtn, SIGNAL(clicked()), this, SLOT(haveLookupPartBtn()));
00057    };
00058 
00059 public slots:
00060    void haveNewRequest()
00061    {
00062       QMap<QString, QString> fields;
00063       fields.insert("workorder", QString::number(workorder));
00064       ui.woPartsForm->insertRecord(fields);
00065       fields.clear();
00066       QString xmldef = ui.woPartsForm->readXmlDef();
00067       QString index = pFormDef->getIndexField(xmldef);
00068       QString index_value = ui.woPartsForm->getFieldText(index);
00069       fields.insert(index, index_value);
00070       ui.woPartsTable->refresh();
00071       ui.woPartsTable->findRow(fields);
00072    };
00073 
00074 protected slots:
00075    void haveLookupPartBtn();
00076 
00077 private:
00078    int               workorder;
00079    Ui::WoPartEntry   ui;
00080 };
00081 
00082 #endif
00083 
00084 

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