Esempio n. 1
0
        void ObjectsItemEndEdit(IEditableObject sender)
        {
            RecursoFactibleViewModel UIObject = sender as RecursoFactibleViewModel;

            try
            {
                RecursoFactibleDataAccess.UpdateRecursoFactible(UIObject.GetDataObject());
            }
            catch (Exception ex)
            {
                log.Error(ex.StackTrace);
            }
        }
Esempio n. 2
0
 void ObjectsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Remove)
     {
         try
         {
             foreach (object item in e.OldItems)
             {
                 RecursoFactibleViewModel UIObject = item as RecursoFactibleViewModel;
                 RecursoFactibleDataAccess.DeleteRecursoFactible(UIObject.GetDataObject());
             }
         }
         catch (Exception ex)
         {
             log.Error(ex.StackTrace);
         }
     }
 }
Esempio n. 3
0
        public RecursoFactibleCollectionViewModel GetObjects()
        {
            RecursoFactibleCollectionViewModel UIObjects = new RecursoFactibleCollectionViewModel();

            //   List<RecursoFactible> dataObjects = RecursoFactibleDataAccess.GetRecursoFactible();
            List <RecursoFactible> dataObjects = RecursoFactibleDataAccess.GetRecursoFactible();

            foreach (RecursoFactible dataObject in dataObjects)
            {
                UIObjects.Add(new RecursoFactibleViewModel(dataObject));
            }


            UIObjects.ItemEndEdit       += new ItemEndEditEventHandler(ObjectsItemEndEdit);
            UIObjects.CollectionChanged += new NotifyCollectionChangedEventHandler(ObjectsCollectionChanged);

            return(UIObjects);
        }