SelMsgContent.cpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // SelMsgContent.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "SelMsgContent.h"
  6. #include "SelMsgContent2.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // SelMsgContent dialog
  14. SelMsgContent::SelMsgContent(CWnd* pParent /*=NULL*/)
  15. : CDialog(SelMsgContent::IDD, pParent)
  16. {
  17. //{{AFX_DATA_INIT(SelMsgContent)
  18. m_content = _T("");
  19. //}}AFX_DATA_INIT
  20. }
  21. void SelMsgContent::DoDataExchange(CDataExchange* pDX)
  22. {
  23. CDialog::DoDataExchange(pDX);
  24. //{{AFX_DATA_MAP(SelMsgContent)
  25. DDX_Control(pDX, IDC_LIST1, m_List1);
  26. DDX_Text(pDX, IDC_EDIT1, m_content);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(SelMsgContent, CDialog)
  30. //{{AFX_MSG_MAP(SelMsgContent)
  31. ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1)
  32. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  33. //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // SelMsgContent message handlers
  37. BOOL SelMsgContent::OnInitDialog()
  38. {
  39. CDialog::OnInitDialog();
  40. // TODO: Add extra initialization here
  41. g_sendhead.bsql=0;
  42. g_sendhead.code[0]=134;
  43. g_sendhead.tabcount=1;
  44. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return false;
  45. DataToArray(&m_List1array);
  46. for(int i=0; i<m_List1array.GetSize (); i++)
  47. {
  48. m_List1.AddString (m_List1array.ElementAt (i).ElementAt (0));
  49. }
  50. CenterWindow();
  51. return TRUE; // return TRUE unless you set the focus to a control
  52. // EXCEPTION: OCX Property Pages should return FALSE
  53. }
  54. void SelMsgContent::OnOK()
  55. {
  56. // TODO: Add extra validation here
  57. UpdateData();
  58. CDialog::OnOK();
  59. }
  60. void SelMsgContent::OnSelchangeList1()
  61. {
  62. // TODO: Add your control notification handler code here
  63. int pos=m_List1.GetCurSel ();
  64. if(pos==-1)return;
  65. CString companyname=g_cominfoarray.ElementAt (0).ElementAt (10);
  66. CString phone=g_cominfoarray.ElementAt (0).ElementAt (11);
  67. m_content=m_List1array.ElementAt (pos).ElementAt (1);
  68. m_content.Replace ("[¹«Ë¾Ãû³Æ]", companyname);
  69. m_content.Replace ("[µç»°]", phone);
  70. UpdateData(false);
  71. }
  72. void SelMsgContent::OnButton1()
  73. {
  74. // TODO: Add your control notification handler code here
  75. SelMsgContent2 dlg;
  76. dlg.DoModal ();
  77. g_sendhead.bsql=0;
  78. g_sendhead.code[0]=134;
  79. g_sendhead.tabcount=1;
  80. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  81. DataToArray(&m_List1array);
  82. m_List1.ResetContent ();
  83. for(int i=0; i<m_List1array.GetSize (); i++)
  84. {
  85. m_List1.AddString (m_List1array.ElementAt (i).ElementAt (0));
  86. }
  87. }