private static void GenerateCodeClasses(string appExecutableFolder, UInt32 versCreate) { EFCodeSourceBuilder builder = new EFCodeSourceBuilder(versCreate); IList <string> subsetTable = null; IList <string> subsetIndex = null; IList <string> subsetRelat = null; IList <string> subsetUpdTrigger = null; IList <string> subsetInsTrigger = null; IList <string> subsetQuery = null; SetUpSchemaSubsets(ref subsetTable, ref subsetIndex, ref subsetRelat, ref subsetUpdTrigger, ref subsetInsTrigger, ref subsetQuery); string xmlAppParamsFile = "../MSSQL_OKMZDY_DATA.XML"; SoftwareUserData regItemData = OKmzdy.AppParams.XmlFile.AppParamsUtils.LoadOKmzdyDataRegistry(xmlAppParamsFile, "DATA", "NEW_MSSQL"); BaseSchemaInfo schemaInfo = new OKmzdySchemaInfo(regItemData.UserName(), regItemData.OwnrName()); IList <TableDefInfo> tableList = schemaInfo.CreateSubsetTableCloneList(subsetTable); IList <CloneTableDefInfo> cloneTableList = tableList.Select((t) => (new CloneTableDefInfo(t, versCreate))).ToList(); CloneSchemaTransformation.ConvertTablesAutoIdFieldToId(cloneTableList); CloneSchemaTransformation.ConvertTablesRelationsMxToId(cloneTableList); tableList = cloneTableList.Select((t) => (t.GetTargetInfo())).ToList(); string infoFileClazz = "NEW_CODESOURCE_CLAZZ.TXT"; string codeFileClazz = "NEW_CODESOURCE_CLAZZ.cs"; using (ScriptWritter writer = new ScriptWritter(appExecutableFolder, infoFileClazz, codeFileClazz, regItemData.DataType(), false)) { builder.CreateTableListCodeClasses(tableList, writer); } string infoFileConfig = "NEW_CODESOURCE_CONFIG.TXT"; string codeFileConfig = "NEW_CODESOURCE_CONFIG.cs"; using (ScriptWritter writer = new ScriptWritter(appExecutableFolder, infoFileConfig, codeFileConfig, regItemData.DataType(), false)) { builder.CreateTableListCodeConfigs(tableList, writer); } string infoFileContext = "NEW_CODESOURCE_CONTEXT.TXT"; string codeFileContext = "NEW_CODESOURCE_CONTEXT.cs"; using (ScriptWritter writer = new ScriptWritter(appExecutableFolder, infoFileContext, codeFileContext, regItemData.DataType(), false)) { builder.CreateTableListCodeContext(tableList, writer); } }
private static SoftwareUserData LoadOKmzdyDataRegistryItem(XmlDocument paramXmlDoc, string strNodeXPath, string dataItemNode) { SoftwareUserData appDataItem = new SoftwareUserData(); if (paramXmlDoc == null) { appDataItem.Init(); return(appDataItem); } Int32 defaultZero = 0; Int32 defaultOnes = 1; Int32 defaultNegs = -1; appDataItem.AppNodeName = dataItemNode; appDataItem.AppUIcolors = GetValueInt32(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_UICOLOR, defaultZero); appDataItem.DbsProvider = GetValueInt32(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSPROV, defaultZero); appDataItem.DbsProvVers = GetValueInt32(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_ACEVERS, defaultZero); appDataItem.DbsExclusiv = GetValueInt32(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBEXCLS, defaultOnes); appDataItem.DbsSysDBShr = GetValueInt32(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_ENSHARE, defaultNegs); appDataItem.BitmapyTisk = GetValueInt32(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_TISKBMP, defaultZero); appDataItem.DbsFileName = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSNAME, SoftwareDataKeys.EMPTY_STRING); appDataItem.DbsDSrcName = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_ODBCDSN, SoftwareDataKeys.EMPTY_STRING); appDataItem.DbsSystemDB = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSSYST, SoftwareDataKeys.EMPTY_STRING); appDataItem.DbsConnServ = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_ODBCSRV, SoftwareDataKeys.EMPTY_STRING); appDataItem.DbsConnUser = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSUSER, SoftwareDataKeys.USER_NAME); appDataItem.DbsConnUPsw = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSUPSW, SoftwareDataKeys.EMPTY_STRING); appDataItem.DbsDschOwnr = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSOWNR, SoftwareDataKeys.OWNER_NAME); appDataItem.DbsDschOPsw = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSOPSW, SoftwareDataKeys.EMPTY_STRING); appDataItem.SouboryArch = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSARCH, SoftwareDataKeys.EMPTY_STRING); appDataItem.SouboryBkup = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSBKUP, SoftwareDataKeys.EMPTY_STRING); appDataItem.SouboryTisk = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_PRNFILE, SoftwareDataKeys.EMPTY_STRING); appDataItem.SouboryTXML = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_XMLFILE, SoftwareDataKeys.EMPTY_STRING); appDataItem.SouboryTPDF = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_PDFFILE, SoftwareDataKeys.EMPTY_STRING); appDataItem.SouboryTXLS = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_XLSFILE, SoftwareDataKeys.EMPTY_STRING); appDataItem.CmdLineExpt = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSCMDE, SoftwareDataKeys.EMPTY_STRING); appDataItem.CmdLineImpt = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSCMDI, SoftwareDataKeys.EMPTY_STRING); appDataItem.DbfDrivImpt = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_ODBCDBF, SoftwareDataKeys.FOXBASE_DRIVER); appDataItem.ExpUMuvozov = GetValueString(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_EXUMUVZ, SoftwareDataKeys.QUOTES); appDataItem.DbsHRLink = GetValueInt32(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_DBSHRMG, defaultZero); appDataItem.RemovePrac = GetValueInt32(paramXmlDoc, strNodeXPath, dataItemNode, SoftwareDataKeys.REG_ITEM_REMPRAC, defaultZero); return(appDataItem); }
public BaseSchemaGenerator(BaseSchemaInfo schemaInfo, SoftwareUserData dataParams) { this.m_SchemaInfo = schemaInfo; this.m_TableList = new List <TableDefInfo>(); this.m_TrigUList = new List <TableDefInfo>(); this.m_TrigIList = new List <TableDefInfo>(); this.m_IndexList = new List <TableDefInfo>(); this.m_RelatList = new List <TableDefInfo>(); this.m_QueryList = new List <QueryDefInfo>(); }
public SqlTargetGenerator(BaseSchemaInfo schemaInfo, SoftwareUserData dataParams, SqlScriptBuilderBase scriptBuilder, UInt32 createVersion) : base(schemaInfo, dataParams) { this.m_scriptBuilder = scriptBuilder; this.m_createVersion = createVersion; }