本周冲刺

计划

估算时间

估计这个任务需要多少时间

8天

开发

1天

需求分析

1小时

生成设计文档

1小时

设计复审

40分钟

代码规范

4小时

具体设计

1小时

具体编码

5天

代码复审

2天

测试

50min

测试报告

30min

计算工作量

1小时

事后总结并提出改进计划

1小时

 

需求分析

作为一个排球比赛的现场工作人员,我需要统计每一名

队员的得分及技术统计,以便颁发每场比赛的最有价值球员奖,

以及确定赛会的最佳阵容。

设计文档

进入现场工作人员界面,记录每位运动员的得分情况。

活动图

 

 

 

设计复审

和同学一起审核。

代码规范

Visual Studio 2012

具体设计

private void button2_Click(object sender, EventArgs e)
{
if (dbUpdate())
{
MessageBox.Show("更新成功");
}
}
private Boolean dbUpdate()
{
string strOleDb = "select * from Allathlete";
DataTable dtUpdate = new DataTable();
dtUpdate = this.dbcon(strOleDb);
dtUpdate.Rows.Clear();
DataTable dtShow = new DataTable();
dtShow = (DataTable)this.dataGridView1.DataSource;
for (int i = 0; i < dtShow.Rows.Count; i++)//循环遍历
{
dtUpdate.ImportRow(dtShow.Rows[i]);

}
try
{
this.conn.Open();
OleDbCommandBuilder cb = new OleDbCommandBuilder(this.adapter);
this.adapter.Update(dtUpdate);
this.conn.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return false;
}
dtUpdate.AcceptChanges();
return true;
}

private void button3_Click(object sender, EventArgs e)
{
Form2 a = new Form2();
a.Show();
this.Hide();
}

private void button3_Click(object sender, EventArgs e)
{
string conn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Administrator\Desktop\统计表.mdb";
OleDbConnection con = new OleDbConnection(conn);
// string sql = "select qiuyuan from Allathletes order by faqiu desc";
con.Open();
string sql = "select qiuyuan from Allathlete order by faqiu desc";
OleDbCommand cmd = new OleDbCommand(sql,con);
OleDbDataReader reader = cmd.ExecuteReader();
try
{
reader.Read();
string faqiu = (string)reader[0].ToString();
textBox1.Text = faqiu;
reader.Close();
con.Close();
con.Open();
string sqa = "select qiuyuan from Allathlete order by kouqiu desc";
OleDbCommand cma = new OleDbCommand(sqa, con);
OleDbDataReader readera = cma.ExecuteReader();
readera.Read();
string kouqiu = (string)readera[0].ToString();
textBox2.Text = kouqiu;
readera.Close();
con.Close();
con.Open();
string sqb = "select qiuyuan from Allathlete order by lanwang desc";
OleDbCommand cmb = new OleDbCommand(sqb, con);
OleDbDataReader readerb = cmb.ExecuteReader();
readerb.Read();
string lanwang = (string)readerb[0].ToString();
textBox3.Text = lanwang;
readerb.Close();
con.Close();
con.Open();
string sqc = "select qiuyuan from Allathlete order by yichuan desc";
OleDbCommand cmc = new OleDbCommand(sqc, con);
OleDbDataReader readerc = cmc.ExecuteReader();
readerc.Read();
string yichuan = (string)readerc[0].ToString();
textBox4.Text = yichuan;
readerc.Close();
con.Close();
con.Open();
string sqd = "select qiuyuan from Allathlete order by erchuan desc";
OleDbCommand cme = new OleDbCommand(sqd, con);
OleDbDataReader readerd = cme.ExecuteReader();
readerd.Read();
string erchuan = (string)readerd[0].ToString();
textBox5.Text = erchuan;
readerd.Close();
con.Close();
con.Open();
string sqf = "select qiuyuan from Allathlete order by ziyouren desc";
OleDbCommand cmf = new OleDbCommand(sqf, con);
OleDbDataReader readerf = cmf.ExecuteReader();
readerf.Read();
string ziyouren = (string)readerf[0].ToString();
//textBox1.Text = faqiu;
//textBox2.Text = kouqiu;
// textBox3.Text = lanwang;
// textBox4.Text = yichuan;
// textBox5.Text = erchuan;
textBox6.Text = ziyouren;
reader.Close();
}
catch
{
MessageBox.Show("没有比赛数据!");
}
con.Close();
}

private void button1_Click(object sender, EventArgs e)
{
string conn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Administrator\Desktop\统计表.mdb";
OleDbConnection con = new OleDbConnection(conn);
string sql = "select qiuyuan from Allathlete order by score desc";
con.Open();
OleDbCommand cmd = new OleDbCommand(sql,con);
OleDbDataReader reader = cmd.ExecuteReader();
reader.Read();
try
{
string mvp = (string)reader[0].ToString();
text.Text = mvp;
}
catch
{
MessageBox.Show("没有比赛数据!");
}
reader.Close();
con.Close();

}

private void label4_Click(object sender, EventArgs e)
{

}

private void button2_Click(object sender, EventArgs e)
{
text.Text = "";
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
textBox5.Text = "";
textBox6.Text= "";
}
}
}

 

转载于:https://www.cnblogs.com/YXD123/p/6257860.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值