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

📄 supplier.cpp

📁 玩具百货公司销售进货记录系统!界面比较齐全,功能完善
💻 CPP
字号:
// Supplier.cpp: implementation of the CSupplier class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "heavenmis.h"
#include "Supplier.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CSupplier::CSupplier()
{
	m_factoryName="";
	m_ContactName="";
	m_Phone="";
	m_address="";
	m_Province="";
	m_City="";
}

CSupplier::~CSupplier()
{
}
void CSupplier::AddRecord()
{
	CADORecordset* pRs=new CADORecordset(((CHeavenMISApp*)AfxGetApp())->pDB);
	CString strSQL;
	strSQL.Format("select * from tbSupplier");
	pRs->Open(strSQL,CADORecordset::openQuery);
	pRs->AddNew();
	pRs->SetFieldValue("FactoryName",m_factoryName);
	pRs->SetFieldValue("ContactName",m_ContactName);
	pRs->SetFieldValue("ContactPhone",m_Phone);
	pRs->SetFieldValue("Address",m_address);
	pRs->SetFieldValue("Province",m_Province);
	pRs->SetFieldValue("City",m_City);
	pRs->Update();
	pRs->Close();
	delete pRs;
}

long CSupplier::GetKeyByName(CString name)
{
	CADORecordset* pRs=new CADORecordset(((CHeavenMISApp*)AfxGetApp())->pDB);
	CString strSQL;
	strSQL.Format("select SupplierID from tbSupplier where FactoryName='%s'",name);
	pRs->Open(strSQL,CADORecordset::openQuery);
	long key;
	if(pRs->GetRecordCount()==1)
	{
		pRs->GetFieldValue("SupplierID",key);
	}
	else key=-1;
	
	pRs->Close();
	delete pRs;
	return key;	
}

⌨️ 快捷键说明

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