Exemple #1
0
 internal void Construct(ApplicationCompositionDefinition composition, CompositeDataMap dataMap, DetailController detailController)
 {
     _composition       = composition;
     _compositeDataMap  = dataMap;
     _componentDataMaps = dataMap.Components(composition.To());
     _detailController  = detailController;
 }
Exemple #2
0
            public static void OnBeforeSave(CompositeDataMap dataMap)
            {
                ApplicationBehaviorDispatcher
                .OnBeforeSave(dataMap.Composite, dataMap.Application);

                foreach (var component in dataMap.Components())
                {
                    foreach (var componentDataMap in component.DataMaps)
                    {
                        ApplicationBehaviorDispatcher
                        .OnBeforeSave(componentDataMap, component.Application);
                    }
                }
            }
Exemple #3
0
        private static void SaveAsyncImpl(CompositeDataMap dataMap, SQLiteConnection connection)
        {
            connection.Execute("delete from DataMap where LocalId = ?", dataMap.Composite.LocalState.LocalId);
            connection.Insert(new PersistableDataMap(dataMap.Application, dataMap.Composite, true, DateTime.Now));

            foreach (var component in dataMap.Components())
            {
                foreach (var componentDataMap in component.DataMaps)
                {
                    // Links the component to its composite.
                    componentDataMap.LocalState.ParentId = dataMap.Composite.LocalState.LocalId;

                    connection.Execute("delete from DataMap where LocalId = ?", componentDataMap.LocalState.LocalId);
                    connection.Insert(new PersistableDataMap(component.Application, componentDataMap, true, DateTime.Now));
                }
            }
        }