Ejemplo n.º 1
0
        private void LblMenu1_Click(object sender, EventArgs e)
        {
            List <Project1.Models.MenuItem> list = new List <Project1.Models.MenuItem>();

            Label label = sender as Label;

            switch (label.Text.ToUpper())
            {
            case "BURGER":
                list = MenuItemRepository.GetAllMenuItem(0);
                break;

            case "MCMORNING":
                list = MenuItemRepository.GetAllMenuItem(1);
                break;

            case "DRINK":
                list = MenuItemRepository.GetAllMenuItem(2);
                break;

            case "SIDE":
                list = MenuItemRepository.GetAllMenuItem(3);
                break;
            }

            if (list.Count > 0)
            {
                flowLayoutPanel1.Controls.Clear();

                AddItems(list);

                scrollOffset = 0;

                flowLayoutPanel1.VerticalScroll.Value = 1;
            }
        }