📄 marketinvestigate.cpp
字号:
// MarketInvestigate.cpp: implementation of the CMarketInvestigate class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ClientRelationship.h"
#include "MarketInvestigate.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMarketInvestigate::CMarketInvestigate()
{
}
CMarketInvestigate::~CMarketInvestigate()
{
}
CString CMarketInvestigate::GetMarketInvestigateID()
{
return marketInvestigateID;
}
CString CMarketInvestigate::GetSummary()
{
return summary;
}
CString CMarketInvestigate::GetObject()
{
return object;
}
CString CMarketInvestigate::GetInvestigatePerson()
{
return investigatePerson;
}
COleDateTime CMarketInvestigate::GetInvestigateDate()
{
return investigateDate;
}
void CMarketInvestigate::SetMarketInvestigateID(CString vMarketInvestigateID)
{
marketInvestigateID=vMarketInvestigateID;
}
void CMarketInvestigate::SetSummary(CString vSummary)
{
summary=vSummary;
}
void CMarketInvestigate::SetObject(CString vObject)
{
object=vObject;
}
void CMarketInvestigate::SetInvestigatePerson(CString vInvestigatePerson)
{
investigatePerson=vInvestigatePerson;
}
void CMarketInvestigate::SetInvestigateDate(COleDateTime vInvestigateDate)
{
investigateDate=vInvestigateDate;
}
void CMarketInvestigate::sqlInsert()
{
CString strSQL;
strSQL="select * from marketInvestigate";
_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();
m_pRecordset->PutCollect("marketInvestigateID",_variant_t(marketInvestigateID));
m_pRecordset->PutCollect("investigateDate",_variant_t(investigateDate));
m_pRecordset->PutCollect("investigatePerson",_variant_t(investigatePerson.Left(50)));
m_pRecordset->PutCollect("object",_variant_t(object.Left(50)));
m_pRecordset->PutCollect("summary",_variant_t(summary.Left(50)));
m_pRecordset->Update();
}
}
void CMarketInvestigate::sqlUpdate(CString cMarketInvestigateID)
{
CString strSQL;
strSQL="select * from marketInvestigate where marketInvestigateID='";
strSQL=strSQL+cMarketInvestigateID+"'";
_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->PutCollect("investigateDate",_variant_t(investigateDate));
m_pRecordset->PutCollect("investigatePerson",_variant_t(investigatePerson.Left(50)));
m_pRecordset->PutCollect("object",_variant_t(object.Left(50)));
m_pRecordset->PutCollect("summary",_variant_t(summary.Left(50)));
m_pRecordset->Update();
}
}
void CMarketInvestigate::sqlDelete(CString cMarketInvestigateID)
{
CString strSQL;
strSQL="delete from marketInvestigate where marketInvestigateID='";
strSQL=strSQL+cMarketInvestigateID+"'";
(((CClientRelationshipApp*)AfxGetApp())->m_pConn)->Execute((_bstr_t)strSQL,NULL,adCmdText);
}
void CMarketInvestigate::GetData(CString cMarketInvestigateID)
{
CString strSQL;
strSQL="select * from marketInvestigate where marketInvestigateID='";
strSQL=strSQL+cMarketInvestigateID+"'";
_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))
{
investigateDate= m_pRecordset->GetCollect("investigateDate");
investigatePerson= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("investigatePerson"));
object= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("object"));
summary= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("summary"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -