Beispiel #1
0
        // GET: PracticeRequirements/Create
        public ActionResult Create(int practiceId)
        {
            PracticeRequirementViewModel practiceRequirementViewModel = new PracticeRequirementViewModel();

            practiceRequirementViewModel.PracticeId = practiceId;

            return(View(practiceRequirementViewModel));
        }
Beispiel #2
0
        public ActionResult Edit(int id, PracticeRequirementViewModel practiceRequirementViewModel)
        {
            if (ModelState.IsValid)
            {
                var practiceRequirementModel = AutoMapper.Mapper.Map <PracticeRequirementViewModel, PracticeRequirement>(practiceRequirementViewModel);

                this.practiceRequirementService.Update(practiceRequirementModel);

                ViewBag.PracticeId = practiceRequirementViewModel.PracticeId;
            }

            return(RedirectToAction("Index", new { practiceId = practiceRequirementViewModel.PracticeId }));
        }
Beispiel #3
0
        public ActionResult Create(PracticeRequirementViewModel practiceRequirementViewModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var practiceRequirementModel = AutoMapper.Mapper.Map <PracticeRequirementViewModel, PracticeRequirement>(practiceRequirementViewModel);

                    this.practiceRequirementService.Add(practiceRequirementModel);
                }
                return(RedirectToAction("Index", new { practiceId = practiceRequirementViewModel.PracticeId }));
            }
            catch
            {
                return(View());
            }
        }