Esempio n. 1
0
 public string FormatValue(QItem Value, IDbCommand command = null)
 {
     if (Value == null)
     {
         return(string.Empty);
     }
     if (Value is QQuery && ((QQuery)Value).Table != null)
     {
         QQuery squery = (QQuery)Value;
         if (squery.Columns.Count == 0)
         {
             squery.Columns.Add(new QColumn(squery.Table.PrimaryKey));
         }
         return("(" + squery.Format(command) + ")");
     }
     else if (Value is QExpression)
     {
         return("(" + Value.Format(command) + ")");
     }
     else
     {
         return(Value.Format(command));
     }
 }
Esempio n. 2
0
        public override string Format(IDbCommand command = null)
        {
            string f1 = value1?.Format(command) ?? string.Empty;
            string f2 = value2?.Format(command) ?? string.Empty;

            if (f1.Length == 0 || f2.Length == 0)
            {
                return(string.Empty);
            }

            if (Query?.Table?.Schema?.System == DBSystem.MSSql ||
                Query?.Table?.Schema?.System == DBSystem.Postgres ||
                Query?.Table?.Schema?.System == DBSystem.SQLite)
            {
                return(f1 + " and " + f2);
            }
            else
            {
                return(string.Format("({0}, {1})", f1, f2));
            }
        }