⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 feetelenumadddlg.cpp

📁 VC6.0环境下编写的一个交换机计费程序。
💻 CPP
字号:
// feetelenumaddDlg.cpp : implementation file
//

#include "stdafx.h"
#include "fee.h"
#include "feetelenumaddDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CfeetelenumaddDlg dialog


CfeetelenumaddDlg::CfeetelenumaddDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CfeetelenumaddDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CfeetelenumaddDlg)
	m_uintaddper =100;
	m_uintrent = 0;
	m_uintrentper = 100;
	m_uintstartper =100;
	m_uintstepper = 100;
	m_strtelenum = _T("");
	m_strproperty = _T("");
	//}}AFX_DATA_INIT
}


void CfeetelenumaddDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CfeetelenumaddDlg)
	DDX_Text(pDX, IDC_EDIT_FEETELE_TELENUM, m_strtelenum);
	DDX_CBString(pDX, IDC_COMBO1, m_strproperty);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CfeetelenumaddDlg, CDialog)
	//{{AFX_MSG_MAP(CfeetelenumaddDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CfeetelenumaddDlg message handlers

void CfeetelenumaddDlg::OnOK() 
{
	UpdateData(TRUE);
	// TODO: Add extra validation here
	if (m_strtelenum=="")
	{
		AfxMessageBox("The number cannot be blank");
		return;
	}
	HRESULT result;

	CString strSql,strTemp;
	CFeeApp* pApp=(CFeeApp *)AfxGetApp();
	strSql.Format("select * from feefreecalled where callednum='%s'",m_strtelenum);
	result=pApp->m_pjifeiRecordset->Open(strSql.AllocSysString(),
		pApp->m_pjifeiConnection.GetInterfacePtr(),
		adOpenDynamic,adLockOptimistic,adCmdText);
	if (!SUCCEEDED(result))
	{
		AfxMessageBox("can't open telephone table");
	}
	if (!pApp->m_pjifeiRecordset->adoEOF)
	{
		AfxMessageBox("This free number has existed");
		pApp->m_pjifeiRecordset->Close();
		return;
	}
	else 
	{
		pApp->m_pjifeiRecordset->AddNew();
	}
	strTemp=m_strtelenum;
	pApp->m_pjifeiRecordset->PutCollect("callednum",_variant_t(strTemp));
	strTemp=m_strproperty;
	pApp->m_pjifeiRecordset->PutCollect("property",_variant_t(strTemp));
	pApp->m_pjifeiRecordset->Update();
	pApp->m_pjifeiRecordset->Close();
//	feeteleQueryList(TRUE,m_strtelenum,m_strproperty);	
	CDialog::OnOK();
}

void CfeetelenumaddDlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -