public ActionResult Save(FormCollection form) { string navSortOrderPrefix = "nav-"; foreach (string key in form.Keys) { if (key.StartsWith(navSortOrderPrefix) && !string.IsNullOrEmpty(form[key]) && form[key].All(c => Char.IsNumber(c))) { var nav = navigateService.GetNavigate(Convert.ToInt32(key.TrimStart(navSortOrderPrefix))); nav.SortOrder = Convert.ToInt32(form[key]); navigateService.Update(nav); } } return(RedirectToAction("Index")); }
public ActionResult Edit(string moudleId, string menuId, string btnId, NavigateDto dto) { SetMenuType(ref dto); service.Update(dto); return(RedirectToAction("Index", RouteData.Values)); }