您的位置:首页 > 其它

第六小组作业

2016-12-25 22:40 232 查看
计划:

估计这个任务需要多少时间完成:5-6天

开发:

需求分析:作为一个排球记分员,我希望能够方便的记录分数(精确到每球的的分),以便及时的把分数反映给观众。

设计文档:①排球计分程序的加减分②比赛结果的查询③比赛详细记录的查询

具体设计:

活动图:



具体编写:





详细得每场总比分:



具体代码:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void jia1_Click(object sender, EventArgs e)
{
if(TBC.Text=="第一场")
{
if(int.Parse(TB1.Text)<25)
{
int a = int.Parse(TB1.Text);
a++;
TB1.Text = a.ToString();

int c = int.Parse(TB2.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第一场" + CB1.Text + "赢");
TBC.Text = "第二场";
TB1.Text = "0";
TB2.Text = "0";
}
}
else
{
int a = int.Parse(TB1.Text);
a++;
TB1.Text = a.ToString();
int c = int.Parse(TB2.Text);
if (a - 1 > c)
{
MessageBox.Show("第一场" + CB1.Text + "赢");
TBC.Text = "第二场";
TB1.Text = "0";
TB2.Text = "0";
}
}
}
else if (TBC.Text == "第二场")
{
if (int.Parse(TB1.Text) < 25)
{
int a = int.Parse(TB1.Text);
a++;
TB1.Text = a.ToString();
int c = int.Parse(TB2.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第二场" + CB1.Text + "赢");
TBC.Text = "第三场";
TB1.Text = "0";
TB2.Text = "0";
}
}
else
{
int a = int.Parse(TB1.Text);
a++;
TB1.Text = a.ToString();
int c = int.Parse(TB2.Text);
if (a - 1 > c)
{
MessageBox.Show("第二场" + CB1.Text + "赢");
TBC.Text = "第三场";
TB1.Text = "0";
TB2.Text = "0";
}
}
}
else if(TBC.Text=="第三场"){
if (int.Parse(TB1.Text) < 25)
{
int a = int.Parse(TB1.Text);
a++;
TB1.Text = a.ToString();
int c = int.Parse(TB2.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第三场" + CB1.Text + "赢");
TBC.Text = "第四场";
TB1.Text = "0";
TB2.Text = "0";
}
}
else
{
int a = int.Parse(TB1.Text);
a++;
TB1.Text = a.ToString();
int c = int.Parse(TB2.Text);
if (a - 1 > c)
{
MessageBox.Show("第三场" + CB1.Text + "赢");
TBC.Text = "第四场";
TB1.Text = "0";
TB2.Text = "0";
}
}
}
else if(TBC.Text=="第四场"){
if (int.Parse(TB1.Text) < 25)
{
int a = int.Parse(TB1.Text);
a++;
TB1.Text = a.ToString();
int c = int.Parse(TB2.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第四场" + CB1.Text + "赢");
TBC.Text = "第五场";
TB1.Text = "0";
TB2.Text = "0";
}
}
else
{
int a = int.Parse(TB1.Text);
a++;
TB1.Text = a.ToString();
int c = int.Parse(TB2.Text);
if (a - 1 > c)
{
MessageBox.Show("第四场" + CB1.Text + "赢");
TBC.Text = "第五场";
TB1.Text = "0";
TB2.Text = "0";
}
}
}
else if (TBC.Text == "第五场")
{
if (int.Parse(TB1.Text) < 25)
{
int a = int.Parse(TB1.Text);
a++;
TB1.Text = a.ToString();
int c = int.Parse(TB2.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第五场" + CB1.Text + "赢");

}
}
else
{
int a = int.Parse(TB1.Text);
a++;
TB1.Text = a.ToString();
int c = int.Parse(TB2.Text);
if (a - 1 > c)
{
MessageBox.Show("第五场" + CB1.Text + "赢");
}
}
}
}

private void jia2_Click(object sender, EventArgs e)
{
if (TBC.Text == "第一场")
{
if (int.Parse(TB2.Text) < 25)
{
int a = int.Parse(TB2.Text);
a++;
TB2.Text = a.ToString();

int c = int.Parse(TB1.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第一场" + CB2.Text + "赢");
TB2.Text = "0";
TBC.Text = "第二场";
TB1.Text = "0";
}
}

else
{
int a = int.Parse(TB2.Text);
a++;
TB2.Text = a.ToString();
int c = int.Parse(TB1.Text);
if (a - 1 > c)
{
MessageBox.Show("第一场" + CB2.Text + "赢");
TBC.Text = "第二场";
TB2.Text = "0";
TB1.Text = "0";
}
}
}
else if(TBC.Text=="第二场")
{
if (int.Parse(TB2.Text) < 25)
{
int a = int.Parse(TB2.Text);
a++;
TB2.Text = a.ToString();
int c = int.Parse(TB1.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第二场" + CB2.Text + "赢");
TBC.Text = "第三场";
TB2.Text = "0";
TB1.Text = "0";
}
}
else
{
int a = int.Parse(TB2.Text);
a++;
TB2.Text = a.ToString();
int c = int.Parse(TB1.Text);
if (a - 1 > c)
{
MessageBox.Show("第二场" + CB2.Text + "赢");
TBC.Text = "第三场";
TB2.Text = "0";
TB1.Text = "0";
}
}
}
else if (TBC.Text == "第三场")
{
if (int.Parse(TB2.Text) < 25)
{
int a = int.Parse(TB2.Text);
a++;
TB2.Text = a.ToString();
int c = int.Parse(TB1.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第三场" + CB2.Text + "赢");
TBC.Text = "第四场";
TB2.Text = "0";
TB1.Text = "0";
}
}
else
{
int a = int.Parse(TB2.Text);
a++;
TB2.Text = a.ToString();
int c = int.Parse(TB1.Text);
if (a - 1 > c)
{
MessageBox.Show("第三场" + CB2.Text + "赢");
TBC.Text = "第四场";
TB2.Text = "0";
TB1.Text = "0";
}
}
}
else if(TBC.Text=="第四场"){
if (int.Parse(TB2.Text) < 25)
{
int a = int.Parse(TB2.Text);
a++;
TB2.Text = a.ToString();
int c = int.Parse(TB1.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第四场" + CB2.Text + "赢");
TBC.Text = "第五场";
TB2.Text = "0";
TB1.Text = "0";
}
}
else
{
int a = int.Parse(TB2.Text);
a++;
TB2.Text = a.ToString();
int c = int.Parse(TB1.Text);
if (a - 1 > c)
{
MessageBox.Show("第四场" + CB2.Text + "赢");
TBC.Text = "第五场";
TB2.Text = "0";
TB1.Text = "0";
}
}
}
else if (TBC.Text == "第五场")
{
if (int.Parse(TB2.Text) < 25)
{
int a = int.Parse(TB2.Text);
a++;
TB2.Text = a.ToString();
int c = int.Parse(TB1.Text);
if (a == 25 && a - 1 > c)
{
MessageBox.Show("第五场" + CB2.Text + "赢");

}
}
else
{
int a = int.Parse(TB2.Text);
a++;
TB2.Text = a.ToString();
int c = int.Parse(TB1.Text);
if (a - 1 > c)
{
MessageBox.Show("第五场" + CB2.Text + "赢");

}
}
}
}

private void jian1_Click(object sender, EventArgs e)
{
if (TBC.Text == "第一场")
{
if (int.Parse(TB1.Text) < 25)
{
int a = int.Parse(TB1.Text);

TB1.Text = a.ToString();

}
else
{ }

}
if (TBC.Text == " 第二场")
{

if (int.Parse(TB1.Text) < 25)
{
int a = int.Parse(TB1.Text);

TB1.Text = a.ToString();

}
else
{ }
}
else if (TBC.Text == " 第三场")
{

if (int.Parse(TB1.Text) < 25)
{
int a = int.Parse(TB1.Text);

TB1.Text = a.ToString();

}
}
else if (TBC.Text == " 第四场")
{

if (int.Parse(TB1.Text) < 25)
{
int a = int.Parse(TB1.Text);

TB1.Text = a.ToString();

}
}
else if (TBC.Text == " 第五场")
{

if (int.Parse(TB1.Text) < 25)
{
int a = int.Parse(TB1.Text);

TB1.Text = a.ToString();

}
}
}

private void jian2_Click(object sender, EventArgs e)
{
if (TBC.Text == "第一场")
{
if (int.Parse(TB2.Text) < 25)
{
int a = int.Parse(TB2.Text);
a--;
TB2.Text = a.ToString();

}

}
else if (TBC.Text == " 第二场")
{

if (int.Parse(TB2.Text) < 25)
{
int a = int.Parse(TB2.Text);

TB2.Text = a.ToString();

}

}
else if (TBC.Text == " 第三场")
{

if (int.Parse(TB2.Text) < 25)
{
int a = int.Parse(TB2.Text);

TB2.Text = a.ToString();

}

}
else if (TBC.Text == " 第四场")
{

if (int.Parse(TB2.Text) < 25)
{
int a = int.Parse(TB2.Text);

TB2.Text = a.ToString();

}
}
else if (TBC.Text == " 第五场")
{

if (int.Parse(TB2.Text) < 25)
{
int a = int.Parse(TB2.Text);

TB2.Text = a.ToString();

}

}
}

private void Form1_Load(object sender, EventArgs e)
{

}
}
}


还没有测试。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: