123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- // SetPathDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "SetPathDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // SetPathDlg dialog
- SetPathDlg::SetPathDlg(CWnd* pParent /*=NULL*/)
- : CDialog(SetPathDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(SetPathDlg)
- m_server1 = _T("");
- m_server2 = _T("");
- m_server3 = _T("");
- m_server4 = _T("");
- m_server5 = _T("");
- //}}AFX_DATA_INIT
- m_path1 = _T("客户原片(管理软件)$");
- m_path2 = _T("修好的片(管理软件)$");
- m_path3 = _T("设计好的片(管理软件)$");
- m_path4 = _T("精修好的片(管理软件)$");
- m_path5 = _T("礼服图片(管理软件)$");
- }
- void SetPathDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(SetPathDlg)
- 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);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(SetPathDlg, CDialog)
- //{{AFX_MSG_MAP(SetPathDlg)
- ON_WM_CTLCOLOR()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // SetPathDlg message handlers
- BOOL SetPathDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- 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);
- m_server2 = patharray.ElementAt(0).ElementAt(1);
- m_server3 = patharray.ElementAt(0).ElementAt(2);
- m_server4 = patharray.ElementAt(0).ElementAt(3);
- m_server5 = patharray.ElementAt(0).ElementAt(4);
- UpdateData(false);
- }
- CenterWindow(g_pMainWnd);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void SetPathDlg::OnOK()
- {
- // TODO: Add extra validation here
- UpdateData();
- CString sql;
- sql = "update path set path1='" + m_server1 + "',path2='" + m_server2 + "',path3='" + m_server3 + "',path4='" + m_server4 + "',path5='" + m_server5 + "' ";
- g_sendhead.bsql = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)return;
- AfxMessageBox("保存成功,重启软件生效!", MB_ICONINFORMATION);
- CDialog::OnOK();
- }
- HBRUSH SetPathDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
- // TODO: Change any attributes of the DC here
- if (nCtlColor == CTLCOLOR_STATIC && pWnd->GetDlgCtrlID() == IDC_STATIC1)
- {
- pDC->SetBkMode(TRANSPARENT); //设置字体背景为透明
- return (HBRUSH)::GetStockObject(NULL_BRUSH); // 设置背景色
- }
- // TODO: Return a different brush if the default is not desired
- return hbr;
- }
|