Beispiel #1
0
 private void Execute()
 {
     if (!executed)
     {
         executed = true;
         int pageSize = selection.Paging ? selection.PageSize : 0;
         int offset   = selection.Offset;
         data.AddRange(reader.Read(connection.ExecuteQuery(selection.ToString(), ActionId, selection.FieldList.ToString(), WithMetaData, pageSize, offset, LanguageHelper.ToString(VariableLanguage))));
     }
     else
     {
         if (!reader.EndOfData)
         {
             data.AddRange(reader.Read(connection.GetNextRecord(ActionId)));
         }
     }
 }
Beispiel #2
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            if (Groups != null && Groups.Length > 0)
            {
                sb.Append(Database);
                sb.Append(":");
                bool first = true;

                foreach (int group in Groups)
                {
                    if (!first)
                    {
                        sb.Append(".");
                    }

                    sb.Append(group);
                    first = false;
                }
            }

            sb.Append(",");

            // ohne Gruppenangabe die Datenbank mithilfe der Option @database
            // angeben, da die Angabe <DBNr>:, ohne Gruppe nicht angenommen wird
            if (Groups == null || Groups.Length == 0)
            {
                sb.Append(String.Format("@database={0};", Database));
            }

            foreach (Condition c in conditions)
            {
                sb.Append(c).Append(";");
            }

            sb.AppendFormat("@link={0};", ConditionLinkModeHelper.ToString(LinkMode));

            if (!String.IsNullOrEmpty(Key))
            {
                sb.AppendFormat("@sort={0};", Key);
            }

            if (!String.IsNullOrEmpty(OrderField))
            {
                sb.AppendFormat("@order={0}", OrderField);

                if (Direction != OrderDirection.Undefined)
                {
                    sb.Append(".").Append(OrderDirectionHelper.ToString(Direction, true));
                }

                sb.Append(";");
            }

            if (Direction != OrderDirection.Undefined && String.IsNullOrEmpty(OrderField))
            {
                sb.AppendFormat("@direction={0};", OrderDirectionHelper.ToString(Direction, false));
            }

            sb.AppendFormat("@rows={0};", IncludeRows ? "(Yes)" : "(No)");
            sb.AppendFormat("@filingmode={0};", FilingModeHelper.ToString(FilingMode));

            if (Limit > 0)
            {
                sb.AppendFormat("@maxhit={0};", Limit);
            }

            sb.AppendFormat("@lang={0}", LanguageHelper.ToString(VariableLanguage));

            return(sb.ToString());
        }