コード例 #1
0
        public ActionResult Create(ProcessPerspectiveViewModel processPerspective)
        {
            if (ModelState.IsValid)
            {

                var procModel = AutoMapper.Mapper.Map<ProcessPerspectiveViewModel, ProcessPerspective>(processPerspective);

                this.processPerspectiveService.Add(procModel);

            }
            return RedirectToAction("Index");
        }
コード例 #2
0
        public ActionResult Edit(int id, ProcessPerspectiveViewModel processPerspective)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var procModel = AutoMapper.Mapper.Map<ProcessPerspectiveViewModel, ProcessPerspective>(processPerspective);

                    this.processPerspectiveService.Update(procModel);

                }
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }