public ActionResult RecoveryPages(int id) { astwod_Page currentPage = repository.Get(id); currentPage.IsRemove = false; repository.UpdatePage(currentPage.ID, currentPage.LabelForURL, currentPage.LabelForMenu, currentPage.Title, currentPage.MetaDescription, currentPage.MetaKeywords, currentPage.ParentID, currentPage.Content, currentPage.MenuWeight, currentPage.IsMenu, currentPage.IsRemove, currentPage.DateCreation, currentPage.TemplateID); return(RedirectToAction("Basket")); }
/// <summary> /// поиск всех детей, включая вложенные /// </summary> /// <param name="parentPage">родительский узел</param> /// <param name="childs">коллекция всех детей</param> private void GetChilds(astwod_Page parentPage, ref List <astwod_Page> childs) { var pages = repository.GetAll().ToList(); foreach (astwod_Page page in pages) { //поиск по родителю и не удаленным страницам if ((page.ParentID == parentPage.ID) && (!page.IsRemove)) { GetChilds(page, ref childs); childs.Add(page); } } }