12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #ifndef _MULTIBRANCHINFO_HEADER_
- #define _MULTIBRANCHINFO_HEADER_
- //#include "Global.h"
- #include "BranchInfo.h"
- #pragma once
- class CMultiBranchInfo
- {
- CMultiBranchInfo(void);
- public:
- ~CMultiBranchInfo(void);
- static CMultiBranchInfo* GetInstance()
- {
- static CMultiBranchInfo tagInstance;
- return &tagInstance;
- }
- protected:
- CBranchInfo *m_pOurBranchInfo;
- static TCHAR m_szOurBranchId[MAX_PATH]; // 本店域名;
- typedef vector<CBranchInfo*> MULTBRANCH;
- MULTBRANCH m_vtMultiBranchInfo;
- void RemoveAllBranchInf();
- BOOL IsBranchInfoExists(IN CONST CBranchInfo* pBranchInfo);
- BOOL IsCatalogExists(IN LPCTSTR lpConnectString);
- public:
- static INT FindPortEx(int start, BYTE *InByte, int InLen, char *OutPath);
- static BOOL GetOurBranchId();
- const CBranchInfo* GetOurBranchInfo(){return m_pOurBranchInfo;}
- #if TEST_CREATE_DIRECTORY // 测试接口,当没有加密狗时,将硬件的域名设置为数据库的域名;
- void SetTestBranchId(LPCTSTR lpBranchId){_stprintf_s(m_szOurBranchId,_T("%s"),lpBranchId);}
- #endif
-
- public:
- // 1.设置本店域名;
- inline void SetOurBranchId(IN LPCTSTR lpOurBranchId)
- {
- if(_tcscmp(m_szOurBranchId,_T("")) == 0)
- _stprintf_s(m_szOurBranchId,lpOurBranchId);
- }
- LPCTSTR GetOurBranchDomain(){return m_szOurBranchId;}
- // 2.添加分店信息;
- BOOL AddBranchInfo(
- IN CONST DWORD &dwCatalogPort,
- IN LPCTSTR lpCatalogSource,
- IN LPCTSTR lpCatalogAccount,
- IN LPCTSTR lpCatalogPsw,
- IN LPCTSTR lpCatalogName);
- CBranchInfo* GetOurBranchObj();
- CBranchInfo* GetBranchObj(IN LPCTSTR lpBranchId);
- BOOL GetTblVersion(IN LPCTSTR lpBranchId, OUT CArray<CStringArray,CStringArray> &AryOfValues);
-
- };
- #endif
|