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

📄 dlgproductadd.cpp

📁 可以应用于企业商品管理
💻 CPP
字号:
// DlgProductAdd.cpp : implementation file
//

#include "stdafx.h"
#include "MIS.h"
#include "DlgProductAdd.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgProductAdd dialog


//##ModelId=46B609390001
CDlgProductAdd::CDlgProductAdd(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgProductAdd::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgProductAdd)
	m_strProductName = _T("");
	m_strType = _T("");
	m_strUnit = _T("");
	m_strMemo = _T("");
	//}}AFX_DATA_INIT
}


//##ModelId=46B609390022
void CDlgProductAdd::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgProductAdd)
	DDX_Text(pDX, IDC_EDIT_PRODUCTNAME, m_strProductName);
	DDX_Text(pDX, IDC_EDIT_TYPE, m_strType);
	DDX_Text(pDX, IDC_EDIT_UNIT, m_strUnit);
	DDX_Text(pDX, IDC_EDIT_MEMO, m_strMemo);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgProductAdd, CDialog)
	//{{AFX_MSG_MAP(CDlgProductAdd)
	ON_BN_CLICKED(IDOK, OnOk)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgProductAdd message handlers

//##ModelId=46B60939004E
void CDlgProductAdd::OnOk() 
{
	// TODO: Add your control notification handler code here
	UpdateData();
	if(m_strProductName == "")
	{
		MessageBox("商品名不能为空");
		return;
	}

	CDialog::OnOK();
	
}

//##ModelId=46B60939009C
void CDlgProductAdd::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

//##ModelId=46B60939000F
void CDlgProductAdd::GetData(LPPRODUCTINFO pOut)
{
	pOut -> strProductName = m_strProductName;
	pOut -> strUnit		   = m_strUnit;
	pOut -> strType		   = m_strType;
	pOut -> strMemo		   = m_strMemo;
}

//设置商品信息
//##ModelId=46B609390011
void CDlgProductAdd::SetData(LPPRODUCTINFO pIn)
{
	m_strProductName = pIn -> strProductName.c_str() ;
	m_strUnit		 = pIn -> strUnit.c_str()		;
	m_strType		 = pIn -> strUnit.c_str();
	m_strMemo		 = pIn -> strMemo.c_str();

}

//设置标题栏
//##ModelId=46B609390003
void CDlgProductAdd::SetTitle(CHAR* lpszTitle)
{
	m_lpszTitle = lpszTitle;
}

//##ModelId=46B60939002F
BOOL CDlgProductAdd::OnInitDialog()
{
	CDialog::OnInitDialog();
	SetWindowText( m_lpszTitle );
	return TRUE;
}

⌨️ 快捷键说明

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