protected void BindNarrowByManufacturerPanel() { Trace.Write(this.GetType().ToString(), "Begin BindNarrowByManufacturerPanel"); if (!ExpandManufacturerLink.Visible) { NarrowByManufacturerPanel.Visible = true; if (_manufacturers.Count > _MaximumManufacturers) { if (ShowAllManufacturers.Visible) { int count = _manufacturers.Count - _MaximumManufacturers; for (int i = 0; i < count; i++) { if (_manufacturers.Count > _MaximumManufacturers) { _manufacturers.RemoveAt(_MaximumManufacturers); } } } } else { ShowAllManufacturers.Visible = false; } ManufacturerList.DataSource = _manufacturers; ManufacturerList.DataBind(); NarrowByManufacturerPanel.Visible = (ManufacturerList.Items.Count > 0); } else { NarrowByManufacturerPanel.Visible = false; } Trace.Write(this.GetType().ToString(), "End BindNarrowByManufacturerPanel"); }
private void BindManufacturers() { IList <Manufacturer> manufacturers = ManufacturerDataSource.LoadAll("Name"); int index = manufacturers.IndexOf(_ManufacturerId); if (index > -1) { manufacturers.RemoveAt(index); } ManufacturerList.DataSource = manufacturers; ManufacturerList.DataBind(); }
protected void NewManufacturerLink_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(NewManufacturerName.Value)) { Manufacturer manufacturer = ManufacturerDataSource.LoadForName(NewManufacturerName.Value, true); ManufacturerList.DataBind(); ListItem selectedItem = ManufacturerList.Items.FindByValue(manufacturer.Id.ToString()); if (selectedItem != null) { ManufacturerList.SelectedIndex = ManufacturerList.Items.IndexOf(selectedItem); } } }
static void Main(string[] args) { Console.WriteLine("Hello World!"); String[] _mns = { "Bic", "Promex", "TPromo", "Azure", "Xerox" }; String[] _dates = { "7/11/1878", "10/01/1912", "1/5/2001", "8/16/1954", "4/30/1989" }; //List<Manufacturer> manList = new List<Manufacturer>(); List <Manufacturer> manList = ManufacturerList.GenerateDefault(); List <Shipment> shipList = ShipmentList.GenerateDefault(); foreach (var shipTransaction in shipList) { shipTransaction._display(1); } // 1 окно - Все производители foreach (Manufacturer manufacturer in manList) { manufacturer._display(); } Console.Write("\n\n"); // 2 окно - Все производители, рейтинг которых ОТ foreach (Manufacturer manufacturer in manList) { if (manufacturer.TrustRating > 3) { manufacturer._display(); } } Console.Write("\n\n"); // 3 окно - Все НЕПУСТЫЕ производители foreach (Manufacturer manufacturer in manList) { if (!manufacturer.IsEmpty()) { manufacturer._display(); } } }
private void LoadSearchFilter() { ProductFilter criteria = Session["ProductSearchFilter"] as ProductFilter; if (criteria != null) { Name.Text = criteria.Name; SearchDescriptions.Checked = criteria.SearchDescriptions; Sku.Text = criteria.Sku; ListItem selectedItem = null; if (!_DisplayCategorySearch) { CategoriesList.DataBind(); selectedItem = CategoriesList.Items.FindByValue(criteria.CategoryId.ToString()); if (selectedItem != null) { CategoriesList.SelectedIndex = CategoriesList.Items.IndexOf(selectedItem); } } else { Category selectedCategory = CategoryDataSource.Load(criteria.CategoryId); if (selectedCategory != null) { CategoryAutoComplete.Text = selectedCategory.Name; } HiddenSelectedCategoryId.Value = criteria.CategoryId.ToString(); } ManufacturerList.DataBind(); selectedItem = ManufacturerList.Items.FindByValue(criteria.ManufacturerId.ToString()); if (selectedItem != null) { ManufacturerList.SelectedIndex = ManufacturerList.Items.IndexOf(selectedItem); } VendorList.DataBind(); selectedItem = VendorList.Items.FindByValue(criteria.VendorId.ToString()); if (selectedItem != null) { VendorList.SelectedIndex = VendorList.Items.IndexOf(selectedItem); } ProductGroups.DataBind(); selectedItem = ProductGroups.Items.FindByValue(criteria.GroupId.ToString()); if (selectedItem != null) { ProductGroups.SelectedIndex = ProductGroups.Items.IndexOf(selectedItem); } OnlyFeatured.Checked = criteria.Featured == BitFieldState.True; FromPrice.Text = criteria.FromPrice.ToString(); ToPrice.Text = criteria.ToPrice.ToString(); OnlyDigitalGoods.Checked = criteria.DigitalGoodsOnly; OnlyGiftCertificates.Checked = criteria.GiftCertificatesOnly; OnlyKits.Checked = criteria.KitsOnly; OnlySubscriptions.Checked = criteria.SubscriptionsOnly; ShowProductThumbnails.Checked = criteria.IncludeThumbnails; } }