十八周冲刺

计划:

  做这个任务大概需要一周。

需求:

  作为一个排球比赛的现场工作人员,我需要统计每一名队员的得分,便于颁发比赛的最佳球员奖,确定比赛的胜利方

生成设计文档:

  1)  建一个数据库,将比赛情况记录其中。

  2)记分员积分结束之后把相应数据插入到数据库中。

  3)选出这次比赛的最佳选手,选出最佳选手。

设计复审:

  能够做出来

代码规范:

visual studio 2015

具体设计:

 

具体编码:

if (int.Parse(txtone.Text) < 25)
{
int a = int.Parse(txtone.Text);
a++;
txtone.Text = a.ToString();
int c = int.Parse(txtone2.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第一局" + btnwin1.Text);
lblfirst.Text = "第一局比分是" + txtone.Text + ":" + txtone2.Text;
int b = int.Parse(txtscore1.Text);
b++;
txtscore1.Text = b.ToString();
}
}
else
{
int a = int.Parse(txtone.Text);
a++;
txtone.Text = a.ToString();
int c = int.Parse(txtone2.Text);
if (a - 1 > c)
{
MessageBox.Show("第一局" + btnwin1.Text);
lblfirst.Text = "第一局比分是" + txtone.Text + ":" + txtone2.Text;
int b = int.Parse(txtscore1.Text);
b++;
txtscore1.Text = b.ToString();
}
}

}
else if (int.Parse(txtscore1.Text) + int.Parse(txtscore2.Text) ==1)

 数据存入到数据库

ChaRuDAL dal = new ChaRuDAL();
//第一队球员信息
public int insert(string  name,string score)
{
return dal.insert(name,score);
}
//第二队队球员信息
public int insert1(string  name,string score)
{
return dal.insert1(name,score);
}

public DataTable getAllName()
{
string sql = "select distinct name from one";
return SqlHelper.ExecuteDataTable(sql,null);
}

//查询最高分

string sql = "select count(*) as name,score  from one  group by score order by count(*) desc;";
SqlDataReader dr=SqlHelper.ExecuteReader(sql,null);
if (dr.HasRows)
{
dr.Read();
name= "@name";
score= dr["score"].ToString();
}

 

报告:软件没有出现异常问题。能正常运行

总结:软件功能有限,过于简单

posted @ 2017-01-06 22:53  nnnnnnnnnnn  阅读(88)  评论(0编辑  收藏  举报