コード例 #1
0
		public override string GetSql(SqlTable table, ref int offset)
		{
			string name = table.Translate(Column);
			if (name == null || name.Length == 0)
				throw new LightException(string.Format("column {0} not found in table {1}",
				                                       Column, table.Name));
			index = offset;
			IList values = (IList) Value;
			StringBuilder buf = new StringBuilder();
			buf.Append("[").Append(name).Append("] ").Append(Operator).Append(" (");
			if (values.Count > 0)
			{
				offset = offset + values.Count;
				for (int i = index; i < offset; i++)
				{
					if (i > index)
						buf.Append(",");
					string pname = string.Format("@{0}", i);
					buf.Append(pname);
				}
			}
			else
			{
				buf.Append("null");
			}
			buf.Append(")");
			return buf.ToString();
		}
コード例 #2
0
        public override string GetSql(SqlTable table, ref int offset)
        {
            string name = table.Translate(Column);

            if (name == null || name.Length == 0)
            {
                throw new LightException(string.Format("column {0} not found in table {1}",
                                                       Column, table.Name));
            }
            index = offset;
            IList         values = (IList)Value;
            StringBuilder buf    = new StringBuilder();

            buf.Append("[").Append(name).Append("] ").Append(Operator).Append(" (");
            if (values.Count > 0)
            {
                offset = offset + values.Count;
                for (int i = index; i < offset; i++)
                {
                    if (i > index)
                    {
                        buf.Append(",");
                    }
                    string pname = string.Format("@{0}", i);
                    buf.Append(pname);
                }
            }
            else
            {
                buf.Append("null");
            }
            buf.Append(")");
            return(buf.ToString());
        }
コード例 #3
0
		public override string GetSql(SqlTable table, ref int offset)
		{
			string name = table.Translate(this.Column);
			if (name == null || name.Length == 0)
				throw new LightException(string.Format("column {0} not found in table {1}",
				                                       this.Column, table.Name));
			
			return string.Format("[{0}] {1} null", name, this.Operator);
		}
コード例 #4
0
        public override string GetSql(SqlTable table, ref int offset)
        {
            string name = table.Translate(this.Column);

            if (name == null || name.Length == 0)
            {
                throw new LightException(string.Format("column {0} not found in table {1}",
                                                       this.Column, table.Name));
            }

            return(string.Format("[{0}] {1} null", name, this.Operator));
        }
コード例 #5
0
		public virtual string GetSql(SqlTable table, ref int offset)
		{
			if (HasQuery)
			{
				string sql = query.GetSql(table, ref offset);
				return string.Format("({0})", sql);
			}
			else
			{
				index = offset;
				offset = offset + 1;
				string name = table.Translate(column);
				if (name == null || name.Length == 0)
					//name = column;
					throw new LightException(string.Format("column {0} not found in table {1}", column, table.Name));
				return string.Format("[{0}]{1}@{2}", name, oper, index);
			}
		}
コード例 #6
0
 public virtual string GetSql(SqlTable table, ref int offset)
 {
     if (HasQuery)
     {
         string sql = query.GetSql(table, ref offset);
         return(string.Format("({0})", sql));
     }
     else
     {
         index  = offset;
         offset = offset + 1;
         string name = table.Translate(column);
         if (name == null || name.Length == 0)
         {
             //name = column;
             throw new LightException(string.Format("column {0} not found in table {1}", column, table.Name));
         }
         return(string.Format("[{0}]{1}@{2}", name, oper, index));
     }
 }