数据库课程设计说明书格式_第1页
数据库课程设计说明书格式_第2页
数据库课程设计说明书格式_第3页
数据库课程设计说明书格式_第4页
数据库课程设计说明书格式_第5页
已阅读5页,还剩34页未读 继续免费阅读

下载本文档

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

文档简介

1、中北大学 课 程 设 计 说 明 书 数据库大型实验周学生姓名 :苗瑞林 学 号:0906034216 学生姓名 : 罗凡钰 学 号:0906034250 学生姓名 : 曹旭利 学 号:0906034204 学生姓名 : 黄丽 学 号:0906034208 学 院 : 电子与计算机科学技术学院专 业 : 计算机科学与技术题 目 : 英语学习助手指导教师:武瑞娟 职称 : 副教授 2012 年 6月 22日1. 设计目的随着社会的发展和时代的进步, 英语已经成为人们在日常生活和工作中必须 掌握和应用语言。 为了更好、 更快的掌握英语基础知识, 尽快具备英语会话和写 作能力, 适应当前人们的工作、

2、 生活需要, 推动英语学习的普及, 所以我们小组 集体开发了这套完整的英语学习助手, 欢迎大家使用和提出改进意见。 此系统主 要实现了以下几大功能:后台:单词及单词例句信息管理(英语单词的录入、 修 改、删除 ; 前台:实现英语单词检索、翻译。英语单词自测,自测结果显示功 能。2. 设计内容(1主要的数据表用户表,英语分级单词表,常用单词例句表等等。(2主要功能模块1实现英语单词的录入、修改、删除等基本操作。2实现常用英语单词例句的录入、修改、删除等基本操作。3实现英语单词检索、翻译等。4常用英语单词例句检索。5随机生成一份单词测试题目。3. 开发和运行环境介绍开发工具:Visual Stud

3、io 2010,SQL2008运行环境:Windows 9x 、 Windows NT、 Windows 2000、 Windowsxp 操作系 统。4. 需求分析4.1功能需求本系统的功能分为如下几大模块:1. 单词模块:包括单词表的建立,单词的录入、修改、删除等基本操作。单 词表包括单词和汉语翻译以及初级、 中级、 高级三种难度单词的分类。 单词录入 要求能够实现录入 (增加 单词及其汉语翻译; 修改要求能修改单词的拼写以及 其汉语意思;删除即能够删除某一单词记录。2. 例句模块:包括例句表的建立,例句的录入、修改、删除等基本操作。例 句表包括例句及其中文翻译等。 例句录入要求能够实现录入

4、 (增加 例句及其汉语翻译; 修改要求能修改例句的单词以及其汉语意思; 删除即能够删除某一例句 记录。3. 试题模块:随机生成一份相应难度的单词测试表。 可以给出英文单词选择 其正确的汉语翻译4. 检索模块:包括单词检索和例句检索, 。单词检索要实现输入一个单词, 可以检索出它的汉语翻译。 例句检索要能实现输入句子, 可以检索出其中文翻译。 4.2 性能需求(1尽量采取学校现有软硬件环境,及先进的管理系统开发方案,从而达 到充分利用学校现有资源,提高系统系统开发水平的目的。(2系统应符合学校学生现有的多媒体条件,满足学生日常英语学习的需 要,并达到操作过程的直观,方便,实用等要求。(3系统采用

5、模块化程序设计方法,既便于系统功能的各种组合和修改。 4.3 数据流图(1顺序图 符合,登录成功 不符合, 登录失 败 图 2 E-R图5. 系统设计与实现 (写清楚每个人负责的模块 5.1 模块功能描述苗瑞林:自测,实现单词和例句的修改罗凡钰:实现单词和例句的检索曹旭利:实现例句的录入,删除黄丽:实现单词的录入,删除5.2 软件实现黄丽:实现单词的录入,删除添加单词:using System;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Tex

6、t;namespace WindowsFormsApplication1public partial class Form1 : Formpublic Form1(InitializeComponent(;private void Form1_Load(object sender, EventArgs eprivate void btnYes_Click(object sender, EventArgs e string word = textBox1.Text;string fanyi=textBox2.Text;string dengji=textBox3.Text;string Num

7、= textBox4.Text;string Constr = "server = .;database=ENGLISHWORD;uid=sa;pwd=123"SqlConnection con = new SqlConnection(Constr;string sql = String.Format("INSERT INTO word(Num,word,fanyi,dengjiVALUES('0','1','2','3'",Num,word,fanyi,dengji;con.Open(;S

8、qlCommand cmd = new SqlCommand(sql, con;int count = cmd.ExecuteNonQuery(;if (count>0MessageBox.Show("添加英语单词成功! "," 添加成功 ", MessageBoxButtons.OK,MessageBoxIcon.Information;elseMessageBox.Show("添加失败 !"," 添加失败 ",MessageBoxButtons.OK,MessageBoxIcon.Information;

9、 private void lblWord_Click(object sender, EventArgs e private void btnClose_Click(object sender, EventArgs e Form3 ss = new Form3(;ss.Show(;this.Visible = false;删除单词:using System;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;namespace Windows

10、FormsApplication1public partial class Form4 : Formpublic Form4(InitializeComponent(;private void Form4_Load(object sender, EventArgs estring Constr = "server = .;database=ENGLISHWORD;uid=sa;pwd=123" SqlConnection con = new SqlConnection(Constr;string sql = "select * from word"con

11、.Open(;SqlDataAdapter adpt=new SqlDataAdapter(sql, con;DataTable dt=new DataTable(;adpt.Fill(dt;dataGridView1.DataSource = dt;private void button1_Click(object sender, EventArgs estring id = dataGridView1.Rows0.Cells0.Value.ToString(;string Constr = "server = .;database=ENGLISHWORD;uid=sa;pwd=1

12、23" SqlConnection con = new SqlConnection(Constr;string sql = "DELETE from word WHERE Num="+id+""string sql1 = "SELECT * FROM word"con.Open(;SqlCommand cmd = new SqlCommand(sql, con;if (cmd.ExecuteNonQuery( > 0string message = String.Format("删 除 成 功 ",

13、 cmd.ExecuteNonQuery(;MessageBox.Show(message, "删除成功 ", MessageBoxButtons.OK, MessageBoxIcon.Information;SqlDataAdapter adpt = new SqlDataAdapter(sql1,con;DataTable dt = new DataTable(;adpt.Fill(dt;dataGridView1.DataSource = dt;private void button2_Click(object sender, EventArgs eForm3 ssi

14、 = new Form3(;ssi.Show(;this.Visible = false;private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e曹旭利:实现例句的录入,删除添加例句:using System;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;namespace WindowsFormsApplication1

15、public partial class Form7 : Formpublic Form7(InitializeComponent(;private void Form7_Load(object sender, EventArgs eprivate void btnYes_Click(object sender, EventArgs estring sentence = textBox1.Text;string fanyi = textBox2.Text;string sword = textBox3.Text;string Num = textBox4.Text;string Constr

16、= "server = .;database=ENGLISHWORD;uid=sa;pwd=123" SqlConnection con = new SqlConnection(Constr;string sql = String.Format("INSERT INTO sentence(Num,sentence,fanyi,sword VALUES('0','1','2','3'", Num, sentence, fanyi, sword;con.Open(;SqlCommand cmd

17、= new SqlCommand(sql, con;SqlCommand command = new SqlCommand(sql, con;if (cmd.ExecuteNonQuery( > 0MessageBox.Show("添加英语例句成功! ", "添加成功 ",MessageBoxButtons.OK, MessageBoxIcon.Information; elseMessageBox.Show("添加失败 !", "添加失败 ",MessageBoxButtons.OK, MessageBox

18、Icon.Information; private void lblSword_Click(object sender, EventArgs e private void button2_Click(object sender, EventArgs e Form3 ss = new Form3(;ss.Show(;this.Visible = false;删除例句:using System;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;

19、namespace WindowsFormsApplication1public partial class Form9 : Formpublic Form9(InitializeComponent(;string Constr = "server = .;database=ENGLISHWORD;uid=sa;pwd=123" SqlConnection con = new SqlConnection(Constr;string sql = "select * from sentence"con.Open(;SqlDataAdapter adpt =

20、new SqlDataAdapter(sql, con;DataTable dt = new DataTable(;adpt.Fill(dt;dataGridView1.DataSource = dt;private void button3_Click(object sender, EventArgs estring Constr = "server = .;database=ENGLISHWORD;uid=sa;pwd=123" SqlConnection con = new SqlConnection(Constr;string sql = "select

21、* from sentence"con.Open(;SqlCommand cmd = new SqlCommand(sql, con;cmd.ExecuteNonQuery(;private void textBox1_TextChanged(object sender, EventArgs eprivate void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs eprivate void button2_Click_1(object sender, EventArgs eForm3

22、ssi = new Form3(;ssi.Show(;this.Visible = false;private void button1_Click_1(object sender, EventArgs estring id = dataGridView1.Rows0.Cells0.Value.ToString(;string Constr = "server = .;database=ENGLISHWORD;uid=sa;pwd=123" SqlConnection con = new SqlConnection(Constr;string sql = "DEL

23、ETE from sentence WHERE Num=" + id + ""string sql1 = "SELECT * FROM sentence"con.Open(;SqlCommand cmd = new SqlCommand(sql, con;if (cmd.ExecuteNonQuery( > 0string message = String.Format("删 除 成 功 ", cmd.ExecuteNonQuery(;MessageBox.Show(message, "删除成功 "

24、, MessageBoxButtons.OK, MessageBoxIcon.Information;SqlDataAdapter adpt = new SqlDataAdapter(sql1, con; DataTable dt = new DataTable(;adpt.Fill(dt;dataGridView1.DataSource = dt;private void Form9_Load(object sender, EventArgs e罗凡钰:实现单词和例句的检索检索单词 :using System;using System.ComponentModel;using System.

25、Data;using System.Drawing;using System.Linq;using System.Text;namespace WindowsFormsApplication1public partial class Form2 : Formpublic Form2(InitializeComponent(;private void button1_Click(object sender, EventArgs estring Constr = "server = .;database=ENGLISHWORD;uid=sa;pwd=123" SqlConnec

26、tion con = new SqlConnection(Constr;con.Open(;string word = textBox1.Text;string sql = String.Format("select fanyi from word where word='0'", word;SqlCommand cmd = new SqlCommand(sql, con;string wordone = Convert.ToString(cmd.ExecuteScalar(;textBox2.Text =wordone;bool row = cmd.Exe

27、cuteScalar(!=null;if (rowstring message = String.Format("查 询 成 功 ", cmd.ExecuteNonQuery(;MessageBox.Show(message, "查询成功 ", MessageBoxButtons.OK, MessageBoxIcon.Information;elseMessageBox.Show("查询失败 !", "查询失败 ",MessageBoxButtons.OK, MessageBoxIcon.Information;p

28、rivate void button2_Click(object sender, EventArgs e Form3 asd = new Form3(;asd.Show(;this.Visible = false;private void Form2_Load(object sender, EventArgs e 例句检索:using System;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;namespace WindowsForm

29、sApplication1public partial class Form11 : Formpublic Form11(InitializeComponent(;private void button1_Click(object sender, EventArgs e string Constr = "server = .;database=ENGLISHWORD;uid=sa;pwd=123"SqlConnection con = new SqlConnection(Constr;con.Open(;string word = textBox1.Text;string

30、sql = String.Format("select fanyi from sentence where sentence='0'", word;SqlCommand cmd = new SqlCommand(sql, con;string wordone = Convert.ToString(cmd.ExecuteScalar(;textBox2.Text = wordone;bool row = cmd.ExecuteScalar( != null;if (rowstring message = String.Format("查 询 成 功

31、", cmd.ExecuteNonQuery(;MessageBox.Show(message, " 查 询 成 功 ", MessageBoxButtons.OK, MessageBoxIcon.Information;elseMessageBox.Show("查询失败 !", "查询失败 ",MessageBoxButtons.OK, MessageBoxIcon.Information;private void button2_Click(object sender, EventArgs e Form3 asd = n

32、ew Form3(;asd.Show(;this.Visible = false;苗瑞林:自测,实现单词和例句的修改单词修改:using System;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;namespace WindowsFormsApplication1public partial class Form5 : Formpublic Form5(InitializeComponent(;string Constr = &quo

33、t;server = .;database=ENGLISHWORD;uid=sa;pwd=123"string sql = "select * from word"SqlConnection con = new SqlConnection(Constr;con.Open(;SqlDataAdapter adpt = new SqlDataAdapter(sql, con; DataTable dt = new DataTable(;adpt.Fill(dt;dataGridView1.DataSource = dt;private void Form5_Load(

34、object sender, EventArgs eprivate void button2_Click(object sender, EventArgs e string num = textBox1.Text;string num1 = textBox2.Text;string num2 = textBox3.Text;string num3 = textBox4.Text;string Constr = "server = .;database=ENGLISHWORD;uid=sa;pwd=123"SqlConnection con = new SqlConnecti

35、on(Constr;string sql = "Update word set word='"+num1+"',fanyi='"+num2+"', dengji='"+num3+"' where Num='"+num+"'"con.Open(;trySqlCommand cmd = new SqlCommand(sql, con; int count = cmd.ExecuteNonQuery(;if (count>0Mess

36、ageBox.Show("修改英语单词成功! "," 修改 成功 ",MessageBoxButtons.OK,MessageBoxIcon.Information;elseMessageBox.Show("修改失败 !"," 修改失败 ",MessageBoxButtons.OK,MessageBoxIcon.Information;catch (Exception exMessageBox.Show(ex.Message,"操作数据库出错 !",MessageBoxButtons.OK,Me

37、ssageBoxIcon.Exclamation;finallycon.Close(;private void button1_Click(object sender, EventArgs eForm3 sw = new Form3(;sw.Show(;this.Visible = false;private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e例句修改 :using System;using System.ComponentModel;using System.Data;u

38、sing System.Drawing;using System.Linq;using System.Text;namespace WindowsFormsApplication1public partial class Form10 : Formpublic Form10(InitializeComponent(;private void button1_Click(object sender, EventArgs estring num = textBox1.Text;string num1 = textBox2.Text;string num2 = textBox3.Text;strin

39、g num3 = textBox4.Text;string Constr = "server = .;database=ENGLISHWORD;uid=sa;pwd=123"SqlConnection con = new SqlConnection(Constr;string sql = "update sentence set sentence='"+num1+"',sword='"+num2+"',fanyi='"+num3+"' where Num=&

40、#39;"+num+"'"con.Open(;trySqlCommand cmd = new SqlCommand(sql, con;int count = cmd.ExecuteNonQuery(;if (count > 0MessageBox.Show("修改英语单词成功! ", "修改成 功 ",MessageBoxButtons.OK, MessageBoxIcon.Information;elseMessageBox.Show("修改失败 !", "修改失败 "

41、,MessageBoxButtons.OK, MessageBoxIcon.Information;catch (Exception exMessageBox.Show(ex.Message, "操作数据库出错 !", MessageBoxButtons.OK, MessageBoxIcon.Exclamation;finallycon.Close(;private void button2_Click(object sender, EventArgs e Form3 sap = new Form3(;sap.Show(;this.Visible = false;6. 软件

42、测试6.1测试方法(1动态黑盒测试,即不深入代码细节的软件测试方法,对软件的各 功能模块进行通过性测试。所谓动态,即测试过程在软件运行中进行。所谓 黑盒,即测试过程无视代码,只关注软件的输入、输出。(2兼容性测试。在不同的虚拟机、电脑上测试。6.2测试环境Visual studio 20106.3测试用例及测试结果动态黑盒测试测试用例 1: 图 3添加测试测试结果:按下添加按钮后,再打开数据库中的 word 表可以看到刚才添加 的单词都全部成功的加入了 word 表中。测试用例 2: 图 4单词删除测试测试结果:按下确定删除按钮后, 可以在窗口数据库列表中看到上述单词被删除 了 。 测试用例 3: 图 5单词修改测试 按下确定修改按钮,可以在窗口中看到单词、翻译、编号、例句已经被修改了。 测试用例 4: 图 6添加例句测试测试结果:按下确定添加按钮后, 可以在窗口数据库列表中看到上述例句被添 加了。 测试用例 5: 图 7删除例句测试测

温馨提示

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

评论

0/150

提交评论