ASPNET课程设计报告.doc_第1页
ASPNET课程设计报告.doc_第2页
ASPNET课程设计报告.doc_第3页
ASPNET课程设计报告.doc_第4页
ASPNET课程设计报告.doc_第5页
已阅读5页,还剩18页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

黄山 学院 ASP NET ASP NET 编程技术课程设计编程技术课程设计 报告报告 系 院 系 院 信 息工 程 学 院 专专 业业 计算机科学与技术 班班 级级 12 计算机 2 班 学生姓名 学生姓名 耿 帅 学号 学号 111305106 题目题目 指导教师指导教师 陆超泽 学年学期学年学期 2014 2015 学年 第 1 学期 2014年 12 月 15 日 目目录录 1 1 需求分析需求分析 1 1 11 1 学生需求分析学生需求分析 1 1 21 2 教师需求分析教师需求分析 1 1 31 3 管理员需求分析管理员需求分析 1 2 2 数据库 数据表设计数据库 数据表设计 1 2 12 1 创建数据库创建数据库 1 2 22 2 创建数据表创建数据表 2 2 32 3 数据库关系图数据库关系图 3 3 3 数据库 数据表设计数据库 数据表设计 4 3 13 1 系统框架系统框架 4 3 23 2 母版页母版页 5 3 33 3 学生界面学生界面 8 3 43 4 教师界面教师界面 12 3 53 5 注册界面注册界面 13 4 4 使用到的技术使用到的技术 18 4 14 1 后台后台 18 4 24 2 前台前台 19 5 5 测试测试 19 ASP NET 编程技术课程设计报告 0 1 1 需求分析需求分析 1 11 1 学生需求分析学生需求分析 学生可以登录到系统 如果还没有账户 首先注册账户 或者在学生登失败时提 醒注册账户 学生登录到系统后可以查看有关课程 自己的信息 已选课信息 查收 收到的信息 修改自己的信息 包括登录密码 联系方式等 学生可以选课 听课 下载资料 上传问题等 1 21 2 教师需求分析教师需求分析 教师可以登录到系统 如果还没有账户 首先注册账户 或者在教师登失败时提 醒先注册账户 教师登录系统后 可以向管理员申请注册新的授课信息 查看自己授 课信息 1 31 3 管理员需求分析管理员需求分析 管理员可以登录到系统 注册账号 删除学生和教师的账户信息 安排本系统可 以进行的课程 发布公告 推荐最新课程等 2 2 数据库 数据表设计数据库 数据表设计 因为预计远程教育系统的修改操作会比查询操作多 故在设计数据库是大部分表 采用了 3NF 这样在修改时会比较方便 我初期设计了八个表 以满足系统的基本需 求 在后期的系统实现过程中 根据需要添加或修改相应表 八个表分别是 UserAccount StudentInfo InstructorInfo ManagerInfo Course SelectCourse Divin gClass GivingCourse Information 2 12 1 创建数据库创建数据库 CREATE DATABASE RemoteEdu ON PRIMARY NAME RemoteEdu FILENAME E RemoteEdu RemoteEdu mdf 在目录E RemoteEdu 下创建数据 库RemoteEdu SIZE 3MB MAXSIZE 50MB FILEGROWTH 1MB ASP NET 编程技术课程设计报告 1 2 22 2 创建数据表创建数据表 1 创建UserAccount表 create table UserAccount Account char 8 primary key Name char 4 not null Duty char 10 not null Password char 8 not null 2 创建StudentInfo表 create table StudentInfo IdentityNo char 18 primary key name char 4 not null Account char 8 foreign key references UserAccount Account Sex char 2 not null PhoneNum char 11 not null Email varchar 20 not null Birth datetime not null discribtion varchar 200 3 创建InstructorInfo表 create table InstructorInfo IdentityNo char 18 primary key name char 4 not null Account char 8 foreign key references UserAccount Account Sex char 2 not null PhoneNum char 11 not null Email varchar 20 not null Birth datetime not null Discribtion varchar 200 4 创建ManagerInfo表 create table ManagerInfo IdentityNo char 18 primary key name char 4 not null Account char 8 foreign key references UserAccount Account Sex char 2 not null PhoneNum char 11 not null Email varchar 20 not null Birth datetime not null discribtion varchar 200 ASP NET 编程技术课程设计报告 2 5 创建Course表 create table Course CourseNo char 8 primary key CourseName char 20 not null CourseDescribe varchar 100 Price float Type char 10 6 创建DivingClass表 create table DivingClass CourseNo char 8 not null foreign key references Course CourseNo IdentityNo char 18 not null foreign key references InstructorInfo IdentityNo date datetime primary key CourseNo IdentityNo 7 创建SelectCourse表 create table SelectCourse IdentityNo char 18 not null foreign key references StudentInfo IdentityNo CourseNo char 8 not null foreign key references Course CourseNo date datetime primary key IdentityNo CourseNo 8 创建Information表 create table Information 我收到的信息varchar 500 发送者char 8 foreign key references UserAccount Account 接收者char 8 foreign key references UserAccount Account 日期datetime primary key 发送者 接收者 2 32 3 数据库关系图数据库关系图 ASP NET 编程技术课程设计报告 3 图 2 1 数据库关系图 3 3 数据库 数据表设计数据库 数据表设计 3 13 1 系统框架系统框架 ASP NET 编程技术课程设计报告 4 母版页 MasterPage master 学生界面 StudentInterface aspx 教师界面 TeacherInterface aspx 管理员界面 注册账户 修改信息 网上选课 上课 注册账户 修改信息 申请授课 发放资料 注册账户 修改信息 修改 删除学生或老 师信息 交流界面交流界面 图 3 1 系统框架 3 23 2 母版页母版页 3 2 1 主要代码 html Top width 840px height 80px margin 0 auto background color Orange SiteMap width 840px height 25px margin 0 auto background color ccc position relative ContentPlaceHolder width 840px height 500px margin 0 auto Footer width 840px height 50px margin 0 auto background color Gray position relative a text decoration none ASP NET 编程技术课程设计报告 5 C using System using System Collections Generic using System Linq using System Web using System Web UI using System Web UI WebControls using System Data SqlClient using System Data public partial class MasterPage System Web UI MasterPage string duty string constring Data Source SDWM 20130407KX SQLEXPRESS Initial Catalog RemoteEdu Integrated Security true MultipleActiveResultSets True SqlConnection con protected void Page Load object sender EventArgs e con new SqlConnection con ConnectionString constring con Open protected void RadioButtonList1 SelectedIndexChanged object sender EventArgs e if RadioButtonList1 Text Equals 学生 duty 学生 if RadioButtonList1 Text Equals 教师 duty 教师 if RadioButtonList1 Text Equals 管理员 duty 管理员 ASP NET 编程技术课程设计报告 6 SqlCommand cmd new SqlCommand select Account Password from UserAccount con SqlDataReader dr cmd ExecuteReader while dr Read if dr 0 ToString Equals TextBox1 Text if duty Equals 学生 string str id TextBox1 Text Session ID str id Response Redirect StudentInterface aspx if duty Equals 教师 string str id TextBox1 Text Session ID str id Response Redirect TeacherInterface aspx if duty Equals 管理员 string str id TextBox1 Text Session ID str id Response Redirect ManagerInterface aspx Response Write 输入不正确 3 2 2 部分功能 设置一个 Banner 盒子 用来显示系统的标识 一个 SiteMap 盒子 用来显示整 个系统路径 一个 Footer 盒子 用来显示系统制作这的信息 点击 登录 弹出登 录对话框 根据输的信息进入不同的用户界面 3 2 3 截图 ASP NET 编程技术课程设计报告 7 图 3 2 母版页 3 33 3 学生界面学生界面 3 3 1 主要代码 html 我的选课信息 我的账户管理 收到的信息 的收藏 我的笔录 选择课程 上课 资料下载 function 登录 click function 登录界面 toggle 我的选课信息 click function 收到信息 hide gridView1 show 区域二 hide 区域四 hide 区域五 hide 区域六 hide 区域七 hide 区域八 hide 默认 hide C using System ASP NET 编程技术课程设计报告 8 using System Collections Generic using System Linq using System Web using System Web UI using System Web UI WebControls using System Data SqlClient using System Data public partial class StudentInterface System Web UI Page string constring Data Source SDWM 20130407KX SQLEXPRESS Initial Catalog RemoteEdu Integrated Security true MultipleActiveResultSets True SqlConnection con protected void Page Load object sender EventArgs e con new SqlConnection con ConnectionString constring con Open SqlCommand cmd new SqlCommand select UserAccount Name UserAccount Account Sex PhoneNum UserAccount Duty IdentityNo Birth Password Email from UserAccount join StudentInfo on UserAccount Account StudentInfo Account where UserAccount Account Session ID ToString con DataSet ds new DataSet SqlDataAdapter da new SqlDataAdapter select SelectCourse CourseNo CourseName CourseDescribe Price Type from SelectCourse join Course on SelectCourse CourseNo Course CourseNo join StudentInfo on StudentInfo IdentityNo SelectCourse IdentityNo where StudentInfo Account Session ID ToString con da Fill ds GridView1 DataSource ds GridView1 DataBind DataSet ds2 new DataSet SqlDataAdapter da2 new SqlDataAdapter select 我收到的信息 发送者 日期 from Information where 接收者 Session ID ToString con da2 Fill ds2 GridView2 DataSource ds2 GridView2 DataBind DataSet ds3 new DataSet SqlDataAdapter da3 new SqlDataAdapter select DivingClass CourseNo as 课号 Course CourseName as 课程名称 InstructorInfo name as 授课老师 InstructorInfo IdentityNo as 教师号 CourseDescribe as 课程简介 Price as 价格 type as 分类from DivingClass join Course on DivingClass CourseNo Course CourseNo join InstructorInfo on InstructorInfo IdentityNo DivingClass IdentityNo con da3 Fill ds3 GridView3 DataSource ds3 GridView3 DataBind SqlDataReader dr cmd ExecuteReader while dr Read ASP NET 编程技术课程设计报告 9 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 protected void Button2 Click object sender EventArgs e Session ID1 Label2 Text Response Redirect 编辑区域 aspx protected void GridView3 SelectedIndexChanged object sender EventArgs e 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 部分功能 学生里面有我的选课信息 我的账户管理 收到的信息 的收藏 我的笔录 选 择课程等几个功能模块 点击分别切换界面 ASP NET 编程技术课程设计报告 10 3 3 3 截图 图 3 3 图 3 4 学生选课信息 图 3 5 学生编辑界面 ASP NET 编程技术课程设计报告 11 3 43 4 教师界面教师界面 3 4 1 主要代码主要代码 C using System using System Collections Generic using System Linq using System Web using System Web UI using System Web UI WebControls using System Data SqlClient using System Data public partial class TeacherInterface System Web UI Page string constring Data Source SDWM 20130407KX SQLEXPRESS Initial Catalog RemoteEdu Integrated Security true MultipleActiveResultSets True SqlConnection con protected void Page Load object sender EventArgs e con new SqlConnection con ConnectionString constring con Open SqlCommand cmd new SqlCommand select UserAccount Name UserAccount Account Sex PhoneNum UserAccount Duty IdentityNo Birth Password Email from UserAccount join InstructorInfo on UserAccount Account InstructorInfo Account where UserAccount Account Session ID ToString con DataSet ds new DataSet DataSet ds2 new DataSet SqlDataAdapter da new SqlDataAdapter select DivingClass CourseNo CourseName CourseDescribe Price Type from DivingClass join Course on DivingClass CourseNo Course CourseNo join InstructorInfo on InstructorInfo IdentityNo DivingClass IdentityNo where InstructorInfo Account Session ID ToString con SqlDataAdapter da2 new SqlDataAdapter select 我收到的信息发送者日期from Information where 接收者 Session ID ToString con da Fill ds GridView1 DataSource ds GridView1 DataBind da2 Fill ds2 GridView2 DataSource ds2 GridView2 DataBind SqlDataReader dr cmd ExecuteReader while dr Read ASP NET 编程技术课程设计报告 12 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 protected void Button2 Click object sender EventArgs e Session ID1 Label2 Text Response Redirect 编辑区域aspx 3 4 2 部分功能 与学生框架基本相似 3 4 3 截图 图 3 5 教师收信界面 3 53 5 注册界面注册界面 3 5 1 主要代码 C using System using System Collections Generic ASP NET 编程技术课程设计报告 13 using System Linq using System Web using System Web UI using System Web UI WebControls using System Data SqlClient using System Data public partial class 注册界面 System Web UI Page string constring Data Source SDWM 20130407KX SQLEXPRESS Initial Catalog RemoteEdu Integrated Security true MultipleActiveResultSets True SqlConnection con protected void Page Load object sender EventArgs e Label3 Visible false protected void Button1 Click object sender EventArgs ee con new SqlConnection con ConnectionString constring if TextBox1 Text Equals SqlCommand cmd1 new SqlCommand select Account from UserAccount con SqlDataReader rd1 cmd1 ExecuteReader if DropDownList1 Text Equals 学生 学生 int i 0 SqlCommand cmd2 new SqlCommand select IdentityNo from StudentInfo con SqlDataReader rd2 cmd2 ExecuteReader while rd1 Read if TextBox1 Text Equals rd1 0 rd1 Close i 1 break ASP NET 编程技术课程设计报告 14 while rd2 Read if TextBox6 Text Equals rd2 0 rd2 Close i 1 break rd1 Close rd2 Close if i 1 SqlCommand cmd3 new SqlCommand insert UserAccount values TextBox1 Text ToString TextBox5 Text ToString DropDownList1 Text ToString TextBox2 Text ToString con SqlCommand cmd4 new SqlCommand insert StudentInfo values 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 教师 教师 int i 0 SqlCommand cmd2 new SqlCommand select IdentityNo from InstructorInfo con ASP NET 编程技术课程设计报告 15 SqlDataReader rd2 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 SqlCommand cmd3 new SqlCommand insert UserAccount values TextBox1 Text ToString TextBox5 Text ToString DropDownList1 Text ToString TextBox2 Text ToString con SqlCommand cmd4 new SqlCommand insert InstructorInfo values 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 ASP NET 编程技术课程设计报告 16 if DropDownList1 Text Equals 管理员 管理员 int i 0 SqlCommand cmd2 new SqlCommand select IdentityNo from ManagerInfo con SqlDataReader rd2 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 SqlCommand cmd3 new SqlCommand insert UserAccount values TextBox1 Text ToString TextBox5 Text ToString DropDownList1 Text ToString TextBox2 Text ToString con SqlCommand cmd4 new SqlCommand insert ManagerInfo values TextBox6 Text ToString TextBo

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论