DBServerDlg.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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 AutoDelBakPhoto();
  26. void ManagePhoto();
  27. void RestoreHQ();
  28. void CheckConnCount();
  29. void AddOneConn();
  30. //void LoadDB();
  31. void LoadHistoryDB(); // Jeff¼ÓÔØÀúÊ·Êý¾Ý¿â;
  32. void GenUPhoneData();
  33. void CheckRegCode(); //
  34. CString GetRegCode(int m_id, int m_time1, int m_time2);
  35. void CheckBakState();
  36. void CheckMemberMsg();
  37. BOOL m_bNetWorkOK;
  38. void LoadBranchInfo2();
  39. void ReleaseBranchDB();
  40. void LoadBranchInfo();
  41. void UpdateBalance();
  42. void GetFileDate();
  43. void OnExit2();
  44. void MyExitWindows();
  45. void ShutDown();
  46. void LoadThumbImages2();
  47. void BakPhoto();
  48. BOOL DelPhoto1(CString path, CString id);
  49. void AutoDelPhoto();
  50. void UpdateDate();
  51. void MyExecuteSQL(CDatabase* pdb, CString sql);
  52. BOOL CheckSendReg(CDatabase *pdb1, CDatabase *pdb2, CString id);
  53. BOOL CheckDinDanExist(CDatabase *pdb1, CDatabase *pdb2, CString id, CStringArray *pretarray);
  54. BOOL CheckPayOutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  55. BOOL CheckIncomeExist(CDatabase *pdb1, CDatabase *pdb2, CString id, CStringArray *pretarray);
  56. BOOL CheckIncomeMoneyExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  57. int TransDinDan(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  58. BOOL TransPayOut(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  59. BOOL TransIncome(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  60. BOOL TransIncomeMoney(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  61. BOOL Checkclient2phonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  62. BOOL Transclient2phonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  63. BOOL Checkclient2phonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  64. BOOL Transclient2phonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  65. BOOL Checkclient3phonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  66. BOOL Transclient3phonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  67. BOOL Checkclient3phonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  68. BOOL Transclient3phonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  69. BOOL CheckemployeephonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  70. BOOL Transemployeephonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  71. BOOL CheckemployeephonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  72. BOOL Transemployeephonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  73. BOOL CheckphonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  74. BOOL Transphonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  75. BOOL CheckphonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  76. BOOL Transphonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  77. BOOL CheckunknownphonerecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  78. BOOL Transunknownphonerecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  79. BOOL CheckunknownphonerecordoutExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  80. BOOL Transunknownphonerecordout(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  81. BOOL CheckmisscallrecordExist(CDatabase *pdb1, CDatabase *pdb2, CString id);
  82. BOOL Transmisscallrecord(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  83. BOOL TransSendReg(CDatabase *pdb1, CDatabase *pdb2, CString id, int year);
  84. CDatabase* GetDB(int year);
  85. void CheckYear(int year);
  86. void CheckHistoryData(CDatabase *pSrcdb=NULL, int nSrcYear=0, BOOL bMode2=0);
  87. void InitLia();
  88. bool m_bRunning; // Flag to whether thread is on running or not
  89. bool m_bTerminate; // Flag to Thread to be terminated
  90. unsigned int m_dwThreadID; // Thread ID
  91. HANDLE m_hThread; // Thread and Event handle
  92. bool m_bRunning2; // Flag to whether thread is on running or not
  93. bool m_bTerminate2; // Flag to Thread to be terminated
  94. unsigned int m_dwThreadID2; // Thread ID
  95. HANDLE m_hThread2; // Thread and Event handle
  96. bool m_bRunning3; // Flag to whether thread is on running or not
  97. bool m_bTerminate3; // Flag to Thread to be terminated
  98. unsigned int m_dwThreadID3; // Thread ID
  99. HANDLE m_hThread3; // Thread and Event handle
  100. BOOL TerminateThread();
  101. BOOL TerminateThread2();
  102. void LoadThumbImages();
  103. void RunTimer();
  104. void StopTimer();
  105. CDBServerDlg(CWnd* pParent = NULL); // standard constructor
  106. virtual ~CDBServerDlg();
  107. CTracePage m_TracePage;
  108. COnlineUsersPage m_OnlineUsersPage;
  109. CConfigurationPage m_ConfigurationPage;
  110. CStatisticsPage m_StatisticsPage;
  111. CSecurityPage m_SecurityPage;
  112. // Dialog Data
  113. enum { IDD = IDD_APPLICATION };
  114. CInfobarCtrl m_InfobarCtrl;
  115. CListCtrl m_OutlookBar;
  116. //}}AFX_DATA
  117. // ClassWizard generated virtual function overrides
  118. public:
  119. virtual BOOL PreTranslateMessage(MSG* pMsg);
  120. protected:
  121. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  122. //}}AFX_VIRTUAL
  123. // Implementation
  124. protected:
  125. char* FormatSize(DWORD dwSizeLow, DWORD dwSizeHigh);
  126. void SetOnlineLed(BOOL bOnline);
  127. void SetOfflineLed(BOOL bOffline);
  128. BOOL m_bInitialized;
  129. HICON m_hIcon;
  130. void SetupOutlookBar();
  131. CImageList m_ImageList;
  132. void MoveChilds();
  133. void ActivatePage(int nIndex);
  134. BOOL ServerStart();
  135. BOOL CreateStatusbar();
  136. CStatusBar m_wndStatusBar;
  137. CToolBar m_wndToolBar;
  138. // Generated message map functions
  139. virtual BOOL OnInitDialog();
  140. afx_msg void OnButton1();
  141. afx_msg void OnDestroy();
  142. afx_msg void OnServerStart();
  143. afx_msg void OnUpdateServerStart(CCmdUI* pCmdUI);
  144. afx_msg void OnServerStop();
  145. afx_msg void OnUpdateServerStop(CCmdUI* pCmdUI);
  146. afx_msg void OnServerExit();
  147. afx_msg void OnClickOutlookBar(NMHDR* pNMHDR, LRESULT* pResult);
  148. afx_msg void OnKeydownOutlookBar(NMHDR* pNMHDR, LRESULT* pResult);
  149. afx_msg void OnUserAccounts();
  150. afx_msg void OnClose();
  151. afx_msg void OnViewTrace();
  152. afx_msg void OnViewOnlineUsers();
  153. afx_msg void OnViewConfiguration();
  154. afx_msg void OnUpdateViewTrace(CCmdUI* pCmdUI);
  155. afx_msg void OnUpdateViewOnlineUsers(CCmdUI* pCmdUI);
  156. afx_msg void OnUpdateViewConfiguration(CCmdUI* pCmdUI);
  157. afx_msg void OnApply();
  158. afx_msg void OnViewStatistics();
  159. afx_msg void OnUpdateViewStatistics(CCmdUI* pCmdUI);
  160. afx_msg void OnViewSecurity();
  161. afx_msg void OnUpdateViewSecurity(CCmdUI* pCmdUI);
  162. afx_msg void OnAccountWizard();
  163. virtual void OnCancel();
  164. virtual void OnOK();
  165. afx_msg void OnTimer(UINT nIDEvent);
  166. afx_msg void OnOpen();
  167. afx_msg void OnExit();
  168. afx_msg void OnAutorun();
  169. //}}AFX_MSG
  170. LRESULT OnTrayNotification(WPARAM wParam,LPARAM lParam);
  171. LRESULT OnAbortClose(WPARAM wParam, LPARAM lParam);
  172. LRESULT OnFtpStatistic(WPARAM wParam, LPARAM lParam);
  173. DECLARE_MESSAGE_MAP()
  174. virtual void OnFTPUserConnected(DWORD nThreadID, LPCTSTR lpszUser, LPCSTR lpszAddress);
  175. virtual void OnFTPUserDisconnected(DWORD nThreadID, LPCTSTR lpszUser);
  176. virtual void OnFTPStatusChange(int nType, LPCTSTR lpszText);
  177. virtual void OnFTPReceivedBytesChange(int nBytes);
  178. virtual void OnFTPSentBytesChange(int nBytes);
  179. virtual void OnFTPStatisticChange(int nType, int nValue);
  180. };
  181. //{{AFX_INSERT_LOCATION}}
  182. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  183. #endif // !defined(AFX_APPLICATIONDLG_H__D3E3BA87_EEFA_11D5_AB1C_00D0B70C3D79__INCLUDED_)