Esempio n. 1
0
 protected void OnDataStoreModifyData(DataStoreModifyDataEventArgs args)
 {
     if (DataStoreModifyData != null)
     {
         DataStoreModifyData(this, args);
     }
 }
Esempio n. 2
0
        public virtual ModificationResult ModifyData(params ModificationStatement[] dmlStatements)
        {
            var args = new DataStoreModifyDataEventArgs(dmlStatements);

            OnDataStoreModifyData(args);
            return(args.ModificationResult ?? _dataStoreCore.ModifyData(args.ModificationStatements));
        }
Esempio n. 3
0
        public void ModifyData(DataStoreModifyDataEventArgs args)
        {
            var modificationResultIdentities = new List <ParameterValue>();

            foreach (ModificationStatement stm in args.ModificationStatements)
            {
                if (stm.TableName == "XPObjectType")
                {
                    foreach (var dataLayer in _dataStoreManager.SimpleDataLayers.Select(pair => pair.Value))
                    {
                        modificationResultIdentities.AddRange(dataLayer.ModifyData(stm).Identities);
                    }
                }
                else
                {
                    string             key = _dataStoreManager.GetKeyInfo(stm.TableName);
                    ModificationResult modificationResult = _dataStoreManager.SimpleDataLayers[key].ModifyData(stm);
                    if (modificationResult != null)
                    {
                        modificationResultIdentities.AddRange(modificationResult.Identities);
                    }
                }
            }
            args.ModificationResult = new ModificationResult(modificationResultIdentities);
        }
Esempio n. 4
0
 public override ModificationResult ModifyData(params ModificationStatement[] dmlStatements) {
     var modificationResultIdentities = new List<ParameterValue>();
     var dataStoreModifyDataEventArgs = new DataStoreModifyDataEventArgs(dmlStatements);
     OnDataStoreModifyData(dataStoreModifyDataEventArgs);
     foreach (ModificationStatement stm in dataStoreModifyDataEventArgs.ModificationStatements) {
         if (stm.TableName == typeof(XPObjectType).Name) {
             ModifyXPObjectTypeData(stm, modificationResultIdentities);
         } else {
             ModifyData(stm, modificationResultIdentities);
         }
     }
     return new ModificationResult(modificationResultIdentities);
 }
Esempio n. 5
0
 public override ModificationResult ModifyData(params ModificationStatement[] dmlStatements) {
     var dataStoreModifyDataEventArgs = new DataStoreModifyDataEventArgs(dmlStatements);
     OnDataStoreModifyData(dataStoreModifyDataEventArgs);
     var name = typeof(XPObjectType).Name;
     var insertStatement = dataStoreModifyDataEventArgs.ModificationStatements.OfType<InsertStatement>().FirstOrDefault(statement => statement.TableName == name);
     var modificationResult = new ModificationResult();
     if (insertStatement != null) {
         modificationResult = ModifyXPObjectTable(dmlStatements, insertStatement, modificationResult);
     } else {
         var key = _dataStoreManager.GetKeyInfo(dmlStatements[0].TableName);
         modificationResult = _dataStoreManager.SimpleDataLayers[key].ModifyData(dmlStatements);
     }
     if (modificationResult != null) return modificationResult;
     throw new NotImplementedException();
 }
Esempio n. 6
0
 public void ModifyData(DataStoreModifyDataEventArgs args) {
     var modificationResultIdentities = new List<ParameterValue>();
     foreach (ModificationStatement stm in args.ModificationStatements) {
         if (stm.TableName == "XPObjectType") {
             foreach (var dataLayer in _dataStoreManager.SimpleDataLayers.Select(pair => pair.Value)){
                 modificationResultIdentities.AddRange(dataLayer.ModifyData(stm).Identities);    
             }
         }
         else {
             string key = _dataStoreManager.GetKey(stm.TableName);
             ModificationResult modificationResult = _dataStoreManager.SimpleDataLayers[key].ModifyData(stm);
             if (modificationResult != null){
                 modificationResultIdentities.AddRange(modificationResult.Identities);
             }   
         }
     }
     args.ModificationResult = new ModificationResult(modificationResultIdentities);
 }
Esempio n. 7
0
 protected void OnDataStoreModifyData(DataStoreModifyDataEventArgs args) {
     if (DataStoreModifyData != null) {
         DataStoreModifyData(this, args);
     }
 }
Esempio n. 8
0
 public virtual ModificationResult ModifyData(params ModificationStatement[] dmlStatements) {
     var args = new DataStoreModifyDataEventArgs(dmlStatements);
     OnDataStoreModifyData(args);
     return args.ModificationResult ?? dataLayerCore.ModifyData(args.ModificationStatements);
 }
Esempio n. 9
0
 protected void OnDataStoreModifyData(DataStoreModifyDataEventArgs args)
 {
     DataStoreModifyData?.Invoke(this, args);
 }