예제 #1
0
        public ActionResult Enable(int id)
        {
            SectionViewModel section = SectionMapper.ToViewModel(sectionSrv.Get(id));

            section.IsActive = true;

            sectionSrv.Edit(SectionMapper.ToEntity(section));

            return(RedirectToAction("Disabled"));
        }
예제 #2
0
        public ActionResult Edit(SectionViewModel model)
        {
            if (ModelState.IsValid)
            {
                var section = sectionSrv.Edit(SectionMapper.ToEntity(model));
                model = SectionMapper.ToViewModel(section);
            }

            return(RedirectToAction("Edit", new { id = model.Id }));
        }