资源简介
该系统是基于VC的MFC程序,程序里包括数据库备份文件,数据库是使用的SQL Server。实现的功能有:登陆功能,学生选课,管理员添加课程,删除,查看,教师评分功能!运行前要先把数据库文件还原,然后建立一个名为Student的数据源。数据库连接使用的是ODBC连接,该程序是基于单文档的MFC程序!!!
代码片段和文件信息
// AdmADDCDialog.cpp : implementation file
//
#include “stdafx.h“
#include “Student.h“
#include “AdmADDCDialog.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAdmADDCDialog dialog
CAdmADDCDialog::CAdmADDCDialog(CWnd* pParent /*=NULL*/)
: CDialog(CAdmADDCDialog::IDD pParent)
{
//{{AFX_DATA_INIT(CAdmADDCDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CAdmADDCDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAdmADDCDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAdmADDCDialog CDialog)
//{{AFX_MSG_MAP(CAdmADDCDialog)
ON_BN_CLICKED(IDC_ADMADDC OnAdmAddc)
ON_BN_CLICKED(IDC_ADMCANCLES OnAdmcancles)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAdmADDCDialog message handlers
void CAdmADDCDialog::OnAdmAddc()
{
// TODO: Add your control notification handler code here
CDatabase db;
db.OpenEx(“DSN=Student“);
CString strSQL;
CRecordset rs(&db);
CString temp1temp2temp3temp4temp5;
GetDlgItemText(IDC_EDIT1temp1);
GetDlgItemText(IDC_EDIT2temp2);
GetDlgItemText(IDC_EDIT3temp3);
GetDlgItemText(IDC_EDIT4temp4);
GetDlgItemText(IDC_EDIT5temp5);
if(temp1.IsEmpty())
{
AfxMessageBox(“课程编号不能为空!“);
return;
}
strSQL.Format(“select * from Course where courseNum=‘%s‘“temp1);
rs.Open(CRecordset::snapshotstrSQL);
int i=rs.GetRecordCount();
if(i!=0)
{
AfxMessageBox(“课程编号已经存在!“);
SetDlgItemText(IDC_EDIT1““);
return;
}
strSQL.Format(“insert into Course(courseNumcourseNamecourseTimecourseScorecourseTerm) values(‘%s‘‘%s‘‘%s‘‘%s‘‘%s‘)“temp1temp2temp3temp4temp5);
db.ExecuteSQL(strSQL);
AfxMessageBox(“添加课程成功!“);
SetDlgItemText(IDC_EDIT1““);
SetDlgItemText(IDC_EDIT2““);
SetDlgItemText(IDC_EDIT3““);
SetDlgItemText(IDC_EDIT4““);
SetDlgItemText(IDC_EDIT5““);
}
void CAdmADDCDialog::OnAdmcancles()
{
// TODO: Add your control notification handler code here
SendMessage(WM_CLOSE);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2338 2010-03-04 14:23 学生选课系统\Student\AdmADDCDialog.cpp
文件 1294 2010-03-04 14:23 学生选课系统\Student\AdmADDCDialog.h
文件 2404 2010-03-04 20:14 学生选课系统\Student\AdmADDSDialog.cpp
文件 1292 2010-03-04 20:08 学生选课系统\Student\AdmADDSDialog.h
文件 1046 2010-03-04 10:18 学生选课系统\Student\AdmCcDialog.cpp
文件 1267 2010-03-04 10:18 学生选课系统\Student\AdmCcDialog.h
文件 2920 2010-03-07 01:25 学生选课系统\Student\AdmChangecDialog.cpp
文件 1339 2010-03-04 15:49 学生选课系统\Student\AdmChangecDialog.h
文件 2840 2010-03-07 01:25 学生选课系统\Student\AdmChangesDialog.cpp
文件 1343 2010-03-04 15:18 学生选课系统\Student\AdmChangesDialog.h
文件 1948 2010-03-03 21:34 学生选课系统\Student\AdmCourseDialog.cpp
文件 1280 2010-03-03 21:20 学生选课系统\Student\AdmCourseDialog.h
文件 3674 2010-03-07 01:25 学生选课系统\Student\AdmDeletecDialog.cpp
文件 1338 2010-03-04 14:46 学生选课系统\Student\AdmDeletecDialog.h
文件 3599 2010-03-07 01:25 学生选课系统\Student\AdmDeletesDialog.cpp
文件 1341 2010-03-04 15:34 学生选课系统\Student\AdmDeletesDialog.h
文件 3080 2010-03-05 17:01 学生选课系统\Student\AdmDialog.cpp
文件 1484 2010-03-04 20:01 学生选课系统\Student\AdmDialog.h
文件 4836 2010-03-04 14:21 学生选课系统\Student\AdmStudentDialog.cpp
文件 1432 2010-03-04 14:21 学生选课系统\Student\AdmStudentDialog.h
文件 3628 2010-03-04 19:53 学生选课系统\Student\ChangeCourseDialog.cpp
文件 1370 2010-03-04 16:55 学生选课系统\Student\ChangeCourseDialog.h
文件 2376 2010-03-05 19:21 学生选课系统\Student\ChangeKey.cpp
文件 1264 2010-03-05 19:21 学生选课系统\Student\ChangeKey.h
文件 3541 2010-03-04 19:56 学生选课系统\Student\ChangeStudentDialog.cpp
文件 1381 2010-03-04 19:39 学生选课系统\Student\ChangeStudentDialog.h
文件 2588 2010-03-07 11:03 学生选课系统\Student\CJDialog.cpp
文件 1216 2010-03-07 11:03 学生选课系统\Student\CJDialog.h
文件 4998 2010-03-04 14:21 学生选课系统\Student\CourseDialog.cpp
文件 1377 2010-03-04 14:20 学生选课系统\Student\CourseDialog.h
............此处省略56个文件信息
- 上一篇:C语言试卷附答案
- 下一篇:俄罗斯方块c++源码
相关资源
- c/c++经典1000例100+900例 包括详细题目、
- VC++语法分析工具源代码附文档
- 图书管理系统纯c++编译,vc6轻松实现
- 8数码难题含代码,实验报告
- VC++俄罗斯方块完整源码
- 自制FFT频谱分析软件
- 基于vc++的SVM
- 数子水印 c++ vc
- 详细vc++写的俄罗斯方块
- VC6.0仿真windows记事本程序
- chartCtrl Vc++
- Cminus 词法、语法分析程序VC6.0
- 混合加密程序 VC++包括DES加密和AES加密
- 五子棋 源码 游戏编程 MFC VC C++
- glut.3.7.6+.DevPak
- 用Socket写的HTTP类,商业级C++源码。
- PL0超强扩展(可视化)
- vc++6.0开发的音频采集程序
- VC++ 导入excel数据
- VC2017+OPENCV4.30实现机器人与传感器的手
- 五子棋(棋盘)(MFC编写)
- 基于vc6开发的计算器
- opelgl基于vc的mfc写的粒子烟花效果源代
- 在线考试系统VC++MFC
- VC++ 视频播放器 程序及源码
- vc++编写的聊天程序
- mfc推箱子代码
- VC++ 网络对战五子棋游戏(服务端+用
- VC++简单多人聊天室源码
- A*算法vc++源码
评论
共有 条评论