Changeset 95d916c in mmcs


Ignore:
Timestamp:
Sep 29, 2015, 12:14:58 PM (9 years ago)
Author:
rboet <rboet@…>
Branches:
master
Children:
239e1ea
Parents:
37dd9aa
Message:

incorporada validacion al ingresar cuentas con nombres iguales

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • mainwindow.C

    r37dd9aa r95d916c  
    805805        QString nombreCuenta=le->text();
    806806
     807        bool cuenta = comprobarNombreCuenta(nombreCuenta,index);
     808
    807809        if(nombreCuenta.isEmpty() or nombreCuenta.isNull())
    808810        {
     
    812814        {
    813815            QMessageBox::warning(this,"Alerta","Esta cuenta ya fue\nagregada");
     816        }
     817        else if(cuenta)
     818        {
     819            QMessageBox::warning(this,"Alerta","Este nombre de cuenta\nya existe");
    814820        }
    815821        else
     
    11021108    }
    11031109    return centinela;
     1110}
     1111
     1112bool MainWindow::comprobarNombreCuenta(QString nombre,int indice)
     1113{
     1114    bool cuenta = false;
     1115    for(int i=0;i<numAccounts;i++)
     1116    {
     1117        QLineEdit *le= findChild<QLineEdit *>(QString("linedit %1").arg(i + 1));
     1118        if(le->text()==nombre and indice+1!=i+1)
     1119        {
     1120            cuenta = true;
     1121        }
     1122    }
     1123    return cuenta;
    11041124}
    11051125
  • mainwindow.H

    r37dd9aa r95d916c  
    170170    void matricesMenuBar();
    171171    void populateTable(QTableWidget *);
     172
    172173    void CalcularTotales(QTableWidget *, int inicio, bool &);
     174    bool comprobarNombreCuenta(QString, int indice);
    173175    void loadMatrizExogena();
    174176    void clonarTabla(QTableWidget *,QTableWidget *, int cantidad);
  • moc_mainwindow.cpp

    r37dd9aa r95d916c  
    22** Meta object code from reading C++ file 'mainwindow.H'
    33**
    4 ** Created: Mon Sep 28 11:46:38 2015
     4** Created: Tue Sep 29 08:30:17 2015
    55**      by: The Qt Meta Object Compiler version 63 (Qt 4.8.2)
    66**
Note: See TracChangeset for help on using the changeset viewer.