public ActionResult Create(CompetitionDto competitionDto)
        {
            try
            {
                ViewBag.IsCrying = false;
                MainCompetition = CompetitionService.CreateCompetition(competitionDto.Nom, competitionDto.Price, competitionDto.BetByTeam, competitionDto.PercentPotForMainCompetion / 100.0);

                return RedirectToAction("AddTeamInCompetition", "Team", new { competitionId = MainCompetition.Id });
            }
            catch
            {
                return View();
            }
        }
 public ActionResult Edit(string id, CompetitionDto competitionDto)
 {
     try
     {
         ViewBag.IsCrying = false;
         var competition = CompetitionService.Find(id);
         competition.Name = competitionDto.Nom;
         CompetitionService.Save(competition);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
 //
 // GET: /Competition/Create
 public ActionResult Create()
 {
     var competitionDto = new CompetitionDto();
     return View(competitionDto);
 }
        public ActionResult GetTreePartial(bool isCrying)
        {
            ViewBag.IsCrying = isCrying;
            var competition = GetCurrentCompetition(isCrying);

            var node = _nodeService.GetTree(competition);

            var competitionDto = new CompetitionDto
            {
                Id = competition.Id,
                Nom = competition.Name,
                Node = node,
            };
            return PartialView("PartialNode", competitionDto.Node);
        }
 public ActionResult GetTreeDebug(int nbTeam)
 {
     var competition = CompetitionService.CreateCompetition(nbTeam);
     var node = _nodeService.GetTree(competition);
     var competitionDto = new CompetitionDto
     {
         Id = competition.Id,
         Nom = competition.Name,
         Node = node
     };
     return View("Tree", competitionDto);
 }
        public ActionResult GetTree(bool isCrying)
        {
            ViewBag.IsCrying = isCrying;
            var competition = GetCurrentCompetition(isCrying);
            ViewBag.Page =  Page.TreeConsolante;
            var node = _nodeService.GetTree(competition);

            var competitionDto = new CompetitionDto
                                     {
                                         Id = competition.Id,
                                         Nom = competition.Name,
                                         Node = node,
                                     };
            return View("Tree", competitionDto);
        }