#pragma once #include "MBWatchDef.h" /************************************************************************/ /* mb_watch.db Á¬½Ó /************************************************************************/ class CMBWatchDBConnect : public CDBConnect { public: CMBWatchDBConnect(); virtual ~CMBWatchDBConnect(); // Attributers public: CString m_strLogin; // User Login Name CString m_strServerID; // Server ID CString m_strDBFile; // DB File Name private: int m_nAddRef; BOOL m_bOpenDB; // Operations public: BOOL OpenDB( CString strLogin,CString strPassword, CString strServerID,BOOL bCheckFile, BOOL &bFirstDB ); BOOL CloseDB(); BOOL IsThisDB( CString strLogin, CString strServerID ); CString GetTemplateDBFile( ); void AddRef(); void Release(); BOOL IsDBOpen(){return m_bOpenDB;}; }; /************************************************************************/ /* mb_watch.db¹ÜÀí /************************************************************************/ class AFX_EXT_CLASS CMBWatchDBMgr { public: CMBWatchDBMgr(void); ~CMBWatchDBMgr(void); private: CString m_strLogin; // User Login Name CString m_strServerID; // Server ID BOOL m_bIsCloseDB; CStringArray m_arBatchSql; private: CMBWatchDBConnect *m_pDBConnect; public: BOOL Logined( CString strLogin, CString strPassword, CString strServerID, BOOL &bFirstDB, BOOL bCheckFile = FALSE); BOOL GetDBVersion( int &dwVersion ); BOOL SetDBVersion( int dwVersion ); BOOL UpdateNewDBTableInfo(int nVer ); void CleanDBConnect(); BOOL IsDBOpen(); CMBWatchDBConnect* GetWatchDBConnect( ); BOOL UpdatePropStringData( CString strPropClass, CString strPropName, int nPropVer,CString strPropValue, CString strPropExtValue ); BOOL GetPropStringData(CString strPropClass, CString strPropName, int &nPropVer,CString &strPropValue, CString &strPropExtValue ); public: void WriteLog(CString strLog ); public: BOOL GetBackupDirChangeCMD(CArraySyncDirCmd &arBackupDirCmd,bool bFirst = false ); BOOL GetBackupDirChangeFailedCMD(CArraySyncDirCmd &arBackupDirCmd ); BOOL UpdateBackupDirChangeCMD( CString strGUID, int nState, CString strErr = _T(""), int nErrID = 0); BOOL ResetBackupDirChangeCMD( CString strGUID, CString strFilePath, CString strOperateType, CString strFileParam =_T("")); BOOL RemoveBackupDirChangeCMD( CString strGUID); BOOL RemoveBackupDirCMD( CString strDir); BOOL RemoveAllBackupDirFailedCMD( ); BOOL ResetAllBackupDirFailedCMD( ); BOOL ResetBackupDirCMDInitState(CString strGUID ); BOOL InsertChangeDirCMD(CString strFilePath, CString strOperateType, CString strFileParam ); BOOL ResetBackupDirAllCMD( ); public: BOOL GetBackupDirInfo(CArraySyncDirInfo &arBackupDirInfo ); BOOL NewBackupDirInfoToDB(CString strRootGUID, CString strGUID,CString strName,int nType, CString strDir); BOOL RemoveBackupDirInfo( CString strRootGUID,CString strGUID,int nType); BOOL RenameBackupDirInfo( CString strRootGUID, CString strGUID,CString strName,int nType); BOOL BatchRunSQL( CStringArray &arSQL); };