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

📄 querydlg.cpp

📁 my-project-VC++学生信息系统
💻 CPP
字号:
// QueryDlg.cpp : implementation file
//

#include "stdafx.h"
#include "S2009072032.h"
#include "QueryDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CQueryDlg dialog


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


void CQueryDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CQueryDlg)
	DDX_Text(pDX, IDC_EDIT_QUERY, m_strQuery);
	DDV_MaxChars(pDX, m_strQuery, 10);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CQueryDlg message handlers

BOOL CQueryDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_strFilterText.TrimLeft();							
	GetDlgItem(IDC_STATIC_QUERY)->SetWindowText(m_strFilterText);
	GetDlgItem(IDOK)->SetWindowText(m_strOKText);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CQueryDlg::OnOK() 
{
	// TODO: Add extra validation here
	this->UpdateData();															
	m_strQuery.TrimLeft();												
	if(m_strQuery.IsEmpty())												
		MessageBox("查询条件不能为空!");								
	else			
		CDialog::OnOK();
/*	if(this->scoreSet->IsOpen())											
		this->scoreSet->Close();		//如果记录集打开,则先关闭				
	this->scoreSet->m_strFilter.Format("studentno='%s'", this->m_strQuery);		
					//studentno是score表的字段名,用于指定查询条件				
	this->scoreSet->m_strSort="course";	//course是表score的字段名,用于按course排序	
	this->scoreSet->Open();		//打开记录集									
	if(!this->scoreSet->IsBOF())	//如果打开记录集有记录							
		this->UpdateData(FALSE);	//自动更新表单中控件显示的内容				
	else																	
		MessageBox("没有查到你要找的学号记录!");  */
}

⌨️ 快捷键说明

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