예제 #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());
        }
예제 #2
0
        public Athlete Add(Athlete entity)
        {
            var obj = _athleteRepository.Add(entity);

            return(obj);
        }