CorpSms/DLG_CJCard.cpp
2025-02-27 16:58:16 +08:00

94 lines
2.1 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// DLG_CJCard.cpp : implementation file
//
#include "stdafx.h"
#include "corpsms.h"
#include "DLG_CJCard.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// DLG_CJCard dialog
#include "MainFrm.h"
DLG_CJCard::DLG_CJCard(CWnd* pParent /*=NULL*/)
: CDialog(DLG_CJCard::IDD, pParent)
{
//{{AFX_DATA_INIT(DLG_CJCard)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_pMainFrame = (CMainFrame*)pParent;
}
void DLG_CJCard::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DLG_CJCard)
DDX_Control(pDX, IDOK, m_B_OK);
DDX_Control(pDX, IDC_CJCARD_PASSWD, m_E_Passwd);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DLG_CJCard, CDialog)
//{{AFX_MSG_MAP(DLG_CJCard)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DLG_CJCard message handlers
void DLG_CJCard::OnOK()
{
CString str;
m_E_Passwd.GetWindowText(str);
if ( str.GetLength() != 16 )
{
MessageBox( _T("你输入的充值卡密码有误,请仔细检查!\r\n充值卡由16位数字组成\r\n") , _T("错误") , MB_ICONWARNING );
m_E_Passwd.SetFocus();
return ;
}
REQ_CJCard * pCJ = new REQ_CJCard;
memset(pCJ,0,sizeof(REQ_CJCard));
pCJ->lCorpID = m_pMainFrame->m_lCorpID;
pCJ->lUserID = m_pMainFrame->m_lUserID;
_tcscpy( pCJ->szPasswd , str );
m_B_OK.EnableWindow(false);
m_pMainFrame->SendFrame( SMSFUNC_CJCARD , (BYTE*)pCJ , sizeof(REQ_CJCard) );
//CDialog::OnOK();
}
void DLG_CJCard::ProcessRet(ANS_CJCard *pCJ)
{
if ( pCJ->lSmsCount <= 0 ) //充值不成功
{
MessageBox( pCJ->szMsg , _T("充值不成功") , MB_ICONWARNING );
m_B_OK.EnableWindow(true);
m_E_Passwd.SetFocus();
return ;
}
else
{
MessageBox( pCJ->szMsg , _T("充值成功") , MB_ICONINFORMATION );
CDialog::OnOK();
}
}
BOOL DLG_CJCard::OnInitDialog()
{
CDialog::OnInitDialog();
m_E_Passwd.LimitText(16);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}