Example #1
0
        /// <summary>
        /// 判断两个Sql语句参数是否相同
        /// </summary>
        /// <param name="obj">待比较的Sql语句参数</param>
        /// <returns>两个Sql语句参数是否相同</returns>
        public override Boolean Equals(Object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            DataParameter param = obj as DataParameter;

            if (param == null)
            {
                return(false);
            }

            if (this._isUseParameter != param._isUseParameter)
            {
                return(false);
            }

            if (this.DataType != param.DataType)
            {
                return(false);
            }

            if (!String.Equals(this.ColumnName, param.ColumnName))
            {
                return(false);
            }

            if (!String.Equals(this.ParameterName, param.ParameterName))
            {
                return(false);
            }

            if (!Object.Equals(this.Value, param.Value))
            {
                return(false);
            }

            return(true);
        }
Example #2
0
        /// <summary>
        /// 创建新的Sql语句参数类
        /// </summary>
        /// <param name="database">数据库</param>
        /// <param name="columnName">字段名</param>
        /// <param name="parameterIndex">参数索引</param>
        /// <param name="dataType">字段类型</param>
        /// <param name="value">赋值内容</param>
        /// <returns>Sql语句参数类</returns>
        internal static DataParameter InternalCreate(AbstractDatabase database, String columnName, String parameterIndex, DataType dataType, Object value)
        {
            DataParameter param = new DataParameter(database, columnName, parameterIndex, value);
            param._parameter.DbType = DataParameter.GetDbType(dataType);

            return param;
        }