/// <summary> /// Load thanh menu ngang /// </summary> private void LoadTopMenu() { List <MenuInfo> MenuPanelList = MenuController.GetInstance().GetMenus(-1, false, true, CurrentUser.ID).OrderByDescending(p => p.Order).ToList(); foreach (MenuInfo item in MenuPanelList) { Ext.Net.Button btn = new Ext.Net.Button(item.MenuName.ToUpper()); btn.ID = "mnu" + item.ID; // btn.IconCls = item.Icon; Toolbar1.Items.Insert(0, btn); LoadSubTopMenu(btn, item); } Ext.Net.ImageButton btnLogo = new Ext.Net.ImageButton(); btnLogo.ImageUrl = "Resource/images/logo.png"; btnLogo.OverImageUrl = "Resource/images/logoHover.png"; Toolbar1.Items.Insert(0, btnLogo); Ext.Net.Label lblApplication = new Ext.Net.Label(); lblApplication.Html = "<b style='color:#15428B !important;font-family:verdana !important;'>" + ltrApplicationName.Text.ToUpper() + "</b>"; Toolbar1.Items.Insert(1, lblApplication); Toolbar1.Items.Insert(1, new ToolbarSpacer() { ID = "tbspacer", Width = 5 }); }
private void LoadLeftMenu(bool isCollapsed) { try { Ext.Net.Panel westPanel = new Ext.Net.Panel(GlobalResourceManager.GetInstance().GetLanguageValue("MenuChucNang"), Icon.Table); westPanel.ID = "WestPanel"; westPanel.Width = 245; westPanel.Layout = "Accordion"; westPanel.LoadMask.ShowMask = true; westPanel.LoadMask.Msg = GlobalResourceManager.GetInstance().GetLanguageValue("LoadingMask"); westPanel.Collapsed = isCollapsed; BorderLayout1.West.Items.Add(westPanel); BorderLayout1.West.MarginsSummary = "5 0 0 5"; BorderLayout1.West.CMarginsSummary = "5 5 0 5"; BorderLayout1.West.MinWidth = 245; BorderLayout1.West.MaxWidth = 400; BorderLayout1.West.Collapsible = true; Ext.Net.ImageButton btnLogo = new Ext.Net.ImageButton(); btnLogo.ImageUrl = "Resource/images/logo.png"; btnLogo.OverImageUrl = "Resource/images/logoHover.png"; Toolbar1.Items.Insert(0, btnLogo); Ext.Net.Label lblApplication = new Ext.Net.Label(); lblApplication.Html = "<b style='color:#15428B !important;font-family:verdana !important;'>" + ltrApplicationName.Text.ToUpper() + "</b>"; Toolbar1.Items.Insert(1, lblApplication); List <MenuInfo> MenuPanelList = null; if (CurrentUser.IsSuperUser == false) { MenuPanelList = MenuController.GetInstance().GetMenus(-1, false, true, CurrentUser.ID); } else { MenuPanelList = MenuController.GetInstance().GetMenus(-1, false, true); } westPanel.Items.Clear(); foreach (MenuInfo panel in MenuPanelList) { Ext.Net.TreePanel tree = new Ext.Net.TreePanel(); westPanel.Items.Add(tree); tree.RootVisible = false; tree.IconCls = panel.Icon; tree.Title = panel.MenuName; tree.AutoScroll = true; tree.Border = false; tree.ContextMenuID = "Menu4"; tree.Animate = true; List <MenuInfo> ChildMenu = new List <MenuInfo>(); if (CurrentUser.IsSuperUser) { ChildMenu = MenuController.GetInstance().GetMenus(panel.ID, false, false); //Lấy các tree nằm trong panel } else { ChildMenu = MenuController.GetInstance().GetMenus(panel.ID, false, false, CurrentUser.ID); } Ext.Net.TreeNode root = new Ext.Net.TreeNode(); tree.Root.Add(root); LoadAllChildMenu(ref root, ChildMenu); } } catch (Exception ex) { Dialog.ShowError(ex.Message); } }
/// <summary> /// /// </summary> public ImageButton.Builder ImageButton(ImageButton component) { return(new ImageButton.Builder(component)); }