Ejemplo n.º 1
0
        private void chbListProductTypes_SelectedIndexChanged(object sender, EventArgs e)
        {
            CheckedListBox checkList   = (CheckedListBox)sender;
            string         controlName = checkList.SelectedItem.ToString();

            if (checkList.CheckedItems.Contains(controlName))
            {
                ProductType productType = ProductType.OTHERS;
                if (controlName.ToUpper().Equals("APPAREL"))
                {
                    productType = ProductType.APPAREL;
                }
                else if (controlName.ToUpper().Equals("PRINT"))
                {
                    productType = ProductType.PRINTS;
                }
                var control = new SimpleControl(controlName, productType);
                SimpleControl.SimpleControlsList.Add(control);
                flowLayout.Controls.Add(control);
            }
            else
            {
                var control = SimpleControl.FindControl(controlName);
                flowLayout.Controls.Remove(control);
                SimpleControl.RemoveControl(controlName);
            }
        }