Exemplo n.º 1
0
        private void MenuItemsControl_Load(object sender, EventArgs e)
        {
            menuList = new ChattersLib.ChattersDBLists.MenuList();
            menuList.GetAll();

            menuListFilter = new ChattersLib.ChattersDBLists.MenuList();
            menuListFilter.Insert(0, new ChattersLib.ChattersDBBusiness.Menu() { ID = 0, Title = "All" });

            menuList.ForEach(x =>
            {
                menuListFilter.Add(x);
            });

            menuList.Insert(0, new ChattersLib.ChattersDBBusiness.Menu() { ID = 0, Title = "None" });

            menuListBindingSource.DataSource = menuList;
            menuListBindingSourceFilter.DataSource = menuListFilter;

            menuItemList = new ChattersLib.ChattersDBLists.MenuItemList();
            menuItemList.GetAll();
            ConvertToView();

            menuItemListBindingSource.DataSource = menuItemList;

            refresh();
        }
Exemplo n.º 2
0
        public MenuItemsControl()
        {
            InitializeComponent();

            menuList = new ChattersLib.ChattersDBLists.MenuList();
            menuList.GetAll();

            menuListFilter = new ChattersLib.ChattersDBLists.MenuList();
            menuListFilter.Insert(0, new ChattersLib.ChattersDBBusiness.Menu() { ID = 0, Title = "All" });

            menuList.ForEach(x =>
                {
                    menuListFilter.Add(x);
                });

            menuList.Insert(0, new ChattersLib.ChattersDBBusiness.Menu() { ID = 0, Title = "None" });

            menuListBindingSource.DataSource = menuList;
            menuListBindingSourceFilter.DataSource = menuListFilter;

            menuItemList = new ChattersLib.ChattersDBLists.MenuItemList();
            menuItemList.GetAll();
            ConvertToView();

            menuItemListBindingSource.DataSource = menuItemList;
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ChattersLib.ChattersDBLists.MenuList menuList = new ChattersLib.ChattersDBLists.MenuList();
            menuList.GetAll();

            if (subMenues == null)
                subMenues = new List<subMenuControl>();

            menuList.ForEach(x =>
                {
                    x.GetMenuItems();

                    subMenuControl subMenu = Page.LoadControl("~/Controls/subMenuControl.ascx") as subMenuControl;
                    if (subMenu != null)
                    {
                        subMenu.ID = "subMenu" + x.ID;
                        subMenu.Title = x.Title;
                        subMenu.Description = x.Description;
                        subMenu.MenuItems = x.MenuItems;
                        subMenu.Collapsed = false;

                        subMenues.Add(subMenu);
                        placeHolderSubMenus.Controls.Add(subMenu);
                    }
                });

            if (Request.QueryString["Sub"] != null)
            {
                //int indexOf = placeHolderSubMenus.Controls.IndexOf(subMenues.Find(x => x.ID == "subMenu" + x.ID));
                foreach (subMenuControl subMenu in placeHolderSubMenus.Controls)
                {
                    subMenu.Collapsed = subMenu.ID != "subMenu" + Request.QueryString["Sub"];
                }
            }
        }
Exemplo n.º 4
0
        public MenusControl()
        {
            InitializeComponent();

            menuList = new ChattersLib.ChattersDBLists.MenuList();
            menuList.GetAll();

            menuListBindingSource.DataSource = menuList;
        }
Exemplo n.º 5
0
        internal void ResetMenus()
        {
            menuList = new ChattersLib.ChattersDBLists.MenuList();
            menuList.GetAll();
            menuList.Insert(0, new ChattersLib.ChattersDBBusiness.Menu() { ID = 0, Title = "None" });

            menuListBindingSource.DataSource = menuList;
        }