public ActionResult Enable(int id) { SectionViewModel section = SectionMapper.ToViewModel(sectionSrv.Get(id)); section.IsActive = true; sectionSrv.Edit(SectionMapper.ToEntity(section)); return(RedirectToAction("Disabled")); }
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 })); }
public PartialViewResult TopNavigate() { TopNavigateViewModel model = new TopNavigateViewModel { CurrentUrl = HttpContext.Request.Url.AbsolutePath, Sections = section.Sections .Where(x => x.IsActive) .Select(x => SectionMapper.ToViewModel(x)) }; return(PartialView("_TopNavigate", model)); }
public ViewResult Edit(int id = 0) { SectionViewModel model = new SectionViewModel(); if (id > 0) { model = SectionMapper.ToViewModel(sectionSrv.Get(id)); } model.CurrentRole = UserManager.GetRoles(User.Identity.GetUserId()).FirstOrDefault(); return(View(model)); }