private async void LoadSuppliers() { SupplierCollection.Clear(); var collection = await DbHandler.Instance.GetSupplierCollection(); SupplierCollection.AddRange(collection); }
/// <summary> /// Конструктор создает объект с привязкой родительского объекта /// </summary> public Product(Product toCopy) : this() { if (toCopy == null) return; _batchNumber = toCopy.BatchNumber; _costNew = toCopy.CostNew; _costOvehaul = toCopy.CostOverhaul; _costServiceable = toCopy.CostServiceable; _description = toCopy.Description; _manufacturer = toCopy.Manufacturer; _measure = toCopy.Measure; _partNumber = toCopy.PartNumber; _remarks = toCopy.Remarks; _serialNumber = toCopy.SerialNumber; _standart = toCopy.Standart; if (_suppliers == null) _suppliers = new SupplierCollection(); _suppliers.Clear(); foreach (Supplier supplier in toCopy.Suppliers) { _suppliers.Add(supplier); } if (_supplierRelations == null) _supplierRelations = new CommonCollection<KitSuppliersRelation>(); _supplierRelations.Clear(); foreach (KitSuppliersRelation ksr in toCopy.SupplierRelations) { _supplierRelations.Add(new KitSuppliersRelation(ksr) {KitId = ItemId}); } }