




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
沈阳理工大学ASPNET课程设计报告23500字
淮阴工学院《ASP.NET+数据库设计开发实习》报告系(院):计算机工程学院专业:计算机科学与技术班级:NIIT1111学生姓名:耿帅学号:1111305106指导教师:王媛媛张海艳学年学期:2013~2014学年第1学期年目录1需求分析11.1学生需求分析11.2教师需求分析11.3管理员需求分析12数据库、数据表设计12.1创建数据库12.2创建数据表22.3数据库关系图33数据库、数据表设计43.1系统框架43.2母版页53.3学生界面83.4教师界面123.5注册界面134使用到的技术184.1后台184.2前台195测试19《ASP..NET+数据库设计开发实习》1需求分析1.1学生需求分析学生可以登录到系统,如果还没有账户,首先注册账户,或者在学生登失败时提醒注册账户。学生登录到系统后可以查看有关课程、自己的信息、已选课信息,查收收到的信息,修改自己的信息(包括登录密码、联系方式等),学生可以选课、听课、下载资料、上传问题等。1.2教师需求分析教师可以登录到系统,如果还没有账户,首先注册账户,或者在教师登失败时提醒先注册账户。教师登录系统后,可以向管理员申请注册新的授课信息,查看自己授课信息。1.3管理员需求分析管理员可以登录到系统,注册账号,删除学生和教师的账户信息,安排本系统可以进行的课程,发布公告,推荐最新课程等。2数据库、数据表设计因为预计远程教育系统的修改操作会比查询操作多,故在设计数据库是大部分表采用了3NF,这样在修改时会比较方便。我初期设计了八个表,以满足系统的基本需求,在后期的系统实现过程中,根据需要添加或修改相应表。八个表分别是UserAccount,StudentInfo,InstructorInfo,ManagerInfo,Course,SelectCourse,DivingClass(GivingCourse),Information。2.1创建数据库CREATEDATABASERemoteEduONPRIMARY(NAME=RemoteEdu,FILENAME='E:\RemoteEdu\RemoteEdu.mdf',--在目录E:\RemoteEdu\下创建数据--库RemoteEduSIZE=3MB,MAXSIZE=50MB,FILEGROWTH=1MB)1《ASP..NET+数据库设计开发实习》2.2创建数据表1.创建UserAccount表:createtableUserAccount(Accountchar(8)primarykey,Namechar(4)notnull,Dutychar(10)notnull,Passwordchar(8)notnull,)2.创建StudentInfo表:createtableStudentInfo()IdentityNochar(18)primarykey,namechar(4)notnull,Accountchar(8)foreignkeyreferencesUserAccount(Account),Sexchar(2)notnull,PhoneNumchar(11)notnull,Emailvarchar(20)notnull,Birthdatetimenotnull,discribtionvarchar(200),3.创建InstructorInfo表:createtableInstructorInfo()IdentityNochar(18)primarykey,namechar(4)notnull,Accountchar(8)foreignkeyreferencesUserAccount(Account),Sexchar(2)notnull,PhoneNumchar(11)notnull,Emailvarchar(20)notnull,Birthdatetimenotnull,Discribtionvarchar(200)4.创建ManagerInfo表:createtableManagerInfo()2IdentityNochar(18)primarykey,namechar(4)notnull,Accountchar(8)foreignkeyreferencesUserAccount(Account),Sexchar(2)notnull,PhoneNumchar(11)notnull,Emailvarchar(20)notnull,Birthdatetimenotnull,discribtionvarchar(200),《ASP..NET+数据库设计开发实习》5.创建Course表:createtableCourse()CourseNochar(8)primarykey,CourseNamechar(20)notnull,CourseDescribevarchar(100),Pricefloat,Typechar(10)6.创建DivingClass表:createtableDivingClass()CourseNochar(8)notnullforeignkeyreferencesCourse(CourseNo),IdentityNochar(18)notnullforeignkeyreferencesInstructorInfo(IdentityNo),datedatetime,primarykey(CourseNo,IdentityNo)7.创建SelectCourse表:createtableSelectCourse()IdentityNochar(18)notnullforeignkeyreferencesStudentInfo(IdentityNo),CourseNochar(8)notnullforeignkeyreferencesCourse(CourseNo),datedatetime,primarykey(IdentityNo,CourseNo)8.创建Information表:createtableInformation()我收到的信息varchar(500),发送者char(8)foreignkeyreferencesUserAccount(Account),接收者char(8)foreignkeyreferencesUserAccount(Account),日期datetime,primarykey(发送者,接收者)2.3数据库关系图3《ASP..NET+数据库设计开发实习》图2-1数据库关系图3数据库、数据表设计3.1系统框架4《ASP..NET+数据库设计开发实习》母版页MasterPage.master学生界面StudentInterface.aspx教师界面(TeacherInterface.aspx)管理员界面注册账户注册账户注册账户修改信息修改信息修改信息网上选课申请授课修改、删除学生或老师信息上课发放资料交流界面交流界面图3-1系统框架3.2母版页3.2.1主要代码html:<headrunat="server"><title></title><styletype="text/css">#Top{width:840px;height:80px;margin:0auto;background-color:Orange;}#SiteMap{width:840px;height:25px;margin:0auto;background-color:#ccc;position:relative;}#ContentPlaceHolder{width:840px;height:500px;margin:0auto;}#Footer{width:840px;height:50px;margin:0auto;background-color:Gray;position:relative;}a{text-decoration:none;}</style></head><body><formid="form1"runat="server"><divid="Top"style="position:relative;top:0px;left:0px;">5《ASP..NET+数据库设计开发实习》</div><divid="SiteMap"></div><divid="ContentPlaceHolder"><asp:ContentPlaceHolderid="ContentPlaceHolder1"runat="server"></asp:ContentPlaceHolder></div><divid="Footer"></div></form></body>C#:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Data.SqlClient;usingSystem.Data;publicpartialclassMasterPage:System.Web.UI.MasterPage{stringduty;stringconstring="DataSource=SDWM-20130407KX\\SQLEXPRESS;InitialCatalog=RemoteEdu;IntegratedSecurity=true;MultipleActiveResultSets=True";SqlConnectioncon;protectedvoidPage_Load(objectsender,EventArgse){con=newSqlConnection();con.ConnectionString=constring;con.Open();}protectedvoidRadioButtonList1_SelectedIndexChanged(objectsender,EventArgse){if(RadioButtonList1.Text.Equals("学生")){duty="学生";}if(RadioButtonList1.Text.Equals("教师")){duty="教师";}if(RadioButtonList1.Text.Equals("管理员")){duty="管理员";6《ASP..NET+数据库设计开发实习》}}SqlCommandcmd=newSqlCommand("selectAccount,PasswordfromUserAccount",con);SqlDataReaderdr=cmd.ExecuteReader();while(dr.Read()){if(dr[0].ToString().Equals(TextBox1.Text)){if(duty.Equals("学生")){stringstr_id=TextBox1.Text;Session["ID"]=str_id;Response.Redirect("StudentInterface.aspx");}if(duty.Equals("教师")){stringstr_id=TextBox1.Text;Session["ID"]=str_id;Response.Redirect("TeacherInterface.aspx");}if(duty.Equals("管理员")){stringstr_id=TextBox1.Text;Session["ID"]=str_id;Response.Redirect("ManagerInterface.aspx");}}}Response.Write("输入不正确¨");}}3.2.2部分功能设置一个Banner盒子,用来显示系统的标识;一个SiteMap盒子,用来显示整个系统路径;一个Footer盒子,用来显示系统制作这的信息。点击“登录”,弹出登录对话框,根据输的信息进入不同的用户界面。3.2.3截图7《ASP..NET+数据库设计开发实习》图3-2母版页3.3学生界面3.3.1主要代码html:<divstyle="width:200px;height:500px;float:left;position:relative;background-color:#B9B9FF;"><div><ahref="#"id="我的选课信息">我的选课信息</a></div><div><ahref="#"id="我的账户管理">我的账户管理</a></div><div><ahref="#"id="收到的信息">收到的信息</a></div><div><ahref="#"id="我的收藏">的收藏</a></div><div><ahref="#"id="我的笔录">我的笔录</a></div><div><ahref="#"id="选择课程">选择课程</a></div><div><ahref="#"id="上课">上课</a></div><div><ahref="#"id="资料下载">资料下载</a></div></div><scripttype="text/javascript">$(function(){$("#登录").click(function(){$("#登录界面").toggle();});$("#我的选课信息").click(function(){$("#收到信息").hide();$("#gridView1").show();$("#区域二").hide();$("#区域四").hide();$("#区域五").hide();$("#区域六¨?").hide();$("#区域七").hide();$("#区域八").hide();$("#默认").hide();});});</script>C#:usingSystem;8《ASP..NET+数据库设计开发实习》usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Data.SqlClient;usingSystem.Data;publicpartialclassStudentInterface:System.Web.UI.Page{stringconstring="DataSource=SDWM-20130407KX\\SQLEXPRESS;InitialCatalog=RemoteEdu;IntegratedSecurity=true;MultipleActiveResultSets=True";SqlConnectioncon;protectedvoidPage_Load(objectsender,EventArgse){con=newSqlConnection();con.ConnectionString=constring;con.Open();SqlCommandcmd=newSqlCommand("selectUserAccount.Name,UserAccount.Account,Sex,PhoneNum,UserAccount.Duty,IdentityNo,Birth,Password,EmailfromUserAccountjoinStudentInfoonUserAccount.Account=StudentInfo.AccountwhereUserAccount.Account='"+Session["ID"].ToString()+"'",con);DataSetds=newDataSet();SqlDataAdapterda=newSqlDataAdapter("selectSelectCourse.CourseNo,CourseName,CourseDescribe,Price,TypefromSelectCoursejoinCourseonSelectCourse.CourseNo=Course.CourseNojoinStudentInfoonStudentInfo.IdentityNo=SelectCourse.IdentityNowhereStudentInfo.Account='"+Session["ID"].ToString()+"'",con);da.Fill(ds);GridView1.DataSource=ds;GridView1.DataBind();DataSetds2=newDataSet();SqlDataAdapterda2=newSqlDataAdapter("select我收到的信息,发送者,日期¨fromInformationwhere接收者='"+Session["ID"].ToString()+"'",con);da2.Fill(ds2);GridView2.DataSource=ds2;GridView2.DataBind();DataSetds3=newDataSet();SqlDataAdapterda3=newSqlDataAdapter("selectDivingClass.CourseNoas课号,Course.CourseNameas课程名称,InstructorIas授课老师,InstructorInfo.IdentityNoas教师号,CourseDescribeas课程简介,Priceas价格,typeas分类fromDivingClassjoinCourseonDivingClass.CourseNo=Course.CourseNojoinInstructorInfoonInstructorInfo.IdentityNo=DivingClass.IdentityNo",con);da3.Fill(ds3);GridView3.DataSource=ds3;GridView3.DataBind();SqlDataReaderdr=cmd.ExecuteReader();while(dr.Read())9《ASP..NET+数据库设计开发实习》{Label1.Text=dr[0].ToString();Label2.Text=dr[1].ToString();Label3.Text=dr[0].ToString();Label4.Text=dr[2].ToString();Label5.Text=dr[3].ToString();Label6.Text=dr[4].ToString();Label7.Text=dr[5].ToString();Label8.Text=dr[6].ToString();}}protectedvoidButton2_Click(objectsender,EventArgse){Session["ID1"]=Label2.Text;Response.Redirect("编辑区域.aspx");}protectedvoidGridView3_SelectedIndexChanged(objectsender,EventArgse){Session["课号"]=GridView3.SelectedRow.Cells[1].Text;Session["教师号"]=GridView3.SelectedRow.Cells[4].Text;Session["学生账号"]=Session["ID"];//Response.Write(Session["学生账号"].ToString());Response.Redirect("SelectCourse.aspx");}}3.3.2部分功能学生里面有我的选课信息、我的账户管理、收到的信息、的收藏、我的笔录、选择课程等几个功能模块,点击分别切换界面。10《ASP..NET+数据库设计开发实习》3.3.3截图图3-3图3-4学生选课信息图3-5学生编辑界面11《ASP..NET+数据库设计开发实习》3.4教师界面3.4.1主要代码C#:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Data.SqlClient;usingSystem.Data;publicpartialclassTeacherInterface:System.Web.UI.Page{stringconstring="DataSource=SDWM-20130407KX\\SQLEXPRESS;InitialCatalog=RemoteEdu;IntegratedSecurity=true;MultipleActiveResultSets=True";SqlConnectioncon;protectedvoidPage_Load(objectsender,EventArgse){con=newSqlConnection();con.ConnectionString=constring;con.Open();SqlCommandcmd=newSqlCommand("selectUserAccount.Name,UserAccount.Account,Sex,PhoneNum,UserAccount.Duty,IdentityNo,Birth,Password,EmailfromUserAccountjoinInstructorInfoonUserAccount.Account=InstructorInfo.AccountwhereUserAccount.Account='"+Session["ID"].ToString()+"'",con);DataSetds=newDataSet();DataSetds2=newDataSet();SqlDataAdapterda=newSqlDataAdapter("selectDivingClass.CourseNo,CourseName,CourseDescribe,Price,TypefromDivingClassjoinCourseonDivingClass.CourseNo=Course.CourseNojoinInstructorInfoonInstructorInfo.IdentityNo=DivingClass.IdentityNowhereInstructorInfo.Account='"+Session["ID"].ToString()+"'",con);SqlDataAdapterda2=newSqlDataAdapter("select我收到的信息发送者日期fromInformationwhere接收者='"+Session["ID"].ToString()+"'",con);da.Fill(ds);GridView1.DataSource=ds;GridView1.DataBind();da2.Fill(ds2);GridView2.DataSource=ds2;GridView2.DataBind();SqlDataReaderdr=cmd.ExecuteReader();while(dr.Read()){12《ASP..NET+数据库设计开发实习》Label1.Text=dr[0].ToString();Label2.Text=dr[1].ToString();Label3.Text=dr[0].ToString();Label4.Text=dr[2].ToString();Label5.Text=dr[3].ToString();Label6.Text=dr[4].ToString();Label7.Text=dr[5].ToString();Label8.Text=dr[6].ToString();}}protectedvoidButton2_Click(objectsender,EventArgse){Session["ID1"]=Label2.Text;Response.Redirect("编辑区域aspx");}}3.4.2部分功能与学生框架基本相似3.4.3截图图3-5教师收信界面3.5注册界面3.5.1主要代码C#:usingSystem;usingSystem.Collections.Generic;13《ASP..NET+数据库设计开发实习》usingSystem.Linq;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Data.SqlClient;usingSystem.Data;publicpartialclass注册界面:System.Web.UI.Page{stringconstring="DataSource=SDWM-20130407KX\\SQLEXPRESS;InitialCatalog=RemoteEdu;IntegratedSecurity=true;MultipleActiveResultSets=True";SqlConnectioncon;protectedvoidPage_Load(objectsender,EventArgse){Label3.Visible=false;}protectedvoidButton1_Click(objectsender,EventArgsee){con=newSqlConnection();con.ConnectionString=constring;if(!TextBox1.Text.Equals("")&!TextBox2.Text.Equals("")&!TextBox3.Text.Equals("")&!DropDownList1.Text.Equals("")&!TextBox5.Text.Equals("")&!TextBox6.Text.Equals("")&!TextBox7.Text.Equals("")&!TextBox8.Text.Equals("")&!TextBox9.Text.Equals("")&!TextBox10.Text.Equals("")){con.Open();SqlCommandcmd1=newSqlCommand("selectAccountfromUserAccount",con);SqlDataReaderrd1=cmd1.ExecuteReader();if(DropDownList1.Text.Equals("学生"))//学生{inti=0;SqlCommandcmd2=newSqlCommand("selectIdentityNofromStudentInfo",con);SqlDataReaderrd2=cmd2.ExecuteReader();while(rd1.Read()){if(TextBox1.Text.Equals(rd1[0])){rd1.Close();i=1;break;}}14《ASP..NET+数据库设计开发实习》while(rd2.Read()){if(TextBox6.Text.Equals(rd2[0])){rd2.Close();i=1;break;}}rd1.Close();rd2.Close();if(i!=1){SqlCommandcmd3=newSqlCommand("insertUserAccountvalues('"+TextBox1.Text.ToString()+"','"+TextBox5.Text.ToString()+"','"+DropDownList1.Text.ToString()+"','"+TextBox2.Text.ToString()+"')",con);SqlCommandcmd4=newSqlCommand("insertStudentInfovalues('"+TextBox6.Text.ToString()+"','"+TextBox5.Text.ToString()+"','"+TextBox1.Text.ToString()+"','"+TextBox7.Text.ToString()+"','"+TextBox8.Text.ToString()+"','"+TextBox9.Text.ToString()+"','"+TextBox10.Text.ToString()+"','')",con);if(cmd3.ExecuteNonQuery()!=0){if(cmd4.ExecuteNonQuery()!=0){Label2.Visible=true;Label1.Visible=false;Label3.Visible=false;con.Close();}}}if(i==1){Label1.Visible=true;Label2.Visible=false;Label3.Visible=false;}}if(DropDownList1.Text.Equals("教师"))//教师{inti=0;SqlCommandcmd2=newSqlCommand("selectIdentityNofromInstructorInfo",con);15《ASP..NET+数据库设计开发实习》SqlDataReaderrd2=cmd2.ExecuteReader();while(rd1.Read()){if(TextBox1.Text.Equals(rd1[0])){rd1.Close();i=1;break;}}while(rd2.Read()){if(TextBox6.Text.Equals(rd2[0])){rd2.Close();i=1;break;}}rd1.Close();rd2.Close();if(i!=1){SqlCommandcmd3=newSqlCommand("insertUserAccountvalues('"+TextBox1.Text.ToString()+"','"+TextBox5.Text.ToString()+"','"+DropDownList1.Text.ToString()+"','"+TextBox2.Text.ToString()+"')",con);SqlCommandcmd4=newSqlCommand("insertInstructorInfovalues('"+TextBox6.Text.ToString()+"','"+TextBox5.Text.ToString()+"','"+TextBox1.Text.ToString()+"','"+TextBox7.Text.ToString()+"','"+TextBox8.Text.ToString()+"','"+TextBox9.Text.ToString()+"','"+TextBox10.Text.ToString()+"','')",con);if(cmd3.ExecuteNonQuery()!=0){if(cmd4.ExecuteNonQuery()!=0){Label2.Visible=true;con.Close();}}}if(i==1){Label1.Visible=true;}16《ASP..NET+数据库设计开发实习》}if(DropDownList1.Text.Equals("管理员"))//管理员{inti=0;SqlCommandcmd2=newSqlCommand("selectIdentityNofromManagerInfo",con);SqlDataReaderrd2=cmd2.ExecuteReader();while(rd1.Read()){if(TextBox1.Text.Equals(rd1[0])){rd1.Close();i=1;break;}}while(rd2.Read()){if(TextBox6.Text.Equals(rd2[0])){rd2.Close();i=1;break;}}rd1.Close();rd2.Close();if(i!=1){SqlCommandcmd3=newSqlCommand("insertUserAccountvalues('"+TextBox1.Text.ToString()+"','"+TextBox5.Text.ToString()+"','"+DropDownList1.Text.ToString()+"','"+TextBox2.Text.ToString()+"')",con);SqlCommandcmd4=newSqlCommand("insertManagerInfovalues('"+TextBox6.Text.ToString()+"','"+TextBox5.Text.ToString()+"','"+TextBox1.T
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年消防主战车测试题及答案
- 2025年建筑装饰类考试题及答案
- 烤瓷上OP作业指导书
- 2025年铅山单招考试试题及答案
- 2025年拼音考试题讲解教案及答案
- 2025年初一数学数轴试题及答案
- 工业机器人理论复习测试附答案
- 2025年梧州二模英语试题及答案
- 2025年大河事业编考试题及答案
- 2025年礼仪考试题及答案七八套
- 川教版六年级《生命.生态.安全》下册第1课《我们的闲暇时光》课件
- 2024年社区工作者考试必背1000题题库含必背答案
- 心理危机干预指导手册
- 抖音:短视频与直播运营全套教学课件
- 部编小学语文单元作业设计二年级下册第七单元
- 【真题】2023年镇江市中考化学试卷(含答案解析)
- 小米创始人雷军的创业经历
- 2023年江苏省苏州市吴江区中考一模数学试题
- 海南中维生物科技有限公司 蝗虫微孢子虫生物制剂项目 环评报告
- 房地产市场报告 -【年报】2023年全国总结与展望-易居克而瑞
- 【广西农产品出口东盟的现状、问题及优化建议分析11000字(论文)】
评论
0/150
提交评论