예제 #1
0
        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());
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }