68 lines
1.3 KiB
C++
68 lines
1.3 KiB
C++
#include "stdafx.h"
|
|
#include "CXTBGDlg.h"
|
|
#include "CoreTools.h"
|
|
|
|
IMPLEMENT_DYNAMIC(CXTBGDlg, CDialog)
|
|
|
|
CXTBGDlg::CXTBGDlg(CWnd *pParent/*=NULL*/)
|
|
: CDialog(CXTBGDlg::IDD, pParent)
|
|
{
|
|
m_pDb = NULL;
|
|
}
|
|
|
|
CXTBGDlg::~CXTBGDlg()
|
|
{
|
|
|
|
}
|
|
|
|
void CXTBGDlg::SetDbServer(CUIISQLiteServer *pDb)
|
|
{
|
|
m_pDb = pDb;
|
|
}
|
|
|
|
void CXTBGDlg::DoDataExchange(CDataExchange *pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
DDX_Control(pDX, IDC_COMBO_SYS, m_wndComboPipeSys);
|
|
DDX_Text(pDX, IDC_EDIT1, m_sPipeSys);
|
|
DDX_CBString(pDX, IDC_COMBO_SYS, m_sPipeSys2);
|
|
}
|
|
|
|
BEGIN_MESSAGE_MAP(CXTBGDlg, CDialog)
|
|
END_MESSAGE_MAP()
|
|
|
|
BOOL CXTBGDlg::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
CString sStd(CoreTools::getCurrentPipeSysTblName()), sTemp;
|
|
//sSQL = _T("select tablename from wpipecfg where currstd=1");
|
|
//m_pDb->GetSelData(sSQL, sStd);
|
|
|
|
CString sSQL;
|
|
sSQL.Format(_T("select distinct system from %s"), sStd);
|
|
CStringArray arSyses;
|
|
m_pDb->GetSelData(sSQL, arSyses);
|
|
for (int i = 0; i < arSyses.GetSize(); i++)
|
|
{
|
|
sTemp = arSyses.GetAt(i);
|
|
m_wndComboPipeSys.AddString(sTemp);
|
|
}
|
|
|
|
//再从图层中加一遍
|
|
m_wndComboPipeSys.SetCurSel(0);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
void CXTBGDlg::OnOK()
|
|
{
|
|
UpdateData();
|
|
|
|
if (m_sPipeSys.CompareNoCase(m_sPipeSys2) == 0)
|
|
{
|
|
AfxMessageBox(_T("请选择一不同的系统!"));
|
|
return;
|
|
}
|
|
EndDialog(IDOK);
|
|
} |