www.gusucode.com > VC++开发的ACD树形策略编辑器-源码程序 > VC++开发的ACD树形策略编辑器-源码程序/code/QueryParameter.cpp
//Download by http://www.NewXing.com // QueryParameter.cpp : implementation file // #include "stdafx.h" #include "dsACD_IVR.h" #include "QueryParameter.h" #include "dsACD_IVRDoc.h" #include "dsACD_IVRView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CQueryParameter dialog CQueryParameter::CQueryParameter(CWnd* pParent /*=NULL*/) : CDialog(CQueryParameter::IDD, pParent) { //{{AFX_DATA_INIT(CQueryParameter) m_csComment = _T(""); m_csName = _T(""); m_csParameter = _T(""); m_csValue = _T(""); //}}AFX_DATA_INIT } void CQueryParameter::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CQueryParameter) DDX_Text(pDX, IDC_QP_COMMENT, m_csComment); DDX_CBString(pDX, IDC_QP_CONN, m_csName); DDX_CBString(pDX, IDC_QP_PARAMETER, m_csParameter); DDX_CBString(pDX, IDC_QP_VALUE, m_csValue); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CQueryParameter, CDialog) //{{AFX_MSG_MAP(CQueryParameter) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CQueryParameter message handlers BOOL CQueryParameter::OnInitDialog() { CDialog::OnInitDialog(); CComboBox *pName=(CComboBox *)GetDlgItem(IDC_QP_CONN); CComboBox *pParameter=(CComboBox *)GetDlgItem(IDC_QP_PARAMETER); CComboBox *pValue=(CComboBox *)GetDlgItem(IDC_QP_VALUE); CString buf1, buf2, csVarName, csDBConnName; m_pDsACD_IVRView->ReadVariable(buf1); while (!buf1.IsEmpty()) { csVarName = buf1.Left(buf1.Find(";" )); pParameter->AddString(csVarName); pValue->AddString(csVarName); buf1.Delete(0, buf1.Find(";" )+1); } m_pDsACD_IVRView->ReadDBConn(buf2); while (!buf2.IsEmpty()) { csDBConnName = buf2.Left(buf2.Find(";" )); pName->AddString(csDBConnName); buf2.Delete(0, buf2.Find(";" )+1); } int nIndex; nIndex = pName->SelectString(-1, m_csName); pName->SetCurSel(nIndex); nIndex = pParameter->SelectString(-1, m_csParameter); pParameter->SetCurSel(nIndex); nIndex = pValue->SelectString(-1, m_csValue); pValue->SetCurSel(nIndex); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CQueryParameter::DisplayDlg(dsACDObjectBase *pObj) { dsQP_INFO * pInfo = (dsQP_INFO*) pObj->Read(); m_csName = pInfo->Name; m_csParameter = pInfo->Parameter; m_csValue = pInfo->Value; m_csComment = pInfo->Comment; if(DoModal()==IDOK) { if (m_csName == "") m_csName = "无数据库"; if (m_csParameter == "") m_csParameter = "空"; if (m_csValue == "") m_csValue = "空"; pInfo->Name = m_csName; pInfo->Parameter = m_csParameter; pInfo->Value = m_csValue; pInfo->Comment = m_csComment; } else return; }