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

📄 feetelelistdlg.cpp

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

#include "stdafx.h"
#include "fee.h"
#include "feetelelistDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CfeetelelistDlg dialog


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


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


BEGIN_MESSAGE_MAP(CfeetelelistDlg, CDialog)
	//{{AFX_MSG_MAP(CfeetelelistDlg)
	ON_BN_CLICKED(ID_FEETELELIST_MODIFY, OnFeetelelistModify)
	ON_BN_CLICKED(ID_FEETELELIST_DELETE, OnFeetelelistDelete)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CfeetelelistDlg message handlers

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

void CfeetelelistDlg::OnFeetelelistModify() 
{
	// TODO: Add your control notification handler code here
	HRESULT result;

	// TODO: Add your control notification handler code here
	CString strSql,strTemp;
	CString oldtelenum;
	/*
	UINT	m_uintrent;
	UINT	m_uintaddper;
	UINT	m_uintrentper;
	UINT	m_uintstartper;
	UINT	m_uintstepper;
	CString	m_strtelenum;	
	*/

	oldtelenum=m_strtelenum;

	UpdateData(TRUE);
	CFeeApp* pApp=(CFeeApp *)AfxGetApp();
	strSql.Format("select * from feefreecalled where callednum='%s'",\
		oldtelenum);
	result=pApp->m_pjifeiRecordset->Open(strSql.AllocSysString(),
		pApp->m_pjifeiConnection.GetInterfacePtr(),
		adOpenDynamic,adLockOptimistic,adCmdText);
	if (!SUCCEEDED(result))
	{
		AfxMessageBox("can't open feetele table");
	}
	if(!pApp->m_pjifeiRecordset->adoEOF)
	{
		strTemp=m_strtelenum;
		if (strTemp=="")
			strTemp="NULL";
		pApp->m_pjifeiRecordset->PutCollect("callednum",_variant_t(strTemp));
		strTemp=m_strproperty;
		if (strTemp=="")
			strTemp="NULL";
		pApp->m_pjifeiRecordset->PutCollect("property",_variant_t(strTemp));
		pApp->m_pjifeiRecordset->Update();
	}
	pApp->m_pjifeiRecordset->Close();
	AfxMessageBox("Modified successfully");
	//telelistcmd=1;
	CDialog::OnOK();
	
}

void CfeetelelistDlg::OnFeetelelistDelete() 
{
	// TODO: Add your control notification handler code here
	HRESULT result;

	// TODO: Add your control notification handler code here
	CString strSql,strTemp;
	CString oldtelenum;

	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	
	oldtelenum=m_strtelenum;

	CFeeApp* pApp=(CFeeApp *)AfxGetApp();
	strSql.Format("select * from feefreecalled where callednum='%s'",\
		oldtelenum);
	result=pApp->m_pjifeiRecordset->Open(strSql.AllocSysString(),
		pApp->m_pjifeiConnection.GetInterfacePtr(),
		adOpenDynamic,adLockOptimistic,adCmdText);
	if (!SUCCEEDED(result))
	{
		AfxMessageBox("can't open feetele table");
	}
	if(!pApp->m_pjifeiRecordset->adoEOF)
	{
	}
	else
	{
		pApp->m_pjifeiRecordset->Close();
		AfxMessageBox("The record does not exist");
		return ;
	}
	pApp->m_pjifeiRecordset->Close();
	strSql.Format("delete * from feefreecalled where callednum='%s'",\
		oldtelenum);
	result=pApp->m_pjifeiRecordset->Open(strSql.AllocSysString(),
		pApp->m_pjifeiConnection.GetInterfacePtr(),
		adOpenDynamic,adLockOptimistic,adCmdText);
	if (!SUCCEEDED(result))
	{
		AfxMessageBox("can't open telephone table");
	}
	AfxMessageBox("Deleted successfully");
//	telelistcmd=1;
	CDialog::OnOK();
	
}

⌨️ 快捷键说明

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