📄 dallign.cpp
字号:
// Dallign.cpp : implementation file
//
#include "stdafx.h"
#include "Dormitory.h"
#include "Dallign.h"
#include "building.h"
#include "floor.h"
#include "allign.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Dallign dialog
extern CDormitoryApp theApp;
Dallign::Dallign(CWnd* pParent /*=NULL*/)
: CDialog(Dallign::IDD, pParent)
{
//{{AFX_DATA_INIT(Dallign)
m_class = _T("");
//}}AFX_DATA_INIT
}
void Dallign::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Dallign)
DDX_Control(pDX, IDC_COMBO_class, m_CLASS);
DDX_CBString(pDX, IDC_COMBO_class, m_class);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Dallign, CDialog)
//{{AFX_MSG_MAP(Dallign)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Dallign message handlers
void Dallign::OnOK()
{
// TODO: Add extra validation here
UpdateData();
Callign *allign=new Callign();
allign->input(m_class);
if(allign->create())
AfxMessageBox("该班学生已经成功分配");
CDialog::OnOK();
}
BOOL Dallign::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
//找到学生表中所有学生的系别放入下拉列表框要求不重复
Cstudent*stu;
stu=(Cstudent*)(((Cstudent*)theApp.vec2)->getFirstRecord());
if(stu)
m_CLASS.AddString(stu->getField("grade"));
for(stu;stu!=NULL;stu=(Cstudent*)(((Cstudent*)theApp.vec2)->getNext()))
{
int exist;
if((exist=m_CLASS.FindString(-1,stu->getField("grade")))==CB_ERR)
{
m_CLASS.AddString(stu->getField("grade"));
}
}
m_CLASS.SetCurSel(0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -