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

📄 customerif_tjdlg.cpp

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

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

/////////////////////////////////////////////////////////////////////////////
// CCustomerif_TJDlg dialog


CCustomerif_TJDlg::CCustomerif_TJDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CCustomerif_TJDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCustomerif_TJDlg)
	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("");
	m_aires = _T("");
	m_beizhu = _T("");
	//}}AFX_DATA_INIT
}


void CCustomerif_TJDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCustomerif_TJDlg)
	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);
	DDX_Text(pDX, IDC_aires, m_aires);
	DDX_Text(pDX, IDC_beizhu, m_beizhu);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCustomerif_TJDlg, CDialog)
	//{{AFX_MSG_MAP(CCustomerif_TJDlg)
	ON_BN_CLICKED(IDOK, OnAdd)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCustomerif_TJDlg message handlers

void CCustomerif_TJDlg::OnAdd() 
{
	// TODO: Add your control notification handler code here
	UpdateData();
	if (m_ctmid.IsEmpty())
	{
		MessageBox("顾客的编号不能为空!");
		return ;
	}
	if (m_conn.IsEmpty()) 
	{
		MessageBox("联系人的姓名不能为空!");
		return ;
	}
	m_pSet = new CCustomerifSet();
	m_pSet->Open();
	while (!m_pSet->IsEOF())
	{	
		if ((m_pSet->m_CustomerId == m_ctmid) && (m_pSet->m_ContactName == m_conn))
		{
			MessageBox("商品的编号和名称已经存在,请重新输入新的信息!");
			m_pSet->Close();
			return ;
		}
		m_pSet->MoveNext();
	}
	m_pSet->AddNew();
	m_pSet->m_CustomerId = m_ctmid;
	m_pSet->m_ContactName = m_conn;
	m_pSet->m_Fax= m_fax;
	m_pSet->m_City = m_city;
	m_pSet->m_CustomerNemo = m_beizhu;
	m_pSet->m_Phone = m_conPh;
	m_pSet->m_PostalCde = 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 + -