DBServerDlg.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. // DBServerDlg.h : header file
  2. //
  3. #if !defined(AFX_APPLICATIONDLG_H__D3E3BA87_EEFA_11D5_AB1C_00D0B70C3D79__INCLUDED_)
  4. #define AFX_APPLICATIONDLG_H__D3E3BA87_EEFA_11D5_AB1C_00D0B70C3D79__INCLUDED_
  5. #if _MSC_VER > 1000
  6. #pragma once
  7. #endif // _MSC_VER > 1000 GenSPhoto
  8. #include "TracePage.h"
  9. #include "OnlineUsersPage.h"
  10. #include "ConfigurationPage.h"
  11. #include "StatisticsPage.h"
  12. #include "SecurityPage.h"
  13. #include "DialogResize.h"
  14. #include "FTPEventSink.h"
  15. #include "InfobarCtrl.h"
  16. #include "TrayIcon.h"
  17. class CDBServerDlg : public CDialog, CFTPEventSink
  18. {
  19. CString m_bakserver5;
  20. HINSTANCE hInst;
  21. CTrayIcon m_TrayIcon;
  22. // Construction
  23. public:
  24. void GenYLGL();
  25. void ManagePhoto();
  26. void RestoreHQ();
  27. void CheckConnCount();
  28. void AddOneConn();
  29. void AddAdoConn();
  30. //备份
  31. void AutoDelBakPhoto();
  32. void BakPhoto();
  33. BOOL DelPhoto1(CString path, CString id);
  34. void AutoDelPhoto();
  35. //自动生成s或m缩略图
  36. void LoadThumbImages();
  37. BOOL TerminateThread();
  38. //void LoadDB();
  39. void LoadHistoryDB(); // Jeff加载历史数据库;
  40. void GenUPhoneData();
  41. void CheckRegCode(); //
  42. CString GetRegCode(int m_id, int m_time1, int m_time2);
  43. void CheckBakState();
  44. void CheckMemberMsg();
  45. void LoadBranchInfo2();
  46. void ReleaseBranchDB();
  47. void LoadBranchInfo();
  48. void UpdateBalance();
  49. void GetFileDate();
  50. void OnExit2();
  51. void MyExitWindows();
  52. void ShutDown();
  53. void UpdateDate();
  54. void MyExecuteSQL(CDatabase* pdb, CString sql);
  55. BOOL CheckSendReg(CDatabase *pdb1, CDatabase *pdb2, CString id);
  56. BOOL CheckDinDanExist(CDatabase *pdb1, CDatabase *pdb2, CString id, CStringArray *pretarray);
  57. BOOL CheckPayOutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  58. BOOL CheckIncomeExist(CDatabase *pdb1, CDatabase *pdb2, CString id, CStringArray *pretarray);
  59. BOOL CheckIncomeMoneyExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  60. int TransDinDan(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  61. BOOL TransPayOut(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  62. BOOL TransIncome(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  63. BOOL TransIncomeMoney(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  64. BOOL Checkclient2phonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  65. BOOL Transclient2phonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  66. BOOL Checkclient2phonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  67. BOOL Transclient2phonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  68. BOOL Checkclient3phonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  69. BOOL Transclient3phonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  70. BOOL Checkclient3phonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  71. BOOL Transclient3phonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  72. BOOL CheckemployeephonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  73. BOOL Transemployeephonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  74. BOOL CheckemployeephonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  75. BOOL Transemployeephonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  76. BOOL CheckphonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  77. BOOL Transphonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  78. BOOL CheckphonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  79. BOOL Transphonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  80. BOOL CheckunknownphonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  81. BOOL Transunknownphonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  82. BOOL CheckunknownphonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  83. BOOL Transunknownphonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  84. BOOL CheckmisscallrecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  85. BOOL Transmisscallrecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  86. BOOL TransSendReg(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  87. //OK文件是否存在
  88. BOOL CheckOkFileExistence(const CString& strPath, CStringArray& arr);
  89. CDatabase* GetDB(int year);
  90. void CheckYear(int year);
  91. void CheckHistoryData(CDatabase *pSrcdb=NULL, int nSrcYear=0, BOOL bMode2=0);
  92. void InitLia();
  93. bool m_bRunning; // Flag to whether thread is on running or not
  94. bool m_bTerminate; // Flag to Thread to be terminated
  95. unsigned int m_dwThreadID; // Thread ID
  96. HANDLE m_hThread; // Thread and Event handle
  97. BOOL m_bNetWorkOK;
  98. void RunTimer();
  99. void StopTimer();
  100. CDBServerDlg(CWnd* pParent = NULL); // standard constructor
  101. virtual ~CDBServerDlg();
  102. CTracePage m_TracePage;
  103. COnlineUsersPage m_OnlineUsersPage;
  104. CConfigurationPage m_ConfigurationPage;
  105. CStatisticsPage m_StatisticsPage;
  106. CSecurityPage m_SecurityPage;
  107. // Dialog Data
  108. enum { IDD = IDD_APPLICATION };
  109. CInfobarCtrl m_InfobarCtrl;
  110. CListCtrl m_OutlookBar;
  111. //}}AFX_DATA
  112. // ClassWizard generated virtual function overrides
  113. public:
  114. virtual BOOL PreTranslateMessage(MSG* pMsg);
  115. protected:
  116. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  117. //}}AFX_VIRTUAL
  118. public:
  119. BOOL m_bStartCheckSvc; // 是否已启动检查服务线程
  120. HANDLE m_hExitCheckSvc; // 退出检查服务
  121. HANDLE m_hWaitTimeOut; // 等待超时
  122. HANDLE m_hCheckSvcThread; // 检查服务
  123. // 检查服务工作
  124. static unsigned int WINAPI CheckSvcWork(LPVOID LPARAM);
  125. // 结束检查工作
  126. void TerminateCheckWork();
  127. // 启动服务
  128. int StartSvc( IN LPCSTR lpExeFile);
  129. // 停止服务
  130. int StopSvc( IN LPCSTR lpSvcName);
  131. // Implementation
  132. protected:
  133. char* FormatSize(DWORD dwSizeLow, DWORD dwSizeHigh);
  134. void SetOnlineLed(BOOL bOnline);
  135. void SetOfflineLed(BOOL bOffline);
  136. BOOL m_bInitialized;
  137. HICON m_hIcon;
  138. void SetupOutlookBar();
  139. CImageList m_ImageList;
  140. void MoveChilds();
  141. void ActivatePage(int nIndex);
  142. BOOL ServerStart();
  143. BOOL CreateStatusbar();
  144. CStatusBar m_wndStatusBar;
  145. CToolBar m_wndToolBar;
  146. // Generated message map functions
  147. virtual BOOL OnInitDialog();
  148. afx_msg void OnButton1();
  149. afx_msg void OnDestroy();
  150. afx_msg void OnServerStart();
  151. afx_msg void OnUpdateServerStart(CCmdUI* pCmdUI);
  152. afx_msg void OnServerStop();
  153. afx_msg void OnUpdateServerStop(CCmdUI* pCmdUI);
  154. afx_msg void OnServerExit();
  155. afx_msg void OnClickOutlookBar(NMHDR* pNMHDR, LRESULT* pResult);
  156. afx_msg void OnKeydownOutlookBar(NMHDR* pNMHDR, LRESULT* pResult);
  157. afx_msg void OnUserAccounts();
  158. afx_msg void OnClose();
  159. afx_msg void OnViewTrace();
  160. afx_msg void OnViewOnlineUsers();
  161. afx_msg void OnViewConfiguration();
  162. afx_msg void OnUpdateViewTrace(CCmdUI* pCmdUI);
  163. afx_msg void OnUpdateViewOnlineUsers(CCmdUI* pCmdUI);
  164. afx_msg void OnUpdateViewConfiguration(CCmdUI* pCmdUI);
  165. afx_msg void OnApply();
  166. afx_msg void OnViewStatistics();
  167. afx_msg void OnUpdateViewStatistics(CCmdUI* pCmdUI);
  168. afx_msg void OnViewSecurity();
  169. afx_msg void OnUpdateViewSecurity(CCmdUI* pCmdUI);
  170. afx_msg void OnAccountWizard();
  171. virtual void OnCancel();
  172. virtual void OnOK();
  173. afx_msg void OnTimer(UINT nIDEvent);
  174. afx_msg void OnOpen();
  175. afx_msg void OnExit();
  176. afx_msg void OnAutorun();
  177. afx_msg void OnStartBackupSvc();
  178. afx_msg void OnStopBackupSvc();
  179. afx_msg void OnStartDelPhotoSvc();
  180. afx_msg void OnStopDelPhotoSvc();
  181. afx_msg void OnAutoCheckSvc();
  182. //}}AFX_MSG
  183. LRESULT OnTrayNotification(WPARAM wParam,LPARAM lParam);
  184. LRESULT OnAbortClose(WPARAM wParam, LPARAM lParam);
  185. LRESULT OnFtpStatistic(WPARAM wParam, LPARAM lParam);
  186. DECLARE_MESSAGE_MAP()
  187. virtual void OnFTPUserConnected(DWORD nThreadID, LPCTSTR lpszUser, LPCSTR lpszAddress);
  188. virtual void OnFTPUserDisconnected(DWORD nThreadID, LPCTSTR lpszUser);
  189. virtual void OnFTPStatusChange(int nType, LPCTSTR lpszText);
  190. virtual void OnFTPReceivedBytesChange(int nBytes);
  191. virtual void OnFTPSentBytesChange(int nBytes);
  192. virtual void OnFTPStatisticChange(int nType, int nValue);
  193. };
  194. //{{AFX_INSERT_LOCATION}}
  195. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  196. #endif // !defined(AFX_APPLICATIONDLG_H__D3E3BA87_EEFA_11D5_AB1C_00D0B70C3D79__INCLUDED_)