SetPathDlg.cpp 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // SetPathDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "SetPathDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // SetPathDlg dialog
  13. SetPathDlg::SetPathDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(SetPathDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(SetPathDlg)
  17. m_server1 = _T("");
  18. m_server2 = _T("");
  19. m_server3 = _T("");
  20. m_server4 = _T("");
  21. m_server5 = _T("");
  22. //}}AFX_DATA_INIT
  23. m_path1 = _T("客户原片(管理软件)$");
  24. m_path2 = _T("修好的片(管理软件)$");
  25. m_path3 = _T("设计好的片(管理软件)$");
  26. m_path4 = _T("精修好的片(管理软件)$");
  27. m_path5 = _T("礼服图片(管理软件)$");
  28. }
  29. void SetPathDlg::DoDataExchange(CDataExchange* pDX)
  30. {
  31. CDialog::DoDataExchange(pDX);
  32. //{{AFX_DATA_MAP(SetPathDlg)
  33. DDX_Text(pDX, IDC_server1, m_server1);
  34. DDX_Text(pDX, IDC_server2, m_server2);
  35. DDX_Text(pDX, IDC_server3, m_server3);
  36. DDX_Text(pDX, IDC_server4, m_server4);
  37. DDX_Text(pDX, IDC_path1, m_path1);
  38. DDX_Text(pDX, IDC_path2, m_path2);
  39. DDX_Text(pDX, IDC_path3, m_path3);
  40. DDX_Text(pDX, IDC_path4, m_path4);
  41. DDX_Text(pDX, IDC_path5, m_path5);
  42. DDX_Text(pDX, IDC_server5, m_server5);
  43. //}}AFX_DATA_MAP
  44. }
  45. BEGIN_MESSAGE_MAP(SetPathDlg, CDialog)
  46. //{{AFX_MSG_MAP(SetPathDlg)
  47. ON_WM_CTLCOLOR()
  48. //}}AFX_MSG_MAP
  49. END_MESSAGE_MAP()
  50. /////////////////////////////////////////////////////////////////////////////
  51. // SetPathDlg message handlers
  52. BOOL SetPathDlg::OnInitDialog()
  53. {
  54. CDialog::OnInitDialog();
  55. // TODO: Add extra initialization here
  56. g_sendhead.bsql = 0;
  57. g_sendhead.code[0] = 29;
  58. g_sendhead.tabcount = 1;
  59. g_pMainWnd->ProcessChatMessageRequest2(23);
  60. if (g_bSendOK == 0)
  61. {
  62. CDialog::OnCancel();
  63. return 1;
  64. }
  65. CArray<CStringArray, CStringArray>patharray;
  66. DataToArray(&patharray);
  67. if (patharray.GetSize())
  68. {
  69. m_server1 = patharray.ElementAt(0).ElementAt(0);
  70. m_server2 = patharray.ElementAt(0).ElementAt(1);
  71. m_server3 = patharray.ElementAt(0).ElementAt(2);
  72. m_server4 = patharray.ElementAt(0).ElementAt(3);
  73. m_server5 = patharray.ElementAt(0).ElementAt(4);
  74. UpdateData(false);
  75. }
  76. CenterWindow(g_pMainWnd);
  77. return TRUE; // return TRUE unless you set the focus to a control
  78. // EXCEPTION: OCX Property Pages should return FALSE
  79. }
  80. void SetPathDlg::OnOK()
  81. {
  82. // TODO: Add extra validation here
  83. UpdateData();
  84. CString sql;
  85. sql = "update path set path1='" + m_server1 + "',path2='" + m_server2 + "',path3='" + m_server3 + "',path4='" + m_server4 + "',path5='" + m_server5 + "' ";
  86. g_sendhead.bsql = 1;
  87. g_pMainWnd->ProcessChatMessageRequest2(sql);
  88. if (g_bSendOK == 0)return;
  89. AfxMessageBox("保存成功,重启软件生效!", MB_ICONINFORMATION);
  90. CDialog::OnOK();
  91. }
  92. HBRUSH SetPathDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
  93. {
  94. HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
  95. // TODO: Change any attributes of the DC here
  96. if (nCtlColor == CTLCOLOR_STATIC && pWnd->GetDlgCtrlID() == IDC_STATIC1)
  97. {
  98. pDC->SetBkMode(TRANSPARENT); //设置字体背景为透明
  99. return (HBRUSH)::GetStockObject(NULL_BRUSH); // 设置背景色
  100. }
  101. // TODO: Return a different brush if the default is not desired
  102. return hbr;
  103. }