lvAuthor.Items.Add(item); }
thisReader.Close();//关闭dataReader对象 thisConnection.Close(); }
//修改
private void btnEdit_Click(object sender, EventArgs e) {
if (lvAuthor.SelectedIndices != null && lvAuthor.SelectedIndices.Count > 0) {
thisConnection.Open();
thisCommand = thisConnection.CreateCommand();
thisCommand.CommandText = \作者信息表set \
+ \ + tbAuthorID.Text.ToString().Trim() + \ + tbAuthorName.Text.ToString().Trim()
+ \= '\ + comboBox1.Text.ToString().Trim() + \= '\ + dtpAuthorDateOfBirth.Value.ToString().Trim()
+ \= '\ + tbAuthorTel.Text.ToString().Trim() + \= '\ + tbAuthorEmail.Text.ToString().Trim()
+ \ + tbAuthorAddress.Text.ToString().Trim() + \ + \ + tbAuthorID.Text.ToString().Trim() + \; try {
thisReader = thisCommand.ExecuteReader(); }
catch (SqlException ex) {
MessageBox.Show(\此作者不存在\); }
thisReader.Close(); thisConnection.Close(); thisConnection.Open();
thisCommand = thisConnection.CreateCommand(); thisCommand.CommandText = \用户表set \
+ \ + tbAuthorName.Text.ToString().Trim() + \ + \ + tbAuthorID.Text.ToString().Trim() + \; try {
thisReader = thisCommand.ExecuteReader(); }
catch (SqlException ex) {
MessageBox.Show(\此作者不存在\); }
thisReader.Close(); thisConnection.Close(); DisplayAll(); } else
MessageBox.Show(\请先选中要修改的行\);//*/ }
//按号搜索
private void btnSearch_Click(object sender, EventArgs e) {
thisConnection.Open();
thisCommand = thisConnection.CreateCommand();
thisCommand.CommandText = \* from 作者信息表where Author_ID = '\ + tbSearchID.Text.Trim() + \;
thisReader = thisCommand.ExecuteReader(); //ListView上显示
lvAuthor.Items.Clear();
if (thisReader.Read())//查找到了 {
string id = (string)thisReader[\].ToString().Trim();
string name = (string)thisReader[\].ToString().Trim(); string sex = (string)thisReader[\].ToString().Trim();
string Birthday = Convert.ToString(thisReader[\]).ToString().Trim(); string Phone = (string)thisReader[\].ToString().Trim(); string Email = (string)thisReader[\].ToString().Trim(); string Address = (string)thisReader[\].ToString().Trim(); //创建ListView的主项
ListViewItem item = new ListViewItem(id);//添加子项 item.SubItems.Add(name); item.SubItems.Add(sex);
item.SubItems.Add(Birthday); item.SubItems.Add(Phone); item.SubItems.Add(Email); item.SubItems.Add(Address); lvAuthor.Items.Add(item); lvAuthor.Focus();
lvAuthor.Items[0].Selected = true; } else
MessageBox.Show(\未找到此作者\); thisReader.Close(); thisConnection.Close(); }
private void btnDisplay_Click(object sender, EventArgs e)
{
DisplayAll(); }
//当选中某行时 private void lvAuthor_ItemSelectionChanged(object ListViewItemSelectionChangedEventArgs e) {
if (lvAuthor.SelectedIndices != null && lvAuthor.SelectedIndices.Count > 0) {
ListView.SelectedIndexCollection sel = lvAuthor.SelectedIndices; tbAuthorID.Text = lvAuthor.Items[sel[0]].Text.Trim();
tbAuthorName.Text = lvAuthor.Items[sel[0]].SubItems[1].Text.Trim(); comboBox1.Text = lvAuthor.Items[sel[0]].SubItems[2].Text.Trim(); tbAuthorTel.Text = lvAuthor.Items[sel[0]].SubItems[4].Text.Trim(); tbAuthorEmail.Text = lvAuthor.Items[sel[0]].SubItems[5].Text.Trim(); tbAuthorAddress.Text = lvAuthor.Items[sel[0]].SubItems[6].Text.Trim(); if (lvAuthor.Items[sel[0]].SubItems[3].Text.Trim() != \) {
dtpAuthorDateOfBirth.Value
DateTime.Parse(lvAuthor.Items[sel[0]].SubItems[3].Text.Trim()); } } }
sender,
=
测试报告
1. 引言
1.1 编写目的
这份测试分析报告主要是测试学报信息管理系统中各个主要功能的完善性和可用性,以求进一步完善系统的功能,适应用户的需求。
1.2 背景
学报信息管理系统是一个完整的系统,主要包括对刊用稿件的组稿、审稿、编辑、加工、终审、排版、校对、发行等多个环节,涉及的信息资源包括稿件信息、作者信息、审稿人信息、评审结果、编委会终审结论、编辑排版等信息。运行环境就是个人的电脑,而我们进行的测试也是在个人电脑上进行,运行环境与测试环境没有太大差异,对测试结果没有多大的影响。
2. 测试概要
2.1测试人员
本次参与测试的人员是:王伟阁 王娜
2.2测试用例
测试分别针对系统主要功能进行测试,总共有4个测试用例。测试用例如下:
1.添加用户功能测试 项目/系统:学报信息管理系统 测试级别:功能测试 测试案例名称:添加用户功能测试 平台:Windows XP,SQL Severe2005 测试方法:黑盒测试 测试编号:Test-01 测试描述:测试添加用户的界面,功能是否可用。 数据准备:作者编号:123密码:123 前提条件:到注册用户界面 提示/参考:如果出现提示添加成功的对话框,则测试通过;再次添加同一个用户,如果出现提示添加失败的对话框,则测试通过。 步骤 操作/输入数据 预期结果 跳转到注册页面 返回添加失败的信息提示。 可以正常登录。 跳转到登陆界面 返回添加失败的提示。 实际结果/注释 通过/失败 通过 通过 通过 通过 通过 若失败继续的操作 测试问题报告编号: 1. 在主页面点击注册 2. 输入准备的数据,提交 3. 使用添加的数据,进行登录 4. 点击登陆页面 5. 再次添加123用户
2.用户权限的功能测试 项目/系统:高校学报信息管理系统 测试案例名称:用户权限功能测试 测试案例方法:黑盒测试 测试级别:集成测试 平台:Windows XP,SQL Severe2005 测试编号:Test-02 测试描述:测试不同权限的用户所具有的功能 数据准备:普通用户 用户名:l23密码:123 管理员 用户名:aa 密码为admin 前提条件:进入登陆页面 提示/参考:进入主界面,不同权限的用户可以对其权限对应的模块进行操作,则测试通过。 步操作/输入数据 骤 1 打开登录界面 预期结果 进入用户登录界面 实际结果/注释 通过/ 若失败继测试问题失败 续的操作 报告编号: 通过 通过 2 使用普通权限用户进入系统主页面,可以看登录,用户名:123 到系统管理,审稿人信息密码:123 等模块不可用。 3 使用超级用户登录,用户名:aa 密码:aa 进入系统主页面,可以看到系统管理,审稿人信息等所有模块都可用。 通过
3.手机号长度测试 项目/系统:学报信息管理系统 测试案例名称:手机号输入测试 测试级别:集成测试 平台:Windows XP,SQL Severe2005 测试描述:测试手机号长度的限制 数据准备:数据库中限定手机号长度为8到13位 分别输入小于8位、8位、13位、大于13位的手机号 前提条件:进入用户注册页面 提示/参考: 若输入小于8位、大于13位的手机号提示注册失败,输入8到13位的手机号注册成功,则测试通过。
测试案例方法:边界值测试法 测试编号:Test-03