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

📄 supplierif_xgdlg.cpp

📁 本程序是居于对话框用access数据库开发的一个简单的销售管理系统
💻 CPP
字号:
// Supplierif_XGDlg.cpp : implementation file
//

#include "stdafx.h"
#include "WinNerComputers.h"
#include "Supplierif_XGDlg.h"
#include "SupplierifSet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSupplierif_XGDlg dialog


CSupplierif_XGDlg::CSupplierif_XGDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSupplierif_XGDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSupplierif_XGDlg)
	m_aires = _T("");
	m_beizhu = _T("");
	m_city = _T("");
	m_conadr = _T("");
	m_conn = _T("");
	m_conPh = _T("");
	m_cpnn = _T("");
	m_ctmid = _T("");
	m_fax = _T("");
	m_home = _T("");
	m_ybhm = _T("");
	edit = "";
	//}}AFX_DATA_INIT
}


void CSupplierif_XGDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSupplierif_XGDlg)
	DDX_Text(pDX, IDC_aires, m_aires);
	DDX_Text(pDX, IDC_beizhu, m_beizhu);
	DDX_Text(pDX, IDC_city, m_city);
	DDX_Text(pDX, IDC_conadr, m_conadr);
	DDX_Text(pDX, IDC_conn, m_conn);
	DDX_Text(pDX, IDC_conPh, m_conPh);
	DDX_Text(pDX, IDC_cpnn, m_cpnn);
	DDX_Text(pDX, IDC_ctmid, m_ctmid);
	DDX_Text(pDX, IDC_fax, m_fax);
	DDX_Text(pDX, IDC_home, m_home);
	DDX_Text(pDX, IDC_ybhm, m_ybhm);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSupplierif_XGDlg, CDialog)
	//{{AFX_MSG_MAP(CSupplierif_XGDlg)
	ON_BN_CLICKED(IDC_EDIT, OnEdit)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSupplierif_XGDlg message handlers

BOOL CSupplierif_XGDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	UpdateData();
	m_pSet = new CSupplierifSet();
	m_pSet->m_strFilter.Format("SupplierId='%s'",edit);
	m_pSet->Open();
	if (!m_pSet->IsEOF())
	{
		m_ctmid=m_pSet->m_SupplierId ;
		m_conn=m_pSet->m_ContactName  ;
		m_fax=m_pSet->m_Fax;
	    m_city=m_pSet->m_City ;
		m_beizhu=m_pSet->m_SupplierMemo ;
		m_conPh=m_pSet->m_Phone ;
		m_ybhm=m_pSet->m_PostalCode;
		m_home=m_pSet->m_HomePage ;
		m_cpnn=m_pSet->m_CompanyName ;
		m_conadr=m_pSet->m_Address;
		m_aires=m_pSet->m_Region ;
		UpdateData(FALSE);
	}
	m_pSet->Close();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSupplierif_XGDlg::OnEdit() 
{
	// TODO: Add your control notification handler code here
	UpdateData();
	m_pSet = new CSupplierifSet();
	m_pSet->m_strFilter.Format("SupplierId='%s'",edit);
	m_pSet->Open();
	m_pSet->Edit();
	m_pSet->m_SupplierId = m_ctmid;
	m_pSet->m_ContactName = m_conn;
	m_pSet->m_Fax= m_fax;
	m_pSet->m_City = m_city;
	m_pSet->m_SupplierMemo = m_beizhu;
	m_pSet->m_Phone = m_conPh;
	m_pSet->m_PostalCode = m_ybhm;
	m_pSet->m_HomePage = m_home;
	m_pSet->m_CompanyName = m_cpnn;
	m_pSet->m_Address = m_conadr;
	m_pSet->m_Region = m_aires;
	m_pSet->Update();
	m_pSet->Requery();
	m_pSet->Close();
	MessageBox("记录修改成功!");
	
}

⌨️ 快捷键说明

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