public ActionResult New(int parentId) { BLM blm = BLM.Load(); Group parent = (Group)blm.GetItemByID(parentId); Group newGroup = new Group() { Parent = parent }; return(View(newGroup)); }
public ActionResult Edit(int id, bool?dummy) { BLM blm = BLM.Load(); Group group = (Group)blm.GetItemByID(id); if (!TryUpdateModel(group)) { return(View(group)); } blm.Save(); return(RedirectToAction("Index", new { id = group.Parent.ID })); }
public ActionResult New(int parentId, Group group) { BLM blm = BLM.Load(); if (!ModelState.IsValid) { Group parent = (Group)blm.GetItemByID(parentId); group.Parent = parent; return(View(group)); } blm.AddGroup(parentId, group); return(RedirectToAction("Index", new { id = parentId })); }