private static CreateCompetitionInfo CreateCompetitionInfo(CreateCompetitionParameters parameters)
        {
            var createCompetitionInfo = new CreateCompetitionInfo();

            createCompetitionInfo.Name             = parameters.Name;
            createCompetitionInfo.StartTime        = parameters.StartTime;
            createCompetitionInfo.EndTime          = parameters.EndTime;
            createCompetitionInfo.TypeId           = parameters.Type;
            createCompetitionInfo.MainReferee      = parameters.MainReferee;
            createCompetitionInfo.MainRefereePhone = parameters.MainRefereePhone;
            createCompetitionInfo.Site             = parameters.Site;
            createCompetitionInfo.SitePhone        = parameters.SitePhone;
            return(createCompetitionInfo);
        }
        public ActionResult Create(CreateCompetitionParameters parameters, HttpPostedFileBase playersFile, HttpPostedFileBase qualifyingPlayersFile)
        {
            var manager = ServiceProvider.Get <ICompetitionsManager>();
            var createCompetitionInfo = CreateCompetitionInfo(parameters);

            if (playersFile.IsNotNull())
            {
                createCompetitionInfo.PlayersFileUrl = AcceptCsvFile(playersFile, "CompetitionPlayers").ToString();
            }

            manager.Create(createCompetitionInfo);

            return(RedirectToAction("Index"));
        }
 private static CreateCompetitionInfo CreateCompetitionInfo(CreateCompetitionParameters parameters)
 {
     var createCompetitionInfo = new CreateCompetitionInfo();
     createCompetitionInfo.Name = parameters.Name;
     createCompetitionInfo.StartTime = parameters.StartTime;
     createCompetitionInfo.EndTime = parameters.EndTime;
     createCompetitionInfo.TypeId = parameters.Type;
     createCompetitionInfo.MainReferee = parameters.MainReferee;
     createCompetitionInfo.MainRefereePhone = parameters.MainRefereePhone;
     createCompetitionInfo.Site = parameters.Site;
     createCompetitionInfo.SitePhone = parameters.SitePhone;
     return createCompetitionInfo;
 }
        public ActionResult Create(CreateCompetitionParameters parameters, HttpPostedFileBase playersFile, HttpPostedFileBase qualifyingPlayersFile)
        {
            var manager = ServiceProvider.Get<ICompetitionsManager>();
            var createCompetitionInfo = CreateCompetitionInfo(parameters);
            if (playersFile.IsNotNull())
            {
                createCompetitionInfo.PlayersFileUrl = AcceptCsvFile(playersFile, "CompetitionPlayers").ToString();
            }

            manager.Create(createCompetitionInfo);

            return RedirectToAction("Index");
        }