busquedatarifa.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Tomeu Borras Riera                              *
00003  *   tborras@conetxia.com                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #include <QComboBox>
00022 
00023 #include "busquedatarifa.h"
00024 #include "company.h"
00025 #include "funcaux.h"
00026 
00027 
00029 
00032 BusquedaTarifa::BusquedaTarifa(QWidget *parent)
00033         : QComboBox(parent), PEmpresaBase() {
00034         _depura("BusquedaTarifa::BusquedaTarifa", 0);
00035     m_cursorcombo = NULL;
00036     connect(this, SIGNAL(activated(int)), this, SLOT(m_activated(int)));
00037         _depura("END BusquedaTarifa::BusquedaTarifa", 0);
00038 }
00039 
00040 
00042 
00044 BusquedaTarifa::~BusquedaTarifa() {
00045     _depura("BusquedaTarifa::~BusquedaTarifa", 0);
00046     _depura("END BusquedaTarifa::~BusquedaTarifa", 0);
00047 }
00048 
00049 
00051 
00054 void BusquedaTarifa::setidtarifa(QString idtarifa) {
00055     _depura("BusquedaTarifa::setidtarifa", 0);
00056     mdb_idtarifa = idtarifa;
00057     if (m_cursorcombo != NULL)
00058         delete m_cursorcombo;
00059     m_cursorcombo = empresaBase()->cargacursor("SELECT * FROM tarifa");
00060     int i = 0;
00061     int i1 = 0;
00062     clear();
00063     addItem("--");
00064     while (!m_cursorcombo->eof()) {
00065         i++;
00066         if (m_cursorcombo->valor("idtarifa") == idtarifa)
00067             i1 = i;
00068         addItem(m_cursorcombo->valor("nomtarifa"));
00069         m_cursorcombo->siguienteregistro();
00070     }
00071     setCurrentIndex(i1);
00072     _depura("END BusquedaTarifa::setidtarifa", 0);
00073 }
00074 

Generated on Sat Dec 15 00:01:07 2007 for BulmaGes by  doxygen 1.5.1