/// <summary>
        /// Adapte un Tournoi Model en Tournoi Contract.
        /// </summary>
        /// <param name="tournoi">Tournoi à adapter.</param>
        /// <returns>Tournoi contract.</returns>
        public static TournoiContract fromTournoiModel(TournoiModel tournoi)
        {
            if (tournoi == null)
                return null;

            TournoiContract tc = new TournoiContract();
            tc.ID = tournoi.ID;
            tc.Nom = tournoi.Nom;
            tc.Matchs = MatchAdapter.fromMatchModelList(tournoi.Matchs).ToArray();

            return tc;
        }
        /// <summary>
        /// Adapte un Tournoi Contract en Tournoi Model.
        /// </summary>
        /// <param name="tournoiC">Tournoi à adapter.</param>
        /// <returns>Tournoi Model.</returns>
        public static TournoiModel fromTournoiContract(TournoiContract tournoiC)
        {
            if (tournoiC == null)
                return null;

            TournoiModel t = new TournoiModel();
            t.ID = tournoiC.ID;
            t.Nom = tournoiC.Nom;
            t.Matchs = MatchAdapter.fromMatchContractList(tournoiC.Matchs.ToList());

            return t;
        }
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // Récupère les valeurs du formulaire soumis
                List<MatchModel> matchs = new List<MatchModel>();
                for (int i = 1; i <= 4; i++)
                {
                    int tmp;
                    int.TryParse(collection["SelectedMatch" + i], out tmp);

                    // Saisie invalide
                    if (tmp == -1)
                        return View();

                    // Récupères les objets nécessaires via la web service
                    matchs.Add(MatchAdapter.fromMatchContract(m_webService.GetMatchById(tmp)));
                }

                string name = collection["Nom"];

                // Nouveau Tournoi
                TournoiModel newTournoi = new TournoiModel();
                newTournoi.ID = -1; // En cours de création
                newTournoi.Nom = name;
                newTournoi.Matchs = matchs;

                // Crée le tournoi
                m_webService.CreateTournoi(TournoiAdapter.fromTournoiModel(newTournoi));

                return new RedirectResult(Url.Action("Index") + "#content");
            }
            catch
            {
                return View();
            }
        }