一、计划
估计任务需要时间是3天。
二、开发
1、需求分析
记录传球情况、记录垫球情况、记录发球情况、记录扣球情况、记录抹球情况、记录拦网情况
2、设计文档
目的:帮助运动员了解自己、提高自己。
功能:记录每场比赛技术发挥情况、储存以往比赛技术发挥情况以便于进行比较。
输入:输入运动员名称、点击按钮对不同技术进行统计、输入局次
输出:将每局统计的数据存入数据库
3、设计复审
由同小组的成员进行设计复审
4、代码规范
代码编写不使用三层架构,只创建几个类用于编写方法,数据库使用SQLServer
5、具体设计
1)连接数据库
2)界面需输入姓名、局次、对手球队名称
3)数据库必须标明是第几局比赛
4)每种技术分别有三种统计结果:得分、一般、失误,点击不同的按钮对统计结果进行操作
5)除了统计界面还有查寻界面,可以对以往的数据进行显示
6)两个界面都有退出按钮,点击退出关闭程序,查询界面有返回按钮,点击返回统计界面
6、测试
1)输入测试
2)统计测试
3)数据插入测试
三、报告
1、测试报告:
1)输入测试,结果代码正常运行
2)统计测试,结果统计正常
3)数据插入测试,结果数据无法插入。通过排查插入语句错误,修改后数据正常插入
2、计算工作量:
开发 |
11h |
需求分析 |
15 |
生成设计文档 |
1h |
设计复审 |
30min |
代码规范 |
30min |
具体设计 |
50min |
具体编码 |
6h |
代码复审 |
20min |
测试 |
5miin |
测试报告 |
5min |
总结20min |
|
3、事后总结
改进:程序架构应修改为三层架构
代码:
private void button1_Click(object sender, EventArgs e)
{
int shu =int.Parse( chuanqiu.Text.Trim().ToString());
defen df = new defen();
chuanqiu.Text = df.defen1(shu).ToString(); }
private void button4_Click(object sender, EventArgs e)
{
int shu = int.Parse(dianqiu.Text.Trim().ToString());
defen df = new defen();
dianqiu.Text= df.defen1(shu).ToString(); }
private void button7_Click(object sender, EventArgs e)
{
int shu = int.Parse(faqiu.Text.Trim().ToString());
defen df = new defen();
faqiu.Text=df.defen1(shu).ToString(); }
private void button10_Click(object sender, EventArgs e)
{
int shu = int.Parse(kouqiu.Text.Trim().ToString());
defen df = new defen();
kouqiu.Text=df.defen1(shu).ToString();
}
private void button13_Click(object sender, EventArgs e)
{
int shu = int.Parse(moqiu.Text.Trim().ToString());
defen df = new defen();
moqiu.Text= df.defen1(shu).ToString();
}
private void button16_Click(object sender, EventArgs e)
{
int shu = int.Parse(lanwang.Text.Trim().ToString());
defen df = new defen();
lanwang.Text= df.defen1(shu).ToString(); }
private void button2_Click(object sender, EventArgs e)
{
int shu = int.Parse(chuanqiu.Text.Trim().ToString());
yiban df = new yiban();
chuanqiu.Text= df.yiban1(shu).ToString();
}
private void button5_Click(object sender, EventArgs e)
{
int shu = int.Parse(dianqiu.Text.Trim().ToString());
yiban df = new yiban();
dianqiu.Text= df.yiban1(shu).ToString(); }
private void button8_Click(object sender, EventArgs e)
{
int shu = int.Parse(faqiu.Text.Trim().ToString());
yiban df = new yiban();
faqiu.Text=df.yiban1(shu).ToString();
}
private void button11_Click(object sender, EventArgs e)
{
int shu = int.Parse(kouqiu.Text.Trim().ToString());
yiban df = new yiban();
kouqiu.Text= df.yiban1(shu).ToString();
}
private void button14_Click(object sender, EventArgs e)
{
int shu = int.Parse(moqiu.Text.Trim().ToString());
yiban df = new yiban();
moqiu.Text= df.yiban1(shu).ToString();
}
private void button17_Click(object sender, EventArgs e)
{
int shu = int.Parse(lanwang.Text.Trim().ToString());
yiban df = new yiban();
df.yiban1(shu);
}
private void button3_Click(object sender, EventArgs e)
{
int shu = int.Parse(chuanqiu.Text.Trim().ToString());
shiwu df = new shiwu();
chuanqiu.Text= df.shiwu1(shu).ToString(); }
private void button6_Click(object sender, EventArgs e)
{
int shu = int.Parse(dianqiu.Text.Trim().ToString());
shiwu df = new shiwu();
dianqiu.Text= df.shiwu1(shu).ToString();
}
private void button9_Click(object sender, EventArgs e)
{
int shu = int.Parse(faqiu.Text.Trim().ToString());
shiwu df = new shiwu();
faqiu.Text= df.shiwu1(shu).ToString();
}
private void button12_Click(object sender, EventArgs e)
{
int shu = int.Parse(kouqiu.Text.Trim().ToString());
shiwu df = new shiwu();
kouqiu.Text= df.shiwu1(shu).ToString();
}
private void button15_Click(object sender, EventArgs e)
{
int shu = int.Parse(moqiu.Text.Trim().ToString());
shiwu df = new shiwu();
moqiu.Text= df.shiwu1(shu).ToString();
}
private void button18_Click(object sender, EventArgs e)
{
int shu = int.Parse(lanwang.Text.Trim().ToString());
shiwu df = new shiwu();
lanwang.Text=df.shiwu1(shu).ToString();
}
private void Form1_Load(object sender, EventArgs e)
{
int i = 0;
chuanqiu.Text = i.ToString();
dianqiu.Text = i.ToString();
faqiu.Text = i.ToString();
kouqiu.Text = i.ToString();
moqiu.Text = i.ToString();
lanwang.Text = i.ToString();
}
private void button19_Click(object sender, EventArgs e)
{
string n1 = name1.Text.ToString();
string n2 = name2.Text.ToString();
string jc = juci.Text.ToString();
int chuan = int.Parse(chuanqiu.Text);
int dian = int.Parse(dianqiu.Text);
int fa = int.Parse(faqiu.Text);
int kou = int.Parse(kouqiu.Text);
int mo = int.Parse(moqiu.Text);
int lan = int.Parse(lanwang.Text);
string strCon = "Data Source=.;Initial Catalog=数据统计;Integrated Security=True";
SqlConnection conn = new SqlConnection(strCon);
conn.Open();
string strsql = "insert into shuju1 (xingming,duishou,juci,chuanqiu,dianqiu,faqiu,kouqiu,moqiu,lanwang) values(‘" + n1 + "‘,‘" + n2 + "‘,‘" + jc + "‘,‘" + chuan + "‘,‘" + dian + "‘,‘" + fa + "‘,‘" + kou + "‘,‘" + mo + "‘,‘" + lan + "‘)";
SqlCommand comm = new SqlCommand(strsql, conn);
int i = comm.ExecuteNonQuery();
if (i>0)
{ MessageBox.Show("数据插入成功"); }
else
{ MessageBox.Show("数据插入失败"); }
conn.Close();
}
private void button20_Click(object sender, EventArgs e)
{
Form2 fr = new Form2();
fr.Show();
this.Hide();
}
原文:http://www.cnblogs.com/hh1234/p/6257533.html