public void SaveGenerateSp(string tableName, string schema, string nodeName, string folderPath, List <DBTableColumnInfo> selectedFields, List <DBTableColumnInfo> whereConditionFields) { StringBuilder sb = new StringBuilder(); BaseSPGenerator spGenerator = SPFactory.GetSpGeneratorObject(nodeName); spGenerator.GenerateSp(tableName, schema, sb, selectedFields, whereConditionFields); File.WriteAllText(folderPath + "\\" + spGenerator.GetSpName(tableName, schema) + ".sql", sb.ToString()); }
public ICollection <StoredProcedure> GenerateSp(DBTableInfo tableInfo, string nodeName, List <DBTableColumnInfo> selectedFields, List <DBTableColumnInfo> whereConditionFields) { BaseSPGenerator spGenerator = SPFactory.GetSpGeneratorObject(nodeName); ICollection <StoredProcedure> procedures = spGenerator.GenerateSp(tableInfo, selectedFields, whereConditionFields); foreach (var procedure in procedures) { SaveProcedureToFile(procedure); } return(procedures); }
public void GenerateSp(string tableName, string nodeName, ref StringBuilder sb, List <DBTableColumnInfo> selectedFields, List <DBTableColumnInfo> whereConditionFields) { BaseSPGenerator spGenerator = SPFactory.GetSpGeneratorObject(nodeName); spGenerator.GenerateSp(tableName, sb, selectedFields, whereConditionFields); }