📄 opponentinfo.cpp
字号:
// OpponentInfo.cpp: implementation of the COpponentInfo class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ClientRelationship.h"
#include "OpponentInfo.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
COpponentInfo::COpponentInfo()
{
}
COpponentInfo::~COpponentInfo()
{
}
CString COpponentInfo::GetOpponentID()
{
return opponentID;
}
CString COpponentInfo::GetOpponentName()
{
return opponentName;
}
COleDateTime COpponentInfo::GetBookinDate()
{
return bookinDate;
}
CString COpponentInfo::GetOpponentLevel()
{
return opponentLevel;
}
CString COpponentInfo::GetLegalPerson()
{
return legalPerson;
}
CString COpponentInfo::GetArea()
{
return area;
}
CString COpponentInfo::GetAddress()
{
return address;
}
CString COpponentInfo::GetPostCode()
{
return postCode;
}
CString COpponentInfo::GetTelephone()
{
return telephone;
}
CString COpponentInfo::GetFax()
{
return fax;
}
CString COpponentInfo::GetWebSite()
{
return webSite;
}
CString COpponentInfo::GetManageRange()
{
return manageRange;
}
CString COpponentInfo::GetIndustryCharacter()
{
return industryCharacter;
}
float COpponentInfo::GetAllFunds()
{
return allFunds;
}
CString COpponentInfo::GetScale()
{
return scale;
}
CString COpponentInfo::GetManagePolicy()
{
return managePolicy;
}
CString COpponentInfo::GetGoalMarket()
{
return goalMarket;
}
CString COpponentInfo::GetResourceCondition()
{
return resourceCondition;
}
CString COpponentInfo::GetDevelopTend()
{
return developTend;
}
CString COpponentInfo::GetAssess()
{
return assess;
}
void COpponentInfo::SetOpponentID(CString vOpponentID)
{
opponentID=vOpponentID;
}
void COpponentInfo::SetOpponentName(CString vOpponentName)
{
opponentName=vOpponentName;
}
void COpponentInfo::SetBookinDate(COleDateTime vBookinDate)
{
bookinDate=vBookinDate;
}
void COpponentInfo::SetOpponentLevel(CString vOpponentLevel)
{
opponentLevel=vOpponentLevel;
}
void COpponentInfo::SetLegalPerson(CString vLegalPerson)
{
legalPerson=vLegalPerson;
}
void COpponentInfo::SetArea(CString vArea)
{
area=vArea;
}
void COpponentInfo::SetAddress(CString vAddress)
{
address=vAddress;
}
void COpponentInfo::SetPostCode(CString vPostCode)
{
postCode=vPostCode;
}
void COpponentInfo::SetTelephone(CString vTelephone)
{
telephone=vTelephone;
}
void COpponentInfo::SetFax(CString vFax)
{
fax=vFax;
}
void COpponentInfo::SetWebSite(CString vWebSite)
{
webSite=vWebSite;
}
void COpponentInfo::SetManageRange(CString vManageRange)
{
manageRange=vManageRange;
}
void COpponentInfo::SetIndustryCharacter(CString vIndustryCharacter)
{
industryCharacter=vIndustryCharacter;
}
void COpponentInfo::SetAllFunds(float vAllFunds)
{
allFunds=vAllFunds;
}
void COpponentInfo::SetScale(CString vScale)
{
scale=vScale;
}
void COpponentInfo::SetManagePolicy(CString vManagePolicy)
{
managePolicy=vManagePolicy;
}
void COpponentInfo::SetGoalMarket(CString vGoalMarket)
{
goalMarket=vGoalMarket;
}
void COpponentInfo::SetResourceCondition(CString vResourceCondition)
{
resourceCondition=vResourceCondition;
}
void COpponentInfo::SetDevelopTend(CString vDevelopTend)
{
developTend=vDevelopTend;
}
void COpponentInfo::SetAssess(CString vAssess)
{
assess=vAssess;
}
void COpponentInfo::sqlInsert()
{
CString strSQL;
strSQL="select * from opponent";
_RecordsetPtr m_pRecordset;
HRESULT hTRes;
hTRes = m_pRecordset.CreateInstance(_T("ADODB.Recordset"));
hTRes = m_pRecordset->Open((LPTSTR)strSQL.GetBuffer(130),
((CClientRelationshipApp*)AfxGetApp())->m_pConn.GetInterfacePtr(),
adOpenDynamic,adLockPessimistic,adCmdText);
if(SUCCEEDED(hTRes))
{
m_pRecordset->AddNew();
CString str;
m_pRecordset->PutCollect("opponentID",_variant_t(opponentID.Left(25)));
m_pRecordset->PutCollect("bookinDate",_variant_t(bookinDate));
m_pRecordset->PutCollect("opponentLevel",_variant_t(opponentLevel.Left(50)));
m_pRecordset->PutCollect("opponentName",_variant_t(opponentName.Left(50)));
m_pRecordset->PutCollect("legalPerson",_variant_t(legalPerson.Left(50)));
m_pRecordset->PutCollect("industryCharacter",_variant_t(industryCharacter.Left(25)));
m_pRecordset->PutCollect("address",_variant_t(address.Left(50)));
m_pRecordset->PutCollect("allFunds",_variant_t(allFunds));
m_pRecordset->PutCollect("scale",_variant_t(scale.Left(50)));
m_pRecordset->PutCollect("webSite",_variant_t(webSite.Left(50)));
m_pRecordset->PutCollect("fax",_variant_t(fax.Left(50)));
m_pRecordset->PutCollect("telephone",_variant_t(telephone.Left(50)));
m_pRecordset->PutCollect("postCode",_variant_t(postCode.Left(50)));
// m_pRecordset->PutCollect("account",_variant_t(account.Left(50)));
m_pRecordset->PutCollect("address",_variant_t(address.Left(50)));
m_pRecordset->PutCollect("manageRange",_variant_t(manageRange.Left(50)));
m_pRecordset->PutCollect("managePolicy",_variant_t(managePolicy.Left(50)));
m_pRecordset->PutCollect("goalMarket",_variant_t(goalMarket.Left(50)));
m_pRecordset->PutCollect("resourceCondition",_variant_t(resourceCondition.Left(50)));
m_pRecordset->PutCollect("developeTend",_variant_t(developTend.Left(50)));
m_pRecordset->PutCollect("assess",_variant_t(assess.Left(50)));
m_pRecordset->Update();
}
}
void COpponentInfo::sqlUpdate(CString cOpponentID)
{
CString strSQL;
strSQL="select * from opponent where opponentID='";
strSQL=strSQL+cOpponentID+"'";
_RecordsetPtr m_pRecordset;
HRESULT hTRes;
hTRes = m_pRecordset.CreateInstance(_T("ADODB.Recordset"));
hTRes = m_pRecordset->Open((LPTSTR)strSQL.GetBuffer(130),
((CClientRelationshipApp*)AfxGetApp())->m_pConn.GetInterfacePtr(),
adOpenDynamic,adLockPessimistic,adCmdText);
if(SUCCEEDED(hTRes))
{
CString str;
m_pRecordset->PutCollect("opponentID",_variant_t(opponentID.Left(25)));
m_pRecordset->PutCollect("bookinDate",_variant_t(bookinDate));
m_pRecordset->PutCollect("opponentLevel",_variant_t(opponentLevel.Left(50)));
m_pRecordset->PutCollect("opponentName",_variant_t(opponentName.Left(50)));
m_pRecordset->PutCollect("legalPerson",_variant_t(legalPerson.Left(50)));
m_pRecordset->PutCollect("industryCharacter",_variant_t(industryCharacter.Left(25)));
m_pRecordset->PutCollect("address",_variant_t(address.Left(50)));
m_pRecordset->PutCollect("allFunds",_variant_t(allFunds));
m_pRecordset->PutCollect("scale",_variant_t(scale.Left(50)));
m_pRecordset->PutCollect("webSite",_variant_t(webSite.Left(50)));
m_pRecordset->PutCollect("fax",_variant_t(fax.Left(50)));
m_pRecordset->PutCollect("telephone",_variant_t(telephone.Left(50)));
m_pRecordset->PutCollect("postCode",_variant_t(postCode.Left(500)));
// m_pRecordset->PutCollect("account",_variant_t(account.Left(50)));
m_pRecordset->PutCollect("address",_variant_t(address.Left(50)));
m_pRecordset->PutCollect("manageRange",_variant_t(manageRange.Left(50)));
m_pRecordset->PutCollect("managePolicy",_variant_t(managePolicy.Left(50)));
m_pRecordset->PutCollect("goalMarket",_variant_t(goalMarket.Left(50)));
m_pRecordset->PutCollect("resourceCondition",_variant_t(resourceCondition.Left(50)));
m_pRecordset->PutCollect("developeTend",_variant_t(developTend));
m_pRecordset->PutCollect("assess",_variant_t(assess.Left(50)));
m_pRecordset->Update();
}
}
void COpponentInfo::sqlDelete(CString cOpponentID)
{
CString strSQL;
strSQL="delete from opponent where opponentID='";
strSQL=strSQL+cOpponentID+"'";
(((CClientRelationshipApp*)AfxGetApp())->m_pConn)->Execute((_bstr_t)strSQL,NULL,adCmdText);
}
void COpponentInfo::GetData(CString cOpponentID)
{
CString strSQL;
strSQL="select * from opponent where opponentID='";
strSQL=strSQL+cOpponentID+"'";
_RecordsetPtr m_pRecordset;
HRESULT hTRes;
hTRes = m_pRecordset.CreateInstance(_T("ADODB.Recordset"));
hTRes = m_pRecordset->Open((LPTSTR)strSQL.GetBuffer(130),
((CClientRelationshipApp*)AfxGetApp())->m_pConn.GetInterfacePtr(),
adOpenDynamic,adLockPessimistic,adCmdText);
if(!(m_pRecordset->adoEOF))
{
CString str;
opponentID= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("opponentID"));
bookinDate= m_pRecordset->GetCollect("bookinDate");
opponentLevel= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("opponentLevel"));
opponentName= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("opponentName"));
legalPerson= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("legalPerson"));
industryCharacter= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("industryCharacter"));
address= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("address"));
allFunds= m_pRecordset->GetCollect("allFunds");
scale= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("scale"));
webSite= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("webSite"));
fax= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("fax"));
telephone= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("telephone"));
postCode= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("postCode"));
// account= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("account"));
address= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("address"));
manageRange= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("manageRange"));
managePolicy= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("managePolicy"));
goalMarket= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("goalMarket"));
resourceCondition= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("resourceCondition"));
developTend= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("developeTend"));
assess= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("assess"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -