fixcoursedialog.cpp
上传用户:yhxbjx
上传日期:2018-11-07
资源大小:7142k
文件大小:2k
- // fixcoursedialog.cpp : implementation file
- //
- #include "stdafx.h"
- #include "课程设计.h"
- #include "fixcoursedialog.h"
- #include "st.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // fixcoursedialog dialog
- fixcoursedialog::fixcoursedialog(CWnd* pParent /*=NULL*/)
- : CDialog(fixcoursedialog::IDD, pParent)
- {
- //{{AFX_DATA_INIT(fixcoursedialog)
- fixcourse = _T("");
- fixtime = _T("");
- fixgrade = _T("");
- fixaddress = _T("");
- fixclass = _T("");
- fixteacher = _T("");
- fixlevel = _T("");
- //}}AFX_DATA_INIT
- }
- void fixcoursedialog::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(fixcoursedialog)
- DDX_Text(pDX, IDC_EDIT1, fixcourse);
- DDX_Text(pDX, IDC_EDIT2, fixtime);
- DDX_Text(pDX, IDC_EDIT3, fixgrade);
- DDX_Text(pDX, IDC_EDIT4, fixaddress);
- DDX_Text(pDX, IDC_EDIT5, fixclass);
- DDX_Text(pDX, IDC_EDIT6, fixteacher);
- DDX_Text(pDX, IDC_EDIT7, fixlevel);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(fixcoursedialog, CDialog)
- //{{AFX_MSG_MAP(fixcoursedialog)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // fixcoursedialog message handlers
- int fixcoursedialog::DoModal()
- {
- // TODO: Add your specialized code here and/or call the base class
-
- return CDialog::DoModal();
- }
- void fixcoursedialog::OnOK()
- {
- // TODO: Add extra validation here
-
- UpdateData();
- int flag=0;
- st a;
- a.Open();
- while(!a.IsEOF())
- {if(fixcourse==a.m_course)
- {flag=1;
- a.Edit();
- a.m_course=fixcourse;
- a.m_period=fixtime;
- a.m_xuefen=fixgrade;
- a.m_address=fixaddress;
- a.m_grade=fixclass;
- a.m_teacher=fixteacher;
- a.m_level=fixlevel;
- a.Update();
- break;}
- a.MoveNext();
- }
- if(flag==1)
- {MessageBox("该门课程及其相关内容已经修改成功!!");
- this->OnCancel();
- }
- if(flag==0)
- {MessageBox("未发现课程!!","警告",16);}
- }