#ifndef DATAMANAGER_H
#define DATAMANAGER_H

#include <QObject>
#include "SqlCore.h"
#include "SqlGenerate.h"
struct MedicRecord
{
    QString m_CheckNum ;
    QString  m_Type ;
    QString  m_Name ;
    QString  m_Sex;
    QString  m_Birthday;
    QString  m_Year;
    QString  m_Laterality;
    QString  m_InspectDate;
    QString  m_Other;
};
class  DataManager:public QObject
{
    Q_OBJECT
private:
    DataManager(QObject * parent = NULL);
      ~DataManager();
public:
    static DataManager& instance();
    //更新医院信息
    bool   updateHospitalInfo(QString sHostpitalName,
                              QString UserName,
                              QString sSection,
                              QString UserPasswd,
                              QString f_UserNum,
                              QString f_RePasswd,
                              QString DataName);

    bool  HospitalInfo(QString& sHostpitalName,
                       QString& UserName,
                       QString& sSection,
                       QString& UserPasswd,
                       QString& f_UserNum,
                       QString& f_RePasswd,
                       QString& DataName);
    bool  updateMedicRecord(
           QString CheckNum ,
           QString Type ,
           QString Name ,
           QString Sex,
           QString _Birthday,
           QString Year,
           QString Laterality,
           QString InspectDate,
           QString Other);
    int  getMedicRecordCount(QString sName);
    uint getMedicRecordList(const QString& fileName,
                                     QList<MedicRecord>& filesInfo,
                                     int& curPage,
                                     int perPageCnt);

    bool  deleteNumRecode(QString checkNum);
private:
    void init();
    void initTable();
private:
    SqlCore m_sqlcore;

};

#endif // DATAMANAGER_H
