42 lines
1.0 KiB
C++
42 lines
1.0 KiB
C++
|
|
#include "StdAfx.h"
|
|
#include "ShopDBProcFactory.h"
|
|
#include "public/ShopDefine.h"
|
|
|
|
CShopDBProcFactory::CShopDBProcFactory()
|
|
:m_pShopDBProc(NULL)
|
|
,m_pConnection_Shop(NULL)
|
|
{
|
|
|
|
}
|
|
|
|
CShopDBProcFactory::~CShopDBProcFactory()
|
|
{
|
|
if(m_pShopDBProc) delete m_pShopDBProc, m_pShopDBProc = NULL;
|
|
if(m_pConnection_Shop) delete m_pConnection_Shop, m_pConnection_Shop = NULL;
|
|
}
|
|
|
|
CBaseShopDBProc * CShopDBProcFactory::GetShopDBProc(long GameCode)
|
|
{
|
|
return m_pShopDBProc;
|
|
}
|
|
|
|
bool CShopDBProcFactory::SetDBConnectionInfo(char* strIP,
|
|
UINT nPortNum,
|
|
char* szDbName,
|
|
char* szID,
|
|
char* szPwd,
|
|
long lTimeOut,
|
|
bool bDBConnect)
|
|
{
|
|
if(NULL == m_pConnection_Shop) { m_pConnection_Shop = new CAdoDBProc; }
|
|
if(NULL == m_pShopDBProc) { m_pShopDBProc = new CBaseShopDBProc; }
|
|
|
|
if(!m_pConnection_Shop->SetConnectionInfo(strIP, nPortNum, szDbName, szID, szPwd, lTimeOut, bDBConnect))
|
|
return false;
|
|
|
|
m_pShopDBProc->SetAdoProc(m_pConnection_Shop);
|
|
|
|
return true;
|
|
}
|