《面向对象程序设计》课程设计1050303061—吕思超(5)

2019-06-17 12:45

#include \#include \#include \#include \#include \#ifdef _DEBUG

#define new DEBUG_NEW #undef THIS_FILE

static char THIS_FILE[] = __FILE__; #endif

//////////////////////////////////////////////////////////////////// // CDelStudentDlg dialog

CDelStudentDlg::CDelStudentDlg(CWnd* pParent /*=NULL*/) {

//{{AFX_DATA_INIT(CDelStudentDlg) m_Name = _T(\m_Sex = _T(\m_Native = _T(\m_Tel = _T(\m_QQ = _T(\m_Email = _T(\m_HomeAddress = _T(\m_Age = 0; //}}AFX_DATA_INIT

: CDialog(CDelStudentDlg::IDD, pParent)

21

}

void CDelStudentDlg::DoDataExchange(CDataExchange* pDX) { }

BEGIN_MESSAGE_MAP(CDelStudentDlg, CDialog)

//{{AFX_MSG_MAP(CDelStudentDlg) ON_COMMAND(ID_MANAGE_DEL, OnManageDel)

ON_BN_CLICKED(IDC_BUTTON_Cancle, OnBUTTONCancle)

ON_CBN_SELCHANGE(IDC_COMBO_DEL_No, OnSelchangeCOMBODELNo) ON_BN_CLICKED(IDC_BUTTON_DEL, OnButtonDel) //}}AFX_MSG_MAP

CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDelStudentDlg)

DDX_Control(pDX, IDC_COMBO_DEL_No, m_No); DDX_Text(pDX, IDC_EDIT_DEL_Name, m_Name); DDX_Text(pDX, IDC_EDIT_DEL_Sex, m_Sex); DDX_Text(pDX, IDC_EDIT_DEL_Native, m_Native); DDX_Text(pDX, IDC_EDIT_DEL_Tel, m_Tel); DDX_Text(pDX, IDC_EDIT_DEL_QQ, m_QQ); DDX_Text(pDX, IDC_EDIT_DEL_Email, m_Email);

DDX_Text(pDX, IDC_EDIT_DEL_HomeAddress, m_HomeAddress); DDX_Text(pDX, IDC_EDIT_DEL_Age, m_Age); //}}AFX_DATA_MAP

END_MESSAGE_MAP()

22

///////////////////////////////////////////////////////////////////// // CDelStudentDlg message handlers

void CDelStudentDlg::OnManageDel() { }

void CDelStudentDlg::OnBUTTONCancle() { }

void CDelStudentDlg::OnSelchangeCOMBODELNo() {

// TODO: Add your control notification handler code here int vSize=(int)m_v.size(); UpdateData(true); CString m_strNo;

m_No.GetWindowText(m_strNo); for(int i=0;i

if (m_strNo==m_v[i]->GetStuNo()) { }

break;

// TODO: Add your control notification handler code here CDialog::OnCancel();

// TODO: Add your command handler code here CDelStudentDlg dlgDel; dlgDel.DoModal();

23

}

}

m_Name=m_v[i]->GetStuName(); m_Sex=m_v[i]->GetSex(); m_Native=m_v[i]->GetNative(); m_Age=m_v[i]->GetAge();

m_HomeAddress=m_v[i]->GetHomeAddress(); m_Tel=m_v[i]->GetTelephone(); m_QQ=m_v[i]->GetQQ(); m_Email=m_v[i]->GetEmail(); UpdateData(false);

BOOL CDelStudentDlg::OnInitDialog() {

return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE CDialog::OnInitDialog();

// TODO: Add extra initialization here CStudentDoc doc;

m_v=doc.GetStudentList(); int vSize=(int)m_v.size(); for(int i=0;i

UpdateData(false);

m_No.AddString(m_v[i]->GetStuNo());

24

}

void CDelStudentDlg::OnButtonDel() {

// TODO: Add your control notification handler code here UpdateData(TRUE); CStudent tmpStu; CString m_strNo;

m_No.GetWindowText(m_strNo); tmpStu.SetStuName(m_Name); tmpStu.SetStuNo(m_strNo); tmpStu.SetSex(m_Sex); tmpStu.SetAge(m_Age);

tmpStu.SetHomeAddress(m_HomeAddress); tmpStu.SetNative(m_Native); tmpStu.SetTelephone(m_Tel); tmpStu.SetQQ(m_QQ); tmpStu.SetEmail(m_Email); CStudentDoc stuDoc; if (stuDoc.Del(tmpStu)) { } else { }

MessageBox(\删除学生信息失败!\MessageBox(\成功删除学生信息!\CDialog::OnOK();

25


《面向对象程序设计》课程设计1050303061—吕思超(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:提高全线温湿度及冷水系统处理效率 完整报告

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: