吴耗子

博客园 首页 联系 订阅 管理

 个人Psp

计划:需要一星期

需求分析:作为一个观众需要知道每一场的比赛得分情况,分数详细,列出局分以便了解比赛的战况。

生成设计文档:需要一个查询队伍界面,和比赛的具体得分.

 

 

设计复审:自己.没有组员参加.

代码规范:c#语言.Winfrom窗体.

具体设计:1,选择观众界面.

 

 

2,查询 场分,局分,胜负.

 

 

具体代码:(还没完成全部编写)

  private void DataGridView( string sql="select * from biao")

        {

            SqlConnection conn = new SqlConnection("server=.;database=biao;uid=sa;pwd=123456");

            SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);

            DataSet ds = new DataSet();

 

            adapter.Fill(ds);

 

            dataGridView1.DataSource = ds.Tables[0];

        }

 

        private void ComboBox1()

        {

            comboBox1.Items.Clear();

            comboBox1.Items.Add("");

            comboBox1.SelectedIndex=0;

            SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=biao;Integrated Security=True");

            string str = "select distinct Name from biao";

           SqlCommand comm = new SqlCommand(str, conn);

            conn.Open();

            SqlDataReader reader = comm.ExecuteReader();

            if (reader.HasRows)

            {

                while (reader.Read())

                {

                    comboBox1.Items.Add(reader[0]);

                }

            }

            reader.Close();

            conn.Close();

        }

 

        private void button1_Click(object sender, EventArgs e)

        {

            string Name = comboBox1.Text.Trim();

            StringBuilder sql = new StringBuilder("select * from biao where 1=1");

            if (!String.IsNullOrEmpty(Name))

            {

                sql.Append("and Name like '%" + Name + "%'");

            }

 

            DataGridView(sql.ToString());

        }

 

        private void chaxunToolStripButton_Click(object sender, EventArgs e)

        {

            try

            {

                this.biaoTableAdapter.chaxun(this.biaoDataSet.biao);

            }

            catch (System.Exception ex)

            {

                System.Windows.Forms.MessageBox.Show(ex.Message);

            }

 

        }

 

        private void fillByToolStripButton_Click(object sender, EventArgs e)

        {

            try

            {

                this.biaoTableAdapter.FillBy(this.biaoDataSet.biao);

            }

            catch (System.Exception ex)

            {

                System.Windows.Forms.MessageBox.Show(ex.Message);

            }

 

        }

 

测试:无.未完成.

测试报告:无

计算工作量:未统计

事后总结:还未完成,等完成在做具体总结

 

posted on 2016-12-24 21:07  吴耗子  阅读(102)  评论(0编辑  收藏  举报