if(App.ActiveCellar == null) { MessageBox.Show("Aucune cave ouverte"); return; } App.SetCursor(true); IWineListWindow listWindow = (IWineListWindow)App.GetWindow(WindowType.WineList); if(listWindow != null) { BindingList list = new BindingList(); ObjectCollection oc = App.ActiveCellar.GetCollection((ushort)ObjectType.Wine); for (int i = 0; i < oc.Count; i++) { Wine w = (Wine)oc[i]; if(!w.ManualManagement) { continue; } if((w.ManualManagement) && (w.Bottles <= w.RackItems.Count)) { continue; } for (int j = 0; j < w.Purchases.Count; j++) { PurchaseSales ps = (PurchaseSales)w.Purchases[j]; if((ps.PurchaseBottles > 0) && (ps.Date.Year >= YEAR)) { list.Add(w); break; } } list.Add(w); } listWindow.Wines = list; listWindow.Show(); } App.SetCursor(false);