rutacomercial.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 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 <QFile>
00022 #include <QTextStream>
00023 
00024 #include "rutacomercial.h"
00025 #include "company.h"
00026 #include "configuracion.h"
00027 #include "plugins.h"
00028 
00029 
00031 
00035 RutaComercial::RutaComercial(Company *comp, QWidget *parent) : FichaBf(comp, parent) {
00036     _depura("RutaComercial::RutaComercial", 0);
00037     setTitleName(tr("Ruta Comercial"));
00038     setDBTableName("rutacomercial");
00039     setDBCampoId("idrutacomercial");
00040     addDBCampo("idrutacomercial", DBCampo::DBint, DBCampo::DBPrimaryKey, QApplication::translate("RutaComercial", "Identificador"));
00041     addDBCampo("fecharutacomercial", DBCampo::DBdate, DBCampo::DBNotNull, QApplication::translate("RutaComercial", "Fecha"));
00042     addDBCampo("idcliente", DBCampo::DBint, DBCampo::DBNotNull, QApplication::translate("RutaComercial", "Familia"));
00043     addDBCampo("comentariosrutacomercial", DBCampo::DBvarchar, DBCampo::DBNothing, QApplication::translate("RutaComercial", "Comentarios"));
00044     addDBCampo("horarutacomercial", DBCampo::DBvarchar, DBCampo::DBNothing, QApplication::translate("RutaComercial", "Hora"));
00045     addDBCampo("refrutacomercial",  DBCampo::DBvarchar, DBCampo::DBNothing, QApplication::translate("RutaComercial", "Referencia"));
00046     _depura("END RutaComercial::RutaComercial", 0);
00047 }
00048 
00049 
00051 
00053 RutaComercial::~RutaComercial() {
00054     _depura("RutaComercial::~RutaComercial", 0);
00055     _depura("END RutaComercial::~RutaComercial", 0);
00056 }
00057 
00058 
00060 
00063 void RutaComercial::pintar() {
00064     _depura("RutaComercial::pintar", 0);
00066     int res = g_plugins->lanza("RutaComercial_pintar", this);
00067     if (res != 0)
00068         return;
00069     _depura("funcion no sobrecargada", 2);
00070     _depura("END RutaComercial::pintar", 0);
00071 }
00072 
00073 
00075 
00079 int RutaComercial::cargar(QString id) {
00080     _depura("RutaComercial::cargar", 0);
00081     QString query = "SELECT * FROM rutacomercial WHERE idrutacomercial = " + id;
00082     cursor2 *cur = empresaBase()->cargacursor(query);
00083     if (!cur->eof())  {
00084         DBload(cur);
00085     }
00086     delete cur;
00087     _depura("END RutaComercial::cargar", 0);
00088     return 0;
00089 }
00090 
00091 

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