TXFG.cpp 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. // ompanyInfo.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "TXFG.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // TXFG dialog
  13. TXFG::TXFG(CWnd* pParent /*=NULL*/)
  14. : CDialog(TXFG::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(TXFG)
  17. m_edit1 = _T("");
  18. m_edit2 = _T("");
  19. m_edit3 = _T("");
  20. m_edit4 = _T("");
  21. m_edit5 = _T("");
  22. m_edit6 = _T("");
  23. m_edit7 = _T("");
  24. m_edit8 = _T("");
  25. m_edit9 = _T("");
  26. m_edit10 = _T("");
  27. m_edit11 = _T("");
  28. m_edit12 = _T("");
  29. //}}AFX_DATA_INIT
  30. }
  31. void TXFG::DoDataExchange(CDataExchange* pDX)
  32. {
  33. CDialog::DoDataExchange(pDX);
  34. //{{AFX_DATA_MAP(TXFG)
  35. DDX_Text(pDX, IDC_EDIT1, m_edit1);
  36. DDX_Text(pDX, IDC_EDIT2, m_edit2);
  37. DDX_Text(pDX, IDC_EDIT3, m_edit3);
  38. DDX_Text(pDX, IDC_EDIT4, m_edit4);
  39. DDX_Text(pDX, IDC_EDIT7, m_edit5);
  40. DDX_Text(pDX, IDC_EDIT8, m_edit6);
  41. DDX_Text(pDX, IDC_EDIT9, m_edit7);
  42. DDX_Text(pDX, IDC_EDIT10, m_edit8);
  43. DDX_Text(pDX, IDC_EDIT11, m_edit9);
  44. DDX_Text(pDX, IDC_EDIT12, m_edit10);
  45. DDX_Text(pDX, IDC_EDIT13, m_edit11);
  46. DDX_Text(pDX, IDC_EDIT14, m_edit12);
  47. //}}AFX_DATA_MAP
  48. }
  49. BEGIN_MESSAGE_MAP(TXFG, CDialog)
  50. //{{AFX_MSG_MAP(TXFG)
  51. //}}AFX_MSG_MAP
  52. END_MESSAGE_MAP()
  53. /////////////////////////////////////////////////////////////////////////////
  54. // TXFG message handlers
  55. BOOL TXFG::OnInitDialog()
  56. {
  57. CDialog::OnInitDialog();
  58. // TODO: Add extra initialization here
  59. g_sendhead.bsql = 0;
  60. g_sendhead.code[0] = 77;
  61. g_sendhead.tabcount = 1;
  62. int g_nYearposTemp = g_nYearpos;
  63. g_nYearpos = -1;
  64. g_pMainWnd->ProcessChatMessageRequest2(1);
  65. g_nYearpos = g_nYearposTemp;
  66. if (g_bSendOK == 0)
  67. {
  68. CDialog::OnCancel();
  69. return 1;
  70. }
  71. DataToArray(&m_List1array);
  72. if (m_List1array.GetSize() == 12)
  73. {
  74. m_edit1 = (m_List1array.ElementAt(0).ElementAt(0));
  75. m_edit2 = (m_List1array.ElementAt(1).ElementAt(0));
  76. m_edit3 = (m_List1array.ElementAt(2).ElementAt(0));
  77. m_edit4 = (m_List1array.ElementAt(3).ElementAt(0));
  78. m_edit5 = (m_List1array.ElementAt(4).ElementAt(0));
  79. m_edit6 = (m_List1array.ElementAt(5).ElementAt(0));
  80. m_edit7 = (m_List1array.ElementAt(6).ElementAt(0));
  81. m_edit8 = (m_List1array.ElementAt(7).ElementAt(0));
  82. m_edit9 = (m_List1array.ElementAt(8).ElementAt(0));
  83. m_edit10 = (m_List1array.ElementAt(9).ElementAt(0));
  84. m_edit11 = (m_List1array.ElementAt(10).ElementAt(0));
  85. m_edit12 = (m_List1array.ElementAt(11).ElementAt(0));
  86. }
  87. else
  88. {
  89. CStringArray strarray;
  90. strarray.Add("复古典雅");
  91. strarray.Add("温文尔雅");
  92. strarray.Add("豪华艳丽");
  93. strarray.Add("传统大方");
  94. strarray.Add("新潮个性");
  95. strarray.Add("浪漫奔放");
  96. strarray.Add("简单素雅");
  97. strarray.Add("活泼俏丽");
  98. strarray.Add("妩媚温馨");
  99. strarray.Add("温柔贤惠");
  100. strarray.Add("成熟感性");
  101. strarray.Add("清纯可爱");
  102. int pos = 0;
  103. m_edit1 = strarray.ElementAt(pos); pos++;
  104. m_edit2 = strarray.ElementAt(pos); pos++;
  105. m_edit3 = strarray.ElementAt(pos); pos++;
  106. m_edit4 = strarray.ElementAt(pos); pos++;
  107. m_edit5 = strarray.ElementAt(pos); pos++;
  108. m_edit6 = strarray.ElementAt(pos); pos++;
  109. m_edit7 = strarray.ElementAt(pos); pos++;
  110. m_edit8 = strarray.ElementAt(pos); pos++;
  111. m_edit9 = strarray.ElementAt(pos); pos++;
  112. m_edit10 = strarray.ElementAt(pos); pos++;
  113. m_edit11 = strarray.ElementAt(pos); pos++;
  114. m_edit12 = strarray.ElementAt(pos); pos++;
  115. }
  116. UpdateData(false);
  117. CenterWindow();
  118. return TRUE; // return TRUE unless you set the focus to a control
  119. // EXCEPTION: OCX Property Pages should return FALSE
  120. }
  121. void TXFG::OnOK()
  122. {
  123. // TODO: Add extra validation here
  124. UpdateData();
  125. CString sql = "delete from taoxifg";
  126. CString temp;
  127. int pos = 0;
  128. temp.Format("***insert into taoxifg([name])values('%s')", m_edit1); sql += temp;
  129. temp.Format("***insert into taoxifg([name])values('%s')", m_edit2); sql += temp;
  130. temp.Format("***insert into taoxifg([name])values('%s')", m_edit3); sql += temp;
  131. temp.Format("***insert into taoxifg([name])values('%s')", m_edit4); sql += temp;
  132. temp.Format("***insert into taoxifg([name])values('%s')", m_edit5); sql += temp;
  133. temp.Format("***insert into taoxifg([name])values('%s')", m_edit6); sql += temp;
  134. temp.Format("***insert into taoxifg([name])values('%s')", m_edit7); sql += temp;
  135. temp.Format("***insert into taoxifg([name])values('%s')", m_edit8); sql += temp;
  136. temp.Format("***insert into taoxifg([name])values('%s')", m_edit9); sql += temp;
  137. temp.Format("***insert into taoxifg([name])values('%s')", m_edit10); sql += temp;
  138. temp.Format("***insert into taoxifg([name])values('%s')", m_edit11); sql += temp;
  139. temp.Format("***insert into taoxifg([name])values('%s')", m_edit12); sql += temp;
  140. g_sendhead.bsql = 1;
  141. g_pMainWnd->ProcessChatMessageRequest2(sql);
  142. if (g_bSendOK == 0)return;
  143. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  144. CDialog::OnOK();
  145. }