Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 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);
         }
     }
 }