DBServerDlg.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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. void MyExecuteSQL(const TCHAR* pfile, const int& nline, const TCHAR* pfunction, CDatabase* pdb, CString sql);
  56. BOOL CheckSendReg(CDatabase *pdb1, CDatabase *pdb2, CString id);
  57. BOOL CheckDinDanExist(CDatabase *pdb1, CDatabase *pdb2, CString id, CStringArray *pretarray);
  58. BOOL CheckPayOutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  59. BOOL CheckIncomeExist(CDatabase *pdb1, CDatabase *pdb2, CString id, CStringArray *pretarray);
  60. BOOL CheckIncomeMoneyExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  61. int TransDinDan(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  62. BOOL TransPayOut(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  63. BOOL TransIncome(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  64. BOOL TransIncomeMoney(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  65. BOOL Checkclient2phonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  66. BOOL Transclient2phonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  67. BOOL Checkclient2phonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  68. BOOL Transclient2phonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  69. BOOL Checkclient3phonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  70. BOOL Transclient3phonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  71. BOOL Checkclient3phonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  72. BOOL Transclient3phonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  73. BOOL CheckemployeephonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  74. BOOL Transemployeephonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  75. BOOL CheckemployeephonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  76. BOOL Transemployeephonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  77. BOOL CheckphonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  78. BOOL Transphonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  79. BOOL CheckphonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  80. BOOL Transphonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  81. BOOL CheckunknownphonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  82. BOOL Transunknownphonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  83. BOOL CheckunknownphonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  84. BOOL Transunknownphonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  85. BOOL CheckmisscallrecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  86. BOOL Transmisscallrecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  87. BOOL TransSendReg(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  88. //OK文件是否存在
  89. BOOL CheckOkFileExistence(const CString& strPath, CStringArray& arr);
  90. CDatabase* GetDB(int year);
  91. void CheckYear(int year);
  92. void CheckHistoryData(CDatabase *pSrcdb=NULL, int nSrcYear=0, BOOL bMode2=0);
  93. void InitLia();
  94. bool m_bRunning; // Flag to whether thread is on running or not
  95. bool m_bTerminate; // Flag to Thread to be terminated
  96. unsigned int m_dwThreadID; // Thread ID
  97. HANDLE m_hThread; // Thread and Event handle
  98. BOOL m_bNetWorkOK;
  99. void RunTimer();
  100. void StopTimer();
  101. CDBServerDlg(CWnd* pParent = NULL); // standard constructor
  102. virtual ~CDBServerDlg();
  103. CTracePage m_TracePage;
  104. COnlineUsersPage m_OnlineUsersPage;
  105. CConfigurationPage m_ConfigurationPage;
  106. CStatisticsPage m_StatisticsPage;
  107. CSecurityPage m_SecurityPage;
  108. // Dialog Data
  109. enum { IDD = IDD_APPLICATION };
  110. CInfobarCtrl m_InfobarCtrl;
  111. CListCtrl m_OutlookBar;
  112. //}}AFX_DATA
  113. // ClassWizard generated virtual function overrides
  114. public:
  115. virtual BOOL PreTranslateMessage(MSG* pMsg);
  116. protected:
  117. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  118. //}}AFX_VIRTUAL
  119. public:
  120. BOOL m_bStartCheckSvc; // 是否已启动检查服务线程
  121. HANDLE m_hExitCheckSvc; // 退出检查服务
  122. HANDLE m_hWaitTimeOut; // 等待超时
  123. HANDLE m_hCheckSvcThread; // 检查服务
  124. // 检查服务工作
  125. static unsigned int WINAPI CheckSvcWork(LPVOID LPARAM);
  126. // 结束检查工作
  127. void TerminateCheckWork();
  128. // 启动服务
  129. int StartSvc( IN LPCSTR lpExeFile);
  130. // 停止服务
  131. int StopSvc( IN LPCSTR lpSvcName);
  132. // Implementation
  133. protected:
  134. char* FormatSize(DWORD dwSizeLow, DWORD dwSizeHigh);
  135. void SetOnlineLed(BOOL bOnline);
  136. void SetOfflineLed(BOOL bOffline);
  137. BOOL m_bInitialized;
  138. HICON m_hIcon;
  139. void SetupOutlookBar();
  140. CImageList m_ImageList;
  141. void MoveChilds();
  142. void ActivatePage(int nIndex);
  143. BOOL ServerStart();
  144. BOOL CreateStatusbar();
  145. CStatusBar m_wndStatusBar;
  146. CToolBar m_wndToolBar;
  147. // Generated message map functions
  148. virtual BOOL OnInitDialog();
  149. afx_msg void OnButton1();
  150. afx_msg void OnDestroy();
  151. afx_msg void OnServerStart();
  152. afx_msg void OnUpdateServerStart(CCmdUI* pCmdUI);
  153. afx_msg void OnServerStop();
  154. afx_msg void OnUpdateServerStop(CCmdUI* pCmdUI);
  155. afx_msg void OnServerExit();
  156. afx_msg void OnClickOutlookBar(NMHDR* pNMHDR, LRESULT* pResult);
  157. afx_msg void OnKeydownOutlookBar(NMHDR* pNMHDR, LRESULT* pResult);
  158. afx_msg void OnUserAccounts();
  159. afx_msg void OnClose();
  160. afx_msg void OnViewTrace();
  161. afx_msg void OnViewOnlineUsers();
  162. afx_msg void OnViewConfiguration();
  163. afx_msg void OnUpdateViewTrace(CCmdUI* pCmdUI);
  164. afx_msg void OnUpdateViewOnlineUsers(CCmdUI* pCmdUI);
  165. afx_msg void OnUpdateViewConfiguration(CCmdUI* pCmdUI);
  166. afx_msg void OnApply();
  167. afx_msg void OnViewStatistics();
  168. afx_msg void OnUpdateViewStatistics(CCmdUI* pCmdUI);
  169. afx_msg void OnViewSecurity();
  170. afx_msg void OnUpdateViewSecurity(CCmdUI* pCmdUI);
  171. afx_msg void OnAccountWizard();
  172. virtual void OnCancel();
  173. virtual void OnOK();
  174. afx_msg void OnTimer(UINT nIDEvent);
  175. afx_msg void OnOpen();
  176. afx_msg void OnExit();
  177. afx_msg void OnAutorun();
  178. afx_msg void OnStartBackupSvc();
  179. afx_msg void OnStopBackupSvc();
  180. afx_msg void OnStartDelPhotoSvc();
  181. afx_msg void OnStopDelPhotoSvc();
  182. afx_msg void OnAutoCheckSvc();
  183. //}}AFX_MSG
  184. LRESULT OnTrayNotification(WPARAM wParam,LPARAM lParam);
  185. LRESULT OnAbortClose(WPARAM wParam, LPARAM lParam);
  186. LRESULT OnFtpStatistic(WPARAM wParam, LPARAM lParam);
  187. DECLARE_MESSAGE_MAP()
  188. virtual void OnFTPUserConnected(DWORD nThreadID, LPCTSTR lpszUser, LPCSTR lpszAddress);
  189. virtual void OnFTPUserDisconnected(DWORD nThreadID, LPCTSTR lpszUser);
  190. virtual void OnFTPStatusChange(int nType, LPCTSTR lpszText);
  191. virtual void OnFTPReceivedBytesChange(int nBytes);
  192. virtual void OnFTPSentBytesChange(int nBytes);
  193. virtual void OnFTPStatisticChange(int nType, int nValue);
  194. public:
  195. static DWORD WINAPI ThreadCallerElves(LPVOID lpPara);
  196. };
  197. //{{AFX_INSERT_LOCATION}}
  198. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  199. #endif // !defined(AFX_APPLICATIONDLG_H__D3E3BA87_EEFA_11D5_AB1C_00D0B70C3D79__INCLUDED_)