📄 productif_xgdlg.cpp
字号:
// Productif_XGDlg.cpp : implementation file
//
#include "stdafx.h"
#include "WinNerComputers.h"
#include "Productif_XGDlg.h"
#include "ProductifSet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CProductif_XGDlg dialog
CProductif_XGDlg::CProductif_XGDlg(CWnd* pParent /*=NULL*/)
: CDialog(CProductif_XGDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CProductif_XGDlg)
m_bz = _T("");
m_sdw = _T("");
m_sgg = _T("");
m_sh = _T("");
m_sm = _T("");
edit = "";
//}}AFX_DATA_INIT
}
void CProductif_XGDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProductif_XGDlg)
DDX_Text(pDX, IDC_beizhu, m_bz);
DDX_Text(pDX, IDC_shangdw, m_sdw);
DDX_Text(pDX, IDC_shanggg, m_sgg);
DDX_Text(pDX, IDC_shanghao, m_sh);
DDX_Text(pDX, IDC_shangming, m_sm);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CProductif_XGDlg, CDialog)
//{{AFX_MSG_MAP(CProductif_XGDlg)
ON_BN_CLICKED(IDOK2, OnEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProductif_XGDlg message handlers
void CProductif_XGDlg::OnEdit()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet = new CProductifSet();
m_pSet->m_strFilter.Format(" ProductId= '%s' ",edit);
m_pSet->Open();
m_pSet->Edit();
m_pSet->m_ProductId =m_sh;
m_pSet->m_ProductName= m_sm;
m_pSet->m_Productmeno = m_bz;
m_pSet->m_Spec = m_sgg;
m_pSet->m_Unit = m_sdw;
m_pSet->Update();
m_pSet->Requery();
m_pSet->Close();
MessageBox("记录修改成功!");
}
BOOL CProductif_XGDlg::OnInitDialog()
{
CDialog::OnInitDialog();
UpdateData();
m_pSet = new CProductifSet();
m_pSet->m_strFilter.Format("ProductId = '%s'",edit);
m_pSet->Open();
if (!m_pSet->IsEOF())
{
m_sh = m_pSet->m_ProductId;
m_sm = m_pSet->m_ProductName;
m_bz = m_pSet->m_Productmeno;
m_sgg = m_pSet->m_Spec;
m_sdw = m_pSet->m_Unit;
UpdateData(FALSE);
}
m_pSet->Close();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -