📄 searchstuinfermation.cpp
字号:
// searchstuinfermation.cpp : implementation file
//
#include "stdafx.h"
#include "mystudent.h"
#include "searchstuinfermation.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Csearchstuinfermation dialog
Csearchstuinfermation::Csearchstuinfermation(CWnd* pParent /*=NULL*/)
: CDialog(Csearchstuinfermation::IDD, pParent)
{
//{{AFX_DATA_INIT(Csearchstuinfermation)
m_stuname = _T("");
m_stuno = _T("");
m_stuname1 = _T("");
m_stuno1 = _T("");
m_xb = _T("");
m_birthday = _T("");
m_native = _T("");
m_depart = _T("");
m_special = _T("");
m_studyyear = _T("");
m_entertime = _T("");
m_homeadd = _T("");
m_classno = _T("");
//}}AFX_DATA_INIT
}
void Csearchstuinfermation::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Csearchstuinfermation)
DDX_Text(pDX, IDC_EDIT1, m_stuname);
DDX_Text(pDX, IDC_EDIT2, m_stuno);
DDX_Text(pDX, IDC_EDIT3, m_stuname1);
DDX_Text(pDX, IDC_EDIT4, m_stuno1);
DDX_Text(pDX, IDC_EDIT5, m_xb);
DDX_Text(pDX, IDC_EDIT6, m_birthday);
DDX_Text(pDX, ID_EDIT7, m_native);
DDX_Text(pDX, IDC_EDIT9, m_depart);
DDX_Text(pDX, IDC_EDIT10, m_special);
DDX_Text(pDX, IDC_EDIT11, m_studyyear);
DDX_Text(pDX, IDC_EDIT12, m_entertime);
DDX_Text(pDX, IDC_EDIT13, m_homeadd);
DDX_Text(pDX, IDC_EDIT8, m_classno);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Csearchstuinfermation, CDialog)
//{{AFX_MSG_MAP(Csearchstuinfermation)
ON_BN_CLICKED(IDOK, OnOk)
ON_BN_CLICKED(IDOK2, OnOk2)
ON_COMMAND(ID_searchstuinfermation, Onsearchstuinfermation)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Csearchstuinfermation message handlers
void Csearchstuinfermation::OnOk()
{
// TODO: Add your control notification handler code here
UpdateData(true);
CDatabase m_database;//连接数据库
Cstudentset student;
Cclassinfo classinfo;
if(student.IsOpen())
student.Close();
CString sql;
sql.Format("select * from student where stuno='%s' or stuname='%s'",m_stuno,m_stuname);//m_stuname,
student.m_pDatabase=&m_database;
student.Open(AFX_DB_USE_DEFAULT_TYPE,sql);
if(student.IsEOF())
{
MessageBox("没有该学生的信息!","提示");
return;
}
else
{
sql.Format("select * from classinfo where classno='%s'",student.m_classno);
classinfo.m_pDatabase=&m_database;
classinfo.Open(AFX_DB_USE_DEFAULT_TYPE,sql);
m_stuname1.Format("%s",student.m_stuname);
m_stuno1.Format("%s",student.m_stuno);
m_xb.Format("%s",student.m_xb);
sql.Format("%d-%d-%d",student.m_birthday.GetYear(),student.m_birthday.GetMonth(),student.m_birthday.GetDay());
m_birthday.Format("%s",sql);
m_native.Format("%s",student.m_native);
m_homeadd.Format("%s",student.m_homeadd);
m_classno.Format("%s",student.m_classno);
m_depart.Format("%s",classinfo.m_depart);
m_special.Format("%s",classinfo.m_special);
m_studyyear.Format("%s",classinfo.m_studyyear);
sql.Format("%d-%d-%d",classinfo.m_entertime.GetYear(),classinfo.m_entertime.GetMonth(),classinfo.m_entertime.GetDay());
m_entertime.Format("%s",sql);
UpdateData(false);
}
}
void Csearchstuinfermation::OnOk2()
{
// TODO: Add your control notification handler code here
CDialog::OnOK();
}
void Csearchstuinfermation::Onsearchstuinfermation()
{
// TODO: Add your command handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -