123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- // ReCharge.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "ReCharge.h"
- #include "SelPayType.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- ReCharge::ReCharge(CWnd* pParent /*=NULL*/): CDialog(ReCharge::IDD, pParent)
- {
- m_money = _T("");
- m_name = _T("");
- m_no = _T("");
- m_card2no = _T("");
- m_money2 = _T("");
- m_bout=m_mode=0;
- }
- void ReCharge::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_EDIT2, m_editnum2);
- DDX_Control(pDX, IDC_EDIT1, m_editnum);
- DDX_Text(pDX, IDC_EDIT1, m_money);
- DDX_Text(pDX, IDC_EDITname, m_name);
- DDX_Text(pDX, IDC_EDITno, m_no);
- DDX_Text(pDX, IDC_EDITcard2no, m_card2no);
- DDX_Text(pDX, IDC_EDIT2, m_money2);
- }
- BEGIN_MESSAGE_MAP(ReCharge, CDialog)
- END_MESSAGE_MAP()
- void ReCharge::OnOK()
- {
- UpdateData();
- if(m_mode==0 && m_bout==0)
- {
- if( atoi(m_money)<=0 && atoi(m_money2)<=0)
- return;
- }
- else if( atoi(m_money)<=0)
- return;
- if(m_bout==0 && m_mode && atoi(m_balance)<atoi(m_money))
- {
- AfxMessageBox("账号余额不足!", MB_ICONINFORMATION);
- return;
- }
-
- if(m_bout) // 提现;m_balance:余额, m_money:提现金额;
- {
- if( (atoi(m_balance)-atoi(m_money)) <0 )
- {
- AfxMessageBox("账号余额不足!", MB_ICONINFORMATION);
- return;
- }
- }
- if(m_mode==0 && m_bout==0)
- {
- SelPayType seltype;
- seltype.m_mode=1;
- if(seltype.DoModal ()!=IDOK)return;
- if(seltype.m_radio1==0)
- paytype="现金";
- else if(seltype.m_radio1==1)
- paytype="POS机刷卡";
- else if(seltype.m_radio1==4)
- paytype="银行转账";
- }
- CDialog::OnOK();
- }
- BOOL ReCharge::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- if(m_mode==0)
- {
- GetDlgItem(IDC_STATIC1)->ShowWindow(0);
- GetDlgItem(IDC_EDITcard2no)->ShowWindow(0);
- if(m_bout)SetWindowText("主卡提现");
- }
- else
- {
- if(m_bout)
- SetWindowText("现金子卡提现");
- else
- SetWindowText("现金子卡充值");
- }
- if(m_mode || m_bout)
- {
- GetDlgItem(IDC_STATIC3)->ShowWindow(0);
- GetDlgItem(IDC_EDIT2)->ShowWindow(0);
- }
- if(m_bout)
- GetDlgItem(IDC_STATIC2)->SetWindowText("提现金额:");
- return TRUE;
- }
|