📄 realtimesetdlg.cpp
字号:
// realTimeSetDlg.cpp : implementation file
//
#include "stdafx.h"
#include "fee.h"
#include "realTimeSetDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CrealTimeSetDlg dialog
CrealTimeSetDlg::CrealTimeSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(CrealTimeSetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CrealTimeSetDlg)
m_brealtimecallednumshow = FALSE;
m_brealtimecalledregshow = FALSE;
m_brealtimecallingnumshow = FALSE;
m_brealtimecallingregshow = FALSE;
m_brealtimetalkendtimeshow = FALSE;
m_brealtimetalkfeeshow = FALSE;
m_brealtimetalktimeshow = FALSE;
//}}AFX_DATA_INIT
}
void CrealTimeSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CrealTimeSetDlg)
DDX_Check(pDX, IDC_CHECK_REALTIME_CALLEDNUMSHOW, m_brealtimecallednumshow);
DDX_Check(pDX, IDC_CHECK_REALTIME_CALLEDREGSHOW, m_brealtimecalledregshow);
DDX_Check(pDX, IDC_CHECK_REALTIME_CALLINGNUMSHOW, m_brealtimecallingnumshow);
DDX_Check(pDX, IDC_CHECK_REALTIME_CALLINGREGSHOW, m_brealtimecallingregshow);
DDX_Check(pDX, IDC_CHECK_REALTIME_TALKENDTIMESHOW, m_brealtimetalkendtimeshow);
DDX_Check(pDX, IDC_CHECK_REALTIME_TALKFEESHOW, m_brealtimetalkfeeshow);
DDX_Check(pDX, IDC_CHECK_REALTIME_TALKTIMESHOW, m_brealtimetalktimeshow);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CrealTimeSetDlg, CDialog)
//{{AFX_MSG_MAP(CrealTimeSetDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CrealTimeSetDlg message handlers
BOOL CrealTimeSetDlg::OnInitDialog()
{
CDialog::OnInitDialog();
HRESULT result;
CString strSql;
CString strtemp;
m_brealtimecallednumshow = TRUE;
m_brealtimecalledregshow = TRUE;
m_brealtimecallingnumshow = TRUE;
m_brealtimecallingregshow = TRUE;
m_brealtimetalkendtimeshow = TRUE;
m_brealtimetalkfeeshow = TRUE;
m_brealtimetalktimeshow = TRUE;
strSql.Format("select * from realtimeshow");
CFeeApp* pApp=(CFeeApp *)AfxGetApp();
result=pApp->m_pjifeiRecordset->Open(strSql.AllocSysString(),
pApp->m_pjifeiConnection.GetInterfacePtr(),
adOpenDynamic,adLockOptimistic,adCmdText);
if (!SUCCEEDED(result))
{
AfxMessageBox("can't open realtimeshow table");
}
if (!pApp->m_pjifeiRecordset->adoEOF)
{
strtemp=(char*)(_bstr_t)pApp->m_pjifeiRecordset->GetCollect(_variant_t("frontfeeCallingNumShow"));
if (strtemp!="YES")
{
m_brealtimecallingnumshow = FALSE;
}
strtemp=(char*)(_bstr_t)pApp->m_pjifeiRecordset->GetCollect(_variant_t("frontfeeCalledNumShow"));
if (strtemp!="YES")
{
m_brealtimecallednumshow = FALSE;
}
strtemp=(char*)(_bstr_t)pApp->m_pjifeiRecordset->GetCollect(_variant_t("frontfeeTalkTimeShow"));
if (strtemp!="YES")
{
m_brealtimetalktimeshow = FALSE;
}
strtemp=(char*)(_bstr_t)pApp->m_pjifeiRecordset->GetCollect(_variant_t("frontfeeTalkEndShow"));
if (strtemp!="YES")
{
m_brealtimetalkendtimeshow = FALSE;
}
strtemp=(char*)(_bstr_t)pApp->m_pjifeiRecordset->GetCollect(_variant_t("frontfeeCallingRegisterShow"));
if (strtemp!="YES")
{
m_brealtimecallingregshow = FALSE;
}
strtemp=(char*)(_bstr_t)pApp->m_pjifeiRecordset->GetCollect(_variant_t("frontfeeCalledRegisterShow"));
if (strtemp!="YES")
{
m_brealtimecalledregshow = FALSE;
}
strtemp=(char*)(_bstr_t)pApp->m_pjifeiRecordset->GetCollect(_variant_t("frontfeeTalkFeeShow"));
if (strtemp!="YES")
{
m_brealtimetalkfeeshow = FALSE;
}
}
pApp->m_pjifeiRecordset->Close();
//将设定应用到对话框控件中
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CrealTimeSetDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
HRESULT result;
CString strSql;
CString strtemp;
CFeeApp* pApp=(CFeeApp *)AfxGetApp();
strSql.Format("select * from realtimeshow");
result=pApp->m_pjifeiRecordset->Open(strSql.AllocSysString(),
pApp->m_pjifeiConnection.GetInterfacePtr(),
adOpenDynamic,adLockOptimistic,adCmdText);
if (!SUCCEEDED(result))
{
AfxMessageBox("can't open realtimeshow table");
}
if (!pApp->m_pjifeiRecordset->adoEOF)
{
pApp->m_pjifeiRecordset->Close();
strSql.Format("delete * from realtimeshow");
CFeeApp* pApp=(CFeeApp *)AfxGetApp();
result=pApp->m_pjifeiRecordset->Open(strSql.AllocSysString(),
pApp->m_pjifeiConnection.GetInterfacePtr(),
adOpenDynamic,adLockOptimistic,adCmdText);
if (!SUCCEEDED(result))
{
AfxMessageBox("can't open frontfeeSet table");
}
// pApp->m_pjifeiRecordset->Update();
}
else
{
pApp->m_pjifeiRecordset->Close();
}
strSql.Format("select * from realtimeshow");
result=pApp->m_pjifeiRecordset->Open(strSql.AllocSysString(),
pApp->m_pjifeiConnection.GetInterfacePtr(),
adOpenDynamic,adLockOptimistic,adCmdText);
if (!SUCCEEDED(result))
{
AfxMessageBox("can't open realtimeshow table");
}
pApp->m_pjifeiRecordset->AddNew();
if (m_brealtimecallingnumshow == TRUE)
pApp->m_pjifeiRecordset->PutCollect("frontfeeCallingNumShow",_variant_t("YES"));
else
pApp->m_pjifeiRecordset->PutCollect("frontfeeCallingNumShow",_variant_t("NO"));
if (m_brealtimecallednumshow == TRUE)
pApp->m_pjifeiRecordset->PutCollect("frontfeeCalledNumShow",_variant_t("YES"));
else
pApp->m_pjifeiRecordset->PutCollect("frontfeeCalledNumShow",_variant_t("NO"));
if (m_brealtimetalktimeshow == TRUE)
pApp->m_pjifeiRecordset->PutCollect("frontfeeTalkTimeShow",_variant_t("YES"));
else
pApp->m_pjifeiRecordset->PutCollect("frontfeeTalkTimeShow",_variant_t("NO"));
if (m_brealtimetalkendtimeshow == TRUE)
pApp->m_pjifeiRecordset->PutCollect("frontfeeTalkEndShow",_variant_t("YES"));
else
pApp->m_pjifeiRecordset->PutCollect("frontfeeTalkEndShow",_variant_t("NO"));
if (m_brealtimecallingregshow == TRUE)
pApp->m_pjifeiRecordset->PutCollect("frontfeeCallingRegistShow",_variant_t("YES"));
else
pApp->m_pjifeiRecordset->PutCollect("frontfeeCallingRegistShow",_variant_t("NO"));
if (m_brealtimecalledregshow == TRUE)
pApp->m_pjifeiRecordset->PutCollect("frontfeeCalledRegistShow",_variant_t("YES"));
else
pApp->m_pjifeiRecordset->PutCollect("frontfeeCalledRegistShow",_variant_t("NO"));
if (m_brealtimetalkfeeshow == TRUE)
pApp->m_pjifeiRecordset->PutCollect("frontfeeTalkFeeShow",_variant_t("YES"));
else
pApp->m_pjifeiRecordset->PutCollect("frontfeeTalkFeeShow",_variant_t("NO"));
pApp->m_pjifeiRecordset->Update();
pApp->m_pjifeiRecordset->Close();
CDialog::OnOK();
}
void CrealTimeSetDlg::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -