inventarioview.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 <QMessageBox>
00022 #include <QWidget>
00023 #include <QObject>
00024 #include <QComboBox>
00025 #include <QToolButton>
00026 #include <QLayout>
00027 
00028 #include <fstream>
00029 
00030 #include "inventarioview.h"
00031 #include "company.h"
00032 #include "listcontrolstockview.h"
00033 #include "inventario.h"
00034 #include "funcaux.h"
00035 
00036 
00038 
00042 InventarioView::InventarioView(Company *comp, QWidget *parent)
00043         :  Inventario(comp, parent) {
00044     _depura("InventarioView::InventarioView", 0);
00045     setAttribute(Qt::WA_DeleteOnClose);
00046     setupUi(this);
00048     subform2->setEmpresaBase(comp);
00049     setListControlStock(subform2);
00050     meteWindow(windowTitle(), this);
00051     _depura("END InventarioView::InventarioView", 0);
00052 }
00053 
00054 
00056 
00058 InventarioView::~InventarioView() {
00059     _depura("InventarioView::~InventarioView", 0);
00060     _depura("END InventarioView::~InventarioView", 0);
00061 }
00062 
00063 
00065 
00068 void InventarioView::on_mui_guardar2_clicked() {
00069     _depura("InventarioView::on_mui_guardar2_clicked", 0);
00070     if (mui_nominventario->text() == "") {
00071         mensajeInfo(tr("Tiene que escribir una descripcion de inventario antes de guardar"));
00072         return;
00073     } // end if
00074     setfechainventario(mui_fechainventario->text());
00075     setnominventario(mui_nominventario->text());
00076     Inventario::guardar();
00077     _depura("END InventarioView::on_mui_guardar2_clicked", 0);
00078 }
00079 
00080 
00082 
00085 int InventarioView::sacaWindow() {
00086     _depura("InventarioView::sacaWindow", 0);
00087     companyact->sacaWindow(this);
00088     return 0;
00089     _depura("END InventarioView::sacaWindow", 0);
00090 }
00091 
00092 
00094 
00096 void InventarioView::on_mui_borrar2_clicked() {
00097     _depura("InventarioView::on_mui_borrar2_clicked", 0);
00098     if (DBvalue("idinventario") != "") {
00099         if (QMessageBox::question(this,
00100                                   tr("Borrar inventario"),
00101                                   tr("Esta a punto de borrar un inventario. Desea continuar?"),
00102                                   tr("Si"), tr("No"), 0, 1, 0) == 0) {
00103             Inventario::borrar();
00104         } // end if
00105     } // end if
00106     _depura("END InventarioView::on_mui_borrar2_clicked", 0);
00107 }
00108 
00109 
00111 
00113 void InventarioView::pintaidinventario(QString) {
00114     _depura("InventarioView::pintaidinventario", 0);
00115     _depura("END InventarioView::pintaidinventario", 0);
00116 }
00117 
00118 
00120 
00123 void InventarioView::pintafechainventario(QString id) {
00124     _depura("InventarioView::pintaidinventario", 0);
00125     mui_fechainventario->setText(id);
00126     _depura("InventarioView::pintaidinventario", 0);
00127 }
00128 
00129 
00131 
00134 void InventarioView::pintanominventario(QString id) {
00135     _depura("InventarioView::pintaidinventario", 0);
00136     mui_nominventario->setText(id);
00137     _depura("InventarioView::pintaidinventario", 0);
00138 }
00139 
00140 
00142 
00144 void InventarioView::on_mui_aceptar_clicked() {
00145         _depura("InventarioView::on_mui_aceptar_clicked", 0);
00146     setfechainventario(mui_fechainventario->text());
00147     setnominventario(mui_nominventario->text());
00148     if (!Inventario::guardar()) {
00149         close();
00150     } // end if
00151         _depura("END InventarioView::on_mui_aceptar_clicked", 0);
00152 }
00153 
00154 
00156 
00158 void InventarioView::on_mui_pregenerar_clicked() {
00159     _depura("InventarioView::on_mui_pregenerar_clicked", 0);
00160     pregenerar();
00161     _depura("END InventarioView::on_mui_pregenerar_clicked", 0);
00162 }

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