首页 > 代码库 > 第16周总结 排球计分
第16周总结 排球计分
计划:需要花费5,6天时间。用户故事:作为一名观众,希望了解到比赛的比分。
代码
public partial class Form1 : Form { Action action = new Action(); public Form1() { InitializeComponent(); } int i = 1; private void btnH_Click(object sender, EventArgs e) { int H = Convert.ToInt32(txtH.Text); int L = Convert.ToInt32(txtL.Text); int H1 = Convert.ToInt32(txtH1.Text); int L1 = Convert.ToInt32(txtL1.Text); txtH.Text = (H+1).ToString(); if (H >= 24 && (H - L) > 1) { txtH1.Text = (Convert.ToInt32(txtH1.Text) + 1).ToString(); if ((H1 + L1) == 0) { txtCount1.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } if ((H1 + L1) == 1) { txtCount2.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } if ((H1 + L1) == 2) { txtCount3.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } if ((H1 + L1) == 3) { txtCount4.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } if ((H1 + L1) == 4) { txtCount5.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } txtH.Text = "0"; txtL.Text = "0"; if (txtH1.Text == "3") { MessageBox.Show("一队胜利"); Insert(); txtH.Text = "0"; txtH1.Text = "0"; txtL.Text = "0"; txtL1.Text = "0"; txtCount1.Clear(); txtCount2.Clear(); txtCount3.Clear(); txtCount4.Clear(); txtCount5.Clear(); } } if (H1 + L1 > 3) { if (H >= 14 && (H - L) > 1) { txtH1.Text = (Convert.ToInt32(txtH1.Text) + 1).ToString(); if ((H1 + L1) == 4) { txtCount5.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text + "\r\n"; } txtH.Text = "0"; txtL.Text = "0"; if (txtH1.Text == "3") { MessageBox.Show("一队胜利"); Insert(); txtH.Text = "0"; txtH1.Text = "0"; txtL.Text = "0"; txtL1.Text = "0"; txtCount1.Clear(); txtCount2.Clear(); txtCount3.Clear(); txtCount4.Clear(); txtCount5.Clear(); i = 1; } } } } private void btnL_Click(object sender, EventArgs e) { int H = Convert.ToInt32(txtH.Text); int L = Convert.ToInt32(txtL.Text); int H1 = Convert.ToInt32(txtH1.Text); int L1 = Convert.ToInt32(txtL1.Text); txtL.Text = (L+1).ToString(); if (L>= 24&&(L-H )>1) { txtL1.Text = (Convert.ToInt32(txtL1.Text) + 1).ToString(); if ((H1 + L1) == 0) { txtCount1.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } if ((H1 + L1) == 1) { txtCount2.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } if ((H1 + L1) == 2) { txtCount3.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } if ((H1 + L1) == 3) { txtCount4.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } if ((H1 + L1) == 4) { txtCount5.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } txtH.Text = "0"; txtL.Text = "0"; if (txtL1.Text == "3") { MessageBox.Show("二队胜利"); Insert(); txtH.Text = "0"; txtH1.Text = "0"; txtL.Text = "0"; txtL1.Text = "0"; txtCount1.Clear(); txtCount2.Clear(); txtCount3.Clear(); txtCount4.Clear(); txtCount5.Clear(); } } if (H1 + L1 > 3) { if (L >= 14 && (L - H) > 1) { txtL1.Text = (Convert.ToInt32(txtL1.Text) + 1).ToString(); if ((H1 + L1) == 4) { txtCount5.Text += "第" + (i++) + "局:" + txtH.Text + ":" + txtL.Text; } txtH.Text = "0"; txtL.Text = "0"; if (txtL1.Text == "3") { MessageBox.Show("二队胜利"); Insert(); txtH.Text = "0"; txtH1.Text = "0"; txtL.Text = "0"; txtL1.Text = "0"; txtCount1.Clear(); txtCount2.Clear(); txtCount3.Clear(); txtCount4.Clear(); txtCount5.Clear(); i = 1; } } } } private void button1_Click(object sender, EventArgs e) { Form2 f2 = new Form2(); f2.Show(); } if (txtCount5.Text == "") { M.FIVE = null; } else { M.FIVE = txtCount5.Text.Trim().Substring(4, 4); } M.SUM = txtH1.Text.ToString() + ":" + txtL1.Text.ToString(); action.InsertPK(M); }
第16周总结 排球计分
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。