第二次冲刺
个人PSP
计划
*估计这个任务需要多长时间:估计需要六天的时间完成这个项目。
开发
*需求分析:
用户故事:作为一名排球教练的助手,我需要了解每场每位队员的技术动作,每场比赛每位队员的得分情况,以便教练更好的了解到每位队员的发挥情况和特长。
设计文档:
1、用户打开进入的界面;
2、用户选择自己要查看的队伍比赛成绩;
3、点击查看的确定按钮;
4、在文本框中查看得分结果;
5.得分结果会保存成记事本文件。
设计复审:
与同学一起审核!
代码规范:vs2010
具体设计:
具体编码:
private void Form1_Load(object sender, EventArgs e)
{
// groupBox1.Visible = true;
// groupBox2.Visible = false;
}
int i = 0;
private void button10_Click(object sender, EventArgs e)
{
// string ZhuGong111 = txtZhuGong1.Text;
//string ZhuGong222 = txtZhuGong2.Text;
string A = txtA.Text;
string B = txtB.Text;
string C=txt1.Text;
string D = txt2.Text;
string E = txterchuan.Text;
string F = txttibu.Text;
if (string.IsNullOrEmpty(A)) { MessageBox.Show("请输入本场比赛的主攻A"); }
else if (string.IsNullOrEmpty(B)) { MessageBox.Show("请输入本场比赛的主攻B"); }
else if (string.IsNullOrEmpty(C)) { MessageBox.Show("请输入本场比赛的助攻A"); }
else if (string.IsNullOrEmpty(D)) { MessageBox.Show("请输入本场比赛的助攻B"); }
else if (string.IsNullOrEmpty(E)) { MessageBox.Show("请输入本场比赛的二传"); }
else if (string.IsNullOrEmpty(F)) { MessageBox.Show("请输入本场比赛的替补"); }
else
{
// groupBox1.Visible = false;
// groupBox2.Visible = true;
dui1.Text = label1.Text + txtA.Text;
dui2.Text = label2.Text + txtB.Text;
dui3.Text = label3.Text + txt1.Text;
dui4.Text = label4.Text + txt2.Text;
dui5.Text = label5.Text + txterchuan.Text;
dui6.Text = label6.Text + txttibu.Text;
}
}
private void button1_Click(object sender, EventArgs e)
{
i++;
txtjieguo.Text = lblName.Text + button1.Text + " " + i;
}
int FQ = 0;
private void button2_Click(object sender, EventArgs e)
{
FQ++;
txtjieguo.AppendText(lblName.Text+button2.Text+""+FQ);
}
int KQ = 0;
private void button3_Click(object sender, EventArgs e)
{
KQ++;
txtjieguo.AppendText(lblName.Text + button3.Text + " " + KQ);
}
int CW = 0;
private void button4_Click(object sender, EventArgs e)
{
CW++;
txtjieguo.AppendText(lblName.Text +button4.Text + " " + CW);
}
int DQ = 0;
private void button5_Click(object sender, EventArgs e)
{
DQ++;
txtjieguo.AppendText(lblName.Text + button5.Text + " " + CW);
}
int LWCJ = 0;
private void button6_Click(object sender, EventArgs e)
{
LWCJ++;
txtjieguo.AppendText(lblName.Text + button6.Text + " " + LWCJ);
}
int FQSW = 0;
private void button7_Click(object sender, EventArgs e)
{
FQSW++;
txtjieguo.AppendText(lblName.Text + button7.Text + " " + FQSW);
}
int KQCJ = 0;
private void button8_Click(object sender, EventArgs e)
{
KQCJ++;
txtjieguo.AppendText(lblName.Text +button8.Text + " " + KQCJ);
}
private void QD_Click(object sender, EventArgs e)
{
FileStream fs = new FileStream("C:\\file.txt", FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter m_streamWriter = new StreamWriter(fs);
m_streamWriter.Flush(); // 使用StreamWriter来往文件中写入内容
m_streamWriter.BaseStream.Seek(0, SeekOrigin.Begin);
// 把richTextBox1中的内容写入文件
m_streamWriter.Write(txtjieguo.Text);
//关闭此文件 m_streamWriter.Flush ( ) ;
m_streamWriter.Close();
MessageBox.Show("保存成功!");
groupBox2.Visible = false;
groupBox1.Visible = true;
}
private void dui1_TextChanged(object sender, EventArgs e)
{
lblName.Text = dui1.Text;
}
private void dui2_TextChanged(object sender, EventArgs e)
{
lblName.Text = dui2.Text;
}
private void dui3_TextChanged(object sender, EventArgs e)
{
lblName.Text = dui3.Text;
}
private void dui4_TextChanged(object sender, EventArgs e)
{
lblName.Text = dui4.Text;
}
private void dui5_TextChanged(object sender, EventArgs e)
{
lblName.Text = dui5.Text;
}
private void dui6_TextChanged(object sender, EventArgs e)
{
lblName.Text = dui6.Text;
}
}
}
代码复审:暂无
测试:运行无错,但功能不全,需改进
总结:整个程序感觉不错,就是方向有点偏,下次要全面分析。