示例#1
0
        //Обновить список комплектов
        private void RefreshKitList()
        {
            if (SelectedConnectionType == null)
            {
                return;
            }
            KitList.Clear();
            string tempKitName = "";

            if (SelectedKit != null)
            {
                tempKitName = SelectedKit.Name;
            }
            switch (ConnectionTypes.IndexOf(SelectedConnectionType))
            {
            case 0:
                KitList.Add(new Kit(gost_base, "2Ш_2Г", true, true, false, 2, true));
                KitList.Add(new Kit(gost_base, "Ш_Гр_Г", true, false, true, 1, true));
                break;

            case 1:
                KitList.Add(new Kit(gost_base, "2Ш_2Г", true, true, false, 2, false));
                KitList.Add(new Kit(gost_base, "Ш_Гр_Г", true, false, true, 1, false));
                break;
            }
            foreach (Kit kit in KitList)
            {
                if (kit.Name == tempKitName)
                {
                    SelectedKit = kit;
                }
            }
        }
 protected void BindKitList()
 {
     List<Product> products = new List<Product>();
     foreach (ProductKitComponent pkc in _KitComponent.ProductKitComponents)
     {
         products.Add(pkc.Product);
     }
     KitList.DataSource = products;
     KitList.DataBind();
 }