premoneysetup.cpp
来自「IP电话计费管理系统本地版」· C++ 代码 · 共 248 行
CPP
248 行
// PreMoneySetup.cpp : implementation file
//
#include "stdafx.h"
#include "IPCount.h"
#include "PreMoneySetup.h"
#include "SysSetUp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPreMoneySetup dialog
CPreMoneySetup::CPreMoneySetup(CWnd* pParent /*=NULL*/)
: CDialog(CPreMoneySetup::IDD, pParent)
{
//{{AFX_DATA_INIT(CPreMoneySetup)
bCheck = FALSE;
m_strLine0 = _T("");
m_strLine1 = _T("");
m_strLine2 = _T("");
m_strLine3 = _T("");
m_strLine4 = _T("");
m_strLine5 = _T("");
m_strLine6 = _T("");
m_strLine7 = _T("");
m_strLine07 = _T("");
m_strLine9 = _T("");
m_strLine10 = _T("");
m_strLine11 = _T("");
m_strLine12 = _T("");
m_strLine13 = _T("");
m_strLine14 = _T("");
m_strLine15 = _T("");
m_strLine815 = _T("");
m_strLine8 = _T("");
bNoPreMoney = FALSE;
//}}AFX_DATA_INIT
bCheck=FALSE;
}
void CPreMoneySetup::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPreMoneySetup)
DDX_Control(pDX, IDC_CHECK_ADD_PREMONEY, m_bAddPreMoney);
DDX_Check(pDX, IDC_CHECK_ADD_PREMONEY, bCheck);
DDX_Text(pDX, IDC_EDIT1, m_strLine0);
DDX_Text(pDX, IDC_EDIT2, m_strLine1);
DDX_Text(pDX, IDC_EDIT3, m_strLine2);
DDX_Text(pDX, IDC_EDIT4, m_strLine3);
DDX_Text(pDX, IDC_EDIT5, m_strLine4);
DDX_Text(pDX, IDC_EDIT6, m_strLine5);
DDX_Text(pDX, IDC_EDIT7, m_strLine6);
DDX_Text(pDX, IDC_EDIT8, m_strLine7);
DDX_Text(pDX, IDC_EDIT07, m_strLine07);
DDX_Text(pDX, IDC_EDIT10, m_strLine9);
DDX_Text(pDX, IDC_EDIT11, m_strLine10);
DDX_Text(pDX, IDC_EDIT12, m_strLine11);
DDX_Text(pDX, IDC_EDIT13, m_strLine12);
DDX_Text(pDX, IDC_EDIT14, m_strLine13);
DDX_Text(pDX, IDC_EDIT15, m_strLine14);
DDX_Text(pDX, IDC_EDIT16, m_strLine15);
DDX_Text(pDX, IDC_EDIT815, m_strLine815);
DDX_Text(pDX, IDC_EDIT9, m_strLine8);
DDX_Check(pDX, IDC_CHECK_NO_PREMONEY, bNoPreMoney);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPreMoneySetup, CDialog)
//{{AFX_MSG_MAP(CPreMoneySetup)
ON_EN_CHANGE(IDC_EDIT07, OnChangeEdit07)
ON_EN_CHANGE(IDC_EDIT815, OnChangeEdit815)
ON_BN_CLICKED(IDC_CHECK_ADD_PREMONEY, OnCheckAddPremoney)
ON_BN_CLICKED(IDC_CHECK_NO_PREMONEY, OnCheckNoPremoney)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPreMoneySetup message handlers
void CPreMoneySetup::OnChangeEdit07()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
UpdateData(TRUE);
m_strLine0=m_strLine07;
m_strLine1=m_strLine07;
m_strLine2=m_strLine07;
m_strLine3=m_strLine07;
m_strLine4=m_strLine07;
m_strLine5=m_strLine07;
m_strLine6=m_strLine07;
m_strLine7=m_strLine07;
UpdateData(FALSE);
// TODO: Add your control notification handler code here
}
void CPreMoneySetup::OnChangeEdit815()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
UpdateData(TRUE);
m_strLine8=m_strLine815;
m_strLine9=m_strLine815;
m_strLine10=m_strLine815;
m_strLine11=m_strLine815;
m_strLine12=m_strLine815;
m_strLine13=m_strLine815;
m_strLine14=m_strLine815;
m_strLine15=m_strLine815;
UpdateData(FALSE);
// TODO: Add your control notification handler code here
}
void CPreMoneySetup::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
CSysSetUp *qdlg;
qdlg=(CSysSetUp *)GetParent();
if(bCheck)
{
qdlg->SetAddMoneyFlag(1);
}
else
{
qdlg->SetAddMoneyFlag(0);
}
if(bNoPreMoney)
{
qdlg->SetNoPreMoney(1);
}
else
{
qdlg->SetNoPreMoney(0);
}
qdlg->SetMoneyLine(m_strLine0,"Line0");
qdlg->SetMoneyLine(m_strLine1,"Line1");
qdlg->SetMoneyLine(m_strLine2,"Line2");
qdlg->SetMoneyLine(m_strLine3,"Line3");
qdlg->SetMoneyLine(m_strLine4,"Line4");
qdlg->SetMoneyLine(m_strLine5,"Line5");
qdlg->SetMoneyLine(m_strLine6,"Line6");
qdlg->SetMoneyLine(m_strLine7,"Line7");
qdlg->SetMoneyLine(m_strLine8,"Line8");
qdlg->SetMoneyLine(m_strLine9,"Line9");
qdlg->SetMoneyLine(m_strLine10,"Line10");
qdlg->SetMoneyLine(m_strLine11,"Line11");
qdlg->SetMoneyLine(m_strLine12,"Line12");
qdlg->SetMoneyLine(m_strLine13,"Line13");
qdlg->SetMoneyLine(m_strLine14,"Line14");
qdlg->SetMoneyLine(m_strLine15,"Line15");
CDialog::OnOK();
}
void CPreMoneySetup::OnCheckAddPremoney()
{
// TODO: Add your control notification handler code here
bCheck=!bCheck;
}
BOOL CPreMoneySetup::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetIcon(AfxGetApp()->LoadIcon(IDI_ICON12),TRUE);
SetIcon(AfxGetApp()->LoadIcon(IDI_ICON12),FALSE);
CSysSetUp *qdlg;
qdlg=(CSysSetUp *)GetParent();
int nMoneyFlag=qdlg->GetAddMoneyFlag();
if(qdlg->GetNoPreMoney()==1)
{
bNoPreMoney=TRUE;
}
else
{
bNoPreMoney=FALSE;
m_bAddPreMoney.EnableWindow(TRUE);
}
if(nMoneyFlag==1)
{
bCheck=TRUE;
}
else
{
bCheck=FALSE;
}
m_strLine0=qdlg->GetMoneyLine("Line0");
m_strLine1=qdlg->GetMoneyLine("Line1");
m_strLine2=qdlg->GetMoneyLine("Line2");
m_strLine3=qdlg->GetMoneyLine("Line3");
m_strLine4=qdlg->GetMoneyLine("Line4");
m_strLine5=qdlg->GetMoneyLine("Line5");
m_strLine6=qdlg->GetMoneyLine("Line6");
m_strLine7=qdlg->GetMoneyLine("Line7");
m_strLine8=qdlg->GetMoneyLine("Line8");
m_strLine9=qdlg->GetMoneyLine("Line9");
m_strLine10=qdlg->GetMoneyLine("Line10");
m_strLine11=qdlg->GetMoneyLine("Line11");
m_strLine12=qdlg->GetMoneyLine("Line12");
m_strLine13=qdlg->GetMoneyLine("Line13");
m_strLine14=qdlg->GetMoneyLine("Line14");
m_strLine15=qdlg->GetMoneyLine("Line15");
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPreMoneySetup::OnCheckNoPremoney()
{
// TODO: Add your control notification handler code here
bNoPreMoney=!bNoPreMoney;
if(!bNoPreMoney)
{
m_bAddPreMoney.EnableWindow(TRUE);
}
else//无押金模式
{
bCheck=FALSE;
m_bAddPreMoney.EnableWindow(FALSE);
}
UpdateData(FALSE);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?