// GET: UserController public ActionResult Index() { var ViewItems = new BeSafeWebApp.Models.TreeNode(); ViewItems.children = new List <BeSafeEntities.MasterItemsSet>(); ViewItems.Categories = new List <BeSafeEntities.Category>(); ViewItems.Categories = categoryBusinessLogic.GetAllCategories().Result.Where(c => c.ParentCategoryId == null) .ToList(); return(View(ViewItems)); }
public ActionResult Navigate(int idcategory) { var ViewItems = new BeSafeWebApp.Models.TreeNode(); ViewItems.children = new List <BeSafeEntities.MasterItemsSet>(); ViewItems.Categories = new List <BeSafeEntities.Category>(); ViewItems.Categories = categoryBusinessLogic.GetCategories(idcategory).Result.ToList(); var listitems = masterItemBusinessLogic.GetAllMasterItems().Result.Where(c => c.CategoryId == idcategory) .ToList(); foreach (var masterItemsSet in listitems) { if (masterItemsSet.ItemType.ToLower() != "lien") { masterItemsSet.ItemLink = Path.Combine("\\UploadedMasterItem", masterItemsSet.ItemLink); } } ViewItems.children.AddRange(listitems); return(View("index", ViewItems)); }