ReCharge.cpp 2.2 KB

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