支持医院信息保存
This commit is contained in:
parent
51f7c2a47c
commit
fb49dac74f
Binary file not shown.
@ -1,5 +1,7 @@
|
|||||||
#include "datamanager.h"
|
#include "datamanager.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QFile>
|
||||||
DataManager::DataManager(QObject * parent )
|
DataManager::DataManager(QObject * parent )
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
@ -17,11 +19,19 @@ DataManager::~DataManager()
|
|||||||
|
|
||||||
void DataManager::init()
|
void DataManager::init()
|
||||||
{
|
{
|
||||||
|
QString sFileName = QCoreApplication::applicationDirPath()+"/medicalRecode.db";
|
||||||
|
//bool bexist = QFile::exists(sFileName);
|
||||||
|
//if(bexist)
|
||||||
|
{
|
||||||
|
SqlCore::init("QSQLITE","user","passdwd",sFileName);
|
||||||
|
}
|
||||||
initTable();
|
initTable();
|
||||||
}
|
}
|
||||||
void DataManager::initTable()
|
void DataManager::initTable()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//病例信息
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
病历管理
|
病历管理
|
||||||
检查号
|
检查号
|
||||||
@ -43,10 +53,36 @@ void DataManager::initTable()
|
|||||||
map.insert("f_Birthday", "TEXT");
|
map.insert("f_Birthday", "TEXT");
|
||||||
map.insert("f_Year", "TEXT");
|
map.insert("f_Year", "TEXT");
|
||||||
map.insert("f_Laterality", "TEXT");
|
map.insert("f_Laterality", "TEXT");
|
||||||
|
map.insert("f_Other", "TEXT");
|
||||||
SqlGenerate sqlGener;
|
SqlGenerate sqlGener;
|
||||||
QString sql = sqlGener.createTable("t_RecodManage",map);
|
QString sql = sqlGener.createTable("t_RecodManage",map);
|
||||||
qDebug()<<sql<<endl;
|
qDebug()<<sql<<endl;
|
||||||
m_sqlcore.execute(sql);
|
m_sqlcore.execute(sql);
|
||||||
|
}
|
||||||
|
//医院信息
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
医院名称
|
||||||
|
用户名称
|
||||||
|
科室
|
||||||
|
用户密码
|
||||||
|
用户人数
|
||||||
|
确认密码
|
||||||
|
数据名称
|
||||||
|
*/
|
||||||
|
QMap<QString, QString> map;
|
||||||
|
map.insert("f_HostpitalName", "TEXT");
|
||||||
|
map.insert("f_UserName", "TEXT");
|
||||||
|
map.insert("f_Section", "TEXT");
|
||||||
|
map.insert("f_UserPasswd", "TEXT");
|
||||||
|
map.insert("f_UserNum", "TEXT");
|
||||||
|
map.insert("f_RePasswd", "TEXT");
|
||||||
|
map.insert("f_DataName", "TEXT");
|
||||||
|
|
||||||
|
SqlGenerate sqlGener;
|
||||||
|
QString sql = sqlGener.createTable("t_Hostpital",map);
|
||||||
|
qDebug()<<sql<<endl;
|
||||||
|
m_sqlcore.execute(sql);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -366,6 +366,39 @@ vlay2->addStretch();
|
|||||||
|
|
||||||
}
|
}
|
||||||
bool HospitalInfo::initConnect()
|
bool HospitalInfo::initConnect()
|
||||||
|
{
|
||||||
|
bool reok;
|
||||||
|
reok = connect(&m_btnOK,SIGNAL(clicked()),this,SLOT(slotSave()));
|
||||||
|
if(!reok)
|
||||||
|
{
|
||||||
|
qDebug()<<"save connect failed"<<endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void HospitalInfo::slotSave()
|
||||||
|
{
|
||||||
|
|
||||||
|
//医院名称
|
||||||
|
|
||||||
|
QString sName = m_editHospitalName.text();
|
||||||
|
//科室
|
||||||
|
|
||||||
|
QString sSection = m_editSection.text();
|
||||||
|
//用户人数
|
||||||
|
|
||||||
|
QString sNum = m_editUserNum.text();
|
||||||
|
|
||||||
|
//数据名称
|
||||||
|
|
||||||
|
QString sDataNAme = m_editDataBaseName.text();
|
||||||
|
|
||||||
|
//用户名称
|
||||||
|
QString sUserName = m_editUser.text();
|
||||||
|
//用户密码
|
||||||
|
QString sUserPasswd = m_editPasswd.text();
|
||||||
|
//确认密码
|
||||||
|
QString sRePasswwd = m_editRePasswd.text();
|
||||||
|
}
|
||||||
|
void HospitalInfo::slotCancel()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user