Example #1
0
        //显示赛事的基本信息
        public void showSeasonData()
        {
            //先清除DataGridView中的数据
            if (dataGridView_seasons.Rows.Count > 0)
            {
                dataGridView_seasons.Rows.Clear();
            }
            //取出数据

            //此处应该判断一下当前选择赛事与赛季没有

            List<SeasonOfMatch> list = SeasonInfoDAO.getSeasonsOfCertainMatch(SystemParam.getMatch().getName());
            //往dataGridView中添加数据
            for (int i = 0; i < list.Count; i++)
            {
                season = list[i];  //取出线性表中的赛事的信息
                dataGridView_seasons.Rows.Add(season.getId().ToString(), season.getmatchName(), season.getSeasonDescription(), season.getNumOfSeason().ToString() );
            }
        }
Example #2
0
        /****
          *** 新增某一个赛季的信息
         ****/
        public static void addNewSeasonInfo(SeasonOfMatch season)
        {
            DBUtility dbutility = new DBUtility();
            string sql = "insert into gameseason(id,matchname,numofseason,seasondescription,isCurrentSeason,numOfTurn) values('" + season.getId()
              +"','" + season.getmatchName() + "','" + season.getNumOfSeason() + "','" + season.getSeasonDescription() + "',"+1+","+season.getNumOfTurn()+")";

            try
            {
                dbutility.openConnection();
                dbutility.ExecuteUpdate(sql);
            }
            catch (MySqlException ex)
            {
                Console.WriteLine(ex.ToString());
            }
            finally
            {
                dbutility.Close();
            }
        }