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

📄 retiredworker.cpp

📁 应用vc+sqlserver做的一个保卫处数据管理系统
💻 CPP
字号:
// RetiredWorker.cpp : implementation file
//

#include "stdafx.h"
#include "横店集团保卫人员管理系统.h"
#include "RetiredWorker.h"

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

/////////////////////////////////////////////////////////////////////////////
// CRetiredWorker dialog


CRetiredWorker::CRetiredWorker(CWnd* pParent /*=NULL*/)
	: CDialog(CRetiredWorker::IDD, pParent)
{
	//{{AFX_DATA_INIT(CRetiredWorker)
	m_value = _T("");
	//}}AFX_DATA_INIT
}


void CRetiredWorker::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CRetiredWorker)
	DDX_Control(pDX, IDC_COMBO1, m_type);
	DDX_Control(pDX, IDC_ADODC1, m_ad);
	DDX_Control(pDX, IDC_DATAGRID1, m_data);
	DDX_Text(pDX, IDC_EDIT1, m_value);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CRetiredWorker, CDialog)
	//{{AFX_MSG_MAP(CRetiredWorker)
	ON_BN_CLICKED(IDC_BUTTON1, OnSearcj)
	ON_BN_CLICKED(IDC_BUTTON2, OnFresh)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRetiredWorker message handlers

BOOL CRetiredWorker::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_ad.ShowWindow(SW_HIDE);
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CRetiredWorker::OnSearcj() 
{
	UpdateData(true);
	if(m_value.IsEmpty())
		MessageBox("请填写完整");
	else
	{
		int i=m_type.GetCurSel();
		if(i!=-1)
		{
			CString str,sql;
			m_type.GetLBText(i,str);
			sql.Format("select * from Retire where %s='%s'",str,m_value);
			m_ad.SetRecordSource(sql);
			m_ad.Refresh();
			m_data.Refresh();
		}
		else
			MessageBox("请填写完整");		
	}
	
}

void CRetiredWorker::OnFresh() 
{
	m_ad.SetRecordSource("select * from Retire");
	m_ad.Refresh();
	m_data.Refresh();
	
}

⌨️ 快捷键说明

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