void ObjectsItemEndEdit(IEditableObject sender) { PeriodicFuelContractsViewModel UIObject = sender as PeriodicFuelContractsViewModel; try { if (UIObject.Name != null) { PeriodicFuelContractsDataAccess.UpdatePeriodicFuelContract(UIObject.GetDataObject()); } } catch (Exception ex) { log.Error(ex.StackTrace); } }
void ObjectsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Remove) { try { foreach (object item in e.OldItems) { PeriodicFuelContractsViewModel UIObject = item as PeriodicFuelContractsViewModel; PeriodicFuelContractsDataAccess.DeletePeriodicFuelContract(UIObject.GetDataObject()); } } catch (Exception ex) { log.Error(ex.StackTrace); } } }