Ejemplo n.º 1
0
 public void InsertData(IList <InsertStatement> statements)
 {
     foreach (InsertStatement statement in statements)
     {
         if (!IsSystemTable(statement.TableName))
         {
             List <QueryOperand> operands = statement.Operands.OfType <QueryOperand>().ToList();
             for (int i = 0; i < operands.Count(); i++)
             {
                 FilterProviderBase providerBase =
                     FilterProviderManager.GetFilterProvider(statement.TableName, operands[i].ColumnName, StatementContext.Insert);
                 if (providerBase != null && !FilterIsShared(statements, providerBase))
                 {
                     statement.Parameters[i].Value = GetModifyFilterValue(providerBase);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        public SelectStatement ApplyCondition(SelectStatement statement)
        {
            var extractor = new CriteriaOperatorExtractor();

            extractor.Extract(statement.Condition);

            foreach (FilterProviderBase provider in FilterProviderManager.Providers)
            {
                FilterProviderBase providerBase = FilterProviderManager.GetFilterProvider(statement.TableName, provider.FilterMemberName, StatementContext.Select);
                if (providerBase != null)
                {
                    IEnumerable <BinaryOperator> binaryOperators = GetBinaryOperators(extractor, providerBase);
                    if (!FilterIsShared(statement.TableName, providerBase.Name) && !binaryOperators.Any())
                    {
                        string nodeAlias = GetNodeAlias(statement, providerBase);
                        ApplyCondition(statement, providerBase, nodeAlias);
                    }
                }
            }
            return(statement);
        }