void DataStoreProxyOnDataStoreModifyData(object sender, DataStoreModifyDataEventArgs dataStoreModifyDataEventArgs) { var modificationStatement = dataStoreModifyDataEventArgs.ModificationStatements[0]; List <QueryOperand> queryOperands = modificationStatement.Operands.OfType <QueryOperand>().Where(value => value.ColumnName != GCRecordField.StaticName && value.ColumnName != OptimisticLockingAttribute.DefaultFieldName).ToList(); ((ISupportModificationStatements)View.CurrentObject).ModificationStatements = "THIS IS COMES FROM THE DATALAYER :---->" + (modificationStatement is UpdateStatement ? GetUpdateMessage((UpdateStatement)modificationStatement, queryOperands) : GetInsertMessage((InsertStatement)modificationStatement, queryOperands)); }
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(); }