Example #1
0
        //显示赛事的基本信息
        public void showTeamData()
        {
            //先清除DataGridView中的数据
            if (dataGridView_teamManage.Rows.Count > 0)
            {
                dataGridView_teamManage.Rows.Clear();
            }
            //取出数据
            List<Team> list =TeamInfoDAO.getTeamInfoOfCertainMatch(SystemParam.getMatch());
            //往dataGridView中添加数据
            for (int i = 0; i < list.Count; i++)
            {
                team = list[i];  //取出线性表中的赛事的信息
                dataGridView_teamManage.Rows.Add(team.getID().ToString(), team.getName(),team.getTeamFullName(),team.getMatchName(), team.getLocation(),team.getBirthDate().ToString(),team.getIntroduction(),team.getLeader(),team.getManager(),team.getCoach());

            }
        }
Example #2
0
 //往数据库中添加球队,返回是否添加成功的信息
 public static bool addNewTeam(Team team)
 {
     DBUtility dbutility = new DBUtility();
     string SQL = "insert into team(teamName,teamLeader,teamManager,teamCoach,teamFullName,birthDate,matchName,location,introduction) values('";
     SQL = SQL + team.getName() + "','" + team.getLeader() + "','" + team.getManager() + "','" + team.getCoach() + "','" + team.getTeamFullName() +
               "','" + team.getBirthDate() + "','" + team.getMatchName() + "','" + team.getLocation()+ "','" + team.getIntroduction() + "')";
     try
     {
         dbutility.openConnection();
         dbutility.ExecuteUpdate(SQL);
         return true;
     }
     catch (MySqlException ex)
     {
         Console.WriteLine(ex.ToString());
         return false;
     }
     finally
     {
         dbutility.Close();
     }
 }