?? jiludlg.cpp
字號:
// JiLuDlg.cpp : implementation file
//
#include "stdafx.h"
#include "廢品收購管理系統.h"
#include "JiLuDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CJiLuDlg dialog
CJiLuDlg::CJiLuDlg(CWnd* pParent /*=NULL*/)
: CDialog(CJiLuDlg::IDD, pParent)
{
EnableAutomation();
//{{AFX_DATA_INIT(CJiLuDlg)
m_tjwp = _T("");
m_tjfk = _T("");
m_tjjs = _T("");
m_tjsj = _T("");
m_tjje = _T("");
m_tjdd = _T("");
//}}AFX_DATA_INIT
}
void CJiLuDlg::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CDialog::OnFinalRelease();
}
void CJiLuDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CJiLuDlg)
DDX_CBString(pDX, IDC_COMBO_TJ_WP, m_tjwp);
DDX_Text(pDX, IDC_EDIT_TIANJIA_JL_FK, m_tjfk);
DDX_Text(pDX, IDC_EDIT_TIANJIA_JL_JS, m_tjjs);
DDX_Text(pDX, IDC_EDIT_TIANJIA_JL_SJ, m_tjsj);
DDX_Text(pDX, IDC_EDIT_TJJE, m_tjje);
DDX_Text(pDX, IDC_EDIT_TJ_DD, m_tjdd);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CJiLuDlg, CDialog)
//{{AFX_MSG_MAP(CJiLuDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CJiLuDlg, CDialog)
//{{AFX_DISPATCH_MAP(CJiLuDlg)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IJiLuDlg to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {019A4807-912D-433E-9EEA-477932A3D685}
static const IID IID_IJiLuDlg =
{ 0x19a4807, 0x912d, 0x433e, { 0x9e, 0xea, 0x47, 0x79, 0x32, 0xa3, 0xd6, 0x85 } };
BEGIN_INTERFACE_MAP(CJiLuDlg, CDialog)
INTERFACE_PART(CJiLuDlg, IID_IJiLuDlg, Dispatch)
END_INTERFACE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CJiLuDlg message handlers
BOOL CJiLuDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CoInitialize(NULL);
_ConnectionPtr pCon(_uuidof(Connection));
_RecordsetPtr pRec(_uuidof(Recordset));
pCon->ConnectionTimeout=5;
pCon->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=廢品交易數據庫.mdb","","",adModeUnknown);
CString strSQL;
strSQL.Format("SELECT * FROM 交易物品表");
pRec->Open(_bstr_t(strSQL),
_variant_t((IDispatch*)pCon,true),
adOpenStatic,
adLockOptimistic,
adCmdText
);
while(!pRec->adoEOF)
{
((CComboBox*)GetDlgItem(IDC_COMBO_TJ_WP))->AddString(_bstr_t(pRec->GetCollect("交易物品")));
pRec->MoveNext();
}
((CComboBox*)GetDlgItem(IDC_COMBO_TJ_WP))->SetCurSel(0);
pRec->Close();
pCon->Close();
pRec.Release();
pCon.Release();
CoUninitialize();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
//DEL void CJiLuDlg::OnOk()
//DEL {
//DEL // TODO: Add your control notification handler code here
//DEL UpdateData(TRUE);
//DEL
//DEL CoInitialize(NULL);
//DEL _ConnectionPtr pCon(_uuidof(Connection));
//DEL _RecordsetPtr pRec(_uuidof(Recordset));
//DEL
//DEL pCon->ConnectionTimeout=5;
//DEL pCon->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=廢品交易數據庫.mdb","","",adModeUnknown);
//DEL CString strSQL;
//DEL strSQL.Format("SELECT * FROM 交易記錄表");
//DEL pRec->Open(_bstr_t(strSQL),
//DEL _variant_t((IDispatch*)pCon,true),
//DEL adOpenStatic,
//DEL adLockOptimistic,
//DEL adCmdText
//DEL );
//DEL pRec->AddNew();
//DEL pRec->PutCollect("公司編號",_variant_t((long)(m_bianhao2)));
//DEL pRec->PutCollect("交易時間",_variant_t(m_tjsj));
//DEL pRec->PutCollect("交易地點",_variant_t(m_tjdd));
//DEL pRec->PutCollect("交易物品",_variant_t(m_tjwp));
//DEL pRec->PutCollect("經手人",_variant_t(m_tjjs));
//DEL pRec->PutCollect("付款情況",_variant_t(m_tjfk));
//DEL pRec->PutCollect("交易金額",_variant_t(m_tjje));
//DEL pRec->Update();
//DEL pRec->Close();
//DEL pCon->Close();
//DEL pRec.Release();
//DEL pCon.Release();
//DEL CoUninitialize();
//DEL MessageBox("添加交易記錄成功!");
//DEL OnOK();
//DEL
//DEL
//DEL }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -