Beispiel #1
0
        //Load Participant Entry Form
        public ActionResult Entry()
        {
            var model = new ParticipantEntryVm();

            model.OrganizationList = GetOrganizationList();
            model.CountryList      = GetCountryList();

            return(View(model));
        }
Beispiel #2
0
        public ActionResult Entry(ParticipantEntryVm model)
        {
            if (ModelState.IsValid)
            {
                var participant = Mapper.Map <Participant>(model);

                bool isAdded = _participantManager.Add(participant);
                if (isAdded)
                {
                    return(RedirectToAction("Index"));
                }
            }
            return(RedirectToAction("Entry"));
        }
Beispiel #3
0
        public ActionResult Edit(ParticipantEntryVm model)
        {
            if (ModelState.IsValid)
            {
                var  trainer  = Mapper.Map <Participant>(model);
                bool isUpdate = _participantManager.Update(trainer);

                if (isUpdate)
                {
                    return(RedirectToAction("Index"));
                }
            }

            return(View());
        }