예제 #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();
        }
예제 #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;
        }