ChangeSuspandInfoDlg.cpp
资源名称:school.rar [点击查看]
上传用户:rs600066
上传日期:2017-10-16
资源大小:4788k
文件大小:2k
源码类别:
数据库系统
开发平台:
Visual C++
- // ChangeSuspandInfoDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "school.h"
- #include "ChangeSuspandInfoDlg.h"
- #include "classset.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CChangeSuspandInfoDlg dialog
- CChangeSuspandInfoDlg::CChangeSuspandInfoDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CChangeSuspandInfoDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CChangeSuspandInfoDlg)
- m_strClass = _T("");
- m_strCode = _T("");
- m_strBrief = _T("");
- m_strName = _T("");
- m_strDate = _T("");
- m_strLong = _T("");
- //}}AFX_DATA_INIT
- }
- void CChangeSuspandInfoDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CChangeSuspandInfoDlg)
- DDX_Control(pDX, IDC_COMBO3_CLASS, m_ctrClass);
- DDX_CBString(pDX, IDC_COMBO3_CLASS, m_strClass);
- DDX_Text(pDX, IDC_EDIT1_CODE, m_strCode);
- DDX_Text(pDX, IDC_EDIT2_BRIEF, m_strBrief);
- DDX_Text(pDX, IDC_EDIT4_NAME, m_strName);
- DDX_Text(pDX, IDC_EDIT5_DATE, m_strDate);
- DDX_Text(pDX, IDC_EDIT5_LONG, m_strLong);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CChangeSuspandInfoDlg, CDialog)
- //{{AFX_MSG_MAP(CChangeSuspandInfoDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CChangeSuspandInfoDlg message handlers
- BOOL CChangeSuspandInfoDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- CClassSet recordset ;
- if(!recordset.Open(AFX_DB_USE_DEFAULT_TYPE,"select * from class"))
- {
- MessageBox("打开数据库失败!","数据库错误",MB_OK);
- return FALSE;
- }
- while(!recordset.IsEOF())
- {
- m_ctrClass.AddString(recordset.m_code);
- recordset.MoveNext();
- }
- recordset.Close();
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CChangeSuspandInfoDlg::OnOK()
- {
- UpdateData();
- if(m_strCode.IsEmpty())
- {
- AfxMessageBox("请输入编号!");
- return;
- }
- if(m_strClass.IsEmpty())
- {
- AfxMessageBox("请输入班级!");
- return;
- }
- if(m_strName.IsEmpty())
- {
- AfxMessageBox("请输入休学人姓名!");
- return;
- }
- CDialog::OnOK();
- }