public ActionResult Create(CreateCompetitionViewModel createCompetitionViewModel)
        {
            if (ModelState.IsValid)
            {
                CompetitionRepository competitionRepository = new CompetitionRepository(db);
                Competition           competition           = new Competition();

                competition.Name              = createCompetitionViewModel.Name;
                competition.CompetitionType   = null;
                competition.CompetitionTypeId = createCompetitionViewModel.CompetitionTypeId;
                competition.Date              = createCompetitionViewModel.Date;
                competition.TotalMoney        = 0;
                competition.CreatedAt         = DateTime.Now;
                competition.UpdatedAt         = DateTime.Now;

                competitionRepository.Insert(competition);
                competitionRepository.Commit();
                return(RedirectToAction("Index"));
            }

            CompetitionTypeRepository competitionTypeRepository = new CompetitionTypeRepository(db);

            createCompetitionViewModel.CompetitionTypes = competitionTypeRepository.GetAll().ToList();
            createCompetitionViewModel.PageTitle        = "Create Competition";
            return(View(createCompetitionViewModel));
        }
        // GET: Competitions/Create
        public ActionResult Create()
        {
            CompetitionTypeRepository  competitionTypeRepository  = new CompetitionTypeRepository(db);
            CreateCompetitionViewModel createCompetitionViewModel = new CreateCompetitionViewModel();

            createCompetitionViewModel.CompetitionTypes = competitionTypeRepository.GetAll().ToList();
            createCompetitionViewModel.Date             = DateTime.Now;
            createCompetitionViewModel.PageTitle        = "Create Competition";


            return(View(createCompetitionViewModel));
        }