cuadrante1view.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 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 <QMessageBox>
00022 #include <QCloseEvent>
00023 #include <QFile>
00024 #include <QTextStream>
00025 
00026 #include <fstream>
00027 
00028 #include "cuadrante1view.h"
00029 #include "company.h"
00030 #include "configuracion.h"
00031 #include "plugins.h"
00032 
00033 #include "funcaux.h"
00034 
00035 
00044 Cuadrante1View::Cuadrante1View(Company *comp, QWidget *parent)
00045         : FichaBf(comp, parent) {
00046     _depura("Cuadrante1View::Cuadrante1View", 0);
00047     setAttribute(Qt::WA_DeleteOnClose);
00048     try {
00049         setupUi(this);
00050 
00052         if (g_plugins->lanza("Cuadrante1View_Cuadrante1View", this)) return;
00053 
00054         setTitleName(tr("Cuadrante"));
00055         setDBTableName("cuadrante");
00056         setDBCampoId("idcuadrante");
00057         addDBCampo("idcuadrante", DBCampo::DBint, DBCampo::DBPrimaryKey, tr( "ID cuadrante"));
00058         addDBCampo("idalmacen", DBCampo::DBint, DBCampo::DBNoSave, tr( "Almacen"));
00059         addDBCampo("fechacuadrante", DBCampo::DBdate, DBCampo::DBNoSave  , tr( "Fecha"));
00060         addDBCampo("comentcuadrante", DBCampo::DBvarchar, DBCampo::DBNothing, tr( "Comentarios"));
00061         addDBCampo("aperturacuadrante", DBCampo::DBvarchar, DBCampo::DBNothing, tr( "Apertura Mañana"));
00062         addDBCampo("cierrecuadrante", DBCampo::DBvarchar, DBCampo::DBNothing, tr( "Cierre Mañana"));
00063         addDBCampo("apertura1cuadrante", DBCampo::DBvarchar, DBCampo::DBNothing, tr( "Apartura Tarde"));
00064         addDBCampo("cierre1cuadrante", DBCampo::DBvarchar, DBCampo::DBNothing, tr( "Cierre Tarde"));
00065         addDBCampo("fiestacuadrante", DBCampo::DBboolean, DBCampo::DBNothing, tr( "Festivo"));
00066 
00067         mui_idalmacen->setEmpresaBase(comp);
00068 
00069         mui_list->setEmpresaBase(comp);
00070         mui_list->setDBTableName("horario");
00071         mui_list->setDBCampoId("idhorario");
00072         mui_list->addSHeader("nomtrabajador",  DBCampo::DBvarchar, DBCampo::DBNoSave,     SHeader::DBNone,                         tr("Nombre Trabajador"));
00073         mui_list->addSHeader("horainhorario",  DBCampo::DBvarchar, DBCampo::DBNotNull,    SHeader::DBNone,                         tr("Hora Inicio"));
00074         mui_list->addSHeader("horafinhorario", DBCampo::DBvarchar, DBCampo::DBNotNull,    SHeader::DBNone,                         tr("Hora Fin"));
00075         mui_list->addSHeader("idcuadrante",    DBCampo::DBint,     DBCampo::DBNotNull,    SHeader::DBNoView | SHeader::DBNoWrite,  tr("ID Cuadrante"));
00076         mui_list->addSHeader("idtrabajador",   DBCampo::DBint,     DBCampo::DBNotNull,    SHeader::DBNone,  tr("ID trabajador"));
00077         mui_list->addSHeader("idhorario",      DBCampo::DBint,     DBCampo::DBPrimaryKey, SHeader::DBNoView | SHeader::DBNoWrite,  tr("ID horario"));
00078         mui_list->setinsercion(TRUE);
00079         mui_list->setDelete(TRUE);
00080         mui_list->setSortingEnabled(FALSE);
00081 
00082         dialogChanges_cargaInicial();
00083         meteWindow(windowTitle(), this, FALSE);
00084     } catch (...) {
00085         mensajeInfo(tr("Error al crear el almacen"));
00086     } // end try
00087     _depura("END Cuadrante1View::Cuadrante1View", 0);
00088 }
00089 
00090 
00095 Cuadrante1View::~Cuadrante1View() {
00096     _depura("Cuadrante1View::~Cuadrante1View", 0);
00097     _depura("END Cuadrante1View::~Cuadrante1View", 0);
00098 }
00099 
00100 
00102 
00106 int Cuadrante1View::cargarPost(QString idcuadrante) {
00107     mui_list->cargar("SELECT * FROM horario LEFT JOIN trabajador ON horario.idtrabajador = trabajador.idtrabajador WHERE idcuadrante=" + idcuadrante);
00108     return 0;
00109 }
00110 
00111 
00113 
00116 int Cuadrante1View::guardarPost() {
00117         mui_list->setColumnValue("idcuadrante", DBvalue("idcuadrante"));
00118         mui_list->guardar();
00119         emit(save());
00120         return 0;
00121 }
00122 
00123 
00124 

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