示例#1
0
        public void AddInObject(NpgsqlCommand command, Sql.SchemaParameter parameter, object value)
        {
            var schemaParameter = (SchemaParameter)parameter;

            var sqlParameter = command.CreateParameter();

            sqlParameter.NpgsqlDbType  = schemaParameter.NpgsqlDbType;
            sqlParameter.ParameterName = parameter.Name;
            sqlParameter.Value         = Normalize(value);

            command.Parameters.Add(sqlParameter);
        }
示例#2
0
文件: Command.cs 项目: lulzzz/allors2
        public override void AddInParameter(Sql.SchemaParameter parameter, object value)
        {
            var sqlParameter = this.command.Parameters.Contains(parameter.Name) ? this.command.Parameters[parameter.Name] : null;

            if (sqlParameter == null)
            {
                sqlParameter               = this.command.CreateParameter();
                sqlParameter.DbType        = parameter.DbType;
                sqlParameter.ParameterName = parameter.Name;
                this.command.Parameters.Add(sqlParameter);
            }

            this.SetParameterValue(parameter.Name, value);
        }
示例#3
0
文件: Command.cs 项目: lulzzz/allors2
        public override void AddOutParameter(Sql.SchemaParameter parameter)
        {
            var sqlParameter = this.command.Parameters.Contains(parameter.Name) ? this.command.Parameters[parameter.Name] : null;

            if (sqlParameter == null)
            {
                sqlParameter = this.command.CreateParameter();
                sqlParameter.ParameterName = parameter.Name;
                sqlParameter.DbType        = parameter.DbType;
                sqlParameter.Direction     = ParameterDirection.Output;
                this.command.Parameters.Add(sqlParameter);
            }

            this.command.Parameters.Add(sqlParameter);
        }
示例#4
0
 public void SetInObject(NpgsqlCommand command, Sql.SchemaParameter param, object value)
 {
     command.Parameters[param.Name].Value = Normalize(value);
 }
示例#5
0
文件: Command.cs 项目: lulzzz/allors2
 public override void SetParameterValue(Sql.SchemaParameter parameter, object value)
 {
     this.SetParameterValue(parameter.Name, value);
 }