123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #include "stdafx.h"
- #include "ylgl.h"
- #include "SetPathDlg2.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- SetPathDlg2::SetPathDlg2(CWnd* pParent )
- : CDialog(SetPathDlg2::IDD, pParent)
- {
-
- m_server1 = _T("");
- m_server2 = _T("");
- m_server3 = _T("");
- m_server4 = _T("");
- m_server5 = _T("");
-
- }
- void SetPathDlg2::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
-
- DDX_Text(pDX, IDC_server1, m_server1);
- DDX_Text(pDX, IDC_server2, m_server2);
- DDX_Text(pDX, IDC_server3, m_server3);
- DDX_Text(pDX, IDC_server4, m_server4);
- DDX_Text(pDX, IDC_path1, m_path1);
- DDX_Text(pDX, IDC_path2, m_path2);
- DDX_Text(pDX, IDC_path3, m_path3);
- DDX_Text(pDX, IDC_path4, m_path4);
- DDX_Text(pDX, IDC_path5, m_path5);
- DDX_Text(pDX, IDC_server5, m_server5);
-
- }
- BEGIN_MESSAGE_MAP(SetPathDlg2, CDialog)
-
- ON_WM_CTLCOLOR()
-
- END_MESSAGE_MAP()
- BOOL SetPathDlg2::OnInitDialog()
- {
- CDialog::OnInitDialog();
- #ifdef ENTERPRISE_VERSION
- ((CEdit*)GetDlgItem(IDC_server1))->SetReadOnly ();
- #endif
-
- g_sendhead.bsql=0;
- g_sendhead.code[0]=29;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(23);
- if(g_bSendOK==0)
- {
- CDialog::OnCancel();
- return 1;
- }
- CArray<CStringArray, CStringArray>patharray;
- DataToArray(&patharray);
- if(patharray.GetSize())
- {
- m_server1=patharray.ElementAt(0).ElementAt(0);
- if(m_server1.Find (".ly.com")==-1)m_server1.Empty ();
- UpdateData(false);
- }
- CenterWindow(g_pMainWnd);
- return false;
-
- }
- void SetPathDlg2::OnOK()
- {
-
- #ifndef ENTERPRISE_VERSION
- UpdateData();
- m_server1.MakeLower ();
- CString sql;
- sql= "update path set path1='"+m_server1+"'";
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if(g_bSendOK==0)return;
- AfxMessageBox("保存成功!", MB_ICONINFORMATION);
- #endif
- CDialog::OnOK();
- }
- HBRUSH SetPathDlg2::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
-
-
- if (nCtlColor==CTLCOLOR_STATIC && pWnd->GetDlgCtrlID ()==IDC_STATIC1)
- {
- pDC-> SetBkMode(TRANSPARENT);
- return (HBRUSH)::GetStockObject(NULL_BRUSH);
- }
-
- return hbr;
- }
|