示例#1
0
        public ActionResult Index(NewParticipantsModel model)
        {
            if (ModelState.IsValid)
            {
                AgeGroupManager ageGroupManager = new AgeGroupManager();
                int             parBirthYear    = model.parBirthDate.Year;
                string          parAgeGroup     = ageGroupManager.GetParAgeGroup(parBirthYear, model.parGender);

                manager.CreateNewParticipant(
                    model.parName,
                    model.parSurname,
                    model.parNumber,
                    parAgeGroup,
                    model.parRaceTime1,
                    model.parRaceTime2,
                    model.parRaceTime3,
                    model.parRaceTime4,
                    model.parRaceTime5,
                    model.parRaceTime6,
                    model.parRaceTime7,
                    model.parRaceTime8);

                TempData["Success"] = "Dalībnieks un rezultāts ir reģistrēti!";
                return(RedirectToAction("Index"));
            }
            return(View(model));
        }