学生档案管理系统详细设计说明书.docx
《学生档案管理系统详细设计说明书.docx》由会员分享,可在线阅读,更多相关《学生档案管理系统详细设计说明书.docx(20页珍藏版)》请在冰豆网上搜索。
学生档案管理系统详细设计说明书
中北大学
课程设计任务书
2009-2010学年第二学期
学院:
专业:
班级:
姓名:
课程设计题目:
学生胆敢管理系统
起迄日期:
课程设计地点:
指导教师:
系主任:
下达任务书日期:
2010年5月31日
模块开发卷宗(GB8567——88)
1标题
软件系统名称:
学生档案管理系统
模块名称:
1.登陆模块
2.浏览信息模块
3.修改密码模块
4.管理员添加相关信息模块
5.管理员修改相关信息模块
6.教师添加相关信息模块
7.教师修改相关信息模块
8.更新显示模块
9.查询模块
10.删除模块
程序编制员签名:
张恩瑞,郭伟
修改完成日期:
2010年6月17号
2模块开发情况表
代码设计
计划开始日期
2010年6月11日
实际开始日期
2010年6月10日
计划完成日期
2010年月19日
实际完成日期
2010年6月20日
模块测试
计划开始日期
2010年6月21日
实际开始日期
2010年6月21日
计划完成日期
2010年6月22日
实际完成日期
2010年6月22日
组装测试
计划开始日期
2010年6月23日
实际开始日期
2010年6月23日
计划完成日期
2010年6月23日
实际完成日期
2010年6月23日
代码复查日期/签字
张恩瑞,郭伟
源代码行数
预计
800
实际
900
实际
900
项目负责人批准日期/签字
张恩瑞,郭伟
3功能说明
1.登录模块:
本模块供学生,教师以及管理员登陆到自己所属的页面。
2.浏览信息模块,在学生,教师或着管理员进入自己相应页面时显示相应的信息。
3.修改密码模块:
此模块供学生,教师以及管理员修改自己的密码。
4.管理员添加相关信息模块:
管理员有权限查看和添加班级信息和用户登陆信息,这些在此模块中完成。
5.管理员修改信息模块:
管理员有权限查看和修改班级信息和用户登陆信息,这些在此模块中完成。
6.教师添加相关信息模块:
教师有权限查看本班学生的信息和班级人数,并可以增加新加入的学生信息。
7.教师修改相关信息模块:
教师有权限查看本班学生信息和班级信息,并可以修改相应的信息。
8.更新模块:
此模块用以更新进行添加,修改以及删除以后的信息。
9.查询模块:
教师和管理员有此模块,可以对学生信息进行查询,方便管理。
10.删除模块:
此模块嵌入教师和管理员功能页面中,用以删除相应的信息。
4设计说明
1.登录模块:
判断用户的身份,当用户身份错误时提示错误信息;当用户身份正确时进入相应的页面。
2.浏览信息模块:
在用户页面中应用GridView,显示数据库中信息,且不同的用户浏览不同的信息。
3.修改密码模块:
输入旧的密码,新密码,再次输入新的密码,当输入都准确无误时点击确认按钮,修改成功;若出现错误则提示相应的错误信息。
4.管理员添加相关信息模块:
管理员可以对班级和用户信息作添加,当点击添加按钮,跳转到添加页面,在添加页面添加信息,确认后添加成功;若添加有误,则提示相应的错误信息。
5.管理员修改相关信息模块:
管理员可以对班级和用户信息作修改,此功能用gridview中的“编辑,更新,取消”来实现。
6.教师添加相关信息模块:
教师可以对本班学生进行添加,当点击添加按钮,页面做跳转,在跳转后的页面进行学生的添加。
7.教师修改相关信息模块:
教师可以对本班学生信息作修改,此功能用gridview中的“编辑,更新,取消”来实现。
8.更新显示模块:
在跟新显示按钮中填写数据库连接以及需要读取的信息,将这些信息在gridview中显示出来,让不同的用户看到不同的信息。
9.查询模块:
在TextBox中填写需要查询的信息,确定查询条件后,点击查询按钮即可,此功能功能只有教师和管理员拥有。
10.删除模块:
需要配合查询功能使用,将需要删除的信息作查询,出来结果后点击删除按钮,将此信息删除。
5原代码清单
登陆:
protectedvoidButton1_Click(objectsender,EventArgse)
{
stringYH=yonghu.Text;//输入的文本赋值
stringMM=mima.Text;//输入的文本赋值
OleDbConnectionconn=newOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+AppDomain.CurrentDomain.BaseDirectory+"\\app_data\\学生档案管理系统.mdb;PersistSecurityInfo=True");//连接数据库
stringcmdstr="select*from[admin]";//选择需要连接的表
OleDbCommandcmd=newOleDbCommand(cmdstr,conn);
if(jiaoshi.Checked==true)
{
intT=1;//定义标记
conn.Open();
OleDbDataReaderdr=cmd.ExecuteReader();
while(dr.Read())//循环读取数据
{
stringUserName=dr.GetValue
(2).ToString();
stringPassWord=dr.GetValue(3).ToString();
inttag=Convert.ToInt32(dr.GetValue
(1));
if(YH==UserName&&MM==PassWord&&T==tag)
{
Session["User"]=YH;//数据传值
Response.Redirect("教师页面.aspx");//转到相应的页面
}
else
{
yonghu.Text="";//清空文本
mima.Text="";//清空文本
Label1.Text="用户名或密码错误";
}
}
conn.Close();
}
elseif(guanliyuan.Checked==true)
{
intT=2;//定义标记
conn.Open();
OleDbDataReaderdr=cmd.ExecuteReader();
while(dr.Read())//循环读取数据
{
stringUserName=dr.GetValue
(2).ToString();
stringPassWord=dr.GetValue(3).ToString();
inttag=Convert.ToInt32(dr.GetValue
(1));
if(YH==UserName&&MM==PassWord&&T==tag)
{
Session["User"]=YH;//数据传值
Response.Redirect("管理员页面.aspx");//跳转到相应页面
}
else
{
yonghu.Text="";//清空文本
mima.Text="";//清空文本
Label1.Text="用户名或密码错误";
}
}
conn.Close();
}
elseif(xuesheng.Checked==true)
{
intT=0;//定义标记
conn.Open();
OleDbDataReaderdr=cmd.ExecuteReader();
while(dr.Read())//循环读取数据
{
stringUserName=dr.GetValue
(2).ToString();
stringPassWord=dr.GetValue(3).ToString();
inttag=Convert.ToInt32(dr.GetValue
(1));
if(YH==UserName&&MM==PassWord&&T==tag)
{
Session["User"]=YH;//数据传值
Response.Redirect("学生页面.aspx");//跳转到相应页面
}
else
{
yonghu.Text="";//清空文本
mima.Text="";//清空文本
Label1.Text="用户名或密码错误";
}
}
conn.Close();
}
else
{
Response.Redirect("登陆.aspx");
}
}
修改密码:
protectedvoidqueren_Click1(objectsender,EventArgse)
{
stringmima1=TextBox1.Text.Trim();
stringmima2=TextBox2.Text.Trim();
stringmima3=TextBox3.Text.Trim();
if(!
mima1.Equals("")&&!
mima2.Equals("")&&!
mima3.Equals(""))
{
OleDbConnectionconn=newOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+AppDomain.CurrentDomain.BaseDirectory+"\\app_data\\学生档案管理系统.mdb;PersistSecurityInfo=True");
conn.Open();
try
{
if(TextBox2.Text==TextBox1.Text)
{
stringsqlstr="updateadminset[password]='"+mima1+"'where[password]='"+mima3+"'";//password是关键字需用[]括住
OleDbCommandcmd=newOleDbCommand(sqlstr,conn);
cmd.ExecuteReader();
Label1.Text="修改成功";
}
else
{
Label1.Text="输入有误,请重新输入";
}
}
catch(System.Exceptionee)
{
Response.Write("alert('"+ee.Message.ToString()+"')");
}
finally
{
conn.Close();
}
}
else
{
Label1.Text="密码不能为空";
}
}
protectedvoidfanhui_Click(objectsender,EventArgse)
{
intstudent=0,teacher=1;
if(student==Convert.ToInt32(Session["logo"]))
{
Response.Redirect("学生页面.aspx");
}
elseif(teacher==Convert.ToInt32(Session["logo"]))
{
Response.Redirect("教师页面.aspx");
}
else
{
Response.Redirect("管理员页面.aspx");
}
}
删除模块:
protectedvoidshanchu_Click(objectsender,EventArgse)
{
stringcondition=TextBox1.Text.ToString();
OleDbConnectionconn=newOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+AppDomain.CurrentDomain.BaseDirectory+"\\app_data\\学生档案管理系统.mdb;PersistSecurityInfo=True");
if(!
condition.Equals(""))
{
if(xingming.Checked==true)
{
stringsqlstr="delete*fromS_infowhereS_name='"+condition+"'";//按姓名找到要删除内容
conn.Open();
OleDbCommandcmd=newOleDbCommand(sqlstr,conn);
cmd.ExecuteNonQuery();//执行删除
conn.Close();
Label2.Text="删除成功";
}
elseif(xuehao.Checked==true)
{
stringsqlstr="delete*fromS_infowhereS_number='"+condition+"'";//按学号找到要删除内容
conn.Open();
OleDbCommandcmd=newOleDbCommand(sqlstr,conn);
cmd.ExecuteNonQuery();//执行删除
conn.Close();
Label2.Text="删除成功";
}
else
{
Label2.Text="请输入要删除的信息";
}
}
else
{
Label2.Text="请输入要删除的信息";
}
}
查询模块:
protectedvoidchazhao_Click(objectsender,EventArgse)
{
stringcondition=TextBox1.Text.ToString();//输入查找条件
OleDbConnectionconn=newOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+AppDomain.CurrentDomain.BaseDirectory+"\\app_data\\学生档案管理系统.mdb;PersistSecurityInfo=True");
if(xingming.Checked==true)
{
stringsqlstr="select*fromS_infowhereS_name='"+condition+"'";//按姓名查找
OleDbDataAdapteroda=newOleDbDataAdapter(sqlstr,conn);
DataSetds=newDataSet();
conn.Open();
oda.Fill(ds,"S_info");
GridView1.DataSource=ds;//显示相关姓名数据
GridView1.DataBind();//绑定数据库
Label2.Text="";
TextBox1.Text="";
conn.Close();
}
elseif(xuehao.Checked==true)
{
stringsqlstr="select*fromS_infowhereS_number='"+condition+"'";//按学号查找
OleDbDataAdapteroda=newOleDbDataAdapter(sqlstr,conn);
DataSetds=newDataSet();
conn.Open();
oda.Fill(ds,"S_info");
GridView1.DataSource=ds;//显示相关学号数据
GridView1.DataBind();//绑定数据库
Label2.Text="";
TextBox1.Text="";
conn.Close();
}
else
{
Label2.Text="选择查询关键字";
}
}
浏览模块(教师):
protectedvoidPage_Load(objectsender,EventArgse)
{
if(!
Page.IsPostBack)
{
stringUser=Session["User"].ToString();//接收传来的数据值
OleDbConnectionconn=newOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+AppDomain.CurrentDomain.BaseDirectory+"\\app_data\\学生档案管理系统.mdb;PersistSecurityInfo=True");
stringsqlstr="select*fromS_infowhereS_class='"+User+"'";//依班级在学生表中查找相关信息
stringolestr="select*fromC_infowhereC_class='"+User+"'";//依班级在班级表中查找相关信息
OleDbDataAdapteroda=newOleDbDataAdapter(sqlstr,conn);
OleDbDataAdapterole=newOleDbDataAdapter(olestr,conn);
DataSetds=newDataSet();
DataSetps=newDataSet();
conn.Open();
oda.Fill(ds,"S_info");
ole.Fill(ps,"C_info");
GridView1.DataSource=ds;//显示相关班级数据
GridView2.DataSource=ps;
GridView1.DataBind();//绑定数据库
GridView2.DataBind();
Label1.Text=Session["User"].ToString();
conn.Close();
}
浏览模块(学生):
protectedvoidPage_Load(objectsender,EventArgse)
{
stringUser=Session["User"].ToString();//接收传来的数据值
OleDbConnectionconn=newOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+AppDomain.CurrentDomain.BaseDirectory+"\\app_data\\学生档案管理系统.mdb;PersistSecurityInfo=True");
stringsqlstr="select*fromS_infowhereS_number='"+User+"'";//依条件查找相关信息
OleDbDataAdapteroda=newOleDbDataAdapter(sqlstr,conn);
DataSetds=newDataSet();
conn.Open();
oda.Fill(ds,"S_info");
GridView1.DataSource=ds;//显示相关条件数据
GridView1.DataBind();//绑定数据库
conn.Close();
}
浏览模块(管理员):
protectedvoidPage_Load(objectsender,EventArgse)
{
if(!
Page.IsPostBack)
{
OleDbConnectionconn=newOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+AppDomain.CurrentDomain.BaseDirectory+"\\app_data\\学生档案管理系统.mdb;PersistSecurityInfo=True");
stringcmdstr="select*from[C_info]";//查找数据
OleDbDataAdapteroda=newOleDbDataAdapter(cmdstr,conn);
conn.Open();
DataSetds=newDataSet();
;
oda.Fill(ds,"C_info");
GridView1.DataSource=ds;
GridView1.DataBind();//绑定数据库
conn.Close();
}
管理员修改信息模块(班级信息):
protectedvoidGridView1_RowEditing(objectsender,GridViewEditEventArgse)
{
GridView1.EditIndex=e.NewEditIndex;
OleDbConnectionconn=newOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+AppDomain.CurrentDomain.BaseDirectory+"\\app_data\\学生档案管理系统.mdb;PersistSecurityInfo=True");
stringcmdstr="select*from[C_info]";
OleDbDataAdapteroda=newOleDbDataAdapter(cmdstr,conn);
conn.Op