ReCharge.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // ReCharge.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "ReCharge.h"
  6. #include "SelPayType.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. ReCharge::ReCharge(CWnd* pParent /*=NULL*/): CDialog(ReCharge::IDD, pParent)
  13. {
  14. m_money = _T("");
  15. m_name = _T("");
  16. m_no = _T("");
  17. m_card2no = _T("");
  18. m_money2 = _T("");
  19. m_bout=m_mode=0;
  20. }
  21. void ReCharge::DoDataExchange(CDataExchange* pDX)
  22. {
  23. CDialog::DoDataExchange(pDX);
  24. DDX_Control(pDX, IDC_EDIT2, m_editnum2);
  25. DDX_Control(pDX, IDC_EDIT1, m_editnum);
  26. DDX_Text(pDX, IDC_EDIT1, m_money);
  27. DDX_Text(pDX, IDC_EDITname, m_name);
  28. DDX_Text(pDX, IDC_EDITno, m_no);
  29. DDX_Text(pDX, IDC_EDITcard2no, m_card2no);
  30. DDX_Text(pDX, IDC_EDIT2, m_money2);
  31. }
  32. BEGIN_MESSAGE_MAP(ReCharge, CDialog)
  33. END_MESSAGE_MAP()
  34. void ReCharge::OnOK()
  35. {
  36. UpdateData();
  37. if(m_mode==0 && m_bout==0)
  38. {
  39. if( atoi(m_money)<=0 && atoi(m_money2)<=0)
  40. return;
  41. }
  42. else if( atoi(m_money)<=0)
  43. return;
  44. if(m_bout==0 && m_mode && atoi(m_balance)<atoi(m_money))
  45. {
  46. AfxMessageBox("账号余额不足!", MB_ICONINFORMATION);
  47. return;
  48. }
  49. if(m_bout) // 提现;m_balance:余额, m_money:提现金额;
  50. {
  51. if( (atoi(m_balance)-atoi(m_money)) <0 )
  52. {
  53. AfxMessageBox("账号余额不足!", MB_ICONINFORMATION);
  54. return;
  55. }
  56. }
  57. if(m_mode==0 && m_bout==0)
  58. {
  59. SelPayType seltype;
  60. seltype.m_mode=1;
  61. if(seltype.DoModal ()!=IDOK)return;
  62. if(seltype.m_radio1==0)
  63. paytype="现金";
  64. else if(seltype.m_radio1==1)
  65. paytype="POS机刷卡";
  66. else if(seltype.m_radio1==4)
  67. paytype="银行转账";
  68. }
  69. CDialog::OnOK();
  70. }
  71. BOOL ReCharge::OnInitDialog()
  72. {
  73. CDialog::OnInitDialog();
  74. if(m_mode==0)
  75. {
  76. GetDlgItem(IDC_STATIC1)->ShowWindow(0);
  77. GetDlgItem(IDC_EDITcard2no)->ShowWindow(0);
  78. if(m_bout)SetWindowText("主卡提现");
  79. }
  80. else
  81. {
  82. if(m_bout)
  83. SetWindowText("现金子卡提现");
  84. else
  85. SetWindowText("现金子卡充值");
  86. }
  87. if(m_mode || m_bout)
  88. {
  89. GetDlgItem(IDC_STATIC3)->ShowWindow(0);
  90. GetDlgItem(IDC_EDIT2)->ShowWindow(0);
  91. }
  92. if(m_bout)
  93. GetDlgItem(IDC_STATIC2)->SetWindowText("提现金额:");
  94. return TRUE;
  95. }