tarifalistview.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by J. M. Estopa Rey                                *
00003  *   pepma@telefonica.net                                                  *
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 "tarifalistview.h"
00022 #include "tarifaview.h"
00023 #include "pgimportfiles.h"
00024 #include "company.h"
00025 #include "funcaux.h"
00026 
00028 
00033 TarifaListView::TarifaListView(Company *comp, QWidget *parent, edmode editmodo)
00034         : FichaBf(comp, parent), pgimportfiles(comp) {
00035     _depura("TarifaListView::INIT_TarifaListView()\n", 0);
00036     setAttribute(Qt::WA_DeleteOnClose);
00037     m_modo = editmodo;
00038     setupUi(this);
00039     mui_list->setEmpresaBase(empresaBase());
00040     mui_list->cargar();
00041     meteWindow(tr("Tarifas"), this);
00042     _depura("TarifaListView::END_TarifaListView()\n", 0);
00043 }
00044 
00045 
00047 
00049 TarifaListView::~TarifaListView() {
00050     _depura("TarifaListView::INIT_destructor()\n", 0);
00051     empresaBase()->sacaWindow(this);
00052     _depura("TarifaListView::END_destructor()\n", 0);
00053 }
00054 
00055 
00057 
00060 void TarifaListView::on_mui_editar_clicked() {
00061     _depura("TarifaListView::INIT_s_editArticle()\n", 0);
00062     int a = mui_list->currentRow();
00063     if (a < 0) {
00064         _depura("Debe seleccionar una linea", 2);
00065         return;
00066     } // end if
00067     editar(a);
00068     _depura("TarifaListView::END_s_editArticle()\n", 0);
00069 }
00070 
00071 
00073 
00076 void TarifaListView::editar(int row) {
00077     _depura("TarifaListView::editar", 0);
00078     TarifaView *tar = new TarifaView(empresaBase(), 0);
00079     empresaBase()->m_pWorkspace->addWindow(tar);
00080     tar->cargar(mui_list->DBvalue(QString("idtarifa"), row));
00081     tar->show();
00082     _depura("END TarifaListView::editar", 0);
00083 }
00084 
00085 
00087 
00089 void TarifaListView::on_mui_crear_clicked() {
00090     _depura("TarifaListView::editar", 0);
00091     TarifaView *tar = new TarifaView(empresaBase(), parentWidget());
00093     tar->cargar("0");
00094     empresaBase()->m_pWorkspace->addWindow(tar);
00095     tar->show();
00096     _depura("END  TarifaListView::editar", 0);
00097 }
00098 
00099 
00101 
00103 void TarifaListView::on_mui_borrar_clicked() {
00104     _depura("TarifaListView::on_mui_borrar_clicked\n", 0);
00105     int a = mui_list->currentRow();
00106     TarifaView *tar = new TarifaView(empresaBase(), 0);
00107     tar->cargar(mui_list->DBvalue(QString("idtarifa"), a));
00108     tar->on_mui_borrar_clicked();
00109     delete tar;
00110     _depura("END TarifaListView::on_mui_borrar_clicked\n", 0);
00111 }
00112 

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