teacheraddcourse.cpp
上传用户:yhxbjx
上传日期:2018-11-07
资源大小:7142k
文件大小:2k
- // teacheraddcourse.cpp : implementation file
- //
- #include "stdafx.h"
- #include "课程设计.h"
- #include "teacheraddcourse.h"
- #include "st.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // teacheraddcourse dialog
- teacheraddcourse::teacheraddcourse(CWnd* pParent /*=NULL*/)
- : CDialog(teacheraddcourse::IDD, pParent)
- {
- //{{AFX_DATA_INIT(teacheraddcourse)
- teacher = _T("");
- zhicheng = _T("");
- kecheng = _T("");
- xueshi = _T("");
- xuefen = _T("");
- didian = _T("");
- jibie = _T("");
- //}}AFX_DATA_INIT
- }
- void teacheraddcourse::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(teacheraddcourse)
- DDX_Text(pDX, IDC_EDIT1, teacher);
- DDX_Text(pDX, IDC_EDIT2, zhicheng);
- DDX_Text(pDX, IDC_EDIT3, kecheng);
- DDX_Text(pDX, IDC_EDIT4, xueshi);
- DDX_Text(pDX, IDC_EDIT5, xuefen);
- DDX_Text(pDX, IDC_EDIT6, didian);
- DDX_Text(pDX, IDC_EDIT7, jibie);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(teacheraddcourse, CDialog)
- //{{AFX_MSG_MAP(teacheraddcourse)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // teacheraddcourse message handlers
- void teacheraddcourse::OnOK()
- {
- // TODO: Add extra validation here
-
- UpdateData();
- int flag=0;
- st a;
- a.Open();
- while(!a.IsEOF())
- {if(teacher==a.m_teacher)
- {flag=1;
- a.Edit();
- a.m_course=kecheng;
- a.m_period=xueshi;
- a.m_xuefen=xuefen;
- a.m_address=didian;
- a.m_grade=jibie;
- a.m_teacher=teacher;
- a.m_level=zhicheng;
- a.Update();
- break;}
- a.MoveNext();
- }
- if(flag==1)
- {MessageBox("教师课程更改成功!!");
- this->OnCancel();
- }
- if(flag==0)
- {MessageBox("未发现教师!!","警告",16);}
- }