Ejemplo n.º 1
0
        internal static List <TableRelationFilterLine> GetTableRelationConditions(ref string propertyValue)
        {
            // ELSE IF (Type=CONST("Charge (Item)")) "Item Charge";

            var result = new List <TableRelationFilterLine>();

            if (!Parsing.TryMatch(ref propertyValue, @"^IF\s\("))
            {
                return(result);
            }

            do
            {
                var fieldName = Parsing.MustMatch(ref propertyValue, @"^([^=]+)=").Groups[1].Value;
                var type      = Parsing.MustMatch(ref propertyValue, @"(CONST|FILTER)").Groups[1].Value;
                Parsing.MustMatch(ref propertyValue, @"^\(");
                var value = Parsing.MatchUntil(ref propertyValue, ')', '"', '\'');

                result.Add(new TableRelationFilterLine(fieldName, type, value, false, false));
            }while (Parsing.TryMatch(ref propertyValue, @"^,\s?"));

            Parsing.MustMatch(ref propertyValue, @"^\)\s");

            return(result);
        }