public HomeController(AuctionDbContext _db) { db = _db; layoutVM = new LayoutViewModel() { CategoriesVM = RecursiveMenu.GetRecursiveMenu(db) }; }
public ItemController(AuctionDbContext _db, IWebHostEnvironment hostEnvironment) { db = _db; webHostEnvironment = hostEnvironment; layoutVM = new LayoutViewModel() { CategoriesVM = RecursiveMenu.GetRecursiveMenu(db) }; }
public AccountController(IConfiguration _configuration, AuctionDbContext _db, ILogger <AccountController> logger, IHttpContextAccessor httpContextAccessor, IWebHostEnvironment hostEnvironment) { _logger = logger; webHostEnvironment = hostEnvironment; _httpContextAccessor = httpContextAccessor; db = _db; configuration = _configuration; layoutVM = new LayoutViewModel() { CategoriesVM = RecursiveMenu.GetRecursiveMenu(db) }; }
public List <MenuFunctionModels> RecursiveMenuFunction(RecursiveMenu model) { List <MenuFunctionModels> menuFunctions = new List <MenuFunctionModels>(); foreach (var item in dbContext.v_jusoft_SysMenu_Command.Where(k => k.IdSysMenu == model.Id).ToList()) { menuFunctions.Add(new MenuFunctionModels { Code = item.Code, Name = item.Name, FunctionState = item.FunctionState, children = RecursiveMenuFunction(new RecursiveMenu { Id = item.Id }), }); } return(menuFunctions); }
public BaseFunctionality() { Menu = new RecursiveMenu(); BreadCrumb = new BreadCrumb(); MainMenu = new MainMenu(); SecondaryMenu = new SecondaryMenu(); ViewMode = new ViewMode(); Theme = new Theme(); PageEvents = new PageEvents(); Blocks = new Blocks(); ContentLists = new Dictionary <string, Type> { { Strings.ListContentTree, typeof(ListContentTree) }, { Strings.LinkList, typeof(LinkList) }, { Strings.ExternalList, typeof(ExternalList) }, }; }