Exemplo n.º 1
0
        protected virtual SoqlQueryExpression BuildDataQuery(ListInfo li, SoqlBooleanExpression whereClause, IList<string> theQueryParameters, int startIndex, int topCount, string orderBy, IList<string> selectAliases)
        {
            SoqlQueryExpression theQuery;

            theQuery = new SoqlQueryExpression();
            theQuery.SelectExpressions = new SoqlExpressionCollection();
            theQuery.SelectAliases = new StringCollection();
            theQuery.TopCount = topCount;

            theQuery.From.Add(li.RecordClass);
            theQuery.FromAliases.Add(String.Empty);

            if (orderBy != null)
            {
                //ParseOrderBy(theQuery, orderBy, columns, theQueryParameters);
            }

            // special columns - class Name and key and label

            theQuery.SelectExpressions.Add(new SoqlSoodaClassExpression());
            theQuery.SelectAliases.Add(String.Empty);

            ClassInfo ci = DatabaseSchema.FindClassByName(li.RecordClass);
            Sooda.Schema.FieldInfo key_fi = ci.GetPrimaryKeyFields()[0]; // ci.GetPrimaryKeyField();

            //theQuery.SelectExpressions.Add(new SoqlPathExpression(key_fi.Name));
            //theQuery.SelectAliases.Add(String.Empty);

            foreach (ListColumnInfo lci in li.Columns)
            {
                string alias = lci.DataField;
                alias = alias.Replace('.', '_');
                if (lci.DataExpression != null)
                {
                    theQuery.SelectExpressions.Add(SoqlParser.ParseExpression(lci.DataExpression));
                }
                else
                {
                    theQuery.SelectExpressions.Add(SoqlParser.ParseExpression(lci.DataField));
                }
                theQuery.SelectAliases.Add(alias);
                //selectAliases.Add(alias);
            }

            theQuery.WhereClause = whereClause;

            return theQuery;
        }
Exemplo n.º 2
0
 public SoodaWhereClause(SoqlBooleanExpression whereExpression, params object[] par)
 {
     this.Parameters = par;
     this.WhereExpression = whereExpression;
 }
Exemplo n.º 3
0
 public SoodaWhereClause(SoqlBooleanExpression whereExpression)
 {
     this.WhereExpression = whereExpression;
 }
 public SoodaObjectListSnapshot(IList list, SoqlBooleanExpression filterExpression) : this(list, new SoodaWhereClause(filterExpression))
 {
 }
 public ISoodaObjectList Filter(SoqlBooleanExpression filterExpression)
 {
     return new SoodaObjectListSnapshot(this, filterExpression);
 }