基于数据库的课程管理设计方案.docx
- 文档编号:30378321
- 上传时间:2023-08-14
- 格式:DOCX
- 页数:35
- 大小:1.99MB
基于数据库的课程管理设计方案.docx
《基于数据库的课程管理设计方案.docx》由会员分享,可在线阅读,更多相关《基于数据库的课程管理设计方案.docx(35页珍藏版)》请在冰豆网上搜索。
基于数据库的课程管理设计方案
研究生课程
论文题目基于数据库的课程管理的设计方案
课程名称
学院
专业
学生姓名
学号
系统总体规划
1.1系统设计思想
1、采用现有的资源,先进的管理系统开发方案,充分利用学校现有的资源,减少开发中的时间和财力、物力、提高系统开发的水平和应用效果。
2、系统就满足学校的需求,例如学生信息的录入、查询、更新等。
学生录入与排名。
3、系统就具备数据库维护功能,及时根据用户需求进行数据添加、删除、修改等操作。
1.2系统功能
本系统适用于中小学校,其功能主要分为六大类:
用户管理:
用于对用户的添加,赋于不同权限及对用户的修改及查询。
课程管理:
用于对各学期课程的开设和修改。
成绩管理:
用于对成绩的输入、修改、汇总及排名
教师信息管理:
添加,删除,修改学生信息等。
学生信息管理:
添加,删除,修改学生信息等。
1.3软件架构及系统用例图
1.3.1系统架构
软件的总体架构如图2.1:
主界面
图1.1软件架构图
1.3.2系统总体用例
图1.2系统总体用例图
1.3.3程序功能流程图
图1.3程序功能图
系统实现及源代码
学生成绩管理工作主要是学生成绩的管理,具体功能包括数据输入,修改,删除,查询,统计等功能
2.1数据库设计
在系统分析中把学生成绩管理分为学生基本情况管理,学生成绩管理,教师及管理员管理
成绩表
列号
数据类型
填写限制
数据类型
宽度
课程号
char(10)
数值可以为空
字符型
10
学号
char(10)
数值可以为空
字符型
10
日期
smalldatetime
数值可以为空
时间类型
10
任课教师编号
char(10)
数值可以为空
字符型
10
成绩
float
数值不能为空
数值类型
8
教师表
列号
数据类型
填写限制
数据类型
宽度
教师编号
char(10)
数值可以为空
字符型
10
姓名
char(6)
数值可以为空
字符型
6
性别
char
(2)
数值不能为空
字符型
2
出生日期
smalldatetime
数值不能为空
时间类型
4
院系名称
char(16)
数值可以为空
字符型
16
职称
char(10)
数值可以为空
字符型
10
学历
char(10)
数值不能为空
字符型
10
备注
text
数值不能为空
文本
16
政治面貌
char(16)
数值不能为空
字符型
16
密码
char(10)
数值可以为空
字符型
10
课程表
列号
数据类型
填写限制
数据类型
宽度
课程号
char(10)
数值可以为空
字符型
10
课程名
char(20)
数值可以为空
字符型
20
学分
int
数值不能为空
整数
4
备注
text
数值不能为空
文本
16
学生表
列号
数据类型
填写限制
数据类型
宽度
学号
char(10)
数值可以为空
字符型
10
姓名
char(6)
数值可以为空
字符型
6
性别
char
(2)
数值不能为空
字符型
2
院系
char(20)
数值可以为空
字符型
20
出生日期
smalldatetime
数值不能为空
日时间类型
4
家庭住址
char(40)
数值不能为空
字符型
40
入学时间
smalldatetime
数值不能为空
日时间类型
4
政治面貌
char(16)
数值不能为空
字符型
16
备注
text
数值不能为空
文本
16
密码
char(10)
数值不能为空
字符型
10
用户表
列号
数据类型
填写限制
数据类型
宽度
用户名
char(10)
数值可以为空
字符型
10
密码
char(10)
数值不能为空
字符型
10
备注
char(10)
数值不能为空
字符型
10
2.2软件运行时的界面及代码实现
2.2.1登录模块
用户登录界面以后需要选择用户类型,用户名就是自己的证件号或者学号,初始密码123456登陆后需要修改,只能在信息无误后才能登录
图2.1账户登录界面件帐号界面
代码实现过程
如下登录过程中会从数据库中读取数据进行判断该账户是否存在
publicpartialclass_Default:
System.Web.UI.Page
{
inttemp=0;
protectedvoidPage_Load(objectsender,EventArgse)
{
if(!
IsPostBack)
{
DropDownList1.Items.Add("管理员");
DropDownList1.Items.Add("教师");
DropDownList1.Items.Add("学生");
}
}
protectedvoidButton1_Click(objectsender,EventArgse)
{
stringstrcmd="";
if(TextBox1.Text!
=""&&TextBox2.Text!
="")
{
if(DropDownList1.Text=="管理员")
{
strcmd="selectcount(*)from用户表where用户名='"+TextBox1.Text+"'and密码='"+TextBox2.Text+"'";
temp=1;
}
if(DropDownList1.Text=="教师")
{
strcmd="selectcount(*)from教师表where教师编号='"+TextBox1.Text+"'and密码='"+TextBox2.Text+"'";
temp=2;
}
if(DropDownList1.Text=="学生")
{
strcmd="selectcount(*)from学生表where学号='"+TextBox1.Text+"'and密码='"+TextBox2.Text+"'";
temp=3;
}
SqlConnectioncnn=newSqlConnection(ConfigurationManager.ConnectionStrings["学生成绩智能管理系统ConnectionString"].ToString());
cnn.Open();
SqlCommandcmd=newSqlCommand(strcmd,cnn);
if((int)cmd.ExecuteScalar()==1)
{
this.Session.Add("name",Convert.ToString(TextBox1.Text));
if(temp==1)
Response.Redirect("管理模块//学生信息管理.aspx");
if(temp==2)
Response.Redirect("教师模块//Default1.aspx");
if(temp==3)
Response.Redirect("学生模块//Default.aspx");
}
else
Response.Write("
');history.go(-1);");
cnn.Close();
}
else
Response.Write("
');history.go(-1);");
}
protectedvoid登陆_Click(objectsender,EventArgse)
{
DropDownList1.Text="管理员";
TextBox1.Text="";
TextBox2.Text="";
}
}
2.2.2管理员操作模块
登录账户的不同会进如不同的操作界面,因而会有三个大的功能模块管理员,教师,学生模块
管理员操作界面
主要实现管理员账户管理,教师账户管理,学生账户管理以及课程信息的管理
图2.2管理员操作界面
账户信息管理源代码:
publicpartialclass_Default:
System.Web.UI.Page
{
publicstringCID;
publicstringsqlconn;
DataRowdtr;
SqlDataAdaptermyadapter;
SqlCommandBuilderscb;
DataSetmyDataSet;
SqlConnectionmysqlconnection;
intreturnValue;
protectedvoidPage_Load(objectsender,EventArgse)
{
CID=Session["name"].ToString();
mysqlconnection=newSqlConnection(ConfigurationManager.ConnectionStrings["学生成绩智能管理系统ConnectionString"].ToString());
SqlCommandmysqlcommand=mysqlconnection.CreateCommand();
mysqlcommand.CommandText="select用户名,密码,备注from用户表where用户名="+"'"+CID+"'";
myadapter=newSqlDataAdapter();
myadapter.SelectCommand=mysqlcommand;
myDataSet=newDataSet();
mysqlconnection.Open();
intnumberOfRow=myadapter.Fill(myDataSet,"用户表");
mysqlconnection.Close();
DataTabletb=myDataSet.Tables["用户表"];
dtr=tb.Rows[0];
}
protectedvoidButton1_Click(objectsender,EventArgse)
{
TextBox1.ReadOnly=false;
TextBox4.Visible=true;
TextBox4.ReadOnly=false;
TextBox1.Text="";
TextBox2.Text="";
TextBox2.ReadOnly=false;
TextBox3.Text="请记住新的密码以免造成不必要的麻烦!
";
Label1.Text="原始密码";
Label2.Text="新密码";
Label3.Text="小提示";
Label4.Visible=true;
Button4.Visible=true;
Button5.Visible=true;
Button5.Text="取消";
}
protectedvoidButton4_Click(objectsender,EventArgse)
{
SqlCommandcoutsqlcommand=mysqlconnection.CreateCommand();
mysqlconnection.Open();
if(TextBox1.Text!
=""&&TextBox2.Text!
="")
{
if(TextBox4.Visible==true)
{
coutsqlcommand.CommandText="selectcount(*)as数目from用户表where用户名="+"'"+CID+"'"+"and密码="+"'"+Convert.ToString(TextBox1.Text)+"'";
returnValue=(Int32)coutsqlcommand.ExecuteScalar();
if(returnValue==1)
{
if(TextBox2.Text==TextBox4.Text)
{
Response.Write("");
scb=newSqlCommandBuilder(myadapter);
myDataSet.Tables["用户表"].Rows[0]["密码"]=(String)(TextBox4.Text);
myadapter.Update(myDataSet.Tables["用户表"]);
}
else
Response.Write("");
}
else
Response.Write("");
}
else
if(TextBox4.Visible!
=true)
{
if(Label1.Text=="用户名")
{
myDataSet.Tables["用户表"].Rows[0]["备注"]=(String)(TextBox3.Text);
scb=newSqlCommandBuilder(myadapter);
myadapter.Update(myDataSet.Tables["用户表"]);
Response.Write("");
}
if(Label1.Text=="新用户名")
{
coutsqlcommand.CommandText="selectcount(*)as数目from用户表where用户名="+"'"+TextBox1.Text+"'";
returnValue=(int)coutsqlcommand.ExecuteScalar();
if(returnValue!
=0)
{
Response.Write("");
}
else
{
DataRowdbr=myDataSet.Tables["用户表"].NewRow();
dbr["用户名"]=(String)(TextBox1.Text);
dbr["密码"]=(String)(TextBox2.Text);
dbr["备注"]=(String)(TextBox3.Text);
myDataSet.Tables["用户表"].Rows.Add(dbr);
scb=newSqlCommandBuilder(myadapter);
myadapter.Update(myDataSet.Tables["用户表"]);
Response.Write("");
}
}
if(Label1.Text=="删除用户")
{
coutsqlcommand.CommandText="selectcount(*)as数目from用户表where用户名="+"'"+Convert.ToString(TextBox1.Text)+"'"+"and密码="+"'"+Convert.ToString(TextBox2.Text)+"'";
returnValue=(int)coutsqlcommand.ExecuteScalar();
if(returnValue==1)
{
Response.Write("");
Button5.Enabled=true;
Button4.Enabled=false;
}
else
{
Response.Write("");
Button5.Enabled=false;
}
}
}
}
else
Response.Write("");
mysqlconnection.Close();
}
protectedvoidButton6_Click(objectsender,EventArgse)
{
TextBox1.Text=(String)(dtr["用户名"]);
TextBox2.Text="**********";
TextBox3.Text=(String)(dtr["备注"]);
Label1.Text="用户名";
Label2.Text="密码";
Label3.Text="备注";
Label4.Visible=false;
TextBox4.Visible=false;
Button4.Visible=false;
Button5.Visible=false;
}
protectedvoidButton2_Click(objectsender,EventArgse)
{
Button4.Visible=true;
Button5.Visible=false;
TextBox4.Visible=false;
TextBox3.ReadOnly=false;
Label1.Text="用户名";
Label2.Text="密码";
Label3.Text="备注";
Label4.Visible=false;
TextBox1.Text=(String)(dtr["用户名"]);
TextBox2.Text="**********";
TextBox3.Text=(String)(dtr["备注"]);
}
protectedvoidButton3_Click(objectsender,EventArgse)
{
Button4.Visible=true;
Button5.Visible=false;
Button4.Enabled=true;
Button5.Enabled=true;
TextBox4.Visible=false;
TextBox1.ReadOnly=false;
TextBox2.ReadOnly=false;
TextBox3.ReadOnly=false;
Label1.Text="新用户名";
Label2.Text="密码";
Label3.Text="备注";
Label4.Visible=false;
TextBox1.Text="";
TextBox2.Text="";
TextBox3.Text="";
}
protectedvoidButton7_Click(objectsender,EventArgse)
{
Label1.Text="删除用户";
Button4.Visible=true;
Button5.Visible=true;
Button5.Enabled=false;
TextBox4.Visible=false;
TextBox1.ReadOnly=false;
TextBox2.ReadOnly=false;
TextBox3.ReadOnly=true;
Label2.Text="密码";
Label3.Text="备注";
Label4.Visible=false;
TextBox1.Text="";
TextBox2.Text="";
TextBox3.Text="";
Button4.Text="确定";
Button5.Text="提交删除";
TextBox3.Text="请输入要删除的用户名和密码!
";
}
protectedvoidButton5_Click1(objectsender,EventArgse)
{
if(Label1.Text=="删除用户")
{
SqlCommandcoutsqlcommand=mysqlconnection.CreateCommand();
mysqlconnection.Open();
coutsqlcommand.CommandText="deletefrom用户表where用户名="+"'"+Convert.ToString(TextBox1.Text)+"'"+"and密码="+"'"+Convert.ToString(TextBox2.Text)+"'";
returnValue=coutsqlcommand.ExecuteNonQuery();
if(returnValue==1)
{
Response.Write("");
}
else
{
Response.Write("");
}
Button5.Enabled=false;
Button4.Enabled=true;
}
}
protectedvoidButton8_Click(objectsender,EventArgse)
{
}
}
学生信息管
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 数据库 课程 管理 设计方案
![提示](https://static.bdocx.com/images/bang_tan.gif)