1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- // Dlg_ReadDB.cpp : 实现文件
- //
- #include "stdafx.h"
- #include "SupportSmsPlatform.h"
- #include "Dlg_ReadDB.h"
- #include ".\dlg_readdb.h"
- // CDlg_ReadDB 对话框
- IMPLEMENT_DYNAMIC(CDlg_ReadDB, CDialog)
- CDlg_ReadDB::CDlg_ReadDB(CWnd* pParent /*=NULL*/)
- : CDialog(CDlg_ReadDB::IDD, pParent)
- , m_sComb_DBType(_T(""))
- , m_sEdit_DBIP(_T(""))
- , m_sEdit_DBName(_T(""))
- , m_sEdit_DBUser(_T(""))
- , m_sEdit_DBPwd(_T(""))
- , m_sEdit_SQL(_T(""))
- {
- }
- CDlg_ReadDB::~CDlg_ReadDB()
- {
- }
- void CDlg_ReadDB::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_COMBO_DBTYEP, m_Comb_DBType);
- DDX_CBString(pDX, IDC_COMBO_DBTYEP, m_sComb_DBType);
- DDX_Text(pDX, IDC_EDIT_DBIP, m_sEdit_DBIP);
- DDX_Text(pDX, IDC_EDIT_DBNAME, m_sEdit_DBName);
- DDX_Text(pDX, IDC_EDIT_DBUSER, m_sEdit_DBUser);
- DDX_Text(pDX, IDC_EDIT_DBPWD, m_sEdit_DBPwd);
- DDX_Text(pDX, IDC_EDIT_CONTENT, m_sEdit_SQL);
- }
- BEGIN_MESSAGE_MAP(CDlg_ReadDB, CDialog)
- END_MESSAGE_MAP()
- // CDlg_ReadDB 消息处理程序
- BOOL CDlg_ReadDB::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: 在此添加额外的初始化
- GetIni();
- return TRUE; // return TRUE unless you set the focus to a control
- // 异常: OCX 属性页应返回 FALSE
- }
- void CDlg_ReadDB::GetIni()
- {
- g_IniFile.GetVarStr( "Database_RomoteDB","ServerName",m_sEdit_DBIP );
- g_IniFile.GetVarStr( "Database_RomoteDB","DataBaseName",m_sEdit_DBName );
- g_IniFile.GetVarStr( "Database_RomoteDB","UserName",m_sEdit_DBUser );
- g_IniFile.GetVarStr( "Database_RomoteDB","Password",m_sEdit_DBPwd );
- g_IniFile.GetVarStr( "Database_RomoteDB","DBType",m_sComb_DBType );
- m_sEdit_SQL = "t_waring_record \r\n"\
- "( \r\n"\
- "id, //序列号【整型】不能为空\r\n"\
- "equip_desc, //设备描述【字符串】\r\n"\
- "type_desc, //类型描述【字符串】\r\n"\
- "happen_time, //报警时间【时间类型】\r\n"\
- "curr_status, //当前状态【整型】】\r\n"\
- "curr_value, //当前值【浮点型】\r\n"\
- "memos, //备注【字符串】\r\n"\
- "warncontent //报警内容【字符串】\r\n"\
- ") ";
- UpdateData( false );
- }
- void CDlg_ReadDB::SetIni()
- {
- g_IniFile.SetVarStr( "Database_RomoteDB","ServerName",m_sEdit_DBIP );
- g_IniFile.SetVarStr( "Database_RomoteDB","DataBaseName",m_sEdit_DBName );
- g_IniFile.SetVarStr( "Database_RomoteDB","UserName",m_sEdit_DBUser );
- g_IniFile.SetVarStr( "Database_RomoteDB","Password",m_sEdit_DBPwd );
- g_IniFile.SetVarStr( "Database_RomoteDB","DBType",m_sComb_DBType );
- }
- void CDlg_ReadDB::Apply()
- {
- }
|