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

📄 deldatabasedlg.cpp

📁 本项目是我工作时候应公司需求开发的 开发工具是EVC++4.0
💻 CPP
字号:
// DelDataBaseDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Wonder.h"
#include "DelDataBaseDlg.h"
#include "DataStruct.h"

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


extern CDjbkData DjbkData[];
extern CYjbkData YjbkData[];
/////////////////////////////////////////////////////////////////////////////
// CDelDataBaseDlg dialog


CDelDataBaseDlg::CDelDataBaseDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CDelDataBaseDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDelDataBaseDlg)
	
	//}}AFX_DATA_INIT
}


void CDelDataBaseDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDelDataBaseDlg)
	DDX_Check(pDX, IDC_DEL_DJB_DATABASE, m_DelDjbkDatabase);
	DDX_Check(pDX, IDC_DEL_YJB_DATABASE, m_DelYjbkDatabase);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDelDataBaseDlg, CDialog)
	//{{AFX_MSG_MAP(CDelDataBaseDlg)
	ON_BN_CLICKED(IDC_DEL_DATABASE_EXIT, OnDelDatabaseExit)
	ON_BN_CLICKED(IDC_DEL_DATABASE_OK, OnDelDatabaseOk)
	ON_BN_CLICKED(IDC_DEL_DJB_DATABASE, OnDelDjbDatabase)
	ON_BN_CLICKED(IDC_DEL_YJB_DATABASE, OnDelYjbDatabase)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDelDataBaseDlg message handlers

void CDelDataBaseDlg::OnDelDatabaseExit() 
{
	// TODO: Add your control notification handler code here
	CDialog::OnCancel();
}

void CDelDataBaseDlg::OnDelDatabaseOk() 
{
	// TODO: Add your control notification handler code here
    
	if(m_DelDjbkDatabase==0&&m_DelYjbkDatabase==0)
	{
		AfxMessageBox(_T("请选择要清空的数据库!"));		
	}
	
if(m_DelDjbkDatabase==1||m_DelYjbkDatabase==1)
{
	if(m_DelDjbkDatabase==1&&m_DelYjbkDatabase==1)
	{
	if((MessageBox(_T("确定清所有表库?"),_T("清数据库"),MB_OKCANCEL))==IDOK)
		{
		DeleteFile(_T("\\My Documents\\djbk.dat"));	
		DeleteFile(_T("\\My Documents\\yjbk.dat"));		
		}
	}
	else
	{
	if(m_DelDjbkDatabase==1)//清待校表库
	{
		if((MessageBox(_T("确定清待校表库?"),_T("清数据库"),MB_OKCANCEL))==IDOK)
		{
			DeleteFile(_T("\\My Documents\\djbk.dat"));	
		}
	}
	if(m_DelYjbkDatabase==1)//清已校表库
	{
		if((MessageBox(_T("确定清已校表库?"),_T("清数据库"),MB_OKCANCEL))==IDOK)
		{
			DeleteFile(_T("\\My Documents\\yjbk.dat"));	
		}	
	}
	}
}
	CDialog::OnCancel();	
	
}

BOOL CDelDataBaseDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_DelDjbkDatabase=0;
	m_DelYjbkDatabase=0;

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDelDataBaseDlg::OnDelDjbDatabase() 
{
	// TODO: Add your control notification handler code here
	m_DelDjbkDatabase=1;
}

void CDelDataBaseDlg::OnDelYjbDatabase() 
{
	// TODO: Add your control notification handler code here
	m_DelYjbkDatabase=1;
}

⌨️ 快捷键说明

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