Пример #1
0
        partial void AddManufacturer_Execute()
        {
            if (Manufacturers.SelectedItem != null)
            {
                SupplierManufacture smExist = new SupplierManufacture();
                foreach (SupplierManufacture smSearch in this.SupplierManufactures)
                {
                    if (smSearch.Manufacturer == this.Manufacturers.SelectedItem)
                    {
                        smExist = smSearch;
                        smSearch.Delete();
                        this.DataWorkspace.ProcurementData.Details.DiscardChanges();
                        this.SupplierManufactures.Refresh();
                    }
                }

                if (smExist == null || smExist.Manufacturer == null)
                {
                    smExist.Delete();
                    SupplierManufacture sm = SupplierManufactures.AddNew();
                    sm.Supplier     = this.Suppliers.SelectedItem;
                    sm.Manufacturer = Manufacturers.SelectedItem;
                    this.Save();
                    this.SupplierManufactures.Refresh();
                }
            }
        }
Пример #2
0
 partial void RemoveManufacturer_Execute()
 {
     SupplierManufactures.DeleteSelected();
 }