排球现场工作人员
分类:
IT文章
•
2024-10-22 23:40:54
计划
|
估算时间
|
估计这个任务需要多少时间
|
300min
|
开发
|
80min
|
需求分析
|
30min
|
生成设计文档
|
100min
|
设计复审
|
30min
|
代码规范
|
5min
|
具体设计
|
20min
|
具体编码
|
50min
|
代码复审
|
30min
|
测试
|
50min
|
测试报告
|
15min
|
计算工作量
|
15min
|
事后总结并提出改进计划
|
10min
|
需求分析:
需求: 作为一个排球比赛的现场工作人员,我需要统计每一名队员的得分,及技术统计(发球,拦网,一传...) 以便于颁发每场比赛的最有价值球员奖,以及确定赛会的最佳阵容。
专业术语:
发球
由队员自己抛球,用一只手将球从网上空两标志杆内击入对方场区的技术动作。发球是比赛和进攻的开始。是排球技术中唯一不受别人制约的技术动作。攻击性强的发球不仅可以直接得分,还能削弱乃至破坏对方的进攻,打乱对方的部署,在心理上给对方造成威慑。
拦网
队员在网前以腰部以上身体任何部位主要是手臂、手掌,在球网上沿阻挡对方击球过网的技术动作。拦网是防守的第一道防线,是反攻的重要环节。拦网可将对方有力的扣杀拦起,减轻后排防守的压力,为本方组织反攻创造条件。拦网主要是给对方扣球手以心理压力迫使其出现失误,拦网
可以减缓球速,甚至能把对方的扣球直接拦回、拦死,在比赛中是得分、得权的重要手段之一。
一传:排球运动技术名词.通常指比赛中在本方场区接对方来球的第一次击球,或本方拦网触手后的击球.可运用各种传球或垫球技术,其中以双手垫球运用最多.是一攻中的接发球和反攻中防守的重要环节,也是组成进攻战术的基础.如失误或不到位,可造成直接失分或无法实现预定的进攻战术.
扣球
跳起在空中用一只手臂作弧形挥动 ,用手将本方场区上空的球,从两标志杆内的球网上空击入对方场区的技术动作。扣球在比赛中是进攻最积极最有效的武器,因此是得分、得权的主要手段。
抹球
二传或进攻手用单手将球从网上迅速抹带使其快速而出其不意的进入对方球场的击球方式,是为弥补一传垫球过高即将造成探头失误而采用的一种补救式打法,但有时也会刻意采用这种打法以形成两次球打发。
分析:主要功能记录发球,拦网,一传,扣球,抹球是由谁做的。将其记录到数据库中。
通过查询,将所需要的最有价值球员奖和最佳阵容,以及各个球员的详细分数查询出来。
主要功能体现在数据的增加和查询。
将必要的数据输入数据库,即可利用数据来完成该有的统计
数据库选用access数据库
用ASP.NET 来实现此功能。
建立一个这样的数据库
保存A队球员的衣服编号和姓名:

保存B队球员的衣服编号和姓名:

保存A队球员的衣服标号,击球状态和是否得分

保存B队球员的衣服标号,击球状态和是否得分

生成设计文档:
利用三层架构实现该功能。基本方法如下。

代码规范:(为目前的开发制定合适的规范):代码风格的原则,简明,易读,无二义性。
缩进:四个空格。
行宽:不超过100字符。
括号:在复杂的条件表达式中,用括号清楚地表示逻辑优先级。
断行与空白的{}行:(加代码)
分行:不要把多个语句放在一行上。
命名:
Camel 驼峰命名法:单词连写 无分割符 每个单词大写首字母
类名和接口名 大写第一个单词首字母
注释:要加入必要的注释。
具体设计:

具体编码:
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Configuration;
5 using System.Data.OleDb;
6 using System.Data;
7 using MODEL;
8 using System.Text;
9
10 namespace COMMON
11 {
12 public static class AccessHelpera
13 {
14 private static readonly String constr = ConfigurationManager.ConnectionStrings["connstr"].ConnectionString;
15
16 //执行增删改
17 public static int ExecuteNonQuery(string sql, params OleDbParameter[] pms)
18 {
19 using (OleDbConnection con = new OleDbConnection(constr))
20 {
21 using (OleDbCommand cmd = new OleDbCommand(sql, con))
22 {
23
24 if (pms != null)
25 {
26 cmd.Parameters.AddRange(pms);
27
28 }
29 con.Open();
30 return cmd.ExecuteNonQuery();
31 }
32 }
33 }
34 //执行返回单个值得
35 public static object ExecuteScalar(string sql, params OleDbParameter[] pms)
36 {
37 using (OleDbConnection con = new OleDbConnection(constr))
38 {
39 using (OleDbCommand cmd = new OleDbCommand(sql, con))
40 {
41 if (pms != null)
42 {
43 cmd.Parameters.AddRange(pms);
44 }
45 con.Open();
46 return cmd.ExecuteScalar();
47 }
48 }
49 }
50 //执行返回sqldatareader
51 public static OleDbDataReader ExecuteReader(string sql, params OleDbParameter[] pms)
52 {
53 OleDbConnection con = new OleDbConnection(constr);
54
55 using (OleDbCommand cmd = new OleDbCommand(sql, con))
56 {
57 if (pms != null)
58 {
59 cmd.Parameters.AddRange(pms);
60 }
61 try
62 {
63 con.Open();
64 return cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
65 }
66 catch (Exception)
67 {
68 con.Close();
69 con.Dispose();
70 throw;
71 }
72
73 }
74
75 }
76 //执行返回datatable
77 public static DataTable ExecuteDataTable(string sql, params OleDbParameter[] pms)
78 {
79 DataTable dt = new DataTable();
80 using (OleDbDataAdapter adapter = new OleDbDataAdapter(sql, constr))
81 {
82 if (pms != null)
83 {
84 adapter.SelectCommand.Parameters.AddRange(pms);
85
86 }
87 adapter.Fill(dt);
88 return dt;
89 }
90
91 }
92 //执行删除ren表中数据
93 public static int ClearBiaoRen()
94 {
95 using (OleDbConnection conn = new OleDbConnection(constr))
96 {
97 int a = 0;
98 using (OleDbCommand comm = new OleDbCommand("delete from renA", conn))
99 {
100 OleDbCommand com = new OleDbCommand("delete from renB", conn);
101 conn.Open();
102 a = comm.ExecuteNonQuery() + com.ExecuteNonQuery();
103 ClearBiaoFen();
104 return a;
105 }
106
107 }
108 }
109 //删除的fen表中数据
110 public static int ClearBiaoFen()
111 {
112 using (OleDbConnection conn = new OleDbConnection(constr))
113 {
114 int a = 0;
115 using (OleDbCommand comm = new OleDbCommand("delete from fenA", conn))
116 {
117 OleDbCommand com = new OleDbCommand("delete from fenB", conn);
118 conn.Open();
119 a = comm.ExecuteNonQuery() + com.ExecuteNonQuery();
120 return a;
121 }
122
123 }
124 }
125
126 }
127 }
AccessHelpera
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 //using System.Data.SqlClient;
5 using MySql.Data.MySqlClient;
6 using COMMON;
7 using System.Data;
8 using System.Text;
9
10 namespace DAL
11 {
12 public class ChaRuDAL
13 {
14 //插入A队队员信息
15 public int ChaRuADui(string ADuiBianHao,string ADuiXingming)
16 {
17 int a=int.Parse(ADuiBianHao);
18
19 string sql = "insert into renA values("+a+",'"+ADuiXingming.ToString().Trim()+"');";
20 return AccessHelpera.ExecuteNonQuery(sql,null);
21 }
22 //插入B队队员信息
23 public int ChaRuBDui(string BDuiBianHao, string BDuiXingming)
24 {
25 int a = int.Parse(BDuiBianHao);
26 string sql = "insert into renB values(" + a + ",'" + BDuiXingming.ToString().Trim() + "');";
27 return AccessHelpera.ExecuteNonQuery(sql, null);
28 }
29 //插入A队球员击球状态信息
30 public int ChaRuAQiu(string biamHao,string jiQiu,string deFen)
31 {
32 int a=int.Parse(biamHao);
33 string sql = "insert into fenA values(" + a + ",'" + jiQiu.ToString().Trim() + "','" + deFen.ToString().Trim() + "')";
34 //string sql = "insert into fenA values(" + 1 + ",'" + 2+ "','" + 3 + ")";
35 return AccessHelpera.ExecuteNonQuery(sql,null);
36 }
37 //插入B队球员击球状态信息
38 public int ChaRuBQiu(string biamHao, string jiQiu, string deFen)
39 {
40 int a = int.Parse(biamHao);
41 string sql = "insert into fenB values(" + a + ",'" + jiQiu.ToString().Trim() + "','" + deFen.ToString().Trim() + "')";
42 return AccessHelpera.ExecuteNonQuery(sql, null);
43 }
44
45 }
46 }
ChaRuDAL
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Data;
5 using System.Data.OleDb;
6 using COMMON;
7 using System.Text;
8
9 namespace DAL
10 {
11 public class ChaXunDAL
12 {
13 public DataTable getAllABianHao()
14 {
15 string sql = "select distinct id from fenA";
16 return AccessHelpera.ExecuteDataTable(sql,null);
17 }
18 //查询得分最高的人
19 public string getFenZui()
20 {
21 string Adui="";
22 string Afen="";
23 string Ayifu="";
24 string Bdui = "";
25 string Bfen = "";
26 string Byifu = "";
27 //查询A队的最高分
28 string sql = "select count(*) as a,id,isfen from fenA where isfen='是' group by id, isfen order by count(*) desc;";
29 OleDbDataReader dr=AccessHelpera.ExecuteReader(sql,null);
30 if (dr.HasRows)
31 {
32 dr.Read();
33 Adui = "a";
34 Ayifu = dr["id"].ToString();
35 Afen = dr["a"].ToString();
36
37 }
38 //查询B队的最高分
39 string bsql = "select count(*) as a,id,fen from fenB where fen='是' group by id, fen order by count(*) desc;";
40 OleDbDataReader drr = AccessHelpera.ExecuteReader(bsql, null);
41 if (drr.HasRows)
42 {
43 drr.Read();
44 Bdui = "b";
45 Byifu = drr["id"].ToString();
46 Bfen = drr["a"].ToString();
47
48 }
49 //判断两个队伍的最高是哪个队的
50 if (int.Parse(Afen) > int.Parse(Bfen))
51 {
52 return Adui + Afen+"f" + Ayifu;
53 }
54 else
55 {
56 return Bdui + Bfen+"f" + Byifu;
57 }
58 }
59 //获得a队队员的名字
60 public string getAName(string id)
61 {
62 int aa = int.Parse(id);
63 string sql = "select name from renA where id="+aa;
64 string a = AccessHelpera.ExecuteScalar(sql,null).ToString();
65 return a;
66 }
67 //获得b队队员的名字
68 public string getBName(string id)
69 {
70 int aa = int.Parse(id);
71 string sql = "select name from renB where id="+aa;
72 string a = AccessHelpera.ExecuteScalar(sql, null).ToString();
73 return a;
74 }
75 //查询发球得分最高的人
76 public string getFenQiu(string jiQiuZhuangTai)
77 {
78 string Adui = "";
79 string Afen = "";
80 string Ayifu = "";
81 string Bdui = "";
82 string Bfen = "";
83 string Byifu = "";
84 //查询A队的最高分
85 string sql = "select count(*) as a,id,isfen from fenA where isfen='是' and jiQiu='"+jiQiuZhuangTai+"' group by id, isfen order by count(*) desc";
86 OleDbDataReader dr = AccessHelpera.ExecuteReader(sql, null);
87 if (dr.HasRows)
88 {
89 dr.Read();
90 Adui = "a";
91 Ayifu = dr["id"].ToString();
92 Afen = dr["a"].ToString();
93
94 }
95 //查询B队的最高分
96 string bsql = "select count(*) as a,id,fen from fenB where fen='是' and jiQiu='"+jiQiuZhuangTai+"' group by id, fen order by count(*) desc";
97 OleDbDataReader drr = AccessHelpera.ExecuteReader(bsql, null);
98 if (drr.HasRows)
99 {
100 drr.Read();
101 Bdui = "b";
102 Byifu = drr["id"].ToString();
103 Bfen = drr["a"].ToString();
104
105 }
106 //判断两个队伍的最高是哪个队的
107 if (int.Parse(Afen) > int.Parse(Bfen))
108 {
109 return Adui + Afen + "f" + Ayifu;
110 }
111 else
112 {
113 return Bdui + Bfen + "f" + Byifu;
114 }
115 }
116
117 }
118 }
ChaXunDAL
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using COMMON;
5 using System.Data;
6 using MySql.Data.MySqlClient;
7 using System.Text;
8
9 namespace DAL
10 {
11
12 public class ShanChuBiaoDAL
13 {
14 public int ShanChu()
15 {
16 return AccessHelpera.ClearBiaoRen();
17 }
18
19 }
20
21 }
ShanChuBiaoDAL
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using DAL;
5 using System.Text;
6
7 namespace BLL
8 {
9 public class ShanChuBiaoBLL
10 {
11 ShanChuBiaoDAL dal = new ShanChuBiaoDAL();
12 public int ShanChu()
13 {
14 return dal.ShanChu();
15 }
16 }
17 }
ShanChuBiaoBLL
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Data;
5 using DAL;
6 using System.Text;
7
8 namespace BLL
9 {
10 public class ChaXunBLL
11 {
12 ChaXunDAL dal = new ChaXunDAL();
13 public DataTable getAllABianHao()
14 {
15
16 return dal.getAllABianHao();
17 }
18 public string getFenZui()
19 {
20 return dal.getFenZui();
21 }
22 public string getAName(string id)
23 {
24 return dal.getAName(id);
25 }
26 public string getBName(string id)
27 {
28 return dal.getBName(id);
29 }
30 public string getFenQiu(string jiQiuZhuangTai)
31 {
32 return dal.getFenQiu(jiQiuZhuangTai);
33 }
34 }
35 }
ChaXunBLL
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using DAL;
5 using System.Text;
6
7 namespace BLL
8 {
9 public class ChaRuBLL
10 {
11 ChaRuDAL dal = new ChaRuDAL();
12 //插入A队球员信息
13 public int ChaRuADui(string ADuiBianHao,string ADuiXingming)
14 {
15 return dal.ChaRuADui(ADuiBianHao,ADuiXingming);
16 }
17 //插入B队球员信息
18 public int ChaRuBDui(string ADuiBianHao, string ADuiXingming)
19 {
20 return dal.ChaRuBDui(ADuiBianHao, ADuiXingming);
21 }
22 //插入A队击球信息
23 public int ChaRuAQiu(string biamHao, string jiQiu, string deFen)
24 {
25
26 return dal.ChaRuAQiu(biamHao, jiQiu, deFen);
27 }
28 //插入B队击球信息
29 public int ChaRuBQiu(string biamHao, string jiQiu, string deFen)
30 {
31
32 return dal.ChaRuBQiu(biamHao, jiQiu, deFen);
33 }
34 }
35
36 }
ChaRuBLL
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web;
5 using System.Text;
6 using BLL;
7 using System.Web.UI;
8 using System.Web.UI.WebControls;
9
10 namespace 排球现场工作人员
11 {
12 public partial class A队球员 : System.Web.UI.Page
13 {
14 protected void Page_Load(object sender, EventArgs e)
15 {
16
17 }
18
19 protected void Button1_Click(object sender, EventArgs e)
20 {
21 ShanChuBiaoBLL sbll = new ShanChuBiaoBLL();
22 sbll.ShanChu();
23 //if (bll.ShanChu() <= 0)
24 //{
25 //如果表内数据删除失败则显示必须填写内容。
26
27 //}
28 ChaRuBLL bll = new ChaRuBLL();
29
30 //用循环插入信息
31
32 //for (int i = 1; i < 21; i++)
33 //{
34
35 //}
36
37 //插入A队队员1信息
38 if (Lab1.Text != "" && Text1.Text != "")
39 {
40 if (bll.ChaRuADui(Lab1.Text, Text1.Text) <= 0)
41 {
42 //插入失败
43 }
44 }
45 //插入A队队员2信息
46 if (Lab2.Text != "" && Text2.Text != "")
47 {
48 if (bll.ChaRuADui(Lab2.Text, Text2.Text) <= 0)
49 {
50 //插入失败
51 }
52 }
53 //插入A队队员3信息
54 if (Lab3.Text != "" && Text3.Text != "")
55 {
56 if (bll.ChaRuADui(Lab3.Text, Text3.Text) <= 0)
57 {
58 //插入失败
59 }
60 }
61 //插入A队队员4信息
62 if (Lab4.Text != "" && Text4.Text != "")
63 {
64 if (bll.ChaRuADui(Lab4.Text, Text4.Text) <= 0)
65 {
66 //插入失败
67 }
68 }
69 //插入A队队员5信息
70 if (Lab5.Text != "" && Text5.Text != "")
71 {
72 if (bll.ChaRuADui(Lab5.Text, Text5.Text) <= 0)
73 {
74 //插入失败
75 }
76 }
77 //插入A队队员6信息
78 if (Lab6.Text != "" && Text6.Text != "")
79 {
80 if (bll.ChaRuADui(Lab6.Text, Text6.Text) <= 0)
81 {
82 //插入失败
83 }
84 }
85 //插入A队队员7信息
86 if (Lab7.Text != "" && Text7.Text != "")
87 {
88 if (bll.ChaRuADui(Lab7.Text, Text7.Text) <= 0)
89 {
90 //插入失败
91 }
92 }
93 //插入A队队员8信息
94 if (Lab8.Text != "" && Text8.Text != "")
95 {
96 if (bll.ChaRuADui(Lab8.Text, Text8.Text) <= 0)
97 {
98 //插入失败
99 }
100 }
101 //插入A队队员9信息
102 if (Lab9.Text != "" && Text9.Text != "")
103 {
104 if (bll.ChaRuADui(Lab9.Text, Text9.Text) <= 0)
105 {
106 //插入失败
107 }
108 }
109 //插入A队队员10信息
110 if (Lab10.Text != "" && Text10.Text != "")
111 {
112 if (bll.ChaRuADui(Lab10.Text, Text10.Text) <= 0)
113 {
114 //插入失败
115 }
116 }
117 //插入A队队员11信息
118 if (Lab11.Text != "" && Text11.Text != "")
119 {
120 if (bll.ChaRuADui(Lab11.Text, Text11.Text) <= 0)
121 {
122 //插入失败
123 }
124 }
125 //插入A队队员12信息
126 if (Lab12.Text != "" && Text12.Text != "")
127 {
128 if (bll.ChaRuADui(Lab12.Text, Text12.Text) <= 0)
129 {
130 //插入失败
131 }
132 }
133 //插入A队队员13信息
134 if (Lab13.Text != "" && Text13.Text != "")
135 {
136 if (bll.ChaRuADui(Lab13.Text, Text13.Text) <= 0)
137 {
138 //插入失败
139 }
140 }
141 //插入A队队员14信息
142 if (Lab14.Text != "" && Text14.Text != "")
143 {
144 if (bll.ChaRuADui(Lab14.Text, Text14.Text) <= 0)
145 {
146 //插入失败
147 }
148 }
149 //插入A队队员15信息
150 if (Lab15.Text != "" && Text15.Text != "")
151 {
152 if (bll.ChaRuADui(Lab15.Text, Text15.Text) <= 0)
153 {
154 //插入失败
155 }
156 }
157 //插入A队队员16信息
158 if (Lab16.Text != "" && Text16.Text != "")
159 {
160 if (bll.ChaRuADui(Lab16.Text, Text16.Text) <= 0)
161 {
162 //插入失败
163 }
164 }
165 //插入A队队员17信息
166 if (Lab17.Text != "" && Text17.Text != "")
167 {
168 if (bll.ChaRuADui(Lab17.Text, Text17.Text) <= 0)
169 {
170 //插入失败
171 }
172 }
173 //插入A队队员18信息
174 if (Lab18.Text != "" && Text18.Text != "")
175 {
176 if (bll.ChaRuADui(Lab18.Text, Text18.Text) <= 0)
177 {
178 //插入失败
179 }
180 }
181 //插入A队队员19信息
182 if (Lab19.Text !="" && Text19.Text != "")
183 {
184 if (bll.ChaRuADui(Lab19.Text, Text19.Text) <= 0)
185 {
186 //插入失败
187 }
188 }
189 //插入A队队员20信息
190 if (Lab20.Text != "" && Text20.Text != "")
191 {
192 if (bll.ChaRuADui(Lab20.Text, Text20.Text) <= 0)
193 {
194 //插入失败
195 }
196 }
197
198
199
200 //插入B队队员1信息
201 if (Labe1.Text != "" && TextB1.Text != "")
202 {
203 if (bll.ChaRuBDui(Labe1.Text, TextB1.Text) <= 0)
204 {
205 //插入失败
206 }
207 }
208 //插入B队队员2信息
209 if (Labe2.Text != "" && TextB2.Text != "")
210 {
211 if (bll.ChaRuBDui(Labe2.Text, TextB2.Text) <= 0)
212 {
213 //插入失败
214 }
215 }
216 //插入B队队员3信息
217 if (Labe3.Text != "" && TextB3.Text != "")
218 {
219 if (bll.ChaRuBDui(Labe3.Text, TextB3.Text) <= 0)
220 {
221 //插入失败
222 }
223 }
224 //插入B队队员4信息
225 if (Labe4.Text != "" && TextB4.Text != "")
226 {
227 if (bll.ChaRuBDui(Labe4.Text, TextB4.Text) <= 0)
228 {
229 //插入失败
230 }
231 }
232 //插入B队队员5信息
233 if (Labe5.Text != "" && TextB5.Text != "")
234 {
235 if (bll.ChaRuBDui(Labe5.Text, TextB5.Text) <= 0)
236 {
237 //插入失败
238 }
239 }
240 //插入B队队员6信息
241 if (Labe6.Text != "" && TextB6.Text != "")
242 {
243 if (bll.ChaRuBDui(Labe6.Text, TextB6.Text) <= 0)
244 {
245 //插入失败
246 }
247 }
248 //插入B队队员7信息
249 if (Labe7.Text != "" && TextB7.Text != "")
250 {
251 if (bll.ChaRuBDui(Labe7.Text, TextB7.Text) <= 0)
252 {
253 //插入失败
254 }
255 }
256 //插入B队队员8信息
257 if (Labe8.Text != "" && TextB8.Text != "")
258 {
259 if (bll.ChaRuBDui(Labe8.Text, TextB8.Text) <= 0)
260 {
261 //插入失败
262 }
263 }
264 //插入B队队员9信息
265 if (Labe9.Text != "" && TextB9.Text != "")
266 {
267 if (bll.ChaRuBDui(Labe9.Text, TextB9.Text) <= 0)
268 {
269 //插入失败
270 }
271 }
272 //插入B队队员10信息
273 if (Labe10.Text != "" && TextB10.Text != "")
274 {
275 if (bll.ChaRuBDui(Labe10.Text, TextB10.Text) <= 0)
276 {
277 //插入失败
278 }
279 }
280 //插入B队队员11信息
281 if (Labe11.Text != "" && TextB11.Text != "")
282 {
283 if (bll.ChaRuBDui(Labe11.Text, TextB11.Text) <= 0)
284 {
285 //插入失败
286 }
287 }
288 //插入B队队员12信息
289 if (Labe12.Text != "" && TextB12.Text != "")
290 {
291 if (bll.ChaRuBDui(Labe12.Text, TextB12.Text) <= 0)
292 {
293 //插入失败
294 }
295 }
296 //插入B队队员13信息
297 if (Labe13.Text != "" && TextB13.Text != "")
298 {
299 if (bll.ChaRuBDui(Labe13.Text, TextB13.Text) <= 0)
300 {
301 //插入失败
302 }
303 }
304 //插入B队队员14信息
305 if (Labe14.Text != "" && TextB14.Text != "")
306 {
307 if (bll.ChaRuBDui(Labe14.Text, TextB14.Text) <= 0)
308 {
309 //插入失败
310 }
311 }
312 //插入B队队员15信息
313 if (Labe15.Text != "" && TextB15.Text != "")
314 {
315 if (bll.ChaRuBDui(Labe15.Text, TextB15.Text) <= 0)
316 {
317 //插入失败
318 }
319 }
320 //插入B队队员16信息
321 if (Labe16.Text != "" && TextB16.Text != "")
322 {
323 if (bll.ChaRuBDui(Labe16.Text, TextB16.Text) <= 0)
324 {
325 //插入失败
326 }
327 }
328 //插入B队队员17信息
329 if (Labe17.Text != "" && TextB17.Text != "")
330 {
331 if (bll.ChaRuBDui(Labe17.Text, TextB17.Text) <= 0)
332 {
333 //插入失败
334 }
335 }
336 //插入B队队员18信息
337 if (Labe18.Text != "" && TextB18.Text != "")
338 {
339 if (bll.ChaRuBDui(Labe18.Text, TextB18.Text) <= 0)
340 {
341 //插入失败
342 }
343 }
344 //插入B队队员19信息
345 if (Labe19.Text != "" && TextB19.Text != "")
346 {
347 if (bll.ChaRuBDui(Labe19.Text, TextB19.Text) <= 0)
348 {
349 //插入失败
350 }
351 }
352 //插入B队队员20信息
353 if (Labe20.Text != "" && Text20.Text != "")
354 {
355 if (bll.ChaRuBDui(Labe20.Text, Text20.Text) <= 0)
356 {
357 //插入失败
358 }
359 }
360 //将队名分享到其他网页中
361 HttpCookie cookie = new HttpCookie("ADui", TxtADui.Text);
362 Response.Cookies.Add(cookie);
363 HttpCookie cookies = new HttpCookie("BDui",TxtBDui.Text);
364 Response.Cookies.Add(cookies);
365 //跳转到统计界面
366 //Response.Redirect("统计界面.aspx?Adui="+TxtADui.Text+"&Bdui="+TxtBDui.Text);
367 //Response.WriteFile("统计界面.aspx");
368 Response.Redirect("统计界面.aspx");
369
370 }
371
372 protected void Button2_Click(object sender, EventArgs e)
373 {
374
375
376 }
377 }
378 }
A队球员.aspx
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web;
5 using BLL;
6 using System.Data;
7 using System.Web.UI;
8 using System.Web.UI.WebControls;
9
10 namespace 排球现场工作人员
11 {
12 public partial class 查询 : System.Web.UI.Page
13 {
14 string ADui="";
15 string BDui = "";
16 protected void Page_Load(object sender, EventArgs e)
17 {
18 ////清空队名等
19 //DropDownListDui.ClearSelection();
20 //DropDownListShi.ClearSelection();
21 //DropDownListXing.ClearSelection();
22 //DropDownListYi.ClearSelection();
23 ////添加全部
24 //DropDownListShi.Items.Add("全部");
25 //DropDownListXing.Items.Add("全部");
26 //DropDownListYi.Items.Add("全部");
27 //获取cookie值 写到 某队 vs 某队中
28 ADui = Request.Cookies["Adui"].Value;
29 BDui=Request.Cookies["Bdui"].Value;
30 //写入队名中
31 //DropDownListDui.Items.Add(ADui);
32 //DropDownListDui.Items.Add(BDui);
33 //ChaXunBLL bll = new ChaXunBLL();
34 //if (DropDownListDui.Items[0].Selected)
35 //{
36 // //写入数据源编号
37 // // DropDownListDui.DataSource;
38 // DataTable dt = bll.getAllABianHao();
39 // DropDownListDui.DataSource = dt;
40 // DropDownListDui.DataTextField = "id";
41 // DropDownListDui.DataBind();
42
43 //}
44 //else if(DropDownListDui.Items[1].Selected)
45 //{
46 // //写入
47 //}
48 //加载时间中添加队名 A B
49 //如果A添加A队球员 姓名
50 //如果B添加B队球员 姓名
51
52 }
53
54 protected void ButChaXun_Load(object sender, EventArgs e)
55 {
56
57 }
58
59 protected void ButChaXun_Click(object sender, EventArgs e)
60 {
61 ChaXunBLL bll=new ChaXunBLL();
62 string quanbu = bll.getFenZui();
63 //TextFenZuiFen.Text = bll.getFenZui();
64 string dui = quanbu.Substring(0, 1);
65 int a = quanbu.IndexOf("f");
66 string aa = quanbu.Substring(0,quanbu.Length-1);
67 string fen = quanbu.Substring(1,a-1);
68 string yifu = quanbu.Replace(aa,"");
69 //string yifu = quanbu.Length.ToString();
70 if (dui == "a")
71 {
72 //根据编号查询姓名
73 string Aname = bll.getAName(yifu);
74 TextFenZuiDui.Text =ADui;
75 TextFenZuiXing.Text = Aname;
76 }
77 else
78 {
79 string Bname = bll.getBName(yifu);
80 TextFenZuiDui.Text = BDui;
81 TextFenZuiXing.Text = Bname;
82 }
83 TextFenZuiFen.Text = fen;
84 TextFenZuiYi.Text =yifu;
85
86
87 }
88 ChaXunBLL bll = new ChaXunBLL();
89 protected void TextZuiJia_Click(object sender, EventArgs e)
90 {
91
92 ButFaQiu_Click(null,null);
93 ButKouQiu_Click(null,null);
94 ButLanWang_Click(null,null);
95 ButYiChuan_Click(null, null);
96 ButMoQiu_Click(null, null);
97 }
98
99 protected void ButFaQiu_Click(object sender, EventArgs e)
100 {
101 string quanbu = bll.getFenQiu("发球"); ;
102 //TextFenZuiFen.Text = bll.getFenZui();
103 string dui = quanbu.Substring(0, 1);
104 int a = quanbu.IndexOf("f");
105 string aa = quanbu.Substring(0, quanbu.Length - 1);
106 string fen = quanbu.Substring(1, a - 1);
107 string yifu = quanbu.Replace(aa, "");
108 //string yifu = quanbu.Length.ToString();
109 if (dui == "a")
110 {
111 //根据编号查询姓名
112 string Aname = bll.getAName(yifu);
113 TextZuiFaDui.Text = ADui;
114 TextZuiFaXing.Text = Aname;
115 //TextFenZuiXing.Text = Aname;
116 }
117 else
118 {
119 string Bname = bll.getBName(yifu);
120 TextZuiFaDui.Text = BDui;
121 TextZuiFaXing.Text = Bname;
122 }
123 TextZuiFaFen.Text = fen;
124 TextZuiFaYi.Text = yifu;
125 }
126
127 protected void ButLanWang_Click(object sender, EventArgs e)
128 {
129 string quanbu = bll.getFenQiu("拦网"); ;
130 //TextFenZuiFen.Text = bll.getFenZui();
131 string dui = quanbu.Substring(0, 1);
132 int a = quanbu.IndexOf("f");
133 string aa = quanbu.Substring(0, quanbu.Length - 1);
134 string fen = quanbu.Substring(1, a - 1);
135 string yifu = quanbu.Replace(aa, "");
136 //string yifu = quanbu.Length.ToString();
137 if (dui == "a")
138 {
139 //根据编号查询姓名
140 string Aname = bll.getAName(yifu);
141 TextZuiLanDui.Text = ADui;
142 TextZuiLanXing.Text = Aname;
143 //TextFenZuiXing.Text = Aname;
144 }
145 else
146 {
147 string Bname = bll.getBName(yifu);
148 TextZuiLanDui.Text = BDui;
149 TextZuiLanXing.Text = Bname;
150 }
151 TextZuiLanFen.Text = fen;
152 TextZuiLanYi.Text = yifu;
153 }
154
155 protected void ButYiChuan_Click(object sender, EventArgs e)
156 {
157 string quanbu = bll.getFenQiu("一传"); ;
158 //TextFenZuiFen.Text = bll.getFenZui();
159 string dui = quanbu.Substring(0, 1);
160 int a = quanbu.IndexOf("f");
161 string aa = quanbu.Substring(0, quanbu.Length - 1);
162 string fen = quanbu.Substring(1, a - 1);
163 string yifu = quanbu.Replace(aa, "");
164 //string yifu = quanbu.Length.ToString();
165 if (dui == "a")
166 {
167 //根据编号查询姓名
168 string Aname = bll.getAName(yifu);
169
170 TextZuiYiChuangDui.Text = ADui;
171 TextZuiYiXing.Text = Aname;
172 //TextFenZuiXing.Text = Aname;
173 }
174 else
175 {
176 string Bname = bll.getBName(yifu);
177 TextZuiYiChuangDui.Text = BDui;
178 TextZuiYiXing.Text = Bname;
179 }
180 TextZuiYiFen.Text = fen;
181 TextZuiYiYi.Text = yifu;
182 }
183
184 protected void ButKouQiu_Click(object sender, EventArgs e)
185 {
186 string quanbu = bll.getFenQiu("扣球"); ;
187 //TextFenZuiFen.Text = bll.getFenZui();
188 string dui = quanbu.Substring(0, 1);
189 int a = quanbu.IndexOf("f");
190 string aa = quanbu.Substring(0, quanbu.Length - 1);
191 string fen = quanbu.Substring(1, a - 1);
192 string yifu = quanbu.Replace(aa, "");
193 //string yifu = quanbu.Length.ToString();
194 if (dui == "a")
195 {
196 //根据编号查询姓名
197 string Aname = bll.getAName(yifu);
198 TextZuiKouDui.Text = ADui;
199 TextZuiKouXing.Text = Aname;
200 //TextFenZuiXing.Text = Aname;
201 }
202 else
203 {
204 string Bname = bll.getBName(yifu);
205 TextZuiKouDui.Text = BDui;
206 TextZuiKouXing.Text = Bname;
207 }
208 TextZuiKouFen.Text = fen;
209 TextZuiKouYi.Text = yifu;
210 }
211
212 protected void ButMoQiu_Click(object sender, EventArgs e)
213 {
214 string quanbu = bll.getFenQiu("抹球"); ;
215 //TextFenZuiFen.Text = bll.getFenZui();
216 string dui = quanbu.Substring(0, 1);
217 int a = quanbu.IndexOf("f");
218 string aa = quanbu.Substring(0, quanbu.Length - 1);
219 string fen = quanbu.Substring(1, a - 1);
220 string yifu = quanbu.Replace(aa, "");
221 //string yifu = quanbu.Length.ToString();
222 if (dui == "a")
223 {
224 //根据编号查询姓名
225 string Aname = bll.getAName(yifu);
226 TextZuiMoDui.Text = ADui;
227 TextZuiMoXing.Text = Aname;
228 //TextFenZuiXing.Text = Aname;
229 }
230 else
231 {
232 string Bname = bll.getBName(yifu);
233 TextZuiMoDui.Text = BDui;
234 TextZuiMoXing.Text = Bname;
235 }
236 TextZuiMoFen.Text = fen;
237 TextZuiMoYi.Text = yifu;
238 }
239 }
240 }
查询.aspx
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web;
5 using System.Web.UI;
6 using BLL;
7 using System.Web.UI.WebControls;
8
9 namespace 排球现场工作人员
10 {
11 public partial class 统计界面 : System.Web.UI.Page
12 {
13 protected void Page_Load(object sender, EventArgs e)
14 {
15 //获取cookie值 写到 某队 vs 某队中
16 LabA.Text = Request.Cookies["Adui"].Value;
17 LabB.Text = Request.Cookies["Bdui"].Value;
18 LabADuiMing.Text = LabA.Text;
19 LabBDuiMing.Text = LabB.Text;
20 //加载事件默认 文本框选择 A队 目前选择的第一项 发球 否
21 //TxtDuiMing.Text = LabADuiMing.Text;
22 //TxtSelect.Text = DropDownList1.SelectedValue;
23 //txtJiQiuZhuangTai.Text = ButAFaQiu.Text;
24 //TxtIsFen.Text=RadioButtonList1.SelectedItem.Value;
25 //禁用撤销键
26 ButCheXiao.Enabled = false;
27 }
28
29 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
30 {
31 //A队选项改变 给A队中您当前选择的项中添加选择内容
32 TxtSelect.Text=DropDownList1.SelectedValue;
33 //在您当前选择的项中写入 A队
34 TxtDuiMing.Text=LabADuiMing.Text;
35 }
36
37 protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
38 {
39 //B队选项改变 给A队中您当前选择的项中添加选择内容
40 TxtSelect.Text = DropDownList2.SelectedValue;
41 //在您当前选择的项中写入 B队
42 TxtDuiMing.Text = LabBDuiMing.Text;
43 }
44
45 protected void ButAFaQiu_Click(object sender, EventArgs e)
46 {
47 //单击发球 当前选择的击球状态为 发球
48 txtJiQiuZhuangTai.Text = ButAFaQiu.Text;
49 }
50
51 protected void ButALanWang_Click(object sender, EventArgs e)
52 {
53 //单击拦网 当前选择的击球状态为 拦网
54 txtJiQiuZhuangTai.Text = ButALanWang.Text;
55 }
56
57 protected void ButAKouQiu_Click(object sender, EventArgs e)
58 {
59 //单击扣球 当前选择的击球状态为 扣球
60 txtJiQiuZhuangTai.Text = ButAKouQiu.Text;
61 }
62
63 protected void ButAMoQiu_Click(object sender, EventArgs e)
64 {
65 //单击抹球 当前选择的击球状态为 抹球
66 txtJiQiuZhuangTai.Text = ButAMoQiu.Text;
67 }
68
69 protected void ButAYiChuan_Click(object sender, EventArgs e)
70 {
71 //单击一传 当前选择的击球状态为 一传
72 txtJiQiuZhuangTai.Text = ButAYiChuan.Text;
73 }
74
75 protected void ButBFaQiu_Click(object sender, EventArgs e)
76 {
77 //单击发球 当前选择的击球状态为 发球
78 txtJiQiuZhuangTai.Text = ButBFaQiu.Text;
79 }
80
81 protected void ButBLamWang_Click(object sender, EventArgs e)
82 {
83 //单击拦网 当前选择的击球状态为 拦网
84 txtJiQiuZhuangTai.Text = ButBLamWang.Text;
85 }
86
87 protected void ButBKouQiu_Click(object sender, EventArgs e)
88 {
89 //单击扣球 当前选择的击球状态为 扣球
90 txtJiQiuZhuangTai.Text = ButBKouQiu.Text;
91 }
92
93 protected void ButBMoQiu_Click(object sender, EventArgs e)
94 {
95 //单击抹球 当前选择的击球状态为 抹球
96 txtJiQiuZhuangTai.Text = ButBMoQiu.Text;
97 }
98
99 protected void ButBYiChuan_Click(object sender, EventArgs e)
100 {
101 //单击一传 当前选择的击球状态为 一传
102 txtJiQiuZhuangTai.Text = ButBYiChuan.Text;
103 }
104
105 protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
106 {
107 TxtIsFen.Text = RadioButtonList1.SelectedItem.Value;
108 }
109
110 protected void RadioButtonList2_SelectedIndexChanged(object sender, EventArgs e)
111 {
112 TxtIsFen.Text = RadioButtonList2.SelectedItem.Value;
113 }
114
115 protected void Button12_Click(object sender, EventArgs e)
116 {
117 ChaRuBLL bll = new ChaRuBLL();
118 //如果文本框里的值为A队
119 if (TxtDuiMing.Text == LabA.Text)
120 {
121 //插入到A表
122 //判断文本框里的值是否为空
123 if (TxtSelect.Text != "" && txtJiQiuZhuangTai.Text != "" && TxtIsFen.Text != "")
124 {
125 bll.ChaRuAQiu(TxtSelect.Text,txtJiQiuZhuangTai.Text,TxtIsFen.Text);
126 //在您刚添加过的是的文本框里写入值
127 TxtSelected.Text = TxtSelect.Text;
128 TxtDuiMinged.Text = TxtDuiMing.Text;
129 TxtIsFened.Text = TxtIsFen.Text;
130 TxtJiQiuZhuangTaied.Text = txtJiQiuZhuangTai.Text;
131 ButCheXiao.Enabled = false;
132
133 }
134
135 }
136 else if(TxtDuiMing.Text==LabB.Text)
137 {
138 //插入表B表
139 //判断文本框里的值是否为空
140 if (TxtSelect.Text != "" && txtJiQiuZhuangTai.Text != "" && TxtIsFen.Text != "")
141 {
142 bll.ChaRuBQiu(TxtSelect.Text, txtJiQiuZhuangTai.Text, TxtIsFen.Text);
143 //在您刚添加过的是的文本框里写入值
144 TxtSelected.Text = TxtSelect.Text;
145 TxtDuiMinged.Text = TxtDuiMing.Text;
146 TxtIsFened.Text = TxtIsFen.Text;
147 TxtJiQiuZhuangTaied.Text = txtJiQiuZhuangTai.Text;
148 ButCheXiao.Enabled = false;
149 }
150
151 }
152 else
153 {
154 //无法插入
155 }
156 }
157
158 protected void ButCheXiao_Click(object sender, EventArgs e)
159 {
160 CheXiaoBLL bll = new CheXiaoBLL();
161 //删除数据库中最后一行内容
162 if (TxtDuiMinged.Text == LabA.Text)
163 {
164 bll.CheXiaoA();
165 //禁用撤销键
166 ButCheXiao.Enabled = false;
167 }
168 else if (TxtDuiMinged.Text == LabB.Text)
169 {
170 bll.CheXiaoB();
171 //禁用撤销键
172 ButCheXiao.Enabled = false;
173 }
174
175
176 }
177
178 protected void n_Click(object sender, EventArgs e)
179 {
180 Response.Redirect("查询.aspx");
181 }
182 }
183 }
统计界面.aspx
代码复审:已完成。
测试:已完成。
测试报告:目前测试结果,运行效率不够高。
计算工作量:
计划
|
估算时间
|
实际时间
|
估计这个任务需要多少时间
|
300min
|
840min
|
开发
|
80min
|
640min
|
需求分析
|
30min
|
100min
|
生成设计文档
|
100min
|
50min
|
设计复审
|
30min
|
20min
|
代码规范
|
5min
|
20min
|
具体设计
|
20min
|
240min
|
具体编码
|
50min
|
400min
|
代码复审
|
30min
|
10min
|
测试
|
50min
|
50min
|
测试报告
|
15min
|
15min
|
计算工作量
|
15min
|
15min
|
事后总结并提出改进计划
|
10min
|
10min
|
事后总结,并提出改进计划:设计的不够完善,编写代码的时候还需要更改一些设计上的失误。代码不够完善,还需要进行重构,让其的效率和用户体验更佳。