Exemplo n.º 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());
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }