123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- // 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_strRechargeRemark = _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);
- DDX_Text(pDX, IDC_EDIT3, m_strRechargeRemark);
- }
- 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(_T("账号余额不足!"), MB_ICONINFORMATION);
- return;
- }
- if(m_bout) // 提现;m_balance:余额, m_money:提现金额;
- {
- if( (atoi(m_balance)-atoi(m_money)) <0 )
- {
- AfxMessageBox(_T("账号余额不足!"), 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 = _T("现金");
- else if( seltype.m_radio1 == 1)
- paytype = _T("POS机刷卡");
- else if( seltype.m_radio1 == 2)
- paytype = _T("储值卡扣款");
- else if( seltype.m_radio1 == 3)
- paytype = _T("积分兑换");
- else if( seltype.m_radio1 == 4)
- paytype = _T("银行转账");
- else if( seltype.m_radio1 == 5)
- paytype = _T("代金券");
- else if( seltype.m_radio1 == 6)
- paytype = _T("支付宝");
- else if( seltype.m_radio1 == 7)
- paytype = _T("财付通");
- else if( seltype.m_radio1 == 8)
- paytype = _T("微信支付");
- else if(seltype.m_radio1 == 9)
- paytype = seltype.m_strCustomPayType;
- }
- 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(_T("主卡提现"));
- }
- else
- {
- if(m_bout)
- SetWindowText(_T("现金子卡提现"));
- else
- SetWindowText(_T("现金子卡充值"));
- }
- if(m_mode || m_bout)
- {
- GetDlgItem(IDC_STATIC3)->ShowWindow(0);
- GetDlgItem(IDC_EDIT2)->ShowWindow(0);
- }
- if(m_bout)
- GetDlgItem(IDC_STATIC2)->SetWindowText(_T("提现金额:"));
- return TRUE;
- }
|