Example #1
0
        public ActionResult Add(Athlete athlete)
        {
            ViewBag.teamsList  = ItemListCreator.Teams(_teamRepo);
            ViewBag.sportsList = ItemListCreator.Sports();

            if (ModelState.IsValid)
            {
                if (_athRepo.Add(athlete))
                {
                    ViewBag.Success = "Added succesfully";
                    return(View());
                }
            }

            ViewBag.Error = "Error adding an athlete!";
            return(View());
        }
Example #2
0
        public Athlete Add(Athlete entity)
        {
            var obj = _athleteRepository.Add(entity);

            return(obj);
        }