MrHyde
Défi DVP 2
sql.h
Go to the documentation of this file.
00001 #ifndef SQL_H
00002 #define SQL_H
00003 
00004 #include <QObject>
00005 #include <QtSql>
00006 
00007 QT_BEGIN_NAMESPACE
00008 class QSqlTableModel;
00009 class QSqlDatabase;
00010 class QSqlError;
00011 class QSqlQuery;
00012 QT_END_NAMESPACE
00013 
00014 class Sql : public QObject
00015 {
00016     Q_OBJECT
00017 
00018 public:
00019     Sql(QObject *parent = 0);
00020     void doQuery(QString select, QString from);
00021     bool isOpen() { return dbIsOpen; }
00022     int getDoctorCount() { return doctorCount; }
00023     int getPatientCount() { return patientCount; }
00024 
00025     void createStructure();
00026     QStringList listDoctors();
00027     QStringList listPatients();
00028     void addDoctor(QString employeeId, QString title, QString firstName, QString lastName);
00029     void addPatient(QString socialSecurityId, QString title, QString firstName, QString lastName);
00030     void deleteDoctor(QString employeeId);
00031     void deletePatient(QString socialSecurityId);
00032 
00033 signals:
00034 
00035 public slots:
00036 
00037 private:
00038     bool dbIsOpen;
00039     QSqlTableModel *model;
00040     QString dbName;
00041     QString dbFilename;
00042     int doctorCount;
00043     int patientCount;
00044 };
00045 
00046 #endif // SQL_H
 All Classes Files Functions Variables