Exemplo n.º 1
0
        public static void Write(this DataItemQueryElementTableFilterProperty property, bool isLastProperty, PropertiesStyle style, CSideWriter writer)
        {
            writer.Write("{0}=", property.Name);
            writer.Indent(writer.Column);

            foreach (var line in property.Value)
            {
                var isLastLine = (line == property.Value.Last());
                writer.Write("{0}={1}({2})", line.FieldName, line.Type.AsString(), line.Value);

                switch (isLastLine)
                {
                case true:
                    if (isLastProperty)
                    {
                        writer.Write(" ");
                    }
                    else
                    {
                        writer.WriteLine(";");
                    }

                    break;

                case false:
                    writer.WriteLine(",");
                    break;
                }
            }

            writer.Unindent();
        }
Exemplo n.º 2
0
        internal static void SetDataItemQueryElementTableFilter(this DataItemQueryElementTableFilterProperty property, string propertyValue)
        {
            // DataItemTableFilter=Type=CONST(Sale)

            do
            {
                var fieldName = Parsing.MustMatch(ref propertyValue, @"^([^=]+)=").Groups[1].Value;
                var type      = Parsing.MustMatch(ref propertyValue, @"^(CONST|FILTER)").Groups[1].Value.ToEnum <SimpleTableFilterType>();
                var value     = GetCalcFormulaFilterValue(ref propertyValue);
                property.Value.Add(new TableFilterLine(fieldName, type, value));
            }while (Parsing.TryMatch(ref propertyValue, @"^,\s?"));
        }