⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kehudlg.cpp

📁 自己帮家里人写的一个废品收购管理数据库系统
💻 CPP
字号:
// KeHuDlg.cpp : implementation file
//

#include "stdafx.h"
#include "废品收购管理系统.h"
#include "KeHuDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CKeHuDlg dialog


CKeHuDlg::CKeHuDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CKeHuDlg::IDD, pParent)
{
	EnableAutomation();

	//{{AFX_DATA_INIT(CKeHuDlg)
	m_tjbz = _T("");
	m_tjdh = _T("");
	m_tjdz = _T("");
	m_tjmc = _T("");
	m_tjxm = _T("");
	//}}AFX_DATA_INIT
}


void CKeHuDlg::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 CKeHuDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CKeHuDlg)
	DDX_Text(pDX, IDC_EDIT_TIANJIA_BZ, m_tjbz);
	DDX_Text(pDX, IDC_EDIT_TIANJIA_DH, m_tjdh);
	DDX_Text(pDX, IDC_EDIT_TIANJIA_DZ, m_tjdz);
	DDX_Text(pDX, IDC_EDIT_TIANJIA_MC, m_tjmc);
	DDX_Text(pDX, IDC_EDIT_TIANJIA_XM, m_tjxm);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CKeHuDlg, CDialog)
	//{{AFX_MSG_MAP(CKeHuDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BEGIN_DISPATCH_MAP(CKeHuDlg, CDialog)
	//{{AFX_DISPATCH_MAP(CKeHuDlg)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()

// Note: we add support for IID_IKeHuDlg to support typesafe binding
//  from VBA.  This IID must match the GUID that is attached to the 
//  dispinterface in the .ODL file.

// {41E11135-757B-4E2A-9AFA-FDDA6170F4ED}
static const IID IID_IKeHuDlg =
{ 0x41e11135, 0x757b, 0x4e2a, { 0x9a, 0xfa, 0xfd, 0xda, 0x61, 0x70, 0xf4, 0xed } };

BEGIN_INTERFACE_MAP(CKeHuDlg, CDialog)
	INTERFACE_PART(CKeHuDlg, IID_IKeHuDlg, Dispatch)
END_INTERFACE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CKeHuDlg message handlers

//DEL void CKeHuDlg::OnOk() 
//DEL {
//DEL 	// TODO: Add your control notification handler code here
//DEL 	    UpdateData(TRUE);
//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(m_tjxm));
//DEL     	pRec->PutCollect("公司名称",_variant_t(m_tjmc));
//DEL         pRec->PutCollect("公司地址",_variant_t(m_tjdz));
//DEL         pRec->PutCollect("老板电话",_variant_t(m_tjdh));
//DEL         pRec->PutCollect("备注",_variant_t(m_tjbz));
//DEL     	pRec->Update();		
//DEL 		pRec->Close();
//DEL 	    pCon->Close();
//DEL 	    pRec.Release();
//DEL 	    pCon.Release();
//DEL 	    CoUninitialize();
//DEL 		///////更新其它组件
//DEL 		MessageBox("添加用户成功");
//DEL 		OnOK();
//DEL 		
//DEL 		
//DEL 		/*
//DEL 	    
//DEL 		_bstr_t bstrtemp;
//DEL 		strSQL.Format("UPDATE 用户名与密码表 SET 用户名='"+m_newuser1+"'");
//DEL 		bstrtemp=strSQL;
//DEL 		pRec=pCon->Execute(bstrtemp,NULL,adCmdText);
//DEL 		MessageBox("修改用户名成功!");
//DEL 		OnOK();*/
//DEL 
//DEL 	
//DEL }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -