public void AssertAddParameterSql(SqlDbType sqlDbType) { SPSSchema schema = new SPSSchema(); schema.AddParameterSql(sqlDbType.ToString(), sqlDbType); Assert.IsTrue(schema.Schema.Count == 1); Trace.WriteLine(string.Format("{0}", schema.Schema[0].Name)); Assert.IsTrue(schema.Schema[0].Name == sqlDbType.ToString()); Assert.IsTrue(schema.Schema[0].PropertyType.Equals(schema.GetSystemTypeFromSqlDbType_Test(sqlDbType))); }
public void ConnectionParametersConsumer(IWebPartParameters parameters) { if (parameters != null && Config != null) { SPSSchema schemaBuilder = new SPSSchema(); // Add each necesary parameter foreach (IdentityColumn column in Config.DataBase.Table.IdentityColumnCollection) { schemaBuilder.AddParameterSql(column.Name, column.Type.ToString()); } // Set the schema parameters.SetConsumerSchema(schemaBuilder.Schema); // The get parameters callback parameters.GetParametersData(ConsumeParameterValues); } }
public void ConnectionParametersConsumer(IWebPartParameters parameters) { Debug.WriteLine("ConnectionParametersConsumer " + Title); if (parameters != null && Config != null) { SPSSchema schema = new SPSSchema(); // Add each necesary parameter foreach (Param param in Config.Filter) { schema.AddParameterSql(param.Name, param.Type); } // Set the schema parameters.SetConsumerSchema(schema.Schema); // The get parameters callback parameters.GetParametersData(ConsumeParameterValues); } }
public void AddParameterSql_NullType() { SPSSchema schema = new SPSSchema(); schema.AddParameterSql("Test", null); }
public void AddParameterSql_BadType() { SPSSchema schema = new SPSSchema(); schema.AddParameterSql("Test", "BadType"); }