UsePointBlue.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. // UsePointBlue.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "UsePointBlue.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // UsePointBlue dialog IDC_EDITtime2
  13. UsePointBlue::UsePointBlue(CWnd* pParent /*=NULL*/)
  14. : CDialog(UsePointBlue::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(UsePointBlue)
  17. m_name1 = _T("");
  18. m_name2 = _T("");
  19. m_id = _T("");
  20. m_ren = _T("");
  21. m_taoxiname = _T("");
  22. m_memberno = _T("");
  23. m_name = _T("");
  24. m_point = _T("");
  25. m_taoxijiage = _T("");
  26. m_card2no = _T("");
  27. m_goods = _T("");
  28. m_point2 = _T("");
  29. //}}AFX_DATA_INIT
  30. }
  31. void UsePointBlue::DoDataExchange(CDataExchange* pDX)
  32. {
  33. CDialog::DoDataExchange(pDX);
  34. //{{AFX_DATA_MAP(UsePointBlue)
  35. DDX_Control(pDX, IDC_EDIT3, m_editnum);
  36. DDX_Control(pDX, IDC_COMBO5, m_combobox);
  37. DDX_Text(pDX, IDC_EDITname, m_name1);
  38. DDX_Text(pDX, IDC_EDITname2, m_name2);
  39. DDX_Text(pDX, IDC_EDITid, m_id);
  40. DDX_Text(pDX, IDC_EDITOren, m_ren);
  41. DDX_Text(pDX, IDC_EDITtaoxiname, m_taoxiname);
  42. DDX_Text(pDX, IDC_EDIT1, m_memberno);
  43. DDX_Text(pDX, IDC_EDITmembername, m_name);
  44. DDX_Text(pDX, IDC_EDIT2, m_point);
  45. DDX_Text(pDX, IDC_EDITtaoxijiage, m_taoxijiage);
  46. DDX_Text(pDX, IDC_EDITcard2no, m_card2no);
  47. DDX_Text(pDX, IDC_EDIT7, m_goods);
  48. DDX_Text(pDX, IDC_EDIT3, m_point2);
  49. //}}AFX_DATA_MAP
  50. }
  51. BEGIN_MESSAGE_MAP(UsePointBlue, CDialog)
  52. //{{AFX_MSG_MAP(UsePointBlue)
  53. ON_CBN_SELCHANGE(IDC_COMBO5, OnSelchangeCombo5)
  54. //}}AFX_MSG_MAP
  55. END_MESSAGE_MAP()
  56. /////////////////////////////////////////////////////////////////////////////
  57. // UsePointBlue message handlers
  58. BOOL UsePointBlue::OnInitDialog()
  59. {
  60. CDialog::OnInitDialog();
  61. // TODO: Add extra initialization here
  62. #ifdef CHILD_VERSION
  63. GetDlgItem(IDC_STATIC1)->SetWindowText("家长姓名:");
  64. GetDlgItem(IDC_STATIC2)->SetWindowText("宝宝姓名:");
  65. #endif
  66. /* m_acCombo.Init(&m_combobox);
  67. g_sendhead.bsql=0;
  68. g_sendhead.code[0]=30;
  69. g_sendhead.tabcount=1;
  70. g_pMainWnd->ProcessChatMessageRequest2(21);if(g_bSendOK==0)return 0;
  71. DataToArray(&m_List1array);
  72. m_acCombo.m_pArray=&m_List1array;
  73. m_combobox.SetFocus ();
  74. this->CenterWindow (g_pMainWnd);*/
  75. return false; // return TRUE unless you set the focus to a control
  76. // EXCEPTION: OCX Property Pages should return FALSE
  77. }
  78. void UsePointBlue::OnOK()
  79. {
  80. // TODO: Add extra validation here
  81. UpdateData();
  82. if(atol(m_point)<1)
  83. {
  84. AfxMessageBox("金额不能小于1!", MB_ICONINFORMATION);
  85. return;
  86. }
  87. if(atol(m_point2)<1)
  88. {
  89. AfxMessageBox("金额不能小于1!", MB_ICONINFORMATION);
  90. return;
  91. }
  92. if(atol(m_point2)>atol(m_point))
  93. {
  94. AfxMessageBox("余额不够!", MB_ICONINFORMATION);
  95. return;
  96. }
  97. CString sql;
  98. CString date=g_date;
  99. sql="insert into [memberreg2blue]([memberno],[money],[date])values('"+m_memberno+"','"+m_point2+"','"+date+"')";
  100. sql+="~~~~";
  101. sql+=m_memberno;
  102. g_sendhead.bsql=1;
  103. g_sendhead.bsql=1;
  104. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  105. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  106. CDialog::OnOK();
  107. }
  108. void UsePointBlue::ClientChange()
  109. {
  110. CString filter="id='"+id+"'";
  111. g_sendhead.code[0]=11;
  112. g_sendhead.tabcount=1;
  113. g_sendhead.bsql=0;
  114. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  115. DataToArray(&g_List1array);
  116. if(g_List1array.GetSize ())
  117. {
  118. m_id=g_List1array.ElementAt (0).ElementAt (0);
  119. m_name1=g_List1array.ElementAt (0).ElementAt (4);
  120. m_name2=g_List1array.ElementAt (0).ElementAt (5);
  121. m_taoxiname=g_List1array.ElementAt (0).ElementAt (7);
  122. m_point=m_taoxijiage=g_List1array.ElementAt (0).ElementAt (8);
  123. m_ren=g_List1array.ElementAt (0).ElementAt (14);
  124. UpdateData(false);
  125. }
  126. }
  127. void UsePointBlue::OnSelchangeCombo5()
  128. {
  129. // TODO: Add your control notification handler code here
  130. int pos=m_combobox.GetCurSel ();
  131. if(pos==-1)return;
  132. if(m_acCombo.m_posarray.GetSize ()<=pos)return;
  133. int pos2=m_acCombo.m_posarray .ElementAt (pos);
  134. id=m_List1array.ElementAt (pos2).ElementAt (0);
  135. ClientChange();
  136. }