码迷,mamicode.com
首页 > 其他好文 > 详细

排球计分程序

时间:2016-12-18 21:00:32      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:rgs   alt   protect   技术   image   需要   ext   isp   jpg   

计划

 

time
估计这个任务需要多长时间 480min
开发  
需求分析 60min
生成设计文档 30min
代码复审 55min
具体设计 50min
具体编码 130min
代码复审 60min
测试 30min
报告  
测试报告 15min
计算工作量 20min

技术分享

代码部分:

public class Match
{
public int id;
public int h1F;
public int h2F;
public int h3F;
public int l1F;
public int l2F;
public int l3F;
}

public class dal
{
public Match Select(int id)
{
string strCon = "server=.;database=pqMatch;integrated security=true";
SqlConnection con = new SqlConnection(strCon);
string sql = "select * from Match where id="+id;
SqlCommand comm = new SqlCommand(sql, con);
con.Open();
Match mc = null;
SqlDataReader reader = comm.ExecuteReader();
if (reader.HasRows)
{
while (reader.Read())
{
mc = new Match();
mc.id = 1;
mc.h1j =(int) reader["h1F"];
mc.h2j = (int)reader["h2F"];
mc.h3j = (int)reader["h3F"];
mc.l1j = (int)reader["l1F"];
mc.l2j = (int)reader["l2F"];
mc.l3j = (int)reader["l3F"];
}
}
reader.Close();
con.Close();
return mc;
}
}

public class bll
{
private dal dl = new dal();
public Match Select(int id)
{
return dl.Select(id);
}
}

private bll bl1 = new bll();
protected void Page_Load(object sender, EventArgs e)
{

}

protected void Button1_Click(object sender, EventArgs e)
{
if (!IsPostBack)
{
txt1h.Text = "";
txt2h.Text = "";
txt3h.Text = "";
txt1l.Text = "";
txt2l.Text = "";
txt3l.Text = "";
}
else
{
string id = Label1.Text.Trim();
Match mc = bl1.Select(Convert.ToInt32(id));
txt1h.Text = mc.h1F.ToString();
txt2h.Text = mc.h2F.ToString();
txt3h.Text = mc.h3F.ToString();
txt1l.Text = mc.l1F.ToString();
txt2l.Text = mc.l2F.ToString();
txt3l.Text = mc.l3F.ToString();
}
int ah=Convert.ToInt32(txt1h.Text);
int bh = Convert.ToInt32(txt2h.Text);
int ch = Convert.ToInt32(txt3h.Text);
int al = Convert.ToInt32(txt1l.Text);
int bl = Convert.ToInt32(txt2l.Text);
int cl = Convert.ToInt32(txt3l.Text);
int zfh = 0;
int zfl = 0;
if (ah > al)
{
zfh++;
}
else
{
zfl++;
}
if (bh > bl)
{
zfh++;
}
else
{
zfl++;
}
if (ch > cl)
{
zfh++;
}
else
{
zfl++;
}
if (dh > dl)
{
zfh++;
}
else
{
zfl++;
}
if (eh > el)
{
zfh++;
}
else
{
zfl++;

}

排球计分程序

标签:rgs   alt   protect   技术   image   需要   ext   isp   jpg   

原文地址:http://www.cnblogs.com/logo/p/6195376.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!