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

📄 clientcontact.cpp

📁 关于客户关系管理系统的源码
💻 CPP
字号:
// ClientContact.cpp: implementation of the CClientContact class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ClientRelationship.h"
#include "ClientContact.h"

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

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

CClientContact::CClientContact()
{

}

CClientContact::~CClientContact()
{

}

CString CClientContact::GetClientID()
{
	return clientID;
}
CString	CClientContact::GetContactSubject()
{
	return contactSubject;
}
CString	CClientContact::GetContactCondition()
{
	return contactCondition;
}
CString	CClientContact::GetContactSummary()
{
	return contactSummary;
}
CString	CClientContact::GetContactResult()
{
	return contactResult;
}
CString	CClientContact::GetContactID()
{
	return contactID;
}
CString	CClientContact::GetClientStaff()
{
	return clientStaff;
}
CString	CClientContact::GetOurStaff()
{
	return ourStaff;
}
COleDateTime	CClientContact::GetContactDate()
{
	return contactDate;
}

void CClientContact::SetClientID(CString vClientID)
{
	clientID=vClientID;
}
void CClientContact::SetContactSubject(CString vContactSubject)
{
	contactSubject=vContactSubject;
}
void CClientContact::SetContactCondition(CString vContactCondition)
{
	contactCondition=vContactCondition;
}
void CClientContact::SetContactSummary(CString vContactSummary)
{
	contactSummary=vContactSummary;
}
void CClientContact::SetContactResult(CString	vContactResult)
{
	contactResult=vContactResult;
}
void CClientContact::SetClientStaff(CString vClientStaff)
{
	clientStaff=vClientStaff;
}
void CClientContact::SetOurStaff(CString vOurStaff)
{
	ourStaff=vOurStaff;
}
void CClientContact::SetContactDate(COleDateTime vContactDate)
{
	contactDate=vContactDate;
}
void CClientContact::SetContactID(CString vContactID)
{
	contactID=vContactID;
}
void CClientContact::sqlInsert()
{

	CString strSQL;

	strSQL="select * from clientContact";
	_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("clientID",_variant_t(clientID.Left(25)));
		m_pRecordset->PutCollect("contactID",_variant_t(contactID.Left(25)));
		m_pRecordset->PutCollect("contactDate",_variant_t(contactDate));
		m_pRecordset->PutCollect("ourStaff",_variant_t(ourStaff.Left(50)));
		m_pRecordset->PutCollect("clientStaff",_variant_t(clientStaff.Left(50)));
		m_pRecordset->PutCollect("contactSubject",_variant_t(contactSubject.Left(50)));
		m_pRecordset->PutCollect("contactCondition",_variant_t(contactCondition.Left(100)));
		m_pRecordset->PutCollect("contactSummary",_variant_t(contactSummary.Left(50)));
		m_pRecordset->PutCollect("contactResult",_variant_t(contactResult.Left(50)));
	
		m_pRecordset->Update();
	}
}

void CClientContact::sqlUpdate(CString clientID,CString recordID)
{
	CString strSQL;

	strSQL="select * from clientContact where clientID='";
	strSQL=strSQL+clientID+"' and contactID='"+recordID+"'";
	_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("clientID",_variant_t(clientID.Left(25)));
		m_pRecordset->PutCollect("contactID",_variant_t(contactID.Left(25)));
		m_pRecordset->PutCollect("contactDate",_variant_t(contactDate));
		m_pRecordset->PutCollect("ourStaff",_variant_t(ourStaff.Left(50)));
		m_pRecordset->PutCollect("clientStaff",_variant_t(clientStaff.Left(50)));
		m_pRecordset->PutCollect("contactSubject",_variant_t(contactSubject.Left(50)));
		m_pRecordset->PutCollect("contactCondition",_variant_t(contactCondition.Left(100)));
		m_pRecordset->PutCollect("contactSummary",_variant_t(contactSummary.Left(50)));
		m_pRecordset->PutCollect("contactResult",_variant_t(contactResult.Left(50)));
	
		m_pRecordset->Update();
	}
}

void CClientContact::sqlDelete(CString clientID,CString recordID)
{
	CString strSQL;
	strSQL="delete from clientContact where clientID='";
	strSQL=strSQL+clientID+"' and contactID='"+recordID+"'";
	(((CClientRelationshipApp*)AfxGetApp())->m_pConn)->Execute((_bstr_t)strSQL,NULL,adCmdText);
}

void CClientContact::GetData(CString clientID,CString recordID)
{
	CString strSQL;

	strSQL="select * from clientContact where clientID='";
	strSQL=strSQL+clientID+"' and contactID='"+recordID+"'";
	_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;
		clientID= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("clientID"));
		contactID= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("contactID"));
		contactDate= m_pRecordset->GetCollect("contactDate");
		ourStaff= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("ourStaff"));
		clientStaff= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("clientStaff"));
		contactSubject= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("contactSubject"));
		contactCondition= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("contactCondition"));
		contactSummary= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("contactSummary"));
		contactResult= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("contactResult"));
	
	}
}

⌨️ 快捷键说明

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