Ejemplo n.º 1
0
        /// <summary>
        /// 插入指定参数并返回当前语句
        /// </summary>
        /// <param name="columnName">字段名</param>
        /// <param name="function">函数</param>
        /// <exception cref="ArgumentNullException">函数不能为空</exception>
        /// <returns>当前语句</returns>
        public InsertCommand Add(String columnName, ISqlFunction function)
        {
            if (function == null)
            {
                throw new ArgumentNullException("function");
            }

            this._parameters.Add(SqlParameter.CreateCustomAction(columnName, function.ToString(this.DatabaseType)));

            if (function.HasParameters)
            {
                this._parameters.AddRange(function.GetAllParameters());
            }

            return(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 插入指定参数并返回当前语句
        /// </summary>
        /// <param name="columnName">字段名</param>
        /// <param name="command">选择语句</param>
        /// <exception cref="ArgumentNullException">选择语句不能为空</exception>
        /// <returns>当前语句</returns>
        public InsertCommand Add(String columnName, SelectCommand command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            this._parameters.Add(SqlParameter.CreateCustomAction(columnName, command.ToString()));

            List <SqlParameter> parameters = command.GetAllParameters();

            if (parameters != null)
            {
                this._parameters.AddRange(command.GetAllParameters());
            }

            return(this);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 创建判断是否结尾不包含的Sql条件语句
 /// </summary>
 /// <param name="columnName">字段名</param>
 /// <param name="tableNameTwo">数据表名二</param>
 /// <param name="columnNameTwo">字段名二</param>
 /// <returns>Sql条件语句</returns>
 public static SqlBasicParameterCondition NotLikeColumn(String columnName, String tableNameTwo, String columnNameTwo)
 {
     return(SqlCondition.NotLike(SqlParameter.CreateCustomAction(columnName, GetFieldName(tableNameTwo, columnNameTwo))));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 创建判断是否小于等于的Sql条件语句
 /// </summary>
 /// <param name="columnName">字段名</param>
 /// <param name="tableNameTwo">数据表名二</param>
 /// <param name="columnNameTwo">字段名二</param>
 /// <returns>Sql条件语句</returns>
 public static SqlBasicParameterCondition LessThanOrEqualColumn(String columnName, String tableNameTwo, String columnNameTwo)
 {
     return(SqlCondition.LessThanOrEqual(SqlParameter.CreateCustomAction(columnName, GetFieldName(tableNameTwo, columnNameTwo))));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 指定字段名自减并返回当前语句
 /// </summary>
 /// <param name="columnName">字段名</param>
 /// <returns>当前语句</returns>
 public UpdateCommand Decrease(String columnName)
 {
     this._parameters.Add(SqlParameter.CreateCustomAction(columnName, columnName + "-1"));
     return(this);
 }