From 5afd2e1b0e36d042dc19c82bdf7e320caa36bd64 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 13 Dec 2024 14:25:32 +0100 Subject: [PATCH] ran code cleanup (profile 1) --- PCAxis.Sql.UnitTest/ColTests.cs | 387 ++++---- .../Column4ParameterizedTests.cs | 870 +++++++++-------- PCAxis.Sql.UnitTest/SqlDbEncrypterTest.cs | 28 +- PCAxis.Sql/Builder/PXSQLBuilder.cs | 63 +- PCAxis.Sql/DbConfig/Col.cs | 60 +- PCAxis.Sql/DbConfig/Column4Parameterized.cs | 7 +- ...onfigDatamodelMenuSqlDbConfigExtensions.cs | 108 +-- PCAxis.Sql/DbConfig/Database_partial.cs | 21 +- .../DbConfig/DefaultDbStringProvider.cs | 9 +- PCAxis.Sql/DbConfig/IDbStringProvider.cs | 7 +- PCAxis.Sql/DbConfig/InfoForDbConnection.cs | 9 +- PCAxis.Sql/DbConfig/Lang2Tab.cs | 19 +- PCAxis.Sql/DbConfig/SqlDbConfig.cs | 116 +-- PCAxis.Sql/DbConfig/SqlDbConfig_21.cs | 3 +- PCAxis.Sql/DbConfig/SqlDbConfig_22.cs | 398 ++++---- PCAxis.Sql/DbConfig/SqlDbConfig_23.cs | 884 ++++++++--------- PCAxis.Sql/DbConfig/SqlDbConfig_24.cs | 892 +++++++++--------- PCAxis.Sql/DbConfig/SqlDbConfigs.cs | 37 +- PCAxis.Sql/DbConfig/SqlDbConfigsStatic.cs | 34 +- PCAxis.Sql/DbConfig/Tab.cs | 18 +- PCAxis.Sql/Exceptions/Errno2Text.cs | 165 ++-- PCAxis.Sql/Exceptions/WarnNo2Text.cs | 43 +- PCAxis.Sql/Exceptions/generated_exceptions.cs | 277 +++--- PCAxis.Sql/Models/GroupedValue.cs | 4 +- PCAxis.Sql/Models/Grouping.cs | 4 +- PCAxis.Sql/Models/Value.cs | 6 +- PCAxis.Sql/PXSqlKeywords.cs | 10 +- PCAxis.Sql/Parser/PXSqlData.cs | 3 +- PCAxis.Sql/Parser/PXSqlMeta.cs | 6 +- PCAxis.Sql/Parser/PXSqlParseMetaPostData.cs | 9 +- PCAxis.Sql/Parser/PxSQLEliniationProvider.cs | 9 +- PCAxis.Sql/Parser/PxSqlParser.cs | 4 +- PCAxis.Sql/Parser/PxSqlParserForCodelists.cs | 21 +- .../Parser/PxSqlParserForDataCellNote.cs | 6 +- PCAxis.Sql/Parser_21/ISqlItem.cs | 4 - PCAxis.Sql/Parser_21/PXMetaAdmValues.cs | 70 +- PCAxis.Sql/Parser_21/PXSqlContact.cs | 25 +- PCAxis.Sql/Parser_21/PXSqlContent.cs | 829 ++++++++-------- PCAxis.Sql/Parser_21/PXSqlData_21.cs | 542 +++++++---- PCAxis.Sql/Parser_21/PXSqlDecimalStuff.cs | 63 +- PCAxis.Sql/Parser_21/PXSqlGroup.cs | 8 +- PCAxis.Sql/Parser_21/PXSqlGrouping.cs | 75 +- PCAxis.Sql/Parser_21/PXSqlGroupingInfo.cs | 51 +- PCAxis.Sql/Parser_21/PXSqlGroupingInfos.cs | 48 +- PCAxis.Sql/Parser_21/PXSqlMaintable.cs | 29 +- PCAxis.Sql/Parser_21/PXSqlMeta_21.cs | 129 +-- PCAxis.Sql/Parser_21/PXSqlNotes.cs | 247 +++-- PCAxis.Sql/Parser_21/PXSqlNpm.cs | 217 +++-- .../Parser_21/PXSqlParseMetaPostData_21.cs | 42 +- PCAxis.Sql/Parser_21/PXSqlSubTable.cs | 3 - PCAxis.Sql/Parser_21/PXSqlSubTables.cs | 44 +- ...ingsThatWouldBeTheSameInAllPXSqlContent.cs | 61 +- PCAxis.Sql/Parser_21/PXSqlTimeScale.cs | 13 +- PCAxis.Sql/Parser_21/PXSqlValue.cs | 57 +- PCAxis.Sql/Parser_21/PXSqlValuePool.cs | 44 +- PCAxis.Sql/Parser_21/PXSqlValueSet.cs | 61 +- PCAxis.Sql/Parser_21/PXSqlVariable.cs | 39 +- .../Parser_21/PXSqlVariableClassification.cs | 29 +- PCAxis.Sql/Parser_21/PXSqlVariableContents.cs | 25 +- PCAxis.Sql/Parser_21/PXSqlVariableTime.cs | 236 ++--- PCAxis.Sql/Parser_21/PXSqlVariables.cs | 42 +- .../Parser_21/PXSqlVariablesClassification.cs | 9 +- .../ParseMetaIndependentOfMaintable.cs | 181 ++-- .../Parser_21/PxSqlParserForCodelists_21.cs | 41 +- PCAxis.Sql/Parser_21/PxSqlParser_21.cs | 62 +- PCAxis.Sql/Parser_21/PxSqlValues.cs | 17 +- PCAxis.Sql/Parser_21/SqlCollection.cs | 12 +- PCAxis.Sql/Parser_21/Texts.cs | 18 +- PCAxis.Sql/Parser_22/ISqlItem.cs | 4 - PCAxis.Sql/Parser_22/PXMetaAdmValues.cs | 160 ++-- PCAxis.Sql/Parser_22/PXSqlContact.cs | 29 +- PCAxis.Sql/Parser_22/PXSqlContent.cs | 806 ++++++++-------- PCAxis.Sql/Parser_22/PXSqlData_22.cs | 534 +++++++---- PCAxis.Sql/Parser_22/PXSqlDecimalStuff.cs | 63 +- PCAxis.Sql/Parser_22/PXSqlGroup.cs | 14 +- PCAxis.Sql/Parser_22/PXSqlGrouping.cs | 9 +- PCAxis.Sql/Parser_22/PXSqlGroupingInfo.cs | 28 +- PCAxis.Sql/Parser_22/PXSqlGroupingInfos.cs | 60 +- PCAxis.Sql/Parser_22/PXSqlMaintable.cs | 39 +- PCAxis.Sql/Parser_22/PXSqlMeta_22.cs | 127 +-- PCAxis.Sql/Parser_22/PXSqlNotes.cs | 280 +++--- PCAxis.Sql/Parser_22/PXSqlNpm.cs | 6 +- .../Parser_22/PXSqlParseMetaPostData_22.cs | 6 +- PCAxis.Sql/Parser_22/PXSqlSubTable.cs | 3 - PCAxis.Sql/Parser_22/PXSqlSubTables.cs | 42 +- ...ingsThatWouldBeTheSameInAllPXSqlContent.cs | 61 +- PCAxis.Sql/Parser_22/PXSqlTimeScale.cs | 13 +- PCAxis.Sql/Parser_22/PXSqlValue.cs | 57 +- PCAxis.Sql/Parser_22/PXSqlValuePool.cs | 44 +- PCAxis.Sql/Parser_22/PXSqlValueSet.cs | 61 +- PCAxis.Sql/Parser_22/PXSqlVariable.cs | 31 +- .../Parser_22/PXSqlVariableClassification.cs | 65 +- PCAxis.Sql/Parser_22/PXSqlVariableContents.cs | 25 +- PCAxis.Sql/Parser_22/PXSqlVariableTime.cs | 230 ++--- PCAxis.Sql/Parser_22/PXSqlVariables.cs | 58 +- .../Parser_22/PXSqlVariablesClassification.cs | 9 +- .../ParseMetaIndependentOfMaintable.cs | 181 ++-- .../Parser_22/PxSqlParserForCodelists_22.cs | 41 +- PCAxis.Sql/Parser_22/PxSqlParser_22.cs | 40 +- PCAxis.Sql/Parser_22/PxSqlValues.cs | 17 +- PCAxis.Sql/Parser_22/SqlCollection.cs | 12 +- PCAxis.Sql/Parser_22/Texts.cs | 18 +- PCAxis.Sql/Parser_23/ISqlItem.cs | 4 - PCAxis.Sql/Parser_23/PXMetaAdmValues.cs | 160 ++-- PCAxis.Sql/Parser_23/PXSqlAttributes.cs | 12 +- PCAxis.Sql/Parser_23/PXSqlContact.cs | 25 +- PCAxis.Sql/Parser_23/PXSqlContent.cs | 846 +++++++++-------- PCAxis.Sql/Parser_23/PXSqlData_23.cs | 8 +- PCAxis.Sql/Parser_23/PXSqlDecimalStuff.cs | 63 +- PCAxis.Sql/Parser_23/PXSqlGroup.cs | 14 +- PCAxis.Sql/Parser_23/PXSqlGrouping.cs | 11 +- PCAxis.Sql/Parser_23/PXSqlGroupingInfo.cs | 26 +- PCAxis.Sql/Parser_23/PXSqlGroupingInfos.cs | 60 +- PCAxis.Sql/Parser_23/PXSqlMaintable.cs | 46 +- PCAxis.Sql/Parser_23/PXSqlMeta_23.cs | 133 +-- PCAxis.Sql/Parser_23/PXSqlNotes.cs | 20 +- PCAxis.Sql/Parser_23/PXSqlNpm.cs | 6 +- .../Parser_23/PXSqlParseMetaPostData_23.cs | 9 +- PCAxis.Sql/Parser_23/PXSqlSubTable.cs | 3 - PCAxis.Sql/Parser_23/PXSqlSubTables.cs | 42 +- ...ingsThatWouldBeTheSameInAllPXSqlContent.cs | 61 +- PCAxis.Sql/Parser_23/PXSqlTimeScale.cs | 13 +- PCAxis.Sql/Parser_23/PXSqlValue.cs | 59 +- PCAxis.Sql/Parser_23/PXSqlValuePool.cs | 16 +- PCAxis.Sql/Parser_23/PXSqlValueSet.cs | 57 +- PCAxis.Sql/Parser_23/PXSqlVariable.cs | 54 +- .../Parser_23/PXSqlVariableClassification.cs | 23 +- PCAxis.Sql/Parser_23/PXSqlVariableContents.cs | 25 +- PCAxis.Sql/Parser_23/PXSqlVariableTime.cs | 218 ++--- PCAxis.Sql/Parser_23/PXSqlVariables.cs | 87 +- .../Parser_23/PXSqlVariablesClassification.cs | 9 +- .../ParseMetaIndependentOfMaintable.cs | 181 ++-- .../Parser_23/PxSqlParserForCodelists_23.cs | 41 +- PCAxis.Sql/Parser_23/PxSqlParser_23.cs | 40 +- PCAxis.Sql/Parser_23/PxSqlValues.cs | 17 +- PCAxis.Sql/Parser_23/SqlCollection.cs | 12 +- PCAxis.Sql/Parser_23/Texts.cs | 18 +- PCAxis.Sql/Parser_24/EliminationAux.cs | 12 +- PCAxis.Sql/Parser_24/ISqlItem.cs | 4 - PCAxis.Sql/Parser_24/PXMetaAdmValues.cs | 160 ++-- PCAxis.Sql/Parser_24/PXSqlAttributes.cs | 12 +- PCAxis.Sql/Parser_24/PXSqlContact.cs | 25 +- PCAxis.Sql/Parser_24/PXSqlContent.cs | 846 +++++++++-------- PCAxis.Sql/Parser_24/PXSqlData_24.cs | 10 +- PCAxis.Sql/Parser_24/PXSqlDecimalStuff.cs | 63 +- PCAxis.Sql/Parser_24/PXSqlGroup.cs | 14 +- PCAxis.Sql/Parser_24/PXSqlGrouping.cs | 15 +- PCAxis.Sql/Parser_24/PXSqlGroupingInfo.cs | 30 +- PCAxis.Sql/Parser_24/PXSqlGroupingInfos.cs | 40 +- PCAxis.Sql/Parser_24/PXSqlMaintable.cs | 46 +- PCAxis.Sql/Parser_24/PXSqlMeta_24.cs | 128 +-- PCAxis.Sql/Parser_24/PXSqlNotes.cs | 22 +- PCAxis.Sql/Parser_24/PXSqlNpm.cs | 6 +- .../Parser_24/PXSqlParseMetaPostData_24.cs | 9 +- PCAxis.Sql/Parser_24/PXSqlSubTable.cs | 3 - PCAxis.Sql/Parser_24/PXSqlSubTables.cs | 42 +- ...ingsThatWouldBeTheSameInAllPXSqlContent.cs | 61 +- PCAxis.Sql/Parser_24/PXSqlTimeScale.cs | 13 +- PCAxis.Sql/Parser_24/PXSqlValue.cs | 56 +- PCAxis.Sql/Parser_24/PXSqlValuePool.cs | 16 +- PCAxis.Sql/Parser_24/PXSqlValueSet.cs | 52 +- PCAxis.Sql/Parser_24/PXSqlVariable.cs | 50 +- .../Parser_24/PXSqlVariableClassification.cs | 23 +- PCAxis.Sql/Parser_24/PXSqlVariableContents.cs | 25 +- PCAxis.Sql/Parser_24/PXSqlVariableTime.cs | 218 ++--- PCAxis.Sql/Parser_24/PXSqlVariables.cs | 8 +- .../Parser_24/PXSqlVariablesClassification.cs | 9 +- .../ParseMetaIndependentOfMaintable.cs | 181 ++-- .../Parser_24/PxSqlParserForCodelists_24.cs | 47 +- PCAxis.Sql/Parser_24/PxSqlParser_24.cs | 59 +- PCAxis.Sql/Parser_24/PxSqlValues.cs | 19 +- PCAxis.Sql/Parser_24/SqlCollection.cs | 12 +- PCAxis.Sql/Parser_24/Texts.cs | 18 +- PCAxis.Sql/PxsQuery/FlatFileReaderHelper.cs | 13 +- .../PxsQuery/InfoFromPxSqlMeta2PxsQuery.cs | 7 +- .../PxsQuery/PxsQuery_FlatFile_partial.cs | 377 +++++--- .../PxsQuery/PxsQuery_Paxiom_partial.cs | 99 +- PCAxis.Sql/PxsQuery/PxsQuery_partial.cs | 139 ++- .../QueryLib_21/HandmadeRows/FootNoteRows.cs | 4 +- .../HandmadeRows/MainTableVariableRow.cs | 25 +- .../QueryLib_21/IMetaVersionComparator.cs | 7 +- PCAxis.Sql/QueryLib_21/MetaQuery.cs | 46 +- .../QueryLib_21/MetaQuery_for_PxsSqlData.cs | 113 ++- PCAxis.Sql/QueryLib_21/MetaQuery_partial.cs | 70 +- .../QueryLib_21/fra_master2MetaQuery.cs | 586 +++++++----- PCAxis.Sql/QueryLib_21/fra_master2Rows.cs | 5 +- .../QueryLib_21/value_fra_master2Rows.cs | 79 +- .../MetaQuery_Contents.cs | 13 +- .../MetaQuery_DataStorage.cs | 14 +- .../MetaQuery_Footnote.cs | 16 +- .../MetaQuery_FootnoteGrouping.cs | 8 +- .../MetaQuery_Grouping.cs | 16 +- .../MetaQuery_GroupingLevel.cs | 13 +- .../MetaQuery_MainTable.cs | 16 +- .../MetaQuery_MainTablePerson.cs | 15 +- .../MetaQuery_MainTableVariableHierarchy.cs | 25 +- .../MetaQuery_MenuSelection.cs | 18 +- .../MetaQuery_MetaAdm.cs | 15 +- .../MetaQuery_MetabaseInfo.cs | 14 +- .../MetaQuery_Organization.cs | 16 +- .../MetaQuery_Person.cs | 14 +- .../MetaQuery_SpecialCharacter.cs | 17 +- .../MetaQuery_SubTable.cs | 13 +- .../MetaQuery_SubTableVariable.cs | 25 +- .../MetaQuery_TextCatalog.cs | 11 +- .../MetaQuery_TimeScale.cs | 16 +- .../MetaQuery_VSValue.cs | 20 +- .../MetaQuery_ValueGroup.cs | 17 +- .../MetaQuery_ValuePool.cs | 16 +- .../MetaQuery_ValueSet.cs | 16 +- .../MetaQuery_ValueSetGrouping.cs | 11 +- .../MetaQuery_Variable.cs | 16 +- .../QueryLib_22/GeneratedRows/ContentsRow.cs | 5 +- .../GeneratedRows/DataStorageRow.cs | 5 - .../GeneratedRows/FootnoteGroupingRow.cs | 5 - .../QueryLib_22/GeneratedRows/FootnoteRow.cs | 5 +- .../GeneratedRows/GroupingLevelRow.cs | 5 +- .../QueryLib_22/GeneratedRows/GroupingRow.cs | 5 +- .../GeneratedRows/MainTablePersonRow.cs | 5 - .../QueryLib_22/GeneratedRows/MainTableRow.cs | 5 +- .../MainTableVariableHierarchyRow.cs | 5 - .../GeneratedRows/MenuSelectionRow.cs | 5 +- .../QueryLib_22/GeneratedRows/MetaAdmRow.cs | 5 - .../GeneratedRows/MetabaseInfoRow.cs | 5 - .../GeneratedRows/OrganizationRow.cs | 5 +- .../QueryLib_22/GeneratedRows/PersonRow.cs | 5 - .../GeneratedRows/SpecialCharacterRow.cs | 5 +- .../QueryLib_22/GeneratedRows/SubTableRow.cs | 5 +- .../GeneratedRows/SubTableVariableRow.cs | 5 - .../GeneratedRows/TextCatalogRow.cs | 5 +- .../QueryLib_22/GeneratedRows/TimeScaleRow.cs | 5 +- .../QueryLib_22/GeneratedRows/VSValueRow.cs | 5 +- .../GeneratedRows/ValueGroupRow.cs | 5 +- .../QueryLib_22/GeneratedRows/ValuePoolRow.cs | 5 +- .../GeneratedRows/ValueSetGroupingRow.cs | 5 - .../QueryLib_22/GeneratedRows/ValueSetRow.cs | 5 +- .../QueryLib_22/GeneratedRows/VariableRow.cs | 5 +- .../QueryLib_22/HandmadeRows/FootNoteRows.cs | 10 +- .../HandmadeRows/MainTableVariableRow.cs | 25 +- PCAxis.Sql/QueryLib_22/MetaQuery.cs | 72 +- .../MetaQuery_ValueGroupMaxValueLevel.cs | 17 +- .../QueryLib_22/MetaQuery_ValueGroupSorted.cs | 26 +- .../QueryLib_22/MetaQuery_for_PxsSqlData.cs | 106 ++- PCAxis.Sql/QueryLib_22/MetaQuery_partial.cs | 70 +- .../QueryLib_22/value_fra_master2Rows.cs | 79 +- .../MetaQuery_Attribute.cs | 13 +- .../MetaQuery_Contents.cs | 13 +- .../MetaQuery_DataStorage.cs | 12 +- .../MetaQuery_Footnote.cs | 16 +- .../MetaQuery_FootnoteContTime.cs | 11 +- .../MetaQuery_FootnoteContValue.cs | 11 +- .../MetaQuery_FootnoteGrouping.cs | 10 +- .../MetaQuery_FootnoteMaintTime.cs | 11 +- .../MetaQuery_FootnoteValueSetValue.cs | 10 +- .../MetaQuery_Grouping.cs | 14 +- .../MetaQuery_GroupingLevel.cs | 13 +- .../MetaQuery_MainTable.cs | 14 +- .../MetaQuery_MainTablePerson.cs | 15 +- .../MetaQuery_MainTableVariableHierarchy.cs | 25 +- .../MetaQuery_MenuSelection.cs | 18 +- .../MetaQuery_MetaAdm.cs | 13 +- .../MetaQuery_MetabaseInfo.cs | 12 +- .../MetaQuery_Organization.cs | 14 +- .../MetaQuery_Person.cs | 12 +- .../MetaQuery_SecondaryLanguage.cs | 11 +- .../MetaQuery_SpecialCharacter.cs | 15 +- .../MetaQuery_SubTable.cs | 13 +- .../MetaQuery_SubTableVariable.cs | 25 +- .../MetaQuery_TextCatalog.cs | 11 +- .../MetaQuery_TimeScale.cs | 14 +- .../MetaQuery_VSValue.cs | 20 +- .../MetaQuery_Value.cs | 17 +- .../MetaQuery_ValueGroup.cs | 17 +- .../MetaQuery_ValuePool.cs | 14 +- .../MetaQuery_ValueSet.cs | 14 +- .../MetaQuery_ValueSetGrouping.cs | 11 +- .../MetaQuery_Variable.cs | 14 +- .../QueryLib_23/GeneratedRows/AttributeRow.cs | 5 +- .../QueryLib_23/GeneratedRows/ContentsRow.cs | 5 +- .../GeneratedRows/DataStorageRow.cs | 5 - .../GeneratedRows/FootnoteContTimeRow.cs | 5 - .../GeneratedRows/FootnoteContValueRow.cs | 5 - .../GeneratedRows/FootnoteGroupingRow.cs | 5 - .../GeneratedRows/FootnoteMaintTimeRow.cs | 5 - .../QueryLib_23/GeneratedRows/FootnoteRow.cs | 5 +- .../GeneratedRows/FootnoteValueSetValueRow.cs | 5 - .../GeneratedRows/GroupingLevelRow.cs | 5 +- .../QueryLib_23/GeneratedRows/GroupingRow.cs | 5 +- .../GeneratedRows/MainTablePersonRow.cs | 5 - .../QueryLib_23/GeneratedRows/MainTableRow.cs | 5 +- .../MainTableVariableHierarchyRow.cs | 5 - .../GeneratedRows/MenuSelectionRow.cs | 5 +- .../QueryLib_23/GeneratedRows/MetaAdmRow.cs | 5 - .../GeneratedRows/MetabaseInfoRow.cs | 5 - .../GeneratedRows/OrganizationRow.cs | 5 +- .../QueryLib_23/GeneratedRows/PersonRow.cs | 5 - .../GeneratedRows/SecondaryLanguageRow.cs | 5 - .../GeneratedRows/SpecialCharacterRow.cs | 5 +- .../QueryLib_23/GeneratedRows/SubTableRow.cs | 5 +- .../GeneratedRows/SubTableVariableRow.cs | 5 - .../GeneratedRows/TextCatalogRow.cs | 5 +- .../QueryLib_23/GeneratedRows/TimeScaleRow.cs | 5 +- .../QueryLib_23/GeneratedRows/VSValueRow.cs | 5 +- .../GeneratedRows/ValueGroupRow.cs | 5 +- .../QueryLib_23/GeneratedRows/ValuePoolRow.cs | 5 +- .../QueryLib_23/GeneratedRows/ValueRow.cs | 5 +- .../GeneratedRows/ValueSetGroupingRow.cs | 5 - .../QueryLib_23/GeneratedRows/ValueSetRow.cs | 5 +- .../QueryLib_23/GeneratedRows/VariableRow.cs | 5 +- .../QueryLib_23/HandmadeRows/FootNoteRows.cs | 12 +- .../GetNumberOfDistinctAttributeColumns.cs | 9 +- .../HandmadeRows/MainTableVariableRow.cs | 23 +- PCAxis.Sql/QueryLib_23/MetaQuery.cs | 196 ++-- .../MetaQuery_ValueGroupMaxValueLevel.cs | 17 +- .../QueryLib_23/MetaQuery_ValueGroupSorted.cs | 36 +- .../QueryLib_23/MetaQuery_for_PxsSqlData.cs | 75 +- PCAxis.Sql/QueryLib_23/MetaQuery_partial.cs | 76 +- .../QueryLib_23/value_fra_master2Rows.cs | 80 +- .../MetaQuery_Attribute.cs | 13 +- .../MetaQuery_Contents.cs | 13 +- .../MetaQuery_DataStorage.cs | 12 +- .../MetaQuery_Footnote.cs | 16 +- .../MetaQuery_FootnoteContTime.cs | 11 +- .../MetaQuery_FootnoteContValue.cs | 11 +- .../MetaQuery_FootnoteGrouping.cs | 10 +- .../MetaQuery_FootnoteMaintTime.cs | 11 +- .../MetaQuery_FootnoteValueSetValue.cs | 10 +- .../MetaQuery_Grouping.cs | 14 +- .../MetaQuery_GroupingLevel.cs | 13 +- .../MetaQuery_MainTable.cs | 14 +- .../MetaQuery_MainTablePerson.cs | 15 +- .../MetaQuery_MainTableVariableHierarchy.cs | 25 +- .../MetaQuery_MenuSelection.cs | 18 +- .../MetaQuery_MetaAdm.cs | 13 +- .../MetaQuery_MetabaseInfo.cs | 12 +- .../MetaQuery_Organization.cs | 14 +- .../MetaQuery_Person.cs | 12 +- .../MetaQuery_SecondaryLanguage.cs | 11 +- .../MetaQuery_SpecialCharacter.cs | 15 +- .../MetaQuery_SubTable.cs | 13 +- .../MetaQuery_SubTableVariable.cs | 25 +- .../MetaQuery_TextCatalog.cs | 11 +- .../MetaQuery_TimeScale.cs | 14 +- .../MetaQuery_VSValue.cs | 20 +- .../MetaQuery_Value.cs | 17 +- .../MetaQuery_ValueGroup.cs | 17 +- .../MetaQuery_ValuePool.cs | 14 +- .../MetaQuery_ValueSet.cs | 14 +- .../MetaQuery_ValueSetGrouping.cs | 11 +- .../MetaQuery_Variable.cs | 14 +- .../QueryLib_24/GeneratedRows/AttributeRow.cs | 5 +- .../QueryLib_24/GeneratedRows/ContentsRow.cs | 5 +- .../GeneratedRows/DataStorageRow.cs | 5 - .../GeneratedRows/FootnoteContTimeRow.cs | 5 - .../GeneratedRows/FootnoteContValueRow.cs | 5 - .../GeneratedRows/FootnoteGroupingRow.cs | 5 - .../GeneratedRows/FootnoteMaintTimeRow.cs | 5 - .../QueryLib_24/GeneratedRows/FootnoteRow.cs | 5 +- .../GeneratedRows/FootnoteValueSetValueRow.cs | 5 - .../GeneratedRows/GroupingLevelRow.cs | 5 +- .../QueryLib_24/GeneratedRows/GroupingRow.cs | 5 +- .../GeneratedRows/MainTablePersonRow.cs | 5 - .../QueryLib_24/GeneratedRows/MainTableRow.cs | 5 +- .../MainTableVariableHierarchyRow.cs | 5 - .../GeneratedRows/MenuSelectionRow.cs | 5 +- .../QueryLib_24/GeneratedRows/MetaAdmRow.cs | 5 - .../GeneratedRows/MetabaseInfoRow.cs | 5 - .../GeneratedRows/OrganizationRow.cs | 5 +- .../QueryLib_24/GeneratedRows/PersonRow.cs | 5 - .../GeneratedRows/SecondaryLanguageRow.cs | 5 - .../GeneratedRows/SpecialCharacterRow.cs | 5 +- .../QueryLib_24/GeneratedRows/SubTableRow.cs | 5 +- .../GeneratedRows/SubTableVariableRow.cs | 5 - .../GeneratedRows/TextCatalogRow.cs | 5 +- .../QueryLib_24/GeneratedRows/TimeScaleRow.cs | 5 +- .../QueryLib_24/GeneratedRows/VSValueRow.cs | 5 +- .../GeneratedRows/ValueGroupRow.cs | 5 +- .../QueryLib_24/GeneratedRows/ValuePoolRow.cs | 5 +- .../QueryLib_24/GeneratedRows/ValueRow.cs | 5 +- .../GeneratedRows/ValueSetGroupingRow.cs | 5 - .../QueryLib_24/GeneratedRows/ValueSetRow.cs | 5 +- .../QueryLib_24/GeneratedRows/VariableRow.cs | 5 +- .../QueryLib_24/HandmadeRows/FootNoteRows.cs | 12 +- .../GetNumberOfDistinctAttributeColumns.cs | 9 +- .../HandmadeRows/MainTableVariableRow.cs | 23 +- PCAxis.Sql/QueryLib_24/MetaQuery.cs | 203 ++-- .../QueryLib_24/MetaQuery_GroupingSorted.cs | 8 +- .../QueryLib_24/MetaQuery_SubTableVariable.cs | 11 +- .../MetaQuery_ValueGroupMaxValueLevel.cs | 17 +- .../QueryLib_24/MetaQuery_ValueGroupSorted.cs | 36 +- .../QueryLib_24/MetaQuery_for_PxsSqlData.cs | 75 +- PCAxis.Sql/QueryLib_24/MetaQuery_partial.cs | 80 +- .../QueryLib_24/value_fra_master2Rows.cs | 80 +- PCAxis.Sql/SqlClient/MyDbVendor.cs | 52 +- PCAxis.Sql/SqlClient/MyDbVendorIsOracle.cs | 46 +- PCAxis.Sql/SqlClient/MyDbVendorIsSql.cs | 38 +- PCAxis.Sql/SqlClient/PxSqlCommand.cs | 220 +++-- PCAxis.Sql/SqlClientCleanup/MyDbVendor.cs | 48 +- .../SqlClientCleanup/MyDbVendorIsOracle.cs | 44 +- .../SqlClientCleanup/MyDbVendorIsSql.cs | 31 +- PCAxis.Sql/SqlClientCleanup/PxSqlCommand.cs | 204 ++-- PCAxis.Sql/SqlDbEncrypter.cs | 5 +- 402 files changed, 10986 insertions(+), 10353 deletions(-) diff --git a/PCAxis.Sql.UnitTest/ColTests.cs b/PCAxis.Sql.UnitTest/ColTests.cs index 15cc6e7..a591182 100644 --- a/PCAxis.Sql.UnitTest/ColTests.cs +++ b/PCAxis.Sql.UnitTest/ColTests.cs @@ -1,193 +1,194 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCAxis.Sql.DbConfig; -using System.Collections.Specialized; -using System.Collections.Generic; - -namespace PCAxis.Sql.UnitTest -{ - - [TestClass] - public class ColTests - { - - [TestMethod] - [TestCategory("Unit")] - public void Id_GivenTableCol_ReturnsIdCombinedNameSeperatedbyDot() - { - //Arrange - var col = new Col("ColName", "TableAlias"); - - //Act - var result = col.Id(); - - //Assert - var expectedResult = "TableAlias.ColName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Label_GivenTableCol_ReturnsLabelCombinedNameSeperatedByUnderscore() - { - //Arrange - var col = new Col("ColName", "TableAlias"); - - //Act - var result = col.Label(); - - //Assert - var expectedResult = "TableAlias_ColName"; - Assert.AreEqual(expectedResult, result); - } - - - [TestMethod] - [TestCategory("Unit")] - public void ForSelect_GivenTableCol_ReturnsSQLPartExpressionForLabeling() - { - //Arrange - var col = new Col("ColName", "TableAlias"); - - //Act - var result = col.ForSelect(); - - //Assert - var expectedResult = "TableAlias.ColName AS TableAlias_ColName"; - Assert.AreEqual(expectedResult, result); - } - - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenTableColAndFilter_SoundSQLFilterPartExpression() - { - //Arrange - var col = new Col("SuperCol", "SuperTable"); - var filterValue = "NiceValue"; - - //Act - var isExpression = col.Is(filterValue); - - //Assert - var expectedIsExpression = "SuperTable.SuperCol = 'NiceValue'"; - Assert.AreEqual(expectedIsExpression, isExpression); - } - - [TestMethod] - [TestCategory("Unit")] - public void Like_GivenTableCol_ReturnsSQLPartExpressionForContainsComparisson() - { - //Arrange - var col = new Col("ColName", "TableAlias"); - var wildCard = "myWildCard"; - - //Act - var result = col.Like(wildCard); - - //Assert - var expectedResult = "TableAlias.ColName LIKE 'myWildCard'"; - Assert.AreEqual(expectedResult, result); - } - - - [TestMethod] - [TestCategory("Unit")] - public void In_GivenTableCol_ReturnsInSQLPartExpression() - { - //Arrange - var col = new Col("ColName", "TableAlias"); - var listOfValues = new String[] { "value1", "value2", "value3" }; - - //Act - var expression = col.In(listOfValues); - - //Assert - var expectedExpression = "(TableAlias.ColName IN ('value1', 'value2', 'value3'))"; - Assert.AreEqual(expectedExpression, expression); - } - - [TestMethod] - [TestCategory("Unit")] - public void IsUppered_GivenTableCol_ReturnsUpperedSQLPartExpresssion() - { - //Arrange - var col = new Col("ColName", "TableAlias"); - var constantValue = "someConstantValue"; - - //Act - var expression = col.IsUppered(constantValue); - - //Assert - var expectedExpression = "upper(TableAlias.ColName) = upper('someConstantValue')"; - Assert.AreEqual(expectedExpression, expression); - } - - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenTwoCol_ReturnsIdEqualSQLPartExpresssion() - { - //Arrange - var col = new Col("ColName", "TableAlias"); - var col2 = new Col("ColName", "TableAlias2"); - - //Act - var expression = col.Is(col2); - - //Assert - var expectedExpression = "TableAlias.ColName = TableAlias2.ColName"; - Assert.AreEqual(expectedExpression, expression); - } - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenTableColAndLang_ReturnsIdEqualLandIdSQLPartExpresssion() - { - //Arrange - var col = new Col("ColName", "TableAlias"); - var lang2Col = new Lang2Col("ColName", "TableAlias", new Dictionary { { "no", "norsk" }, { "dk", "dansk" } }); - var lang = "no"; - - //Act - var result = col.Is(lang2Col, lang); - - //Assert - var expectedResult = "TableAlias.ColName = TableAliasnorsk.ColName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void IsNotNULL_GivenTableCol_ReturnsIdIsNotNullSQLPartExpresssion() - { - //Arrange - var col = new Col("ColName", "TableAlias"); - - //Act - var result = col.IsNotNULL(); - - //Assert - var expectedResult = "TableAlias.ColName IS NOT NULL"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void IsNotNULL_GivenTableCol_ReturnsIdIsNotNullSQLPartExpresssionUpperCase() - { - //Arrange - var col = new Col("ColName", "TableAlias"); - - //Act - var result = col.IsNotNULL(); - - //Assert - var notUpperCaseResult = "TableAlias.ColName IS not NULL"; - Assert.AreNotEqual(notUpperCaseResult, result); - } - - - - } -} +using System; +using System.Collections.Generic; + +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using PCAxis.Sql.DbConfig; + +namespace PCAxis.Sql.UnitTest +{ + + [TestClass] + public class ColTests + { + + [TestMethod] + [TestCategory("Unit")] + public void Id_GivenTableCol_ReturnsIdCombinedNameSeperatedbyDot() + { + //Arrange + var col = new Col("ColName", "TableAlias"); + + //Act + var result = col.Id(); + + //Assert + var expectedResult = "TableAlias.ColName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Label_GivenTableCol_ReturnsLabelCombinedNameSeperatedByUnderscore() + { + //Arrange + var col = new Col("ColName", "TableAlias"); + + //Act + var result = col.Label(); + + //Assert + var expectedResult = "TableAlias_ColName"; + Assert.AreEqual(expectedResult, result); + } + + + [TestMethod] + [TestCategory("Unit")] + public void ForSelect_GivenTableCol_ReturnsSQLPartExpressionForLabeling() + { + //Arrange + var col = new Col("ColName", "TableAlias"); + + //Act + var result = col.ForSelect(); + + //Assert + var expectedResult = "TableAlias.ColName AS TableAlias_ColName"; + Assert.AreEqual(expectedResult, result); + } + + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenTableColAndFilter_SoundSQLFilterPartExpression() + { + //Arrange + var col = new Col("SuperCol", "SuperTable"); + var filterValue = "NiceValue"; + + //Act + var isExpression = col.Is(filterValue); + + //Assert + var expectedIsExpression = "SuperTable.SuperCol = 'NiceValue'"; + Assert.AreEqual(expectedIsExpression, isExpression); + } + + [TestMethod] + [TestCategory("Unit")] + public void Like_GivenTableCol_ReturnsSQLPartExpressionForContainsComparisson() + { + //Arrange + var col = new Col("ColName", "TableAlias"); + var wildCard = "myWildCard"; + + //Act + var result = col.Like(wildCard); + + //Assert + var expectedResult = "TableAlias.ColName LIKE 'myWildCard'"; + Assert.AreEqual(expectedResult, result); + } + + + [TestMethod] + [TestCategory("Unit")] + public void In_GivenTableCol_ReturnsInSQLPartExpression() + { + //Arrange + var col = new Col("ColName", "TableAlias"); + var listOfValues = new String[] { "value1", "value2", "value3" }; + + //Act + var expression = col.In(listOfValues); + + //Assert + var expectedExpression = "(TableAlias.ColName IN ('value1', 'value2', 'value3'))"; + Assert.AreEqual(expectedExpression, expression); + } + + [TestMethod] + [TestCategory("Unit")] + public void IsUppered_GivenTableCol_ReturnsUpperedSQLPartExpresssion() + { + //Arrange + var col = new Col("ColName", "TableAlias"); + var constantValue = "someConstantValue"; + + //Act + var expression = col.IsUppered(constantValue); + + //Assert + var expectedExpression = "upper(TableAlias.ColName) = upper('someConstantValue')"; + Assert.AreEqual(expectedExpression, expression); + } + + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenTwoCol_ReturnsIdEqualSQLPartExpresssion() + { + //Arrange + var col = new Col("ColName", "TableAlias"); + var col2 = new Col("ColName", "TableAlias2"); + + //Act + var expression = col.Is(col2); + + //Assert + var expectedExpression = "TableAlias.ColName = TableAlias2.ColName"; + Assert.AreEqual(expectedExpression, expression); + } + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenTableColAndLang_ReturnsIdEqualLandIdSQLPartExpresssion() + { + //Arrange + var col = new Col("ColName", "TableAlias"); + var lang2Col = new Lang2Col("ColName", "TableAlias", new Dictionary { { "no", "norsk" }, { "dk", "dansk" } }); + var lang = "no"; + + //Act + var result = col.Is(lang2Col, lang); + + //Assert + var expectedResult = "TableAlias.ColName = TableAliasnorsk.ColName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void IsNotNULL_GivenTableCol_ReturnsIdIsNotNullSQLPartExpresssion() + { + //Arrange + var col = new Col("ColName", "TableAlias"); + + //Act + var result = col.IsNotNULL(); + + //Assert + var expectedResult = "TableAlias.ColName IS NOT NULL"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void IsNotNULL_GivenTableCol_ReturnsIdIsNotNullSQLPartExpresssionUpperCase() + { + //Arrange + var col = new Col("ColName", "TableAlias"); + + //Act + var result = col.IsNotNULL(); + + //Assert + var notUpperCaseResult = "TableAlias.ColName IS not NULL"; + Assert.AreNotEqual(notUpperCaseResult, result); + } + + + + } +} diff --git a/PCAxis.Sql.UnitTest/Column4ParameterizedTests.cs b/PCAxis.Sql.UnitTest/Column4ParameterizedTests.cs index ebd01b9..db3adad 100644 --- a/PCAxis.Sql.UnitTest/Column4ParameterizedTests.cs +++ b/PCAxis.Sql.UnitTest/Column4ParameterizedTests.cs @@ -1,436 +1,434 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; -using System.Collections.Specialized; -using System.Data.Common; -using System.Data; -using System.Collections.Generic; -using System.Data.SqlClient; - -namespace PCAxis.Sql.UnitTest -{ - [TestClass] - public class Column4ParameterizedTests - { - - private Column4Parameterized col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Oracle"); - - [TestMethod] - [TestCategory("Unit")] - public void PureColumnName_GivenColName_ReturnsThisColName() - { - //Assert - var col4Para = new Column4Parameterized("ColName", null, null, null); - - //Act - var result = col4Para.PureColumnName(); - - //Assert - var expectedResult = "ColName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Id_GivenColNameAndTableAlias_ReturnsThisId() - { - //Assert - var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); - - //Act - var result = col4Para.Id(); - - //Assert - var expectedResult = "TableAlias.ColName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Label_GivenColNameAndTableAlias_ReturnsThisLabel() - { - //Assert - var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); - - //Act - var result = col4Para.Label(); - - //Assert - var expectedResult = "TableAlias_ColName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Label_GivenColName_ReturnsThisLabel2() - { - //Assert - var col4Para = new Column4Parameterized("ColName", null, null, null); - - //Act - var result = col4Para.Label(); - - //Assert - var expectedResult = "_ColName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void ForSelect_GivenColNameAndTableAlias_ReturnsSQLPartExpressionForNamingWithLabel() - { - //Assert - var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); - - //Act - var result = col4Para.ForSelect(); - - //Assert - var expectedResult = "TableAlias.ColName AS TableAlias_ColName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenTableColAndParaMeterRef_ReturnsThisIDEqualsInputSQLPartExpression() - { - //Assert - var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); - var parameterRef = "someParameterRef"; - - //Act - var result = col4Para.Is(parameterRef); - - //Assert - var expectedResult = "TableAlias.ColName = someParameterRef"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenCompleteCol4Para_ReturnsThisIDEqualsParameterReferenceSQLPartExpression_Oracle() - { - //Assert - var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Oracle"); - - //Act - var result = col4Para.Is(); - - //Assert - var expectedResult = "TableAlias.ColName = :aModelName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenCompleteCol4Para_ReturnsThisIDEqualsParameterReferenceSQLPartExpression_SQL() - { - //Assert - var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Sql"); - - //Act - var result = col4Para.Is(); - - //Assert - var expectedResult = "TableAlias.ColName = @aModelName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenCompleteCol4Para_ReturnsThisIDEqualsParameterReferenceSQLPartExpression_OLEDB() - { - //Assert - var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "OLEDB"); - - //Act - var result = col4Para.Is(); - - //Assert - var expectedResult = "TableAlias.ColName = ?"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenCompleteCol4Para_ReturnsThisIDEqualsParameterReferenceSQLPartExpression_ODBC() - { - //Assert - var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "ODBC"); - - //Act - var result = col4Para.Is(); - - //Assert - var expectedResult = "TableAlias.ColName = ?"; - Assert.AreEqual(expectedResult, result); - } - - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenIncorrectDB_ReturnsException() - { - //Assert - var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "notDBString"); - - //Act & Assert - try - { - var result = col4Para.Is(); - Assert.Fail(); - } - catch (Exception ex) - { - Assert.IsTrue(ex is Exceptions.ConfigException); - } - } - - [TestMethod] - [TestCategory("Unit")] - public void IsUppered_GivenCorrectDBAndFullCol4Para_ReturnsSQLPartExpressionToUpper_Oracle() - { - //Arrange - var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Oracle"); - - //Act - var result = col4Para.IsUppered(); - - //Assert - var expectedResult = "upper(TableAlias.ColName) = upper(:aModelName)"; - Assert.AreEqual(expectedResult, result); - - } - - [TestMethod] - [TestCategory("Unit")] - public void IsUppered_GivenInCorrectDBAndFullCol4Para_ReturnsException() - { - //Arrange - var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "notAnDB"); - - //Act & Assert - try - { - var result = col4Para.IsUppered(); - Assert.Fail(); - } - catch (Exception ex) - { - Assert.IsTrue(ex is Exceptions.ConfigException); - } - - } - - - [TestMethod] - [TestCategory("Unit")] - public void Like_GivenCorrectDBType_ReturnsLikeSQLPartExpression_Oracle() - { - //Arrange - var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Oracle"); - - //Act - var result = col4Para.Like(); - - //Assert - var expectedResult = "TableAlias.ColName LIKE :aModelName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Like_GivenCorrectDBType_ReturnsLikeSQLPartExpression_Sql() - { - //Arrange - var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Sql"); - - //Act - var result = col4Para.Like(); - - //Assert - var expectedResult = "TableAlias.ColName LIKE @aModelName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Like_GivenInCorrectDBType_ReturnsException() - { - //Arrange - var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "noDBName"); - - //Act & Assert - try - { - var result = col4Para.Like(); - Assert.Fail(); - } - catch (Exception ex) - { - Assert.IsTrue(ex is Exceptions.ConfigException); - } - } - - [TestMethod] - [TestCategory("Unit")] - public void In_GivenCorrectDBTypeAndQuestionMarkAsParaMeterRefBase_ReturnsInSQLPartExpression() - { - var parameterRefBase = "?"; - var numberOfValues = 5; - - var result = col4Para.In(parameterRefBase, numberOfValues); - - var expectedResult = "TableAlias.ColName IN (?, ?, ?, ?, ?)"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenTwoCol4Para_ReturnsEqualsSQLPartExpression() - { - //Arrange - var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); - var col4Para2 = new Column4Parameterized("ColName", "TableAlias2", null, null); - - //Act - var result = col4Para.Is(col4Para2); - - //Assert - var expectedResult = "TableAlias.ColName = TableAlias2.ColName"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void Is_GivenTableColAndLang_ReturnsIdEqualLandIdSQLPartExpresssion() - { - //Arrange - var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); - var lang2Col4Para = new Lang2Column4Parameterized("ColName", "TableAlias", new Dictionary { { "no", "norsk" }, { "dk", "dansk" } }); - var lang = "no"; - - //Act - var result = col4Para.Is(lang2Col4Para, lang); - - //Assert - var expectedResult = "TableAlias.ColName = TableAliasnorsk.ColName"; - Assert.AreEqual(expectedResult, result); - } - - - [TestMethod] - [TestCategory("Unit")] - public void IsNotNULL_GivenTableCol_ReturnsIdIsNotNullSQLPartExpresssion() - { - //Arrange - var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); - - //Act - var result = col4Para.IsNotNULL(); - - //Assert - var expectedResult = "TableAlias.ColName IS NOT NULL"; - Assert.AreEqual(expectedResult, result); - } - - [TestMethod] - [TestCategory("Unit")] - public void In_GivenCorrectDBType_ReturnsInSQLPartException() - { - var listOfValues = new StringCollection(); - listOfValues.AddRange(new String[] { "value1", "value2", "value3" }); - - var result = col4Para.In(listOfValues); - - var expectedResult = "( (TableAlias.ColName IN ( :aModelName1,:aModelName2,:aModelName3)))"; - Assert.AreEqual(expectedResult, result); - } - - /* - PrivateType could not be found ... - - [TestMethod] - [TestCategory("Unit")] - public void GetParameterReference_GivenValidDBType_ReturnsCorrectSQLPartExpression() - { - //Arrange - var dataProvider = "oRacLE"; - var propertyName = "myPropertyName"; - var args = new object[2] { propertyName, dataProvider }; - PrivateType col4ParaType = new PrivateType(col4Para.GetType()); - - //Act - var result = col4ParaType.InvokeStatic("GetParameterReference", args); - - //Assert - var expectedResult = ":amyPropertyName"; - Assert.AreEqual(expectedResult, result); - } - */ - - -/* - PrivateType could not be found ... - [TestMethod] - [TestCategory("Unit")] - public void GetParameterReference_GivenIncorrectDBType_ReturnsException() - { - var dataProvider = "oraCe"; - var propertyName = "myPropertyName"; - var args = new object[2] { propertyName, dataProvider }; - PrivateType col4ParaType = new PrivateType(col4Para.GetType()); - - try - { - col4ParaType.InvokeStatic("GetParameterReference", args); - Assert.Fail(); - } - catch (Exception ex) - { - Assert.IsTrue(ex is Exceptions.ConfigException); - } - - } - */ - -/* - PrivateType could not be found ... - - [TestMethod] - [TestCategory("Unit")] - public void GetEmptyDbParameter_GivenIncorrectDBType_ReturnsException() - { - - var dataProvider = "oraCe"; - var args = new object[1] { dataProvider }; - PrivateType col4ParaType = new PrivateType(col4Para.GetType()); - - try - { - col4ParaType.InvokeStatic("GetEmptyDbParameter", args); - Assert.Fail(); - } - catch (Exception ex) - { - Assert.IsTrue(ex is Exceptions.ConfigException); - } - } -*/ - - [TestMethod] - [TestCategory("Unit")] - public void In_GivenCorrectDBTypeAndNotQuestionMarkAsParaMeterRefBase_ReturnsInSQLPartException() - { - var parameterRefBase = ":"; - var numberOfValues = 5; - - var result = col4Para.In(parameterRefBase, numberOfValues); - - var expectedResult = "TableAlias.ColName IN (:1, :2, :3, :4, :5)"; - Assert.AreEqual(expectedResult, result); - } - - } -} +using System; +using System.Collections.Generic; +using System.Collections.Specialized; + +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using PCAxis.Sql.DbConfig; + +namespace PCAxis.Sql.UnitTest +{ + [TestClass] + public class Column4ParameterizedTests + { + + private Column4Parameterized col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Oracle"); + + [TestMethod] + [TestCategory("Unit")] + public void PureColumnName_GivenColName_ReturnsThisColName() + { + //Assert + var col4Para = new Column4Parameterized("ColName", null, null, null); + + //Act + var result = col4Para.PureColumnName(); + + //Assert + var expectedResult = "ColName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Id_GivenColNameAndTableAlias_ReturnsThisId() + { + //Assert + var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); + + //Act + var result = col4Para.Id(); + + //Assert + var expectedResult = "TableAlias.ColName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Label_GivenColNameAndTableAlias_ReturnsThisLabel() + { + //Assert + var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); + + //Act + var result = col4Para.Label(); + + //Assert + var expectedResult = "TableAlias_ColName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Label_GivenColName_ReturnsThisLabel2() + { + //Assert + var col4Para = new Column4Parameterized("ColName", null, null, null); + + //Act + var result = col4Para.Label(); + + //Assert + var expectedResult = "_ColName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void ForSelect_GivenColNameAndTableAlias_ReturnsSQLPartExpressionForNamingWithLabel() + { + //Assert + var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); + + //Act + var result = col4Para.ForSelect(); + + //Assert + var expectedResult = "TableAlias.ColName AS TableAlias_ColName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenTableColAndParaMeterRef_ReturnsThisIDEqualsInputSQLPartExpression() + { + //Assert + var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); + var parameterRef = "someParameterRef"; + + //Act + var result = col4Para.Is(parameterRef); + + //Assert + var expectedResult = "TableAlias.ColName = someParameterRef"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenCompleteCol4Para_ReturnsThisIDEqualsParameterReferenceSQLPartExpression_Oracle() + { + //Assert + var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Oracle"); + + //Act + var result = col4Para.Is(); + + //Assert + var expectedResult = "TableAlias.ColName = :aModelName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenCompleteCol4Para_ReturnsThisIDEqualsParameterReferenceSQLPartExpression_SQL() + { + //Assert + var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Sql"); + + //Act + var result = col4Para.Is(); + + //Assert + var expectedResult = "TableAlias.ColName = @aModelName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenCompleteCol4Para_ReturnsThisIDEqualsParameterReferenceSQLPartExpression_OLEDB() + { + //Assert + var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "OLEDB"); + + //Act + var result = col4Para.Is(); + + //Assert + var expectedResult = "TableAlias.ColName = ?"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenCompleteCol4Para_ReturnsThisIDEqualsParameterReferenceSQLPartExpression_ODBC() + { + //Assert + var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "ODBC"); + + //Act + var result = col4Para.Is(); + + //Assert + var expectedResult = "TableAlias.ColName = ?"; + Assert.AreEqual(expectedResult, result); + } + + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenIncorrectDB_ReturnsException() + { + //Assert + var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "notDBString"); + + //Act & Assert + try + { + var result = col4Para.Is(); + Assert.Fail(); + } + catch (Exception ex) + { + Assert.IsTrue(ex is Exceptions.ConfigException); + } + } + + [TestMethod] + [TestCategory("Unit")] + public void IsUppered_GivenCorrectDBAndFullCol4Para_ReturnsSQLPartExpressionToUpper_Oracle() + { + //Arrange + var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Oracle"); + + //Act + var result = col4Para.IsUppered(); + + //Assert + var expectedResult = "upper(TableAlias.ColName) = upper(:aModelName)"; + Assert.AreEqual(expectedResult, result); + + } + + [TestMethod] + [TestCategory("Unit")] + public void IsUppered_GivenInCorrectDBAndFullCol4Para_ReturnsException() + { + //Arrange + var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "notAnDB"); + + //Act & Assert + try + { + var result = col4Para.IsUppered(); + Assert.Fail(); + } + catch (Exception ex) + { + Assert.IsTrue(ex is Exceptions.ConfigException); + } + + } + + + [TestMethod] + [TestCategory("Unit")] + public void Like_GivenCorrectDBType_ReturnsLikeSQLPartExpression_Oracle() + { + //Arrange + var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Oracle"); + + //Act + var result = col4Para.Like(); + + //Assert + var expectedResult = "TableAlias.ColName LIKE :aModelName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Like_GivenCorrectDBType_ReturnsLikeSQLPartExpression_Sql() + { + //Arrange + var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "Sql"); + + //Act + var result = col4Para.Like(); + + //Assert + var expectedResult = "TableAlias.ColName LIKE @aModelName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Like_GivenInCorrectDBType_ReturnsException() + { + //Arrange + var col4Para = new Column4Parameterized("ColName", "TableAlias", "ModelName", "noDBName"); + + //Act & Assert + try + { + var result = col4Para.Like(); + Assert.Fail(); + } + catch (Exception ex) + { + Assert.IsTrue(ex is Exceptions.ConfigException); + } + } + + [TestMethod] + [TestCategory("Unit")] + public void In_GivenCorrectDBTypeAndQuestionMarkAsParaMeterRefBase_ReturnsInSQLPartExpression() + { + var parameterRefBase = "?"; + var numberOfValues = 5; + + var result = col4Para.In(parameterRefBase, numberOfValues); + + var expectedResult = "TableAlias.ColName IN (?, ?, ?, ?, ?)"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenTwoCol4Para_ReturnsEqualsSQLPartExpression() + { + //Arrange + var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); + var col4Para2 = new Column4Parameterized("ColName", "TableAlias2", null, null); + + //Act + var result = col4Para.Is(col4Para2); + + //Assert + var expectedResult = "TableAlias.ColName = TableAlias2.ColName"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void Is_GivenTableColAndLang_ReturnsIdEqualLandIdSQLPartExpresssion() + { + //Arrange + var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); + var lang2Col4Para = new Lang2Column4Parameterized("ColName", "TableAlias", new Dictionary { { "no", "norsk" }, { "dk", "dansk" } }); + var lang = "no"; + + //Act + var result = col4Para.Is(lang2Col4Para, lang); + + //Assert + var expectedResult = "TableAlias.ColName = TableAliasnorsk.ColName"; + Assert.AreEqual(expectedResult, result); + } + + + [TestMethod] + [TestCategory("Unit")] + public void IsNotNULL_GivenTableCol_ReturnsIdIsNotNullSQLPartExpresssion() + { + //Arrange + var col4Para = new Column4Parameterized("ColName", "TableAlias", null, null); + + //Act + var result = col4Para.IsNotNULL(); + + //Assert + var expectedResult = "TableAlias.ColName IS NOT NULL"; + Assert.AreEqual(expectedResult, result); + } + + [TestMethod] + [TestCategory("Unit")] + public void In_GivenCorrectDBType_ReturnsInSQLPartException() + { + var listOfValues = new StringCollection(); + listOfValues.AddRange(new String[] { "value1", "value2", "value3" }); + + var result = col4Para.In(listOfValues); + + var expectedResult = "( (TableAlias.ColName IN ( :aModelName1,:aModelName2,:aModelName3)))"; + Assert.AreEqual(expectedResult, result); + } + + /* + PrivateType could not be found ... + + [TestMethod] + [TestCategory("Unit")] + public void GetParameterReference_GivenValidDBType_ReturnsCorrectSQLPartExpression() + { + //Arrange + var dataProvider = "oRacLE"; + var propertyName = "myPropertyName"; + var args = new object[2] { propertyName, dataProvider }; + PrivateType col4ParaType = new PrivateType(col4Para.GetType()); + + //Act + var result = col4ParaType.InvokeStatic("GetParameterReference", args); + + //Assert + var expectedResult = ":amyPropertyName"; + Assert.AreEqual(expectedResult, result); + } + */ + + + /* + PrivateType could not be found ... + [TestMethod] + [TestCategory("Unit")] + public void GetParameterReference_GivenIncorrectDBType_ReturnsException() + { + var dataProvider = "oraCe"; + var propertyName = "myPropertyName"; + var args = new object[2] { propertyName, dataProvider }; + PrivateType col4ParaType = new PrivateType(col4Para.GetType()); + + try + { + col4ParaType.InvokeStatic("GetParameterReference", args); + Assert.Fail(); + } + catch (Exception ex) + { + Assert.IsTrue(ex is Exceptions.ConfigException); + } + + } + */ + + /* + PrivateType could not be found ... + + [TestMethod] + [TestCategory("Unit")] + public void GetEmptyDbParameter_GivenIncorrectDBType_ReturnsException() + { + + var dataProvider = "oraCe"; + var args = new object[1] { dataProvider }; + PrivateType col4ParaType = new PrivateType(col4Para.GetType()); + + try + { + col4ParaType.InvokeStatic("GetEmptyDbParameter", args); + Assert.Fail(); + } + catch (Exception ex) + { + Assert.IsTrue(ex is Exceptions.ConfigException); + } + } + */ + + [TestMethod] + [TestCategory("Unit")] + public void In_GivenCorrectDBTypeAndNotQuestionMarkAsParaMeterRefBase_ReturnsInSQLPartException() + { + var parameterRefBase = ":"; + var numberOfValues = 5; + + var result = col4Para.In(parameterRefBase, numberOfValues); + + var expectedResult = "TableAlias.ColName IN (:1, :2, :3, :4, :5)"; + Assert.AreEqual(expectedResult, result); + } + + } +} diff --git a/PCAxis.Sql.UnitTest/SqlDbEncrypterTest.cs b/PCAxis.Sql.UnitTest/SqlDbEncrypterTest.cs index abab674..adb881e 100644 --- a/PCAxis.Sql.UnitTest/SqlDbEncrypterTest.cs +++ b/PCAxis.Sql.UnitTest/SqlDbEncrypterTest.cs @@ -2,24 +2,24 @@ namespace PCAxis.Encryption.UnitTest { - [TestClass] - public class SqlDbEncrypterTest - { - [TestMethod] - public void EncryptShouldReturnFalse() - { + [TestClass] + public class SqlDbEncrypterTest + { + [TestMethod] + public void EncryptShouldReturnFalse() + { - //Arrange, - var filepath = "Nopath/Sqldb.Config"; + //Arrange, + var filepath = "Nopath/Sqldb.Config"; - // Act - var result = PCAxis.Encryption.SqlDbEncrypter.Decrypt(filepath); + // Act + var result = PCAxis.Encryption.SqlDbEncrypter.Decrypt(filepath); - //Assert - Assert.AreEqual(result, false); + //Assert + Assert.AreEqual(result, false); - } - } + } + } } \ No newline at end of file diff --git a/PCAxis.Sql/Builder/PXSQLBuilder.cs b/PCAxis.Sql/Builder/PXSQLBuilder.cs index ff6716c..6be387a 100644 --- a/PCAxis.Sql/Builder/PXSQLBuilder.cs +++ b/PCAxis.Sql/Builder/PXSQLBuilder.cs @@ -1,18 +1,17 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; -using PCAxis.Paxiom; +using log4net; -using PCAxis.Sql.Pxs; +using PCAxis.Paxiom; using PCAxis.Sql.DbConfig; - -using log4net; -using System.Collections.Specialized; using PCAxis.Sql.Parser; +using PCAxis.Sql.Pxs; namespace PCAxis.PlugIn.Sql { - + /// /// This builder may be used (setPath) with 2 types of parameters: A maintableId or a pxs-object( or a file that may be read into a pxs-object). /// buildForSelection with a maintableId means extract "all" metadata. @@ -23,12 +22,12 @@ namespace PCAxis.PlugIn.Sql /// what is supposed to happen if setPath is called more than once? /// public class PXSQLBuilder : PCAxis.Paxiom.PXModelBuilderAdapter, IDisposable, PCAxis.PlugIn.IPlugIn - { - + { + #if DEBUG - private static readonly ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(),"LogTime"); + private static readonly ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(), "LogTime"); #endif - + private static readonly ILog log = LogManager.GetLogger(typeof(PXSQLBuilder)); //this must be a parameter @@ -185,11 +184,11 @@ public override void SetUserCredentials(string userName, string password) /// public override bool BuildForSelection() { - #if DEBUG - System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); - stopWatch.Start(); - logTime.DebugFormat("Start "+System.Reflection.MethodBase.GetCurrentMethod().Name+". Maintable={0}", maintableId); - #endif +#if DEBUG + System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); + stopWatch.Start(); + logTime.DebugFormat("Start " + System.Reflection.MethodBase.GetCurrentMethod().Name + ". Maintable={0}", maintableId); +#endif log.Debug("Start BuildForSelection"); @@ -234,14 +233,14 @@ public override bool BuildForSelection() } log.Debug("Done BuildForSelection"); - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(System.Reflection.MethodBase.GetCurrentMethod().Name+" Done in ms = {0}", stopWatch.ElapsedMilliseconds); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0}", stopWatch.ElapsedMilliseconds); +#endif return true; } - + public override void ApplyValueSet(String variableCode, ValueSetInfo valueSet) { //Implements IPXModelBuilder.ApplyValueSet @@ -341,11 +340,11 @@ public override void ApplyGrouping(string variableCode, GroupingInfo groupInfo, /// public override bool BuildForPresentation(PCAxis.Paxiom.Selection[] selections) { - #if DEBUG - System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); - stopWatch.Start(); - logTime.DebugFormat("Start " + System.Reflection.MethodBase.GetCurrentMethod().Name + ". Maintable={0}", maintableId); - #endif +#if DEBUG + System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); + stopWatch.Start(); + logTime.DebugFormat("Start " + System.Reflection.MethodBase.GetCurrentMethod().Name + ". Maintable={0}", maintableId); +#endif log.Debug("Start BuildForPresentation"); if (!_hasCalledSetPath) @@ -408,10 +407,10 @@ public override bool BuildForPresentation(PCAxis.Paxiom.Selection[] selections) #endif m_model.Data.Write(mPXSqlData.CreateMatrix(), 0, mPXSqlData.MatrixSize - 1); - if(mPXSqlData.DataNoteCellEntries.Count >0) + if (mPXSqlData.DataNoteCellEntries.Count > 0) { m_model.Data.WriteDataNoteCells(mPXSqlData.DataCellNotes, 0, mPXSqlData.MatrixSize - 1); - m_model.Data.UseDataCellMatrix= true; + m_model.Data.UseDataCellMatrix = true; } m_parser = PXSqlParseMetaPostData.GetPXSqlParseMetaPostData(mPXSqlMeta, mPXSqlData); @@ -439,13 +438,13 @@ public override bool BuildForPresentation(PCAxis.Paxiom.Selection[] selections) throw; } log.Debug("Done BuildForPresentation"); - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0}", stopWatch.ElapsedMilliseconds); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0}", stopWatch.ElapsedMilliseconds); +#endif return true; } - + private StringCollection getLanguagesPxsQueryCreation() { StringCollection langs = new StringCollection(); diff --git a/PCAxis.Sql/DbConfig/Col.cs b/PCAxis.Sql/DbConfig/Col.cs index a53004b..852cb0e 100644 --- a/PCAxis.Sql/DbConfig/Col.cs +++ b/PCAxis.Sql/DbConfig/Col.cs @@ -16,7 +16,7 @@ public class Col // The alias of the table private string tableAlias; - + public Col(string colName, string tableAliasBase) { this.colName = colName; @@ -51,7 +51,7 @@ public string Label() { return this.tableAlias + "_" + this.colName; } - + /// /// Id() + " AS " + Label() /// @@ -68,7 +68,7 @@ public string ForSelect() /// public string Is(string constantValue) { - return this.Id() + " = '" + constantValue + "'"; + return this.Id() + " = '" + constantValue + "'"; } /// @@ -89,51 +89,51 @@ public string Like(string wildcard) public string In(ICollection listOfValues) { string concatedValues = ""; - string glue =""; + string glue = ""; /// int NumberOfValues = 1; - concatedValues = "(" + this.Id() + " IN ("; - + concatedValues = "(" + this.Id() + " IN ("; + foreach (string val in listOfValues) { if (NumberOfValues >= 250) { - concatedValues = concatedValues + ") OR "+ this.Id() + " IN ('" + val + "'"; - NumberOfValues = 1; + concatedValues = concatedValues + ") OR " + this.Id() + " IN ('" + val + "'"; + NumberOfValues = 1; + } + else + { + concatedValues = concatedValues + glue + "'" + val + "'"; + glue = ", "; + NumberOfValues++; } - else - { - concatedValues = concatedValues + glue + "'" + val + "'"; - glue = ", "; - NumberOfValues++; - } } - return concatedValues + "))"; + return concatedValues + "))"; } - public string In(StringCollection listOfValues) + public string In(StringCollection listOfValues) { string concatedValues = ""; - string glue =""; + string glue = ""; /// int NumberOfValues = 1; - concatedValues = "(" + this.Id() + " IN ("; - + concatedValues = "(" + this.Id() + " IN ("; + foreach (string val in listOfValues) { if (NumberOfValues >= 250) { - concatedValues = concatedValues + ") OR "+ this.Id() + " IN ('" + val + "'"; - NumberOfValues = 1; + concatedValues = concatedValues + ") OR " + this.Id() + " IN ('" + val + "'"; + NumberOfValues = 1; + } + else + { + concatedValues = concatedValues + glue + "'" + val + "'"; + glue = ", "; + NumberOfValues++; } - else - { - concatedValues = concatedValues + glue + "'" + val + "'"; - glue = ", "; - NumberOfValues++; - } } - return concatedValues + "))"; + return concatedValues + "))"; } /// @@ -143,7 +143,7 @@ public string In(StringCollection listOfValues) /// public string IsUppered(string constantValue) { - return "upper("+this.Id() + ") = upper('" + constantValue + "')"; + return "upper(" + this.Id() + ") = upper('" + constantValue + "')"; } @@ -175,6 +175,6 @@ public string IsNotNULL() { return this.Id() + " IS NOT NULL"; } - + } } diff --git a/PCAxis.Sql/DbConfig/Column4Parameterized.cs b/PCAxis.Sql/DbConfig/Column4Parameterized.cs index cefb422..ed1e7ef 100644 --- a/PCAxis.Sql/DbConfig/Column4Parameterized.cs +++ b/PCAxis.Sql/DbConfig/Column4Parameterized.cs @@ -1,11 +1,12 @@ using System.Collections.Specialized; using System.Data; using System.Data.Common; - -using Oracle.ManagedDataAccess.Client; using System.Text;// For Oracle-connections. + using Microsoft.Data.SqlClient; +using Oracle.ManagedDataAccess.Client; + namespace PCAxis.Sql.DbConfig { @@ -76,7 +77,7 @@ public string Label() public string ForSelect() { var doubleQuote = @""""; - if (this.PureColumnName().ToUpper() == "DEFAULT") return this.tableAlias + "." + doubleQuote + this.PureColumnName() + doubleQuote + " AS " + this.Label(); + if (this.PureColumnName().ToUpper() == "DEFAULT") return this.tableAlias + "." + doubleQuote + this.PureColumnName() + doubleQuote + " AS " + this.Label(); return this.Id() + " AS " + this.Label(); } diff --git a/PCAxis.Sql/DbConfig/ConfigDatamodelMenu/ConfigDatamodelMenuSqlDbConfigExtensions.cs b/PCAxis.Sql/DbConfig/ConfigDatamodelMenu/ConfigDatamodelMenuSqlDbConfigExtensions.cs index 93df16c..cd35d37 100644 --- a/PCAxis.Sql/DbConfig/ConfigDatamodelMenu/ConfigDatamodelMenuSqlDbConfigExtensions.cs +++ b/PCAxis.Sql/DbConfig/ConfigDatamodelMenu/ConfigDatamodelMenuSqlDbConfigExtensions.cs @@ -1,69 +1,61 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.Serialization.Formatters.Binary; -using System.IO; -using System.Reflection; - -namespace PCAxis.Sql.DbConfig.ConfigDatamodelMenuExtensions +namespace PCAxis.Sql.DbConfig.ConfigDatamodelMenuExtensions { - /// - /// Extensions for hiding the fact from PCAxis.Menu, that there are different classes of SqlDbConfig for the different metamodels. - /// Agreed on with Norway, June 2013. - /// - public static class ConfigDatamodelMenuSqlDbConfigExtensions - { - public static string GetKeyword(this SqlDbConfig sqlDbConfig, string name) - { - return - sqlDbConfig.getFieldValue("Keywords").getFieldValue(name).ToString(); - } + /// + /// Extensions for hiding the fact from PCAxis.Menu, that there are different classes of SqlDbConfig for the different metamodels. + /// Agreed on with Norway, June 2013. + /// + public static class ConfigDatamodelMenuSqlDbConfigExtensions + { + public static string GetKeyword(this SqlDbConfig sqlDbConfig, string name) + { + return + sqlDbConfig.getFieldValue("Keywords").getFieldValue(name).ToString(); + } + + public static string GetTableNameAndAlias(this SqlDbConfig sqlDbConfig, string table, string languageCode) + { + var tab = sqlDbConfig.getFieldValue(table); - public static string GetTableNameAndAlias(this SqlDbConfig sqlDbConfig, string table, string languageCode) - { - var tab = sqlDbConfig.getFieldValue(table); - - return - ( - tab is Lang2Tab - ? - tab.getMethodValue("GetNameAndAlias", languageCode) - : - tab.getMethodValue("GetNameAndAlias") - ).ToString(); - } + return + ( + tab is Lang2Tab + ? + tab.getMethodValue("GetNameAndAlias", languageCode) + : + tab.getMethodValue("GetNameAndAlias") + ).ToString(); + } - public static string GetColumnName(this SqlDbConfig sqlDbConfig, string table, string column) - { + public static string GetColumnName(this SqlDbConfig sqlDbConfig, string table, string column) + { var col = sqlDbConfig.getFieldValue(table).getFieldValue(column + "Col"); string myOut = (col.getMethodValue("PureColumnName")).ToString(); return myOut; - } + } - public static string GetColumnId(this SqlDbConfig sqlDbConfig, string table, string column, string languageCode) - { - var col = sqlDbConfig.getFieldValue(table).getFieldValue(column + "Col"); + public static string GetColumnId(this SqlDbConfig sqlDbConfig, string table, string column, string languageCode) + { + var col = sqlDbConfig.getFieldValue(table).getFieldValue(column + "Col"); - return - ( - col is Lang2Col - ? - col.getMethodValue("Id", languageCode) - : - col.getMethodValue("Id") - ).ToString(); - } + return + ( + col is Lang2Col + ? + col.getMethodValue("Id", languageCode) + : + col.getMethodValue("Id") + ).ToString(); + } - private static object getFieldValue(this object o, string name) - { - return o.GetType().GetField(name).GetValue(o); - } + private static object getFieldValue(this object o, string name) + { + return o.GetType().GetField(name).GetValue(o); + } - private static object getMethodValue(this object o, string name, params object[] parameters) - { - return - o.GetType().GetMethod(name).Invoke(o, parameters.Length == 0 ? null : parameters); - } - } + private static object getMethodValue(this object o, string name, params object[] parameters) + { + return + o.GetType().GetMethod(name).Invoke(o, parameters.Length == 0 ? null : parameters); + } + } } diff --git a/PCAxis.Sql/DbConfig/Database_partial.cs b/PCAxis.Sql/DbConfig/Database_partial.cs index 74fa4e0..14d6923 100644 --- a/PCAxis.Sql/DbConfig/Database_partial.cs +++ b/PCAxis.Sql/DbConfig/Database_partial.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace PCAxis.Sql.DbConfig +namespace PCAxis.Sql.DbConfig { - public partial class Database + public partial class Database { private LanguageType mainLanguageField; @@ -22,14 +18,17 @@ public LanguageType MainLanguage } - public void postSerialize(){ - foreach (LanguageType lang in Languages) { - if (lang.main) { + public void postSerialize() + { + foreach (LanguageType lang in Languages) + { + if (lang.main) + { mainLanguageField = lang; break; } } - } + } + } } -} \ No newline at end of file diff --git a/PCAxis.Sql/DbConfig/DefaultDbStringProvider.cs b/PCAxis.Sql/DbConfig/DefaultDbStringProvider.cs index 6c95ce6..df732c5 100644 --- a/PCAxis.Sql/DbConfig/DefaultDbStringProvider.cs +++ b/PCAxis.Sql/DbConfig/DefaultDbStringProvider.cs @@ -1,12 +1,9 @@ using System; -using System.Collections.Generic; using System.Data.Common; -using System.Linq; -using System.Text; namespace PCAxis.Sql.DbConfig { - class DefaultDbStringProvider : IDbStringProvider + class DefaultDbStringProvider : IDbStringProvider { public string GetConnectionString(SqlDbConfig config, string user, string password) @@ -23,7 +20,7 @@ public string GetConnectionString(SqlDbConfig config, string user, string passwo throw new Exception("Please add DefaultUser and DefaultPassword"); } - return GetConnectionString(config, config.Database.Connection.DefaultUser, config.Database.Connection.DefaultPassword); + return GetConnectionString(config, config.Database.Connection.DefaultUser, config.Database.Connection.DefaultPassword); } else { @@ -44,7 +41,7 @@ public string GetConnectionString(SqlDbConfig config, string user, string passwo } return connBuilder.ConnectionString; } - + } } } diff --git a/PCAxis.Sql/DbConfig/IDbStringProvider.cs b/PCAxis.Sql/DbConfig/IDbStringProvider.cs index 99fd1dc..d9f205a 100644 --- a/PCAxis.Sql/DbConfig/IDbStringProvider.cs +++ b/PCAxis.Sql/DbConfig/IDbStringProvider.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace PCAxis.Sql.DbConfig +namespace PCAxis.Sql.DbConfig { public interface IDbStringProvider { diff --git a/PCAxis.Sql/DbConfig/InfoForDbConnection.cs b/PCAxis.Sql/DbConfig/InfoForDbConnection.cs index 06ef22b..8295317 100644 --- a/PCAxis.Sql/DbConfig/InfoForDbConnection.cs +++ b/PCAxis.Sql/DbConfig/InfoForDbConnection.cs @@ -1,14 +1,17 @@ -namespace PCAxis.Sql.DbConfig { +namespace PCAxis.Sql.DbConfig +{ /// /// Holds the 3 strings needed by the PxSqlCommand constructor. /// The purpose of this class is just to keep the 3 strings in one place. /// - public class InfoForDbConnection { + public class InfoForDbConnection + { public readonly string DataBaseType; public readonly string DataProvider; public readonly string ConnectionString; - public InfoForDbConnection(string aDataBaseType, string aDataProvider, string aConnectionString) { + public InfoForDbConnection(string aDataBaseType, string aDataProvider, string aConnectionString) + { DataBaseType = aDataBaseType; DataProvider = aDataProvider; ConnectionString = aConnectionString; diff --git a/PCAxis.Sql/DbConfig/Lang2Tab.cs b/PCAxis.Sql/DbConfig/Lang2Tab.cs index f15e7fa..518c22e 100644 --- a/PCAxis.Sql/DbConfig/Lang2Tab.cs +++ b/PCAxis.Sql/DbConfig/Lang2Tab.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; -using System.Text; namespace PCAxis.Sql.DbConfig { public class Lang2Tab { - + // The name of the table in the database without language suffix private string localTableNameBase; @@ -17,7 +16,7 @@ public String TableName { get { return localTableNameBase; } } - + // The alias of the table without language suffix private string tableAliasBase; /// @@ -28,7 +27,7 @@ public String Alias get { return tableAliasBase; } } - + private Dictionary metaSuffixByLanguage; internal Dictionary Suffixes { @@ -36,10 +35,10 @@ internal Dictionary Suffixes } private string metaOwner; - - - internal Lang2Tab(string tableAliasBase, string localTableNameBase, string metaOwner,Dictionary metaSuffixByLanguage) + + + internal Lang2Tab(string tableAliasBase, string localTableNameBase, string metaOwner, Dictionary metaSuffixByLanguage) { this.tableAliasBase = tableAliasBase; this.localTableNameBase = localTableNameBase; @@ -55,8 +54,8 @@ internal Lang2Tab(string tableAliasBase, string localTableNameBase, string metaO /// /// public string GetNameAndAlias(string languageCode) - { - return this.metaOwner+this.localTableNameBase+this.metaSuffixByLanguage[languageCode] + " " + this.tableAliasBase + this.metaSuffixByLanguage[languageCode]; - } + { + return this.metaOwner + this.localTableNameBase + this.metaSuffixByLanguage[languageCode] + " " + this.tableAliasBase + this.metaSuffixByLanguage[languageCode]; + } } } diff --git a/PCAxis.Sql/DbConfig/SqlDbConfig.cs b/PCAxis.Sql/DbConfig/SqlDbConfig.cs index fea8823..7699621 100644 --- a/PCAxis.Sql/DbConfig/SqlDbConfig.cs +++ b/PCAxis.Sql/DbConfig/SqlDbConfig.cs @@ -1,16 +1,13 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Globalization; -using System.Text; using System.Xml; -using System.Xml.XPath; using System.Xml.Serialization; -using PCAxis.Sql.Exceptions; -using System.Data.Common; +using System.Xml.XPath; using log4net; -using log4net.Config; + +using PCAxis.Sql.Exceptions; namespace PCAxis.Sql.DbConfig @@ -65,7 +62,7 @@ public LanguageType MainLanguage } } - + /// /// the @id of this part of the config-file, get value in construktor, has no value in the beginning of the Factory-method, usefull in errormessages. /// @@ -78,7 +75,7 @@ public LanguageType MainLanguage /// private string defaultConnectionString; - + /// /// keyForUserName in the connectionstring (depends on vendor) /// @@ -127,9 +124,9 @@ public string MetaOwner { get { return mMetatablesSchema; } } - - + + /// Reads the part of the config file that corresponds to SqlDbConfig/Database[@id='_this_database_']" /// and returns a SqlDbConfig for the CNMM-version (@metaModel). @@ -185,10 +182,10 @@ public static SqlDbConfig GetSqlDbConfig(XmlReader xmlReader, XPathNavigator nav } } - + protected SqlDbConfig(XmlReader xmlReader, XPathNavigator nav) { - + string docPath = "."; XPathNavigator node = nav.SelectSingleNode(docPath); myID = node.SelectSingleNode("@id").Value; @@ -200,7 +197,7 @@ protected SqlDbConfig(XmlReader xmlReader, XPathNavigator nav) mDatabase = (Database)serializer.Deserialize(xmlReader); mDatabase.postSerialize(); - + foreach (LanguageType lang in mDatabase.Languages) { @@ -208,12 +205,12 @@ protected SqlDbConfig(XmlReader xmlReader, XPathNavigator nav) } //had to use v2_1 not 2.1 in xsd, the xsd.exe dont like "." this.mMetaModel = mDatabase.metaModel.ToString(); - this.mMainLanguage = mDatabase.MainLanguage; - - + this.mMainLanguage = mDatabase.MainLanguage; + + this.mUseTemporaryTables = mDatabase.Connection.useTemporaryTables; this.setMetatablesSchema(); - + // this.defaultConnectionString = mDatabase.Connection.ConnectionString; @@ -250,10 +247,10 @@ protected SqlDbConfig(XmlReader xmlReader, XPathNavigator nav) } this.defaultConnectionString = this.GetConnectionString(mDatabase.Connection.DefaultUser, mDatabase.Connection.DefaultPassword); } - - - if ( MetaModel.Equals("2.1") || MetaModel.Equals("2.0")) + + + if (MetaModel.Equals("2.1") || MetaModel.Equals("2.0")) { allowConfigDefaults = false; } @@ -262,7 +259,7 @@ protected SqlDbConfig(XmlReader xmlReader, XPathNavigator nav) allowConfigDefaults = mDatabase.allowConfigDefaults; } } - + #region Methods @@ -270,7 +267,8 @@ protected SqlDbConfig(XmlReader xmlReader, XPathNavigator nav) internal void ResetConnectionString(string newConnectionstring) { - if (newConnectionstring.IndexOf("=USER;") > -1) { + if (newConnectionstring.IndexOf("=USER;") > -1) + { throw new ConfigException("The text =USER is present in the newConnectionstring or it is empty"); } this.defaultConnectionString = newConnectionstring; @@ -282,7 +280,8 @@ private void setMetatablesSchema() if (mDatabase.Connection.metatablesSchema == null) { mMetatablesSchema = ""; - } else + } + else { mMetatablesSchema = mDatabase.Connection.metatablesSchema.Trim() + "."; } @@ -290,7 +289,7 @@ private void setMetatablesSchema() - + /// /// Gets the description for the database so the user may choose a nice one @@ -307,7 +306,7 @@ public string GetDescription(string langCode) } } // if description for lang not found, then throw exception - throw new ConfigException(41, "Description for lanuage " + langCode + " does not exist." ); + throw new ConfigException(41, "Description for lanuage " + langCode + " does not exist."); } private string GetDatabaseType() @@ -331,13 +330,13 @@ public string GetDataProvider() /// public InfoForDbConnection GetInfoForDbConnection(String user, String password) { - return GetInfoForDbConnection(this.GetConnectionString(user, password)); + return GetInfoForDbConnection(this.GetConnectionString(user, password)); } - public InfoForDbConnection GetInfoForDbConnection(string connectionString) - { + public InfoForDbConnection GetInfoForDbConnection(string connectionString) + { - return new InfoForDbConnection(this.GetDatabaseType(), this.GetDataProvider(), connectionString); + return new InfoForDbConnection(this.GetDatabaseType(), this.GetDataProvider(), connectionString); } /// @@ -348,12 +347,12 @@ public InfoForDbConnection GetInfoForDbConnection(string connectionString) /// The ready to use connectionstring private string GetConnectionString(String user, String password) { - return GetDbStringProvider().GetConnectionString(this, user, password); + return GetDbStringProvider().GetConnectionString(this, user, password); } private IDbStringProvider GetDbStringProvider() { - + if (string.IsNullOrEmpty(this.Database.Connection.ConnectionStringProvider)) { return new DefaultDbStringProvider(); @@ -362,8 +361,8 @@ private IDbStringProvider GetDbStringProvider() return Activator.CreateInstance(Type.GetType(this.Database.Connection.ConnectionStringProvider)) as IDbStringProvider; } - - + + /// /// replaces the user and password in the connection string with default user and password /// @@ -411,7 +410,7 @@ public Boolean isSecondaryLanguage(String langCode) return !mDatabase.MainLanguage.code.Equals(langCode); } - + /// /// return all the language codes spesifyed in this config( intended to be used when @@ -465,7 +464,7 @@ protected string ExtractTableName(string ModelName, string defaultLocalTableName XPathNavigator tableNode = node.SelectSingleNode("@tableName"); - if (tableNode == null) + if (tableNode == null) { if (allowConfigDefaults) { @@ -475,10 +474,12 @@ protected string ExtractTableName(string ModelName, string defaultLocalTableName return tableNode.Value; - } catch (System.Xml.XPath.XPathException XPathExp) + } + catch (System.Xml.XPath.XPathException XPathExp) { throw new ConfigException(XPathExp.Message); - } catch (System.Exception otherExp) + } + catch (System.Exception otherExp) { throw new ConfigException(errFindTable + ModelName, otherExp); } @@ -519,7 +520,7 @@ protected string ExtractAliasName(string ModelName, string defaultTableAlias) return defaultTableAlias; } } - XPathNavigator aliasNode =node.SelectSingleNode("@alias"); + XPathNavigator aliasNode = node.SelectSingleNode("@alias"); if (aliasNode == null) { if (allowConfigDefaults) @@ -529,10 +530,12 @@ protected string ExtractAliasName(string ModelName, string defaultTableAlias) } return aliasNode.Value; - } catch (System.Xml.XPath.XPathException XPathExp) + } + catch (System.Xml.XPath.XPathException XPathExp) { throw new ConfigException(XPathExp.Message); - } catch (System.Exception otherExp) + } + catch (System.Exception otherExp) { throw new ConfigException(errFindAlias + ModelName, otherExp); } @@ -560,12 +563,12 @@ protected string ExtractColumnName(string tableModelName, string columnModelName /// If the column is not spesified in the config-xml and allowConfigDefaults, this value is returned. /// the local column name protected string ExtractColumnName(string tableModelName, string columnModelName, string defaultLocalColumnName) - { - + { + string docPath; try { - + docPath = "Tables/Table[@modelName='" + tableModelName + "']"; XPathNavigator tableNode = nav.SelectSingleNode(docPath); @@ -583,7 +586,7 @@ protected string ExtractColumnName(string tableModelName, string columnModelName } string colPath = "Columns/Column[@modelName='" + columnModelName + "']"; - XPathNavigator colNode = tableNode.SelectSingleNode( colPath ); + XPathNavigator colNode = tableNode.SelectSingleNode(colPath); if (colNode == null) { @@ -607,14 +610,17 @@ protected string ExtractColumnName(string tableModelName, string columnModelName } return theNode.Value; - } catch (ConfigException e) + } + catch (ConfigException e) { - throw e; + throw e; - } catch (System.Xml.XPath.XPathException XPathExp) + } + catch (System.Xml.XPath.XPathException XPathExp) { throw new ConfigException(XPathExp.Message); - } catch (System.Exception otherExp) + } + catch (System.Exception otherExp) { throw new ConfigException(errFindColumn1 + tableModelName + errFindColumn2 + columnModelName, otherExp); } @@ -691,8 +697,8 @@ protected bool FileHasKeyword(string modelName) protected string ExtractKeyword(string modelName) { this.allowConfigDefaults = false; - - return this.ExtractKeyword(modelName,"BUGBUGBUG"); + + return this.ExtractKeyword(modelName, "BUGBUGBUG"); } /// @@ -710,7 +716,7 @@ protected string ExtractKeyword(string modelName, string defaultKeywordName) XPathNavigator node = nav.SelectSingleNode(docPath); if (node == null) { - + if (allowConfigDefaults) { return defaultKeywordName; @@ -719,7 +725,7 @@ protected string ExtractKeyword(string modelName, string defaultKeywordName) { throw new ConfigException(503, modelName, myID); } - + } @@ -735,11 +741,11 @@ protected string ExtractKeyword(string modelName, string defaultKeywordName) return theNode.Value; } - - + + } - #endregion + #endregion } diff --git a/PCAxis.Sql/DbConfig/SqlDbConfig_21.cs b/PCAxis.Sql/DbConfig/SqlDbConfig_21.cs index 1423b72..ed970c8 100644 --- a/PCAxis.Sql/DbConfig/SqlDbConfig_21.cs +++ b/PCAxis.Sql/DbConfig/SqlDbConfig_21.cs @@ -2,6 +2,7 @@ using System.Globalization; using System.Xml; using System.Xml.XPath; + using log4net; //This code is generated. @@ -252,7 +253,7 @@ public SqlDbConfig_21(XmlReader xmlReader, XPathNavigator nav) #region structs - + public class TblContents : Tab { diff --git a/PCAxis.Sql/DbConfig/SqlDbConfig_22.cs b/PCAxis.Sql/DbConfig/SqlDbConfig_22.cs index 466c3f6..ae11eba 100644 --- a/PCAxis.Sql/DbConfig/SqlDbConfig_22.cs +++ b/PCAxis.Sql/DbConfig/SqlDbConfig_22.cs @@ -1,7 +1,7 @@ using System; -using System.Globalization; using System.Xml; using System.Xml.XPath; + using log4net; //This code is generated. @@ -214,7 +214,7 @@ public SqlDbConfig_22(XmlReader xmlReader, XPathNavigator nav) #region structs - + /// /// The table contains information on the content of the data table(s).The content column's name is the same as the name of the corresponding data columns in the data table. @@ -324,9 +324,9 @@ public class TblContents : Tab public Col StoreColumnNoCol; internal TblContents(SqlDbConfig_22 config) - : base(config.ExtractAliasName("Contents","CNT"), config.ExtractTableName("Contents","CONTENTS"), config.MetaOwner) + : base(config.ExtractAliasName("Contents", "CNT"), config.ExtractTableName("Contents", "CONTENTS"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Contents", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("Contents", "Contents", "CONTENTS"); @@ -421,22 +421,22 @@ public class TblContentsLang2 : Lang2Tab public Lang2Col UnitCol; internal TblContentsLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ContentsLang2","CN2"), config.ExtractTableName("ContentsLang2","CONTENTS_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ContentsLang2", "CN2"), config.ExtractTableName("ContentsLang2", "CONTENTS_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ContentsLang2", "MainTable" , "MAINTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ContentsLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "Contents" , "CONTENTS"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "Contents", "CONTENTS"); this.ContentsCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "BasePeriod" , "BASEPERIOD"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "BasePeriod", "BASEPERIOD"); this.BasePeriodCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresTextS" , "PRESTEXTS"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresTextS", "PRESTEXTS"); this.PresTextSCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "RefPeriod" , "REFPERIOD"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "RefPeriod", "REFPERIOD"); this.RefPeriodCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "Unit" , "UNIT"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "Unit", "UNIT"); this.UnitCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -463,9 +463,9 @@ public class TblContentsTime : Tab public Col TimePeriodCol; internal TblContentsTime(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ContentsTime","CTM"), config.ExtractTableName("ContentsTime","CONTENTSTIME"), config.MetaOwner) + : base(config.ExtractAliasName("ContentsTime", "CTM"), config.ExtractTableName("ContentsTime", "CONTENTSTIME"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ContentsTime", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("ContentsTime", "Contents", "CONTENTS"); @@ -497,9 +497,9 @@ public class TblDataStorage : Tab public Col DatabaseNameCol; internal TblDataStorage(SqlDbConfig_22 config) - : base(config.ExtractAliasName("DataStorage","DST"), config.ExtractTableName("DataStorage","DATASTORAGE"), config.MetaOwner) + : base(config.ExtractAliasName("DataStorage", "DST"), config.ExtractTableName("DataStorage", "DATASTORAGE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("DataStorage", "ProductId", "PRODUCTID"); this.ProductIdCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("DataStorage", "ServerName", "SERVERNAME"); @@ -539,9 +539,9 @@ public class TblFootnote : Tab public Col FootnoteTextCol; internal TblFootnote(SqlDbConfig_22 config) - : base(config.ExtractAliasName("Footnote","FNT"), config.ExtractTableName("Footnote","FOOTNOTE"), config.MetaOwner) + : base(config.ExtractAliasName("Footnote", "FNT"), config.ExtractTableName("Footnote", "FOOTNOTE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Footnote", "FootnoteNo", "FOOTNOTENO"); this.FootnoteNoCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("Footnote", "FootnoteType", "FOOTNOTETYPE"); @@ -571,12 +571,12 @@ public class TblFootnoteLang2 : Lang2Tab public Lang2Col FootnoteTextCol; internal TblFootnoteLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteLang2","FN2"), config.ExtractTableName("FootnoteLang2","FOOTNOTE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("FootnoteLang2", "FN2"), config.ExtractTableName("FootnoteLang2", "FOOTNOTE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteNo" , "FOOTNOTENO"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteNo", "FOOTNOTENO"); this.FootnoteNoCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteText" , "FOOTNOTETEXT"); + tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteText", "FOOTNOTETEXT"); this.FootnoteTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -611,9 +611,9 @@ public class TblFootnoteContTime : Tab public Col CellnoteCol; internal TblFootnoteContTime(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteContTime","FCT"), config.ExtractTableName("FootnoteContTime","FOOTNOTECONTTIME"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContTime", "FCT"), config.ExtractTableName("FootnoteContTime", "FOOTNOTECONTTIME"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContTime", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteContTime", "Contents", "CONTENTS"); @@ -665,9 +665,9 @@ public class TblFootnoteContValue : Tab public Col CellnoteCol; internal TblFootnoteContValue(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteContValue","FCA"), config.ExtractTableName("FootnoteContValue","FOOTNOTECONTVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContValue", "FCA"), config.ExtractTableName("FootnoteContValue", "FOOTNOTECONTVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContValue", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "Contents", "CONTENTS"); @@ -711,9 +711,9 @@ public class TblFootnoteContVbl : Tab public Col FootnoteNoCol; internal TblFootnoteContVbl(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteContVbl","FCB"), config.ExtractTableName("FootnoteContVbl","FOOTNOTECONTVBL"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContVbl", "FCB"), config.ExtractTableName("FootnoteContVbl", "FOOTNOTECONTVBL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContVbl", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteContVbl", "Contents", "CONTENTS"); @@ -747,9 +747,9 @@ public class TblFootnoteContents : Tab public Col FootnoteNoCol; internal TblFootnoteContents(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteContents","FCO"), config.ExtractTableName("FootnoteContents","FOOTNOTECONTENTS"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContents", "FCO"), config.ExtractTableName("FootnoteContents", "FOOTNOTECONTENTS"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContents", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteContents", "Contents", "CONTENTS"); @@ -777,9 +777,9 @@ public class TblFootnoteGrouping : Tab public Col FootnoteNoCol; internal TblFootnoteGrouping(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteGrouping","FCO"), config.ExtractTableName("FootnoteGrouping","FOOTNOTEGROUPING"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteGrouping", "FCO"), config.ExtractTableName("FootnoteGrouping", "FOOTNOTEGROUPING"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteGrouping", "Grouping", "GROUPING"); this.GroupingCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteGrouping", "FootnoteNo", "FOOTNOTENO"); @@ -805,9 +805,9 @@ public class TblFootnoteMainTable : Tab public Col FootnoteNoCol; internal TblFootnoteMainTable(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteMainTable","FMT"), config.ExtractTableName("FootnoteMainTable","FOOTNOTEMAINTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMainTable", "FMT"), config.ExtractTableName("FootnoteMainTable", "FOOTNOTEMAINTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMainTable", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteMainTable", "FootnoteNo", "FOOTNOTENO"); @@ -845,9 +845,9 @@ public class TblFootnoteMaintValue : Tab public Col FootnoteNoCol; internal TblFootnoteMaintValue(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteMaintValue","FMV"), config.ExtractTableName("FootnoteMaintValue","FOOTNOTEMAINTVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMaintValue", "FMV"), config.ExtractTableName("FootnoteMaintValue", "FOOTNOTEMAINTVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "Variable", "VARIABLE"); @@ -883,9 +883,9 @@ public class TblFootnoteMenuSel : Tab public Col FootnoteNoCol; internal TblFootnoteMenuSel(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteMenuSel","FMS"), config.ExtractTableName("FootnoteMenuSel","FOOTNOTEMENUSEL"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMenuSel", "FMS"), config.ExtractTableName("FootnoteMenuSel", "FOOTNOTEMENUSEL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMenuSel", "Menu", "MENU"); this.MenuCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteMenuSel", "Selection", "SELECTION"); @@ -917,9 +917,9 @@ public class TblFootnoteSubTable : Tab public Col FootnoteNoCol; internal TblFootnoteSubTable(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteSubTable","FST"), config.ExtractTableName("FootnoteSubTable","FOOTNOTESUBTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteSubTable", "FST"), config.ExtractTableName("FootnoteSubTable", "FOOTNOTESUBTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteSubTable", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteSubTable", "SubTable", "SUBTABLE"); @@ -951,9 +951,9 @@ public class TblFootnoteValue : Tab public Col FootnoteNoCol; internal TblFootnoteValue(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteValue","FVL"), config.ExtractTableName("FootnoteValue","FOOTNOTEVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteValue", "FVL"), config.ExtractTableName("FootnoteValue", "FOOTNOTEVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteValue", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteValue", "ValueCode", "VALUECODE"); @@ -981,9 +981,9 @@ public class TblFootnoteVariable : Tab public Col FootnoteNoCol; internal TblFootnoteVariable(SqlDbConfig_22 config) - : base(config.ExtractAliasName("FootnoteVariable","FVB"), config.ExtractTableName("FootnoteVariable","FOOTNOTEVARIABLE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteVariable", "FVB"), config.ExtractTableName("FootnoteVariable", "FOOTNOTEVARIABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteVariable", "Variable", "VARIABLE"); this.VariableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("FootnoteVariable", "FootnoteNo", "FOOTNOTENO"); @@ -1033,9 +1033,9 @@ public class TblGrouping : Tab public Col KDBidCol; internal TblGrouping(SqlDbConfig_22 config) - : base(config.ExtractAliasName("Grouping","GRP"), config.ExtractTableName("Grouping","GROUPING"), config.MetaOwner) + : base(config.ExtractAliasName("Grouping", "GRP"), config.ExtractTableName("Grouping", "GROUPING"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Grouping", "Grouping", "GROUPING"); this.GroupingCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("Grouping", "ValuePool", "VALUEPOOL"); @@ -1081,16 +1081,16 @@ public class TblGroupingLang2 : Lang2Tab public Lang2Col SortCodeCol; internal TblGroupingLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("GroupingLang2","GR2"), config.ExtractTableName("GroupingLang2","GROUPING_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("GroupingLang2", "GR2"), config.ExtractTableName("GroupingLang2", "GROUPING_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("GroupingLang2", "Grouping" , "GROUPING"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("GroupingLang2", "Grouping", "GROUPING"); this.GroupingCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLang2", "ValuePool" , "VALUEPOOL"); + tmpColumnName = config.ExtractColumnName("GroupingLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("GroupingLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("GroupingLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -1121,9 +1121,9 @@ public class TblGroupingLevel : Tab public Col GeoAreaNoCol; internal TblGroupingLevel(SqlDbConfig_22 config) - : base(config.ExtractAliasName("GroupingLevel","GRP"), config.ExtractTableName("GroupingLevel","GROUPINGLEVEL"), config.MetaOwner) + : base(config.ExtractAliasName("GroupingLevel", "GRP"), config.ExtractTableName("GroupingLevel", "GROUPINGLEVEL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("GroupingLevel", "Grouping", "GROUPING"); this.GroupingCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("GroupingLevel", "Level", "LEVEL"); @@ -1156,14 +1156,14 @@ public class TblGroupingLevelLang2 : Lang2Tab public Lang2Col LevelTextCol; internal TblGroupingLevelLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("GroupingLevelLang2","GR2"), config.ExtractTableName("GroupingLevelLang2","GROUPINGLEVEL_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("GroupingLevelLang2", "GR2"), config.ExtractTableName("GroupingLevelLang2", "GROUPINGLEVEL_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "Grouping" , "GROUPING"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "Grouping", "GROUPING"); this.GroupingCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "Level" , "LEVEL"); + tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "Level", "LEVEL"); this.LevelCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "LevelText" , "LEVELTEXT"); + tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "LevelText", "LEVELTEXT"); this.LevelTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -1214,9 +1214,9 @@ public class TblLink : Tab public Col DescriptionCol; internal TblLink(SqlDbConfig_22 config) - : base(config.ExtractAliasName("Link","LNK"), config.ExtractTableName("Link","LINK"), config.MetaOwner) + : base(config.ExtractAliasName("Link", "LNK"), config.ExtractTableName("Link", "LINK"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Link", "LinkId", "LINKID"); this.LinkIdCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("Link", "Link", "LINK"); @@ -1269,18 +1269,18 @@ public class TblLinkLang2 : Lang2Tab public Lang2Col DescriptionCol; internal TblLinkLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("LinkLang2","LN2"), config.ExtractTableName("LinkLang2","LINK_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("LinkLang2", "LN2"), config.ExtractTableName("LinkLang2", "LINK_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkId" , "LINKID"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkId", "LINKID"); this.LinkIdCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "Link" , "LINK"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "Link", "LINK"); this.LinkCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkText" , "LINKTEXT"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkText", "LINKTEXT"); this.LinkTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -1307,9 +1307,9 @@ public class TblLinkMenuSel : Tab public Col LinkIdCol; internal TblLinkMenuSel(SqlDbConfig_22 config) - : base(config.ExtractAliasName("LinkMenuSel","LMS"), config.ExtractTableName("LinkMenuSel","LINKMENUSEL"), config.MetaOwner) + : base(config.ExtractAliasName("LinkMenuSel", "LMS"), config.ExtractTableName("LinkMenuSel", "LINKMENUSEL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("LinkMenuSel", "Menu", "MENU"); this.MenuCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("LinkMenuSel", "Selection", "SELECTION"); @@ -1373,9 +1373,9 @@ public class TblMainTable : Tab public Col TimeScaleCol; internal TblMainTable(SqlDbConfig_22 config) - : base(config.ExtractAliasName("MainTable","MTA"), config.ExtractTableName("MainTable","MAINTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("MainTable", "MTA"), config.ExtractTableName("MainTable", "MAINTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MainTable", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("MainTable", "TableStatus", "TABLESTATUS"); @@ -1437,20 +1437,20 @@ public class TblMainTableLang2 : Lang2Tab public Lang2Col ContentsVariableCol; internal TblMainTableLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("MainTableLang2","MT2"), config.ExtractTableName("MainTableLang2","MAINTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("MainTableLang2", "MT2"), config.ExtractTableName("MainTableLang2", "MAINTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("MainTableLang2", "MainTable" , "MAINTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("MainTableLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "Status" , "STATUS"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "Status", "STATUS"); this.StatusCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "Published" , "PUBLISHED"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "Published", "PUBLISHED"); this.PublishedCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresTextS" , "PRESTEXTS"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresTextS", "PRESTEXTS"); this.PresTextSCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "ContentsVariable" , "CONTENTSVARIABLE"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "ContentsVariable", "CONTENTSVARIABLE"); this.ContentsVariableCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -1477,9 +1477,9 @@ public class TblMainTablePerson : Tab public Col RolePersonCol; internal TblMainTablePerson(SqlDbConfig_22 config) - : base(config.ExtractAliasName("MainTablePerson","MTP"), config.ExtractTableName("MainTablePerson","MAINTABLEPERSON"), config.MetaOwner) + : base(config.ExtractAliasName("MainTablePerson", "MTP"), config.ExtractTableName("MainTablePerson", "MAINTABLEPERSON"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MainTablePerson", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("MainTablePerson", "PersonCode", "PERSONCODE"); @@ -1519,9 +1519,9 @@ public class TblMainTableVariableHierarchy : Tab public Col AllLevelsStoredCol; internal TblMainTableVariableHierarchy(SqlDbConfig_22 config) - : base(config.ExtractAliasName("MainTableVariableHierarchy","MTP"), config.ExtractTableName("MainTableVariableHierarchy","MAINTABLEVARIABLEHIERARCHY"), config.MetaOwner) + : base(config.ExtractAliasName("MainTableVariableHierarchy", "MTP"), config.ExtractTableName("MainTableVariableHierarchy", "MAINTABLEVARIABLEHIERARCHY"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "Variable", "VARIABLE"); @@ -1581,9 +1581,9 @@ public class TblMenuSelection : Tab public Col InternalIdCol; internal TblMenuSelection(SqlDbConfig_22 config) - : base(config.ExtractAliasName("MenuSelection","MSL"), config.ExtractTableName("MenuSelection","MENUSELECTION"), config.MetaOwner) + : base(config.ExtractAliasName("MenuSelection", "MSL"), config.ExtractTableName("MenuSelection", "MENUSELECTION"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MenuSelection", "Menu", "MENU"); this.MenuCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("MenuSelection", "Selection", "SELECTION"); @@ -1646,22 +1646,22 @@ public class TblMenuSelectionLang2 : Lang2Tab public Lang2Col PresentationCol; internal TblMenuSelectionLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("MenuSelectionLang2","MS2"), config.ExtractTableName("MenuSelectionLang2","MENUSELECTION_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("MenuSelectionLang2", "MS2"), config.ExtractTableName("MenuSelectionLang2", "MENUSELECTION_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Menu" , "MENU"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Menu", "MENU"); this.MenuCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Selection" , "SELECTION"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Selection", "SELECTION"); this.SelectionCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresTextS" , "PRESTEXTS"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresTextS", "PRESTEXTS"); this.PresTextSCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Presentation" , "PRESENTATION"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Presentation", "PRESENTATION"); this.PresentationCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -1688,9 +1688,9 @@ public class TblMetaAdm : Tab public Col DescriptionCol; internal TblMetaAdm(SqlDbConfig_22 config) - : base(config.ExtractAliasName("MetaAdm","MAD"), config.ExtractTableName("MetaAdm","METAADM"), config.MetaOwner) + : base(config.ExtractAliasName("MetaAdm", "MAD"), config.ExtractTableName("MetaAdm", "METAADM"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MetaAdm", "Property", "PROPERTY"); this.PropertyCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("MetaAdm", "Value", "VALUE"); @@ -1722,9 +1722,9 @@ public class TblMetabaseInfo : Tab public Col DatabaseRoleCol; internal TblMetabaseInfo(SqlDbConfig_22 config) - : base(config.ExtractAliasName("MetabaseInfo","MBI"), config.ExtractTableName("MetabaseInfo","METABASEINFO"), config.MetaOwner) + : base(config.ExtractAliasName("MetabaseInfo", "MBI"), config.ExtractTableName("MetabaseInfo", "METABASEINFO"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MetabaseInfo", "Model", "MODEL"); this.ModelCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("MetabaseInfo", "ModelVersion", "MODELVERSION"); @@ -1768,9 +1768,9 @@ public class TblOrganization : Tab public Col InternalIdCol; internal TblOrganization(SqlDbConfig_22 config) - : base(config.ExtractAliasName("Organization","ORG"), config.ExtractTableName("Organization","ORGANIZATION"), config.MetaOwner) + : base(config.ExtractAliasName("Organization", "ORG"), config.ExtractTableName("Organization", "ORGANIZATION"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Organization", "OrganizationCode", "ORGANIZATIONCODE"); this.OrganizationCodeCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("Organization", "OrganizationName", "ORGANIZATIONNAME"); @@ -1812,16 +1812,16 @@ public class TblOrganizationLang2 : Lang2Tab public Lang2Col UnitCol; internal TblOrganizationLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("OrganizationLang2","OR2"), config.ExtractTableName("OrganizationLang2","ORGANIZATION_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("OrganizationLang2", "OR2"), config.ExtractTableName("OrganizationLang2", "ORGANIZATION_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationCode" , "ORGANIZATIONCODE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationCode", "ORGANIZATIONCODE"); this.OrganizationCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationName" , "ORGANIZATIONNAME"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationName", "ORGANIZATIONNAME"); this.OrganizationNameCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Department" , "DEPARTMENT"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Department", "DEPARTMENT"); this.DepartmentCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Unit" , "UNIT"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Unit", "UNIT"); this.UnitCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -1868,9 +1868,9 @@ public class TblPerson : Tab public Col EmailCol; internal TblPerson(SqlDbConfig_22 config) - : base(config.ExtractAliasName("Person","PRS"), config.ExtractTableName("Person","PERSON"), config.MetaOwner) + : base(config.ExtractAliasName("Person", "PRS"), config.ExtractTableName("Person", "PERSON"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Person", "PersonCode", "PERSONCODE"); this.PersonCodeCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("Person", "Forename", "FORENAME"); @@ -1924,9 +1924,9 @@ public class TblSpecialCharacter : Tab public Col PresTextCol; internal TblSpecialCharacter(SqlDbConfig_22 config) - : base(config.ExtractAliasName("SpecialCharacter","SPC"), config.ExtractTableName("SpecialCharacter","SPECIALCHARACTER"), config.MetaOwner) + : base(config.ExtractAliasName("SpecialCharacter", "SPC"), config.ExtractTableName("SpecialCharacter", "SPECIALCHARACTER"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SpecialCharacter", "CharacterType", "CHARACTERTYPE"); this.CharacterTypeCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "PresCharacter", "PRESCHARACTER"); @@ -1963,14 +1963,14 @@ public class TblSpecialCharacterLang2 : Lang2Tab public Lang2Col PresTextCol; internal TblSpecialCharacterLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("SpecialCharacterLang2","SP2"), config.ExtractTableName("SpecialCharacterLang2","SPECIALCHARACTER_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("SpecialCharacterLang2", "SP2"), config.ExtractTableName("SpecialCharacterLang2", "SPECIALCHARACTER_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "CharacterType" , "CHARACTERTYPE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "CharacterType", "CHARACTERTYPE"); this.CharacterTypeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresCharacter" , "PRESCHARACTER"); + tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresCharacter", "PRESCHARACTER"); this.PresCharacterCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -2001,9 +2001,9 @@ public class TblSubTable : Tab public Col CleanTableCol; internal TblSubTable(SqlDbConfig_22 config) - : base(config.ExtractAliasName("SubTable","STB"), config.ExtractTableName("SubTable","SUBTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("SubTable", "STB"), config.ExtractTableName("SubTable", "SUBTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SubTable", "SubTable", "SUBTABLE"); this.SubTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("SubTable", "MainTable", "MAINTABLE"); @@ -2036,14 +2036,14 @@ public class TblSubTableLang2 : Lang2Tab public Lang2Col PresTextCol; internal TblSubTableLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("SubTableLang2","ST2"), config.ExtractTableName("SubTableLang2","SUBTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("SubTableLang2", "ST2"), config.ExtractTableName("SubTableLang2", "SUBTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("SubTableLang2", "SubTable" , "SUBTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("SubTableLang2", "SubTable", "SUBTABLE"); this.SubTableCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SubTableLang2", "MainTable" , "MAINTABLE"); + tmpColumnName = config.ExtractColumnName("SubTableLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SubTableLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("SubTableLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -2082,9 +2082,9 @@ public class TblSubTableVariable : Tab public Col StoreColumnNoCol; internal TblSubTableVariable(SqlDbConfig_22 config) - : base(config.ExtractAliasName("SubTableVariable","STV"), config.ExtractTableName("SubTableVariable","SUBTABLEVARIABLE"), config.MetaOwner) + : base(config.ExtractAliasName("SubTableVariable", "STV"), config.ExtractTableName("SubTableVariable", "SUBTABLEVARIABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SubTableVariable", "MainTable", "MAINTABLE"); this.MainTableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("SubTableVariable", "SubTable", "SUBTABLE"); @@ -2126,9 +2126,9 @@ public class TblTextCatalog : Tab public Col DescriptionCol; internal TblTextCatalog(SqlDbConfig_22 config) - : base(config.ExtractAliasName("TextCatalog","TXC"), config.ExtractTableName("TextCatalog","TEXTCATALOG"), config.MetaOwner) + : base(config.ExtractAliasName("TextCatalog", "TXC"), config.ExtractTableName("TextCatalog", "TEXTCATALOG"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("TextCatalog", "TextCatalogNo", "TEXTCATALOGNO"); this.TextCatalogNoCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("TextCatalog", "TextType", "TEXTTYPE"); @@ -2166,16 +2166,16 @@ public class TblTextCatalogLang2 : Lang2Tab public Lang2Col DescriptionCol; internal TblTextCatalogLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("TextCatalogLang2","TX2"), config.ExtractTableName("TextCatalogLang2","TEXTCATALOG_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("TextCatalogLang2", "TX2"), config.ExtractTableName("TextCatalogLang2", "TEXTCATALOG_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextCatalogNo" , "TEXTCATALOGNO"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextCatalogNo", "TEXTCATALOGNO"); this.TextCatalogNoCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextType" , "TEXTTYPE"); + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextType", "TEXTTYPE"); this.TextTypeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -2218,9 +2218,9 @@ public class TblTimeScale : Tab public Col StoreFormatCol; internal TblTimeScale(SqlDbConfig_22 config) - : base(config.ExtractAliasName("TimeScale","TSC"), config.ExtractTableName("TimeScale","TIMESCALE"), config.MetaOwner) + : base(config.ExtractAliasName("TimeScale", "TSC"), config.ExtractTableName("TimeScale", "TIMESCALE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("TimeScale", "TimeScale", "TIMESCALE"); this.TimeScaleCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("TimeScale", "PresText", "PRESTEXT"); @@ -2254,12 +2254,12 @@ public class TblTimeScaleLang2 : Lang2Tab public Lang2Col PresTextCol; internal TblTimeScaleLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("TimeScaleLang2","TS2"), config.ExtractTableName("TimeScaleLang2","TIMESCALE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("TimeScaleLang2", "TS2"), config.ExtractTableName("TimeScaleLang2", "TIMESCALE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "TimeScale" , "TIMESCALE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "TimeScale", "TIMESCALE"); this.TimeScaleCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -2298,9 +2298,9 @@ public class TblValue : Tab public Col FootnoteCol; internal TblValue(SqlDbConfig_22 config) - : base(config.ExtractAliasName("Value","VAL"), config.ExtractTableName("Value","VALUE"), config.MetaOwner) + : base(config.ExtractAliasName("Value", "VAL"), config.ExtractTableName("Value", "VALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Value", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("Value", "ValueCode", "VALUECODE"); @@ -2347,18 +2347,18 @@ public class TblValueLang2 : Lang2Tab public Lang2Col ValueTextLCol; internal TblValueLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ValueLang2","VA2"), config.ExtractTableName("ValueLang2","VALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValueLang2", "VA2"), config.ExtractTableName("ValueLang2", "VALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValuePool" , "VALUEPOOL"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueCode" , "VALUECODE"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueCode", "VALUECODE"); this.ValueCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextS" , "VALUETEXTS"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextS", "VALUETEXTS"); this.ValueTextSCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextL" , "VALUETEXTL"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextL", "VALUETEXTL"); this.ValueTextLCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -2401,9 +2401,9 @@ public class TblValueExtra : Tab public Col ValueTextX4Col; internal TblValueExtra(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ValueExtra","VXT"), config.ExtractTableName("ValueExtra","VALUEEXTRA"), config.MetaOwner) + : base(config.ExtractAliasName("ValueExtra", "VXT"), config.ExtractTableName("ValueExtra", "VALUEEXTRA"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValueExtra", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("ValueExtra", "ValueCode", "VALUECODE"); @@ -2462,22 +2462,22 @@ public class TblValueExtraLang2 : Lang2Tab public Lang2Col ValueTextX4Col; internal TblValueExtraLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ValueExtraLang2","VX2"), config.ExtractTableName("ValueExtraLang2","VALUEEXTRA_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValueExtraLang2", "VX2"), config.ExtractTableName("ValueExtraLang2", "VALUEEXTRA_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValuePool" , "VALUEPOOL"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValueCode" , "VALUECODE"); + tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValueCode", "VALUECODE"); this.ValueCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "Unit" , "UNIT"); + tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "Unit", "UNIT"); this.UnitCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValueTextX1" , "VALUETEXTX1"); + tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValueTextX1", "VALUETEXTX1"); this.ValueTextX1Col = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValueTextX2" , "VALUETEXTX2"); + tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValueTextX2", "VALUETEXTX2"); this.ValueTextX2Col = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValueTextX3" , "VALUETEXTX3"); + tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValueTextX3", "VALUETEXTX3"); this.ValueTextX3Col = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValueTextX4" , "VALUETEXTX4"); + tmpColumnName = config.ExtractColumnName("ValueExtraLang2", "ValueTextX4", "VALUETEXTX4"); this.ValueTextX4Col = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -2520,9 +2520,9 @@ public class TblValueGroup : Tab public Col SortCodeCol; internal TblValueGroup(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ValueGroup","VPL"), config.ExtractTableName("ValueGroup","VALUEGROUP"), config.MetaOwner) + : base(config.ExtractAliasName("ValueGroup", "VPL"), config.ExtractTableName("ValueGroup", "VALUEGROUP"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValueGroup", "Grouping", "GROUPING"); this.GroupingCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("ValueGroup", "GroupCode", "GROUPCODE"); @@ -2571,18 +2571,18 @@ public class TblValueGroupLang2 : Lang2Tab public Lang2Col SortCodeCol; internal TblValueGroupLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ValueGroupLang2","VL2"), config.ExtractTableName("ValueGroupLang2","VALUEGROUP_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValueGroupLang2", "VL2"), config.ExtractTableName("ValueGroupLang2", "VALUEGROUP_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "Grouping" , "GROUPING"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "Grouping", "GROUPING"); this.GroupingCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "GroupCode" , "GROUPCODE"); + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "GroupCode", "GROUPCODE"); this.GroupCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "ValueCode" , "VALUECODE"); + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "ValueCode", "VALUECODE"); this.ValueCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "ValuePool" , "VALUEPOOL"); + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -2625,9 +2625,9 @@ public class TblValuePool : Tab public Col KDBIdCol; internal TblValuePool(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ValuePool","VPL"), config.ExtractTableName("ValuePool","VALUEPOOL"), config.MetaOwner) + : base(config.ExtractAliasName("ValuePool", "VPL"), config.ExtractTableName("ValuePool", "VALUEPOOL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValuePool", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("ValuePool", "ValuePoolAlias", "VALUEPOOL"); @@ -2666,14 +2666,14 @@ public class TblValuePoolLang2 : Lang2Tab public Lang2Col PresTextCol; internal TblValuePoolLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ValuePoolLang2","VP2"), config.ExtractTableName("ValuePoolLang2","VALUEPOOL_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValuePoolLang2", "VP2"), config.ExtractTableName("ValuePoolLang2", "VALUEPOOL_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePool" , "VALUEPOOL"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePoolAlias" , "VALUEPOOLALIAS"); + tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePoolAlias", "VALUEPOOLALIAS"); this.ValuePoolAliasCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -2728,9 +2728,9 @@ public class TblValueSet : Tab public Col FootnoteCol; internal TblValueSet(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ValueSet","VST"), config.ExtractTableName("ValueSet","VALUESET"), config.MetaOwner) + : base(config.ExtractAliasName("ValueSet", "VST"), config.ExtractTableName("ValueSet", "VALUESET"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValueSet", "ValueSet", "VALUESET"); this.ValueSetCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("ValueSet", "PresText", "PRESTEXT"); @@ -2775,14 +2775,14 @@ public class TblValueSetLang2 : Lang2Tab public Lang2Col DescriptionCol; internal TblValueSetLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ValueSetLang2","VS2"), config.ExtractTableName("ValueSetLang2","VALUESET_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValueSetLang2", "VS2"), config.ExtractTableName("ValueSetLang2", "VALUESET_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValueSetLang2", "ValueSet" , "VALUESET"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValueSetLang2", "ValueSet", "VALUESET"); this.ValueSetCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueSetLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("ValueSetLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueSetLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("ValueSetLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -2805,9 +2805,9 @@ public class TblValueSetGrouping : Tab public Col GroupingCol; internal TblValueSetGrouping(SqlDbConfig_22 config) - : base(config.ExtractAliasName("ValueSetGrouping","VBL"), config.ExtractTableName("ValueSetGrouping","VALUESETGROUPING"), config.MetaOwner) + : base(config.ExtractAliasName("ValueSetGrouping", "VBL"), config.ExtractTableName("ValueSetGrouping", "VALUESETGROUPING"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValueSetGrouping", "ValueSet", "VALUESET"); this.ValueSetCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("ValueSetGrouping", "Grouping", "GROUPING"); @@ -2841,9 +2841,9 @@ public class TblVariable : Tab public Col FootnoteCol; internal TblVariable(SqlDbConfig_22 config) - : base(config.ExtractAliasName("Variable","VBL"), config.ExtractTableName("Variable","VARIABLE"), config.MetaOwner) + : base(config.ExtractAliasName("Variable", "VBL"), config.ExtractTableName("Variable", "VARIABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Variable", "Variable", "VARIABLE"); this.VariableCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("Variable", "PresText", "PRESTEXT"); @@ -2871,12 +2871,12 @@ public class TblVariableLang2 : Lang2Tab public Lang2Col PresTextCol; internal TblVariableLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("VariableLang2","VB2"), config.ExtractTableName("VariableLang2","VARIABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("VariableLang2", "VB2"), config.ExtractTableName("VariableLang2", "VARIABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("VariableLang2", "Variable" , "VARIABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("VariableLang2", "Variable", "VARIABLE"); this.VariableCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VariableLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("VariableLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } @@ -2907,9 +2907,9 @@ public class TblVSValue : Tab public Col SortCodeCol; internal TblVSValue(SqlDbConfig_22 config) - : base(config.ExtractAliasName("VSValue","VVL"), config.ExtractTableName("VSValue","VSVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("VSValue", "VVL"), config.ExtractTableName("VSValue", "VSVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("VSValue", "ValueSet", "VALUESET"); this.ValueSetCol = new Col(tmpColumnName, this.Alias); tmpColumnName = config.ExtractColumnName("VSValue", "ValuePool", "VALUEPOOL"); @@ -2947,16 +2947,16 @@ public class TblVSValueLang2 : Lang2Tab public Lang2Col SortCodeCol; internal TblVSValueLang2(SqlDbConfig_22 config) - : base(config.ExtractAliasName("VSValueLang2","VV2"), config.ExtractTableName("VSValueLang2","VSVALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("VSValueLang2", "VV2"), config.ExtractTableName("VSValueLang2", "VSVALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueSet" , "VALUESET"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueSet", "VALUESET"); this.ValueSetCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValuePool" , "VALUEPOOL"); + tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueCode" , "VALUECODE"); + tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueCode", "VALUECODE"); this.ValueCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VSValueLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("VSValueLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Col(tmpColumnName, this.Alias, this.Suffixes); } diff --git a/PCAxis.Sql/DbConfig/SqlDbConfig_23.cs b/PCAxis.Sql/DbConfig/SqlDbConfig_23.cs index 915a5e7..64d9038 100644 --- a/PCAxis.Sql/DbConfig/SqlDbConfig_23.cs +++ b/PCAxis.Sql/DbConfig/SqlDbConfig_23.cs @@ -1,7 +1,7 @@ using System; -using System.Globalization; using System.Xml; using System.Xml.XPath; + using log4net; //This code is generated. @@ -220,7 +220,7 @@ public SqlDbConfig_23(XmlReader xmlReader, XPathNavigator nav) #region structs - + /// /// The table contains information on the attribute on the observation values. @@ -267,25 +267,25 @@ public class TblAttribute : Tab public Column4Parameterized ColumnLengthCol; internal TblAttribute(SqlDbConfig_23 config) - : base(config.ExtractAliasName("Attribute","ATT"), config.ExtractTableName("Attribute","ATTRIBUTE"), config.MetaOwner) + : base(config.ExtractAliasName("Attribute", "ATT"), config.ExtractTableName("Attribute", "ATTRIBUTE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Attribute", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "Attribute", "ATTRIBUTE"); - this.AttributeCol = new Column4Parameterized(tmpColumnName, this.Alias,"Attribute",config.GetDataProvider()); + this.AttributeCol = new Column4Parameterized(tmpColumnName, this.Alias, "Attribute", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "AttributeColumn", "ATTRIBUTECOLUMN"); - this.AttributeColumnCol = new Column4Parameterized(tmpColumnName, this.Alias,"AttributeColumn",config.GetDataProvider()); + this.AttributeColumnCol = new Column4Parameterized(tmpColumnName, this.Alias, "AttributeColumn", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "SequenceNo", "SEQUENCENO"); - this.SequenceNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"SequenceNo",config.GetDataProvider()); + this.SequenceNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "SequenceNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "ColumnLength", "COLUMNLENGTH"); - this.ColumnLengthCol = new Column4Parameterized(tmpColumnName, this.Alias,"ColumnLength",config.GetDataProvider()); + this.ColumnLengthCol = new Column4Parameterized(tmpColumnName, this.Alias, "ColumnLength", config.GetDataProvider()); } @@ -315,16 +315,16 @@ public class TblAttributeLang2 : Lang2Tab public Lang2Column4Parameterized DescriptionCol; internal TblAttributeLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("AttributeLang2","AT2"), config.ExtractTableName("AttributeLang2","ATTRIBUTE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("AttributeLang2", "AT2"), config.ExtractTableName("AttributeLang2", "ATTRIBUTE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("AttributeLang2", "MainTable" , "MAINTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("AttributeLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("AttributeLang2", "Attribute" , "ATTRIBUTE"); + tmpColumnName = config.ExtractColumnName("AttributeLang2", "Attribute", "ATTRIBUTE"); this.AttributeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("AttributeLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("AttributeLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("AttributeLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("AttributeLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -517,61 +517,61 @@ public class TblContents : Tab public Column4Parameterized MetaIdCol; internal TblContents(SqlDbConfig_23 config) - : base(config.ExtractAliasName("Contents","CNT"), config.ExtractTableName("Contents","CONTENTS"), config.MetaOwner) + : base(config.ExtractAliasName("Contents", "CNT"), config.ExtractTableName("Contents", "CONTENTS"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Contents", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresTextS", "PRESTEXTS"); - this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresTextS",config.GetDataProvider()); + this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresTextS", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresCode", "PRESCODE"); - this.PresCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCode",config.GetDataProvider()); + this.PresCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "Copyright", "COPYRIGHT"); - this.CopyrightCol = new Column4Parameterized(tmpColumnName, this.Alias,"Copyright",config.GetDataProvider()); + this.CopyrightCol = new Column4Parameterized(tmpColumnName, this.Alias, "Copyright", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StatAuthority", "STATAUTHORITY"); - this.StatAuthorityCol = new Column4Parameterized(tmpColumnName, this.Alias,"StatAuthority",config.GetDataProvider()); + this.StatAuthorityCol = new Column4Parameterized(tmpColumnName, this.Alias, "StatAuthority", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "Producer", "PRODUCER"); - this.ProducerCol = new Column4Parameterized(tmpColumnName, this.Alias,"Producer",config.GetDataProvider()); + this.ProducerCol = new Column4Parameterized(tmpColumnName, this.Alias, "Producer", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "LastUpdated", "LASTUPDATED"); - this.LastUpdatedCol = new Column4Parameterized(tmpColumnName, this.Alias,"LastUpdated",config.GetDataProvider()); + this.LastUpdatedCol = new Column4Parameterized(tmpColumnName, this.Alias, "LastUpdated", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "Published", "PUBLISHED"); - this.PublishedCol = new Column4Parameterized(tmpColumnName, this.Alias,"Published",config.GetDataProvider()); + this.PublishedCol = new Column4Parameterized(tmpColumnName, this.Alias, "Published", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "Unit", "UNIT"); - this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias,"Unit",config.GetDataProvider()); + this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias, "Unit", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresDecimals", "PRESDECIMALS"); - this.PresDecimalsCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresDecimals",config.GetDataProvider()); + this.PresDecimalsCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresDecimals", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresCellsZero", "PRESCELLSZERO"); - this.PresCellsZeroCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCellsZero",config.GetDataProvider()); + this.PresCellsZeroCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCellsZero", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresMissingLine", "PRESMISSINGLINE"); - this.PresMissingLineCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresMissingLine",config.GetDataProvider()); + this.PresMissingLineCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresMissingLine", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "AggregPossible", "AGGREGPOSSIBLE"); - this.AggregPossibleCol = new Column4Parameterized(tmpColumnName, this.Alias,"AggregPossible",config.GetDataProvider()); + this.AggregPossibleCol = new Column4Parameterized(tmpColumnName, this.Alias, "AggregPossible", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "RefPeriod", "REFPERIOD"); - this.RefPeriodCol = new Column4Parameterized(tmpColumnName, this.Alias,"RefPeriod",config.GetDataProvider()); + this.RefPeriodCol = new Column4Parameterized(tmpColumnName, this.Alias, "RefPeriod", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StockFA", "STOCKFA"); - this.StockFACol = new Column4Parameterized(tmpColumnName, this.Alias,"StockFA",config.GetDataProvider()); + this.StockFACol = new Column4Parameterized(tmpColumnName, this.Alias, "StockFA", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "BasePeriod", "BASEPERIOD"); - this.BasePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias,"BasePeriod",config.GetDataProvider()); + this.BasePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias, "BasePeriod", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "CFPrices", "CFPRICES"); - this.CFPricesCol = new Column4Parameterized(tmpColumnName, this.Alias,"CFPrices",config.GetDataProvider()); + this.CFPricesCol = new Column4Parameterized(tmpColumnName, this.Alias, "CFPrices", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "DayAdj", "DAYADJ"); - this.DayAdjCol = new Column4Parameterized(tmpColumnName, this.Alias,"DayAdj",config.GetDataProvider()); + this.DayAdjCol = new Column4Parameterized(tmpColumnName, this.Alias, "DayAdj", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "SeasAdj", "SEASADJ"); - this.SeasAdjCol = new Column4Parameterized(tmpColumnName, this.Alias,"SeasAdj",config.GetDataProvider()); + this.SeasAdjCol = new Column4Parameterized(tmpColumnName, this.Alias, "SeasAdj", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StoreColumnNo", "STORECOLUMNNO"); - this.StoreColumnNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreColumnNo",config.GetDataProvider()); + this.StoreColumnNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreColumnNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StoreFormat", "STOREFORMAT"); - this.StoreFormatCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreFormat",config.GetDataProvider()); + this.StoreFormatCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreFormat", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StoreNoChar", "STORENOCHAR"); - this.StoreNoCharCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreNoChar",config.GetDataProvider()); + this.StoreNoCharCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreNoChar", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StoreDecimals", "STOREDECIMALS"); - this.StoreDecimalsCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreDecimals",config.GetDataProvider()); + this.StoreDecimalsCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreDecimals", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); } @@ -634,22 +634,22 @@ public class TblContentsLang2 : Lang2Tab public Lang2Column4Parameterized BasePeriodCol; internal TblContentsLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("ContentsLang2","CN2"), config.ExtractTableName("ContentsLang2","CONTENTS_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ContentsLang2", "CN2"), config.ExtractTableName("ContentsLang2", "CONTENTS_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ContentsLang2", "MainTable" , "MAINTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ContentsLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "Contents" , "CONTENTS"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "Contents", "CONTENTS"); this.ContentsCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresTextS" , "PRESTEXTS"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresTextS", "PRESTEXTS"); this.PresTextSCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "Unit" , "UNIT"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "Unit", "UNIT"); this.UnitCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "RefPeriod" , "REFPERIOD"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "RefPeriod", "REFPERIOD"); this.RefPeriodCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "BasePeriod" , "BASEPERIOD"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "BasePeriod", "BASEPERIOD"); this.BasePeriodCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -679,15 +679,15 @@ public class TblContentsTime : Tab public Column4Parameterized TimePeriodCol; internal TblContentsTime(SqlDbConfig_23 config) - : base(config.ExtractAliasName("ContentsTime","CTM"), config.ExtractTableName("ContentsTime","CONTENTSTIME"), config.MetaOwner) + : base(config.ExtractAliasName("ContentsTime", "CTM"), config.ExtractTableName("ContentsTime", "CONTENTSTIME"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ContentsTime", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ContentsTime", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ContentsTime", "TimePeriod", "TIMEPERIOD"); - this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimePeriod",config.GetDataProvider()); + this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimePeriod", config.GetDataProvider()); } @@ -713,15 +713,15 @@ public class TblDataStorage : Tab public Column4Parameterized DatabaseNameCol; internal TblDataStorage(SqlDbConfig_23 config) - : base(config.ExtractAliasName("DataStorage","DST"), config.ExtractTableName("DataStorage","DATASTORAGE"), config.MetaOwner) + : base(config.ExtractAliasName("DataStorage", "DST"), config.ExtractTableName("DataStorage", "DATASTORAGE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("DataStorage", "ProductCode", "PRODUCTCODE"); - this.ProductCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ProductCode",config.GetDataProvider()); + this.ProductCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ProductCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("DataStorage", "ServerName", "SERVERNAME"); - this.ServerNameCol = new Column4Parameterized(tmpColumnName, this.Alias,"ServerName",config.GetDataProvider()); + this.ServerNameCol = new Column4Parameterized(tmpColumnName, this.Alias, "ServerName", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("DataStorage", "DatabaseName", "DATABASENAME"); - this.DatabaseNameCol = new Column4Parameterized(tmpColumnName, this.Alias,"DatabaseName",config.GetDataProvider()); + this.DatabaseNameCol = new Column4Parameterized(tmpColumnName, this.Alias, "DatabaseName", config.GetDataProvider()); } @@ -786,21 +786,21 @@ public class TblFootnote : Tab public Column4Parameterized PresCharacterCol; internal TblFootnote(SqlDbConfig_23 config) - : base(config.ExtractAliasName("Footnote","FNT"), config.ExtractTableName("Footnote","FOOTNOTE"), config.MetaOwner) + : base(config.ExtractAliasName("Footnote", "FNT"), config.ExtractTableName("Footnote", "FOOTNOTE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Footnote", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Footnote", "FootnoteType", "FOOTNOTETYPE"); - this.FootnoteTypeCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteType",config.GetDataProvider()); + this.FootnoteTypeCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteType", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Footnote", "ShowFootnote", "SHOWFOOTNOTE"); - this.ShowFootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"ShowFootnote",config.GetDataProvider()); + this.ShowFootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "ShowFootnote", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Footnote", "MandOpt", "MANDOPT"); - this.MandOptCol = new Column4Parameterized(tmpColumnName, this.Alias,"MandOpt",config.GetDataProvider()); + this.MandOptCol = new Column4Parameterized(tmpColumnName, this.Alias, "MandOpt", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Footnote", "FootnoteText", "FOOTNOTETEXT"); - this.FootnoteTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteText",config.GetDataProvider()); + this.FootnoteTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Footnote", "PresCharacter", "PRESCHARACTER"); - this.PresCharacterCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCharacter",config.GetDataProvider()); + this.PresCharacterCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCharacter", config.GetDataProvider()); } @@ -824,12 +824,12 @@ public class TblFootnoteLang2 : Lang2Tab public Lang2Column4Parameterized FootnoteTextCol; internal TblFootnoteLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteLang2","FN2"), config.ExtractTableName("FootnoteLang2","FOOTNOTE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("FootnoteLang2", "FN2"), config.ExtractTableName("FootnoteLang2", "FOOTNOTE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteNo" , "FOOTNOTENO"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteNo", "FOOTNOTENO"); this.FootnoteNoCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteText" , "FOOTNOTETEXT"); + tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteText", "FOOTNOTETEXT"); this.FootnoteTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -875,19 +875,19 @@ public class TblFootnoteContTime : Tab public Column4Parameterized CellnoteCol; internal TblFootnoteContTime(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteContTime","FCT"), config.ExtractTableName("FootnoteContTime","FOOTNOTECONTTIME"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContTime", "FCT"), config.ExtractTableName("FootnoteContTime", "FOOTNOTECONTTIME"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContTime", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContTime", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContTime", "TimePeriod", "TIMEPERIOD"); - this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimePeriod",config.GetDataProvider()); + this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimePeriod", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContTime", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContTime", "Cellnote", "CELLNOTE"); - this.CellnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"Cellnote",config.GetDataProvider()); + this.CellnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "Cellnote", config.GetDataProvider()); } @@ -944,23 +944,23 @@ public class TblFootnoteContValue : Tab public Column4Parameterized CellnoteCol; internal TblFootnoteContValue(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteContValue","FCA"), config.ExtractTableName("FootnoteContValue","FOOTNOTECONTVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContValue", "FCA"), config.ExtractTableName("FootnoteContValue", "FOOTNOTECONTVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContValue", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "Cellnote", "CELLNOTE"); - this.CellnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"Cellnote",config.GetDataProvider()); + this.CellnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "Cellnote", config.GetDataProvider()); } @@ -998,17 +998,17 @@ public class TblFootnoteContVbl : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteContVbl(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteContVbl","FCB"), config.ExtractTableName("FootnoteContVbl","FOOTNOTECONTVBL"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContVbl", "FCB"), config.ExtractTableName("FootnoteContVbl", "FOOTNOTECONTVBL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContVbl", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContVbl", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContVbl", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContVbl", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1040,15 +1040,15 @@ public class TblFootnoteContents : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteContents(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteContents","FCO"), config.ExtractTableName("FootnoteContents","FOOTNOTECONTENTS"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContents", "FCO"), config.ExtractTableName("FootnoteContents", "FOOTNOTECONTENTS"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContents", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContents", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContents", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1072,13 +1072,13 @@ public class TblFootnoteGrouping : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteGrouping(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteGrouping","FCO"), config.ExtractTableName("FootnoteGrouping","FOOTNOTEGROUPING"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteGrouping", "FCO"), config.ExtractTableName("FootnoteGrouping", "FOOTNOTEGROUPING"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteGrouping", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteGrouping", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1106,13 +1106,13 @@ public class TblFootnoteMainTable : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteMainTable(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteMainTable","FMT"), config.ExtractTableName("FootnoteMainTable","FOOTNOTEMAINTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMainTable", "FMT"), config.ExtractTableName("FootnoteMainTable", "FOOTNOTEMAINTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMainTable", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMainTable", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1140,15 +1140,15 @@ public class TblFootnoteMaintTime : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteMaintTime(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteMaintTime","FNM"), config.ExtractTableName("FootnoteMaintTime","FOOTNOTEMAINTTIME"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMaintTime", "FNM"), config.ExtractTableName("FootnoteMaintTime", "FOOTNOTEMAINTTIME"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMaintTime", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintTime", "TimePeriod", "TIMEPERIOD"); - this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimePeriod",config.GetDataProvider()); + this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimePeriod", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintTime", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1192,19 +1192,19 @@ public class TblFootnoteMaintValue : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteMaintValue(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteMaintValue","FMV"), config.ExtractTableName("FootnoteMaintValue","FOOTNOTEMAINTVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMaintValue", "FMV"), config.ExtractTableName("FootnoteMaintValue", "FOOTNOTEMAINTVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1234,15 +1234,15 @@ public class TblFootnoteMenuSel : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteMenuSel(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteMenuSel","FMS"), config.ExtractTableName("FootnoteMenuSel","FOOTNOTEMENUSEL"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMenuSel", "FMS"), config.ExtractTableName("FootnoteMenuSel", "FOOTNOTEMENUSEL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMenuSel", "Menu", "MENU"); - this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias,"Menu",config.GetDataProvider()); + this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias, "Menu", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMenuSel", "Selection", "SELECTION"); - this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Selection",config.GetDataProvider()); + this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Selection", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMenuSel", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1274,15 +1274,15 @@ public class TblFootnoteSubTable : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteSubTable(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteSubTable","FST"), config.ExtractTableName("FootnoteSubTable","FOOTNOTESUBTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteSubTable", "FST"), config.ExtractTableName("FootnoteSubTable", "FOOTNOTESUBTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteSubTable", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteSubTable", "SubTable", "SUBTABLE"); - this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"SubTable",config.GetDataProvider()); + this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "SubTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteSubTable", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1314,15 +1314,15 @@ public class TblFootnoteValue : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteValue(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteValue","FVL"), config.ExtractTableName("FootnoteValue","FOOTNOTEVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteValue", "FVL"), config.ExtractTableName("FootnoteValue", "FOOTNOTEVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteValue", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteValue", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteValue", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1360,17 +1360,17 @@ public class TblFootnoteValueSetValue : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteValueSetValue(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteValueSetValue","FVS"), config.ExtractTableName("FootnoteValueSetValue","FOOTNOTEVALUESETVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteValueSetValue", "FVS"), config.ExtractTableName("FootnoteValueSetValue", "FOOTNOTEVALUESETVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteValueSetValue", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteValueSetValue", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteValueSetValue", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteValueSetValue", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1396,13 +1396,13 @@ public class TblFootnoteVariable : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteVariable(SqlDbConfig_23 config) - : base(config.ExtractAliasName("FootnoteVariable","FVB"), config.ExtractTableName("FootnoteVariable","FOOTNOTEVARIABLE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteVariable", "FVB"), config.ExtractTableName("FootnoteVariable", "FOOTNOTEVARIABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteVariable", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteVariable", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1474,25 +1474,25 @@ public class TblGrouping : Tab public Column4Parameterized MetaIdCol; internal TblGrouping(SqlDbConfig_23 config) - : base(config.ExtractAliasName("Grouping","GRP"), config.ExtractTableName("Grouping","GROUPING"), config.MetaOwner) + : base(config.ExtractAliasName("Grouping", "GRP"), config.ExtractTableName("Grouping", "GROUPING"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Grouping", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "Hierarchy", "HIERARCHY"); - this.HierarchyCol = new Column4Parameterized(tmpColumnName, this.Alias,"Hierarchy",config.GetDataProvider()); + this.HierarchyCol = new Column4Parameterized(tmpColumnName, this.Alias, "Hierarchy", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "GroupPres", "GROUPPRES"); - this.GroupPresCol = new Column4Parameterized(tmpColumnName, this.Alias,"GroupPres",config.GetDataProvider()); + this.GroupPresCol = new Column4Parameterized(tmpColumnName, this.Alias, "GroupPres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); } @@ -1527,14 +1527,14 @@ public class TblGroupingLang2 : Lang2Tab public Lang2Column4Parameterized SortCodeCol; internal TblGroupingLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("GroupingLang2","GR2"), config.ExtractTableName("GroupingLang2","GROUPING_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("GroupingLang2", "GR2"), config.ExtractTableName("GroupingLang2", "GROUPING_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("GroupingLang2", "Grouping" , "GROUPING"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("GroupingLang2", "Grouping", "GROUPING"); this.GroupingCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("GroupingLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("GroupingLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -1571,17 +1571,17 @@ public class TblGroupingLevel : Tab public Column4Parameterized GeoAreaNoCol; internal TblGroupingLevel(SqlDbConfig_23 config) - : base(config.ExtractAliasName("GroupingLevel","GRP"), config.ExtractTableName("GroupingLevel","GROUPINGLEVEL"), config.MetaOwner) + : base(config.ExtractAliasName("GroupingLevel", "GRP"), config.ExtractTableName("GroupingLevel", "GROUPINGLEVEL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("GroupingLevel", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("GroupingLevel", "LevelNo", "LEVELNO"); - this.LevelNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"LevelNo",config.GetDataProvider()); + this.LevelNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "LevelNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("GroupingLevel", "LevelText", "LEVELTEXT"); - this.LevelTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"LevelText",config.GetDataProvider()); + this.LevelTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "LevelText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("GroupingLevel", "GeoAreaNo", "GEOAREANO"); - this.GeoAreaNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"GeoAreaNo",config.GetDataProvider()); + this.GeoAreaNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "GeoAreaNo", config.GetDataProvider()); } @@ -1608,14 +1608,14 @@ public class TblGroupingLevelLang2 : Lang2Tab public Lang2Column4Parameterized LevelTextCol; internal TblGroupingLevelLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("GroupingLevelLang2","GR2"), config.ExtractTableName("GroupingLevelLang2","GROUPINGLEVEL_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("GroupingLevelLang2", "GR2"), config.ExtractTableName("GroupingLevelLang2", "GROUPINGLEVEL_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "Grouping" , "GROUPING"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "Grouping", "GROUPING"); this.GroupingCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "LevelNo" , "LEVELNO"); + tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "LevelNo", "LEVELNO"); this.LevelNoCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "LevelText" , "LEVELTEXT"); + tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "LevelText", "LEVELTEXT"); this.LevelTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -1693,27 +1693,27 @@ public class TblLink : Tab public Column4Parameterized DescriptionCol; internal TblLink(SqlDbConfig_23 config) - : base(config.ExtractAliasName("Link","LNK"), config.ExtractTableName("Link","LINK"), config.MetaOwner) + : base(config.ExtractAliasName("Link", "LNK"), config.ExtractTableName("Link", "LINK"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Link", "LinkId", "LINKID"); - this.LinkIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkId",config.GetDataProvider()); + this.LinkIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "Link", "LINK"); - this.LinkCol = new Column4Parameterized(tmpColumnName, this.Alias,"Link",config.GetDataProvider()); + this.LinkCol = new Column4Parameterized(tmpColumnName, this.Alias, "Link", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "LinkType", "LINKTYPE"); - this.LinkTypeCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkType",config.GetDataProvider()); + this.LinkTypeCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkType", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "LinkFormat", "LINKFORMAT"); - this.LinkFormatCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkFormat",config.GetDataProvider()); + this.LinkFormatCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkFormat", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "LinkText", "LINKTEXT"); - this.LinkTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkText",config.GetDataProvider()); + this.LinkTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "PresCategory", "PRESCATEGORY"); - this.PresCategoryCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCategory",config.GetDataProvider()); + this.PresCategoryCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCategory", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "LinkPres", "LINKPRES"); - this.LinkPresCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkPres",config.GetDataProvider()); + this.LinkPresCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkPres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); } @@ -1750,18 +1750,18 @@ public class TblLinkLang2 : Lang2Tab public Lang2Column4Parameterized DescriptionCol; internal TblLinkLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("LinkLang2","LN2"), config.ExtractTableName("LinkLang2","LINK_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("LinkLang2", "LN2"), config.ExtractTableName("LinkLang2", "LINK_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkId" , "LINKID"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkId", "LINKID"); this.LinkIdCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "Link" , "LINK"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "Link", "LINK"); this.LinkCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkText" , "LINKTEXT"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkText", "LINKTEXT"); this.LinkTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -1790,15 +1790,15 @@ public class TblLinkMenuSelection : Tab public Column4Parameterized LinkIdCol; internal TblLinkMenuSelection(SqlDbConfig_23 config) - : base(config.ExtractAliasName("LinkMenuSelection","LMS"), config.ExtractTableName("LinkMenuSelection","LINKMENUSELECTION"), config.MetaOwner) + : base(config.ExtractAliasName("LinkMenuSelection", "LMS"), config.ExtractTableName("LinkMenuSelection", "LINKMENUSELECTION"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("LinkMenuSelection", "Menu", "MENU"); - this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias,"Menu",config.GetDataProvider()); + this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias, "Menu", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("LinkMenuSelection", "Selection", "SELECTION"); - this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Selection",config.GetDataProvider()); + this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Selection", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("LinkMenuSelection", "LinkId", "LINKID"); - this.LinkIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkId",config.GetDataProvider()); + this.LinkIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkId", config.GetDataProvider()); } @@ -1899,35 +1899,35 @@ public class TblMainTable : Tab public Column4Parameterized TimeScaleCol; internal TblMainTable(SqlDbConfig_23 config) - : base(config.ExtractAliasName("MainTable","MTA"), config.ExtractTableName("MainTable","MAINTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("MainTable", "MTA"), config.ExtractTableName("MainTable", "MAINTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MainTable", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "TableStatus", "TABLESTATUS"); - this.TableStatusCol = new Column4Parameterized(tmpColumnName, this.Alias,"TableStatus",config.GetDataProvider()); + this.TableStatusCol = new Column4Parameterized(tmpColumnName, this.Alias, "TableStatus", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "PresTextS", "PRESTEXTS"); - this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresTextS",config.GetDataProvider()); + this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresTextS", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "ContentsVariable", "CONTENTSVARIABLE"); - this.ContentsVariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"ContentsVariable",config.GetDataProvider()); + this.ContentsVariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "ContentsVariable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "TableId", "TABLEID"); - this.TableIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"TableId",config.GetDataProvider()); + this.TableIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "TableId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "PresCategory", "PRESCATEGORY"); - this.PresCategoryCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCategory",config.GetDataProvider()); + this.PresCategoryCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCategory", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "FirstPublished", "FIRSTPUBLISHED"); - this.FirstPublishedCol = new Column4Parameterized(tmpColumnName, this.Alias,"FirstPublished",config.GetDataProvider()); + this.FirstPublishedCol = new Column4Parameterized(tmpColumnName, this.Alias, "FirstPublished", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "SpecCharExists", "SPECCHAREXISTS"); - this.SpecCharExistsCol = new Column4Parameterized(tmpColumnName, this.Alias,"SpecCharExists",config.GetDataProvider()); + this.SpecCharExistsCol = new Column4Parameterized(tmpColumnName, this.Alias, "SpecCharExists", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "SubjectCode", "SUBJECTCODE"); - this.SubjectCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SubjectCode",config.GetDataProvider()); + this.SubjectCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SubjectCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "ProductCode", "PRODUCTCODE"); - this.ProductCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ProductCode",config.GetDataProvider()); + this.ProductCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ProductCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "TimeScale", "TIMESCALE"); - this.TimeScaleCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimeScale",config.GetDataProvider()); + this.TimeScaleCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimeScale", config.GetDataProvider()); } @@ -1971,16 +1971,16 @@ public class TblMainTableLang2 : Lang2Tab public Lang2Column4Parameterized ContentsVariableCol; internal TblMainTableLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("MainTableLang2","MT2"), config.ExtractTableName("MainTableLang2","MAINTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("MainTableLang2", "MT2"), config.ExtractTableName("MainTableLang2", "MAINTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("MainTableLang2", "MainTable" , "MAINTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("MainTableLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresTextS" , "PRESTEXTS"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresTextS", "PRESTEXTS"); this.PresTextSCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "ContentsVariable" , "CONTENTSVARIABLE"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "ContentsVariable", "CONTENTSVARIABLE"); this.ContentsVariableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -2017,15 +2017,15 @@ public class TblMainTablePerson : Tab public Column4Parameterized RolePersonCol; internal TblMainTablePerson(SqlDbConfig_23 config) - : base(config.ExtractAliasName("MainTablePerson","MTP"), config.ExtractTableName("MainTablePerson","MAINTABLEPERSON"), config.MetaOwner) + : base(config.ExtractAliasName("MainTablePerson", "MTP"), config.ExtractTableName("MainTablePerson", "MAINTABLEPERSON"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MainTablePerson", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTablePerson", "PersonCode", "PERSONCODE"); - this.PersonCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"PersonCode",config.GetDataProvider()); + this.PersonCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "PersonCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTablePerson", "RolePerson", "ROLEPERSON"); - this.RolePersonCol = new Column4Parameterized(tmpColumnName, this.Alias,"RolePerson",config.GetDataProvider()); + this.RolePersonCol = new Column4Parameterized(tmpColumnName, this.Alias, "RolePerson", config.GetDataProvider()); } @@ -2068,19 +2068,19 @@ public class TblMainTableVariableHierarchy : Tab public Column4Parameterized AllLevelsStoredCol; internal TblMainTableVariableHierarchy(SqlDbConfig_23 config) - : base(config.ExtractAliasName("MainTableVariableHierarchy","MTP"), config.ExtractTableName("MainTableVariableHierarchy","MAINTABLEVARIABLEHIERARCHY"), config.MetaOwner) + : base(config.ExtractAliasName("MainTableVariableHierarchy", "MTP"), config.ExtractTableName("MainTableVariableHierarchy", "MAINTABLEVARIABLEHIERARCHY"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "ShowLevels", "SHOWLEVELS"); - this.ShowLevelsCol = new Column4Parameterized(tmpColumnName, this.Alias,"ShowLevels",config.GetDataProvider()); + this.ShowLevelsCol = new Column4Parameterized(tmpColumnName, this.Alias, "ShowLevels", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "AllLevelsStored", "ALLLEVELSSTORED"); - this.AllLevelsStoredCol = new Column4Parameterized(tmpColumnName, this.Alias,"AllLevelsStored",config.GetDataProvider()); + this.AllLevelsStoredCol = new Column4Parameterized(tmpColumnName, this.Alias, "AllLevelsStored", config.GetDataProvider()); } @@ -2144,27 +2144,27 @@ public class TblMenuSelection : Tab public Column4Parameterized MetaIdCol; internal TblMenuSelection(SqlDbConfig_23 config) - : base(config.ExtractAliasName("MenuSelection","MSL"), config.ExtractTableName("MenuSelection","MENUSELECTION"), config.MetaOwner) + : base(config.ExtractAliasName("MenuSelection", "MSL"), config.ExtractTableName("MenuSelection", "MENUSELECTION"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MenuSelection", "Menu", "MENU"); - this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias,"Menu",config.GetDataProvider()); + this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias, "Menu", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "Selection", "SELECTION"); - this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Selection",config.GetDataProvider()); + this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Selection", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "PresTextS", "PRESTEXTS"); - this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresTextS",config.GetDataProvider()); + this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresTextS", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "LevelNo", "LEVELNO"); - this.LevelNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"LevelNo",config.GetDataProvider()); + this.LevelNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "LevelNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "Presentation", "PRESENTATION"); - this.PresentationCol = new Column4Parameterized(tmpColumnName, this.Alias,"Presentation",config.GetDataProvider()); + this.PresentationCol = new Column4Parameterized(tmpColumnName, this.Alias, "Presentation", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); } @@ -2219,22 +2219,22 @@ public class TblMenuSelectionLang2 : Lang2Tab public Lang2Column4Parameterized PresentationCol; internal TblMenuSelectionLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("MenuSelectionLang2","MS2"), config.ExtractTableName("MenuSelectionLang2","MENUSELECTION_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("MenuSelectionLang2", "MS2"), config.ExtractTableName("MenuSelectionLang2", "MENUSELECTION_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Menu" , "MENU"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Menu", "MENU"); this.MenuCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Selection" , "SELECTION"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Selection", "SELECTION"); this.SelectionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresTextS" , "PRESTEXTS"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresTextS", "PRESTEXTS"); this.PresTextSCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Presentation" , "PRESENTATION"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Presentation", "PRESENTATION"); this.PresentationCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -2322,15 +2322,15 @@ public class TblMetaAdm : Tab public Column4Parameterized DescriptionCol; internal TblMetaAdm(SqlDbConfig_23 config) - : base(config.ExtractAliasName("MetaAdm","MAD"), config.ExtractTableName("MetaAdm","METAADM"), config.MetaOwner) + : base(config.ExtractAliasName("MetaAdm", "MAD"), config.ExtractTableName("MetaAdm", "METAADM"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MetaAdm", "Property", "PROPERTY"); - this.PropertyCol = new Column4Parameterized(tmpColumnName, this.Alias,"Property",config.GetDataProvider()); + this.PropertyCol = new Column4Parameterized(tmpColumnName, this.Alias, "Property", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MetaAdm", "Value", "VALUE"); - this.ValueCol = new Column4Parameterized(tmpColumnName, this.Alias,"Value",config.GetDataProvider()); + this.ValueCol = new Column4Parameterized(tmpColumnName, this.Alias, "Value", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MetaAdm", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); } @@ -2361,15 +2361,15 @@ public class TblMetabaseInfo : Tab public Column4Parameterized DatabaseRoleCol; internal TblMetabaseInfo(SqlDbConfig_23 config) - : base(config.ExtractAliasName("MetabaseInfo","MBI"), config.ExtractTableName("MetabaseInfo","METABASEINFO"), config.MetaOwner) + : base(config.ExtractAliasName("MetabaseInfo", "MBI"), config.ExtractTableName("MetabaseInfo", "METABASEINFO"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MetabaseInfo", "Model", "MODEL"); - this.ModelCol = new Column4Parameterized(tmpColumnName, this.Alias,"Model",config.GetDataProvider()); + this.ModelCol = new Column4Parameterized(tmpColumnName, this.Alias, "Model", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MetabaseInfo", "ModelVersion", "MODELVERSION"); - this.ModelVersionCol = new Column4Parameterized(tmpColumnName, this.Alias,"ModelVersion",config.GetDataProvider()); + this.ModelVersionCol = new Column4Parameterized(tmpColumnName, this.Alias, "ModelVersion", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MetabaseInfo", "DatabaseRole", "DATABASEROLE"); - this.DatabaseRoleCol = new Column4Parameterized(tmpColumnName, this.Alias,"DatabaseRole",config.GetDataProvider()); + this.DatabaseRoleCol = new Column4Parameterized(tmpColumnName, this.Alias, "DatabaseRole", config.GetDataProvider()); } @@ -2412,21 +2412,21 @@ public class TblOrganization : Tab public Column4Parameterized MetaIdCol; internal TblOrganization(SqlDbConfig_23 config) - : base(config.ExtractAliasName("Organization","ORG"), config.ExtractTableName("Organization","ORGANIZATION"), config.MetaOwner) + : base(config.ExtractAliasName("Organization", "ORG"), config.ExtractTableName("Organization", "ORGANIZATION"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Organization", "OrganizationCode", "ORGANIZATIONCODE"); - this.OrganizationCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"OrganizationCode",config.GetDataProvider()); + this.OrganizationCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "OrganizationCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Organization", "OrganizationName", "ORGANIZATIONNAME"); - this.OrganizationNameCol = new Column4Parameterized(tmpColumnName, this.Alias,"OrganizationName",config.GetDataProvider()); + this.OrganizationNameCol = new Column4Parameterized(tmpColumnName, this.Alias, "OrganizationName", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Organization", "Department", "DEPARTMENT"); - this.DepartmentCol = new Column4Parameterized(tmpColumnName, this.Alias,"Department",config.GetDataProvider()); + this.DepartmentCol = new Column4Parameterized(tmpColumnName, this.Alias, "Department", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Organization", "Unit", "UNIT"); - this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias,"Unit",config.GetDataProvider()); + this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias, "Unit", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Organization", "WebAddress", "WEBADDRESS"); - this.WebAddressCol = new Column4Parameterized(tmpColumnName, this.Alias,"WebAddress",config.GetDataProvider()); + this.WebAddressCol = new Column4Parameterized(tmpColumnName, this.Alias, "WebAddress", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Organization", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); } @@ -2466,18 +2466,18 @@ public class TblOrganizationLang2 : Lang2Tab public Lang2Column4Parameterized WebAddressCol; internal TblOrganizationLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("OrganizationLang2","OR2"), config.ExtractTableName("OrganizationLang2","ORGANIZATION_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("OrganizationLang2", "OR2"), config.ExtractTableName("OrganizationLang2", "ORGANIZATION_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationCode" , "ORGANIZATIONCODE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationCode", "ORGANIZATIONCODE"); this.OrganizationCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationName" , "ORGANIZATIONNAME"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationName", "ORGANIZATIONNAME"); this.OrganizationNameCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Department" , "DEPARTMENT"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Department", "DEPARTMENT"); this.DepartmentCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Unit" , "UNIT"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Unit", "UNIT"); this.UnitCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "WebAddress" , "WEBADDRESS"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "WebAddress", "WEBADDRESS"); this.WebAddressCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -2537,25 +2537,25 @@ public class TblPerson : Tab public Column4Parameterized EmailCol; internal TblPerson(SqlDbConfig_23 config) - : base(config.ExtractAliasName("Person","PRS"), config.ExtractTableName("Person","PERSON"), config.MetaOwner) + : base(config.ExtractAliasName("Person", "PRS"), config.ExtractTableName("Person", "PERSON"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Person", "PersonCode", "PERSONCODE"); - this.PersonCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"PersonCode",config.GetDataProvider()); + this.PersonCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "PersonCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "OrganizationCode", "ORGANIZATIONCODE"); - this.OrganizationCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"OrganizationCode",config.GetDataProvider()); + this.OrganizationCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "OrganizationCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "Forename", "FORENAME"); - this.ForenameCol = new Column4Parameterized(tmpColumnName, this.Alias,"Forename",config.GetDataProvider()); + this.ForenameCol = new Column4Parameterized(tmpColumnName, this.Alias, "Forename", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "Surname", "SURNAME"); - this.SurnameCol = new Column4Parameterized(tmpColumnName, this.Alias,"Surname",config.GetDataProvider()); + this.SurnameCol = new Column4Parameterized(tmpColumnName, this.Alias, "Surname", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "PhonePrefix", "PHONEPREFIX"); - this.PhonePrefixCol = new Column4Parameterized(tmpColumnName, this.Alias,"PhonePrefix",config.GetDataProvider()); + this.PhonePrefixCol = new Column4Parameterized(tmpColumnName, this.Alias, "PhonePrefix", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "PhoneNo", "PHONENO"); - this.PhoneNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"PhoneNo",config.GetDataProvider()); + this.PhoneNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "PhoneNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "FaxNo", "FAXNO"); - this.FaxNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FaxNo",config.GetDataProvider()); + this.FaxNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FaxNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "Email", "EMAIL"); - this.EmailCol = new Column4Parameterized(tmpColumnName, this.Alias,"Email",config.GetDataProvider()); + this.EmailCol = new Column4Parameterized(tmpColumnName, this.Alias, "Email", config.GetDataProvider()); } @@ -2601,21 +2601,21 @@ public class TblSecondaryLanguage : Tab public Column4Parameterized LogDateCol; internal TblSecondaryLanguage(SqlDbConfig_23 config) - : base(config.ExtractAliasName("SecondaryLanguage","SLA"), config.ExtractTableName("SecondaryLanguage","SECONDARYLANGUAGE"), config.MetaOwner) + : base(config.ExtractAliasName("SecondaryLanguage", "SLA"), config.ExtractTableName("SecondaryLanguage", "SECONDARYLANGUAGE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "Language", "LANGUAGE"); - this.LanguageCol = new Column4Parameterized(tmpColumnName, this.Alias,"Language",config.GetDataProvider()); + this.LanguageCol = new Column4Parameterized(tmpColumnName, this.Alias, "Language", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "CompletelyTranslated", "COMPLETELYTRANSLATED"); - this.CompletelyTranslatedCol = new Column4Parameterized(tmpColumnName, this.Alias,"CompletelyTranslated",config.GetDataProvider()); + this.CompletelyTranslatedCol = new Column4Parameterized(tmpColumnName, this.Alias, "CompletelyTranslated", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "Published", "PUBLISHED"); - this.PublishedCol = new Column4Parameterized(tmpColumnName, this.Alias,"Published",config.GetDataProvider()); + this.PublishedCol = new Column4Parameterized(tmpColumnName, this.Alias, "Published", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "UserId", "USERID"); - this.UserIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"UserId",config.GetDataProvider()); + this.UserIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "UserId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "LogDate", "LOGDATE"); - this.LogDateCol = new Column4Parameterized(tmpColumnName, this.Alias,"LogDate",config.GetDataProvider()); + this.LogDateCol = new Column4Parameterized(tmpColumnName, this.Alias, "LogDate", config.GetDataProvider()); } @@ -2673,21 +2673,21 @@ public class TblSpecialCharacter : Tab public Column4Parameterized PresTextCol; internal TblSpecialCharacter(SqlDbConfig_23 config) - : base(config.ExtractAliasName("SpecialCharacter","SPC"), config.ExtractTableName("SpecialCharacter","SPECIALCHARACTER"), config.MetaOwner) + : base(config.ExtractAliasName("SpecialCharacter", "SPC"), config.ExtractTableName("SpecialCharacter", "SPECIALCHARACTER"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SpecialCharacter", "CharacterType", "CHARACTERTYPE"); - this.CharacterTypeCol = new Column4Parameterized(tmpColumnName, this.Alias,"CharacterType",config.GetDataProvider()); + this.CharacterTypeCol = new Column4Parameterized(tmpColumnName, this.Alias, "CharacterType", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "PresCharacter", "PRESCHARACTER"); - this.PresCharacterCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCharacter",config.GetDataProvider()); + this.PresCharacterCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCharacter", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "AggregPossible", "AGGREGPOSSIBLE"); - this.AggregPossibleCol = new Column4Parameterized(tmpColumnName, this.Alias,"AggregPossible",config.GetDataProvider()); + this.AggregPossibleCol = new Column4Parameterized(tmpColumnName, this.Alias, "AggregPossible", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "DataCellPres", "DATACELLPRES"); - this.DataCellPresCol = new Column4Parameterized(tmpColumnName, this.Alias,"DataCellPres",config.GetDataProvider()); + this.DataCellPresCol = new Column4Parameterized(tmpColumnName, this.Alias, "DataCellPres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "DataCellFilled", "DATACELLFILLED"); - this.DataCellFilledCol = new Column4Parameterized(tmpColumnName, this.Alias,"DataCellFilled",config.GetDataProvider()); + this.DataCellFilledCol = new Column4Parameterized(tmpColumnName, this.Alias, "DataCellFilled", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); } @@ -2718,14 +2718,14 @@ public class TblSpecialCharacterLang2 : Lang2Tab public Lang2Column4Parameterized PresTextCol; internal TblSpecialCharacterLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("SpecialCharacterLang2","SP2"), config.ExtractTableName("SpecialCharacterLang2","SPECIALCHARACTER_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("SpecialCharacterLang2", "SP2"), config.ExtractTableName("SpecialCharacterLang2", "SPECIALCHARACTER_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "CharacterType" , "CHARACTERTYPE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "CharacterType", "CHARACTERTYPE"); this.CharacterTypeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresCharacter" , "PRESCHARACTER"); + tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresCharacter", "PRESCHARACTER"); this.PresCharacterCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -2767,17 +2767,17 @@ public class TblSubTable : Tab public Column4Parameterized CleanTableCol; internal TblSubTable(SqlDbConfig_23 config) - : base(config.ExtractAliasName("SubTable","STB"), config.ExtractTableName("SubTable","SUBTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("SubTable", "STB"), config.ExtractTableName("SubTable", "SUBTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SubTable", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTable", "SubTable", "SUBTABLE"); - this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"SubTable",config.GetDataProvider()); + this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "SubTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTable", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTable", "CleanTable", "CLEANTABLE"); - this.CleanTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"CleanTable",config.GetDataProvider()); + this.CleanTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "CleanTable", config.GetDataProvider()); } @@ -2813,14 +2813,14 @@ public class TblSubTableLang2 : Lang2Tab public Lang2Column4Parameterized PresTextCol; internal TblSubTableLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("SubTableLang2","ST2"), config.ExtractTableName("SubTableLang2","SUBTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("SubTableLang2", "ST2"), config.ExtractTableName("SubTableLang2", "SUBTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("SubTableLang2", "MainTable" , "MAINTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("SubTableLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SubTableLang2", "SubTable" , "SUBTABLE"); + tmpColumnName = config.ExtractColumnName("SubTableLang2", "SubTable", "SUBTABLE"); this.SubTableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SubTableLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("SubTableLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -2872,21 +2872,21 @@ public class TblSubTableVariable : Tab public Column4Parameterized StoreColumnNoCol; internal TblSubTableVariable(SqlDbConfig_23 config) - : base(config.ExtractAliasName("SubTableVariable","STV"), config.ExtractTableName("SubTableVariable","SUBTABLEVARIABLE"), config.MetaOwner) + : base(config.ExtractAliasName("SubTableVariable", "STV"), config.ExtractTableName("SubTableVariable", "SUBTABLEVARIABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SubTableVariable", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "SubTable", "SUBTABLE"); - this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"SubTable",config.GetDataProvider()); + this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "SubTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "VariableType", "VARIABLETYPE"); - this.VariableTypeCol = new Column4Parameterized(tmpColumnName, this.Alias,"VariableType",config.GetDataProvider()); + this.VariableTypeCol = new Column4Parameterized(tmpColumnName, this.Alias, "VariableType", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "StoreColumnNo", "STORECOLUMNNO"); - this.StoreColumnNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreColumnNo",config.GetDataProvider()); + this.StoreColumnNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreColumnNo", config.GetDataProvider()); } @@ -2923,17 +2923,17 @@ public class TblTextCatalog : Tab public Column4Parameterized DescriptionCol; internal TblTextCatalog(SqlDbConfig_23 config) - : base(config.ExtractAliasName("TextCatalog","TXC"), config.ExtractTableName("TextCatalog","TEXTCATALOG"), config.MetaOwner) + : base(config.ExtractAliasName("TextCatalog", "TXC"), config.ExtractTableName("TextCatalog", "TEXTCATALOG"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("TextCatalog", "TextCatalogNo", "TEXTCATALOGNO"); - this.TextCatalogNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"TextCatalogNo",config.GetDataProvider()); + this.TextCatalogNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "TextCatalogNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TextCatalog", "TextType", "TEXTTYPE"); - this.TextTypeCol = new Column4Parameterized(tmpColumnName, this.Alias,"TextType",config.GetDataProvider()); + this.TextTypeCol = new Column4Parameterized(tmpColumnName, this.Alias, "TextType", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TextCatalog", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TextCatalog", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); } @@ -2970,16 +2970,16 @@ public class TblTextCatalogLang2 : Lang2Tab public Lang2Column4Parameterized DescriptionCol; internal TblTextCatalogLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("TextCatalogLang2","TX2"), config.ExtractTableName("TextCatalogLang2","TEXTCATALOG_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("TextCatalogLang2", "TX2"), config.ExtractTableName("TextCatalogLang2", "TEXTCATALOG_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextCatalogNo" , "TEXTCATALOGNO"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextCatalogNo", "TEXTCATALOGNO"); this.TextCatalogNoCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextType" , "TEXTTYPE"); + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextType", "TEXTTYPE"); this.TextTypeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3057,23 +3057,23 @@ public class TblTimeScale : Tab public Column4Parameterized StoreFormatCol; internal TblTimeScale(SqlDbConfig_23 config) - : base(config.ExtractAliasName("TimeScale","TSC"), config.ExtractTableName("TimeScale","TIMESCALE"), config.MetaOwner) + : base(config.ExtractAliasName("TimeScale", "TSC"), config.ExtractTableName("TimeScale", "TIMESCALE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("TimeScale", "TimeScale", "TIMESCALE"); - this.TimeScaleCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimeScale",config.GetDataProvider()); + this.TimeScaleCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimeScale", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "TimeScalePres", "TIMESCALEPRES"); - this.TimeScalePresCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimeScalePres",config.GetDataProvider()); + this.TimeScalePresCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimeScalePres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "Regular", "REGULAR"); - this.RegularCol = new Column4Parameterized(tmpColumnName, this.Alias,"Regular",config.GetDataProvider()); + this.RegularCol = new Column4Parameterized(tmpColumnName, this.Alias, "Regular", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "TimeUnit", "TIMEUNIT"); - this.TimeUnitCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimeUnit",config.GetDataProvider()); + this.TimeUnitCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimeUnit", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "Frequency", "FREQUENCY"); - this.FrequencyCol = new Column4Parameterized(tmpColumnName, this.Alias,"Frequency",config.GetDataProvider()); + this.FrequencyCol = new Column4Parameterized(tmpColumnName, this.Alias, "Frequency", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "StoreFormat", "STOREFORMAT"); - this.StoreFormatCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreFormat",config.GetDataProvider()); + this.StoreFormatCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreFormat", config.GetDataProvider()); } @@ -3095,12 +3095,12 @@ public class TblTimeScaleLang2 : Lang2Tab public Lang2Column4Parameterized PresTextCol; internal TblTimeScaleLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("TimeScaleLang2","TS2"), config.ExtractTableName("TimeScaleLang2","TIMESCALE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("TimeScaleLang2", "TS2"), config.ExtractTableName("TimeScaleLang2", "TIMESCALE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "TimeScale" , "TIMESCALE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "TimeScale", "TIMESCALE"); this.TimeScaleCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3141,17 +3141,17 @@ public class TblVSValue : Tab public Column4Parameterized SortCodeCol; internal TblVSValue(SqlDbConfig_23 config) - : base(config.ExtractAliasName("VSValue","VVL"), config.ExtractTableName("VSValue","VSVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("VSValue", "VVL"), config.ExtractTableName("VSValue", "VSVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("VSValue", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("VSValue", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("VSValue", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("VSValue", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); } @@ -3191,16 +3191,16 @@ public class TblVSValueLang2 : Lang2Tab public Lang2Column4Parameterized SortCodeCol; internal TblVSValueLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("VSValueLang2","VV2"), config.ExtractTableName("VSValueLang2","VSVALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("VSValueLang2", "VV2"), config.ExtractTableName("VSValueLang2", "VSVALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueSet" , "VALUESET"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueSet", "VALUESET"); this.ValueSetCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValuePool" , "VALUEPOOL"); + tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueCode" , "VALUECODE"); + tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueCode", "VALUECODE"); this.ValueCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VSValueLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("VSValueLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3282,25 +3282,25 @@ public class TblValue : Tab public Column4Parameterized FootnoteCol; internal TblValue(SqlDbConfig_23 config) - : base(config.ExtractAliasName("Value","VAL"), config.ExtractTableName("Value","VALUE"), config.MetaOwner) + : base(config.ExtractAliasName("Value", "VAL"), config.ExtractTableName("Value", "VALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Value", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "Unit", "UNIT"); - this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias,"Unit",config.GetDataProvider()); + this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias, "Unit", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "ValueTextS", "VALUETEXTS"); - this.ValueTextSCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueTextS",config.GetDataProvider()); + this.ValueTextSCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueTextS", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "ValueTextL", "VALUETEXTL"); - this.ValueTextLCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueTextL",config.GetDataProvider()); + this.ValueTextLCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueTextL", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "Footnote", "FOOTNOTE"); - this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"Footnote",config.GetDataProvider()); + this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "Footnote", config.GetDataProvider()); } @@ -3370,20 +3370,20 @@ public class TblValueLang2 : Lang2Tab public Lang2Column4Parameterized ValueTextLCol; internal TblValueLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("ValueLang2","VA2"), config.ExtractTableName("ValueLang2","VALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValueLang2", "VA2"), config.ExtractTableName("ValueLang2", "VALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValuePool" , "VALUEPOOL"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueCode" , "VALUECODE"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueCode", "VALUECODE"); this.ValueCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "Unit" , "UNIT"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "Unit", "UNIT"); this.UnitCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextS" , "VALUETEXTS"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextS", "VALUETEXTS"); this.ValueTextSCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextL" , "VALUETEXTL"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextL", "VALUETEXTL"); this.ValueTextLCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3436,23 +3436,23 @@ public class TblValueGroup : Tab public Column4Parameterized SortCodeCol; internal TblValueGroup(SqlDbConfig_23 config) - : base(config.ExtractAliasName("ValueGroup","VPL"), config.ExtractTableName("ValueGroup","VALUEGROUP"), config.MetaOwner) + : base(config.ExtractAliasName("ValueGroup", "VPL"), config.ExtractTableName("ValueGroup", "VALUEGROUP"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValueGroup", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "GroupCode", "GROUPCODE"); - this.GroupCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"GroupCode",config.GetDataProvider()); + this.GroupCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "GroupCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "GroupLevel", "GROUPLEVEL"); - this.GroupLevelCol = new Column4Parameterized(tmpColumnName, this.Alias,"GroupLevel",config.GetDataProvider()); + this.GroupLevelCol = new Column4Parameterized(tmpColumnName, this.Alias, "GroupLevel", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "ValueLevel", "VALUELEVEL"); - this.ValueLevelCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueLevel",config.GetDataProvider()); + this.ValueLevelCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueLevel", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); } @@ -3489,16 +3489,16 @@ public class TblValueGroupLang2 : Lang2Tab public Lang2Column4Parameterized SortCodeCol; internal TblValueGroupLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("ValueGroupLang2","VL2"), config.ExtractTableName("ValueGroupLang2","VALUEGROUP_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValueGroupLang2", "VL2"), config.ExtractTableName("ValueGroupLang2", "VALUEGROUP_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "Grouping" , "GROUPING"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "Grouping", "GROUPING"); this.GroupingCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "GroupCode" , "GROUPCODE"); + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "GroupCode", "GROUPCODE"); this.GroupCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "ValueCode" , "VALUECODE"); + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "ValueCode", "VALUECODE"); this.ValueCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3565,23 +3565,23 @@ public class TblValuePool : Tab public Column4Parameterized MetaIdCol; internal TblValuePool(SqlDbConfig_23 config) - : base(config.ExtractAliasName("ValuePool","VPL"), config.ExtractTableName("ValuePool","VALUEPOOL"), config.MetaOwner) + : base(config.ExtractAliasName("ValuePool", "VPL"), config.ExtractTableName("ValuePool", "VALUEPOOL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValuePool", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "ValuePoolAlias", "VALUEPOOLALIAS"); - this.ValuePoolAliasCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePoolAlias",config.GetDataProvider()); + this.ValuePoolAliasCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePoolAlias", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "ValueTextExists", "VALUETEXTEXISTS"); - this.ValueTextExistsCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueTextExists",config.GetDataProvider()); + this.ValueTextExistsCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueTextExists", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "ValuePres", "VALUEPRES"); - this.ValuePresCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePres",config.GetDataProvider()); + this.ValuePresCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); } @@ -3612,14 +3612,14 @@ public class TblValuePoolLang2 : Lang2Tab public Lang2Column4Parameterized PresTextCol; internal TblValuePoolLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("ValuePoolLang2","VP2"), config.ExtractTableName("ValuePoolLang2","VALUEPOOL_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValuePoolLang2", "VP2"), config.ExtractTableName("ValuePoolLang2", "VALUEPOOL_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePool" , "VALUEPOOL"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePoolAlias" , "VALUEPOOLALIAS"); + tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePoolAlias", "VALUEPOOLALIAS"); this.ValuePoolAliasCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3708,29 +3708,29 @@ public class TblValueSet : Tab public Column4Parameterized FootnoteCol; internal TblValueSet(SqlDbConfig_23 config) - : base(config.ExtractAliasName("ValueSet","VST"), config.ExtractTableName("ValueSet","VALUESET"), config.MetaOwner) + : base(config.ExtractAliasName("ValueSet", "VST"), config.ExtractTableName("ValueSet", "VALUESET"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValueSet", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "Elimination", "ELIMINATION"); - this.EliminationCol = new Column4Parameterized(tmpColumnName, this.Alias,"Elimination",config.GetDataProvider()); + this.EliminationCol = new Column4Parameterized(tmpColumnName, this.Alias, "Elimination", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "ValuePres", "VALUEPRES"); - this.ValuePresCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePres",config.GetDataProvider()); + this.ValuePresCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "GeoAreaNo", "GEOAREANO"); - this.GeoAreaNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"GeoAreaNo",config.GetDataProvider()); + this.GeoAreaNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "GeoAreaNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "SortCodeExists", "SORTCODEEXISTS"); - this.SortCodeExistsCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCodeExists",config.GetDataProvider()); + this.SortCodeExistsCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCodeExists", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "Footnote", "FOOTNOTE"); - this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"Footnote",config.GetDataProvider()); + this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "Footnote", config.GetDataProvider()); } @@ -3763,14 +3763,14 @@ public class TblValueSetLang2 : Lang2Tab public Lang2Column4Parameterized DescriptionCol; internal TblValueSetLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("ValueSetLang2","VS2"), config.ExtractTableName("ValueSetLang2","VALUESET_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValueSetLang2", "VS2"), config.ExtractTableName("ValueSetLang2", "VALUESET_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValueSetLang2", "ValueSet" , "VALUESET"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValueSetLang2", "ValueSet", "VALUESET"); this.ValueSetCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueSetLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("ValueSetLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueSetLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("ValueSetLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3797,13 +3797,13 @@ public class TblValueSetGrouping : Tab public Column4Parameterized GroupingCol; internal TblValueSetGrouping(SqlDbConfig_23 config) - : base(config.ExtractAliasName("ValueSetGrouping","VBL"), config.ExtractTableName("ValueSetGrouping","VALUESETGROUPING"), config.MetaOwner) + : base(config.ExtractAliasName("ValueSetGrouping", "VBL"), config.ExtractTableName("ValueSetGrouping", "VALUESETGROUPING"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValueSetGrouping", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSetGrouping", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); } @@ -3850,19 +3850,19 @@ public class TblVariable : Tab public Column4Parameterized FootnoteCol; internal TblVariable(SqlDbConfig_23 config) - : base(config.ExtractAliasName("Variable","VBL"), config.ExtractTableName("Variable","VARIABLE"), config.MetaOwner) + : base(config.ExtractAliasName("Variable", "VBL"), config.ExtractTableName("Variable", "VARIABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Variable", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Variable", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Variable", "VariableInfo", "VARIABLEINFO"); - this.VariableInfoCol = new Column4Parameterized(tmpColumnName, this.Alias,"VariableInfo",config.GetDataProvider()); + this.VariableInfoCol = new Column4Parameterized(tmpColumnName, this.Alias, "VariableInfo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Variable", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Variable", "Footnote", "FOOTNOTE"); - this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"Footnote",config.GetDataProvider()); + this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "Footnote", config.GetDataProvider()); } @@ -3888,12 +3888,12 @@ public class TblVariableLang2 : Lang2Tab public Lang2Column4Parameterized PresTextCol; internal TblVariableLang2(SqlDbConfig_23 config) - : base(config.ExtractAliasName("VariableLang2","VB2"), config.ExtractTableName("VariableLang2","VARIABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("VariableLang2", "VB2"), config.ExtractTableName("VariableLang2", "VARIABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("VariableLang2", "Variable" , "VARIABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("VariableLang2", "Variable", "VARIABLE"); this.VariableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VariableLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("VariableLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } diff --git a/PCAxis.Sql/DbConfig/SqlDbConfig_24.cs b/PCAxis.Sql/DbConfig/SqlDbConfig_24.cs index c78edb2..cab7e9b 100644 --- a/PCAxis.Sql/DbConfig/SqlDbConfig_24.cs +++ b/PCAxis.Sql/DbConfig/SqlDbConfig_24.cs @@ -1,7 +1,7 @@ using System; -using System.Globalization; using System.Xml; using System.Xml.XPath; + using log4net; //This code is generated. @@ -220,7 +220,7 @@ public SqlDbConfig_24(XmlReader xmlReader, XPathNavigator nav) #region structs - + /// /// The table contains information on the attribute on the observation values. @@ -267,25 +267,25 @@ public class TblAttribute : Tab public Column4Parameterized ColumnLengthCol; internal TblAttribute(SqlDbConfig_24 config) - : base(config.ExtractAliasName("Attribute","ATT"), config.ExtractTableName("Attribute","ATTRIBUTE"), config.MetaOwner) + : base(config.ExtractAliasName("Attribute", "ATT"), config.ExtractTableName("Attribute", "ATTRIBUTE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Attribute", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "Attribute", "ATTRIBUTE"); - this.AttributeCol = new Column4Parameterized(tmpColumnName, this.Alias,"Attribute",config.GetDataProvider()); + this.AttributeCol = new Column4Parameterized(tmpColumnName, this.Alias, "Attribute", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "AttributeColumn", "ATTRIBUTECOLUMN"); - this.AttributeColumnCol = new Column4Parameterized(tmpColumnName, this.Alias,"AttributeColumn",config.GetDataProvider()); + this.AttributeColumnCol = new Column4Parameterized(tmpColumnName, this.Alias, "AttributeColumn", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "SequenceNo", "SEQUENCENO"); - this.SequenceNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"SequenceNo",config.GetDataProvider()); + this.SequenceNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "SequenceNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Attribute", "ColumnLength", "COLUMNLENGTH"); - this.ColumnLengthCol = new Column4Parameterized(tmpColumnName, this.Alias,"ColumnLength",config.GetDataProvider()); + this.ColumnLengthCol = new Column4Parameterized(tmpColumnName, this.Alias, "ColumnLength", config.GetDataProvider()); } @@ -315,16 +315,16 @@ public class TblAttributeLang2 : Lang2Tab public Lang2Column4Parameterized DescriptionCol; internal TblAttributeLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("AttributeLang2","AT2"), config.ExtractTableName("AttributeLang2","ATTRIBUTE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("AttributeLang2", "AT2"), config.ExtractTableName("AttributeLang2", "ATTRIBUTE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("AttributeLang2", "MainTable" , "MAINTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("AttributeLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("AttributeLang2", "Attribute" , "ATTRIBUTE"); + tmpColumnName = config.ExtractColumnName("AttributeLang2", "Attribute", "ATTRIBUTE"); this.AttributeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("AttributeLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("AttributeLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("AttributeLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("AttributeLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -515,61 +515,61 @@ public class TblContents : Tab public Column4Parameterized MetaIdCol; internal TblContents(SqlDbConfig_24 config) - : base(config.ExtractAliasName("Contents","CNT"), config.ExtractTableName("Contents","CONTENTS"), config.MetaOwner) + : base(config.ExtractAliasName("Contents", "CNT"), config.ExtractTableName("Contents", "CONTENTS"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Contents", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresTextS", "PRESTEXTS"); - this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresTextS",config.GetDataProvider()); + this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresTextS", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresCode", "PRESCODE"); - this.PresCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCode",config.GetDataProvider()); + this.PresCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "Copyright", "COPYRIGHT"); - this.CopyrightCol = new Column4Parameterized(tmpColumnName, this.Alias,"Copyright",config.GetDataProvider()); + this.CopyrightCol = new Column4Parameterized(tmpColumnName, this.Alias, "Copyright", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StatAuthority", "STATAUTHORITY"); - this.StatAuthorityCol = new Column4Parameterized(tmpColumnName, this.Alias,"StatAuthority",config.GetDataProvider()); + this.StatAuthorityCol = new Column4Parameterized(tmpColumnName, this.Alias, "StatAuthority", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "Producer", "PRODUCER"); - this.ProducerCol = new Column4Parameterized(tmpColumnName, this.Alias,"Producer",config.GetDataProvider()); + this.ProducerCol = new Column4Parameterized(tmpColumnName, this.Alias, "Producer", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "LastUpdated", "LASTUPDATED"); - this.LastUpdatedCol = new Column4Parameterized(tmpColumnName, this.Alias,"LastUpdated",config.GetDataProvider()); + this.LastUpdatedCol = new Column4Parameterized(tmpColumnName, this.Alias, "LastUpdated", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "Published", "PUBLISHED"); - this.PublishedCol = new Column4Parameterized(tmpColumnName, this.Alias,"Published",config.GetDataProvider()); + this.PublishedCol = new Column4Parameterized(tmpColumnName, this.Alias, "Published", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "Unit", "UNIT"); - this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias,"Unit",config.GetDataProvider()); + this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias, "Unit", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresDecimals", "PRESDECIMALS"); - this.PresDecimalsCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresDecimals",config.GetDataProvider()); + this.PresDecimalsCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresDecimals", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresCellsZero", "PRESCELLSZERO"); - this.PresCellsZeroCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCellsZero",config.GetDataProvider()); + this.PresCellsZeroCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCellsZero", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "PresMissingLine", "PRESMISSINGLINE"); - this.PresMissingLineCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresMissingLine",config.GetDataProvider()); + this.PresMissingLineCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresMissingLine", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "AggregPossible", "AGGREGPOSSIBLE"); - this.AggregPossibleCol = new Column4Parameterized(tmpColumnName, this.Alias,"AggregPossible",config.GetDataProvider()); + this.AggregPossibleCol = new Column4Parameterized(tmpColumnName, this.Alias, "AggregPossible", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "RefPeriod", "REFPERIOD"); - this.RefPeriodCol = new Column4Parameterized(tmpColumnName, this.Alias,"RefPeriod",config.GetDataProvider()); + this.RefPeriodCol = new Column4Parameterized(tmpColumnName, this.Alias, "RefPeriod", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StockFA", "STOCKFA"); - this.StockFACol = new Column4Parameterized(tmpColumnName, this.Alias,"StockFA",config.GetDataProvider()); + this.StockFACol = new Column4Parameterized(tmpColumnName, this.Alias, "StockFA", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "BasePeriod", "BASEPERIOD"); - this.BasePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias,"BasePeriod",config.GetDataProvider()); + this.BasePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias, "BasePeriod", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "CFPrices", "CFPRICES"); - this.CFPricesCol = new Column4Parameterized(tmpColumnName, this.Alias,"CFPrices",config.GetDataProvider()); + this.CFPricesCol = new Column4Parameterized(tmpColumnName, this.Alias, "CFPrices", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "DayAdj", "DAYADJ"); - this.DayAdjCol = new Column4Parameterized(tmpColumnName, this.Alias,"DayAdj",config.GetDataProvider()); + this.DayAdjCol = new Column4Parameterized(tmpColumnName, this.Alias, "DayAdj", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "SeasAdj", "SEASADJ"); - this.SeasAdjCol = new Column4Parameterized(tmpColumnName, this.Alias,"SeasAdj",config.GetDataProvider()); + this.SeasAdjCol = new Column4Parameterized(tmpColumnName, this.Alias, "SeasAdj", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StoreColumnNo", "STORECOLUMNNO"); - this.StoreColumnNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreColumnNo",config.GetDataProvider()); + this.StoreColumnNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreColumnNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StoreFormat", "STOREFORMAT"); - this.StoreFormatCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreFormat",config.GetDataProvider()); + this.StoreFormatCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreFormat", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StoreNoChar", "STORENOCHAR"); - this.StoreNoCharCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreNoChar",config.GetDataProvider()); + this.StoreNoCharCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreNoChar", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "StoreDecimals", "STOREDECIMALS"); - this.StoreDecimalsCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreDecimals",config.GetDataProvider()); + this.StoreDecimalsCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreDecimals", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Contents", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); } @@ -632,22 +632,22 @@ public class TblContentsLang2 : Lang2Tab public Lang2Column4Parameterized BasePeriodCol; internal TblContentsLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("ContentsLang2","CN2"), config.ExtractTableName("ContentsLang2","CONTENTS_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ContentsLang2", "CN2"), config.ExtractTableName("ContentsLang2", "CONTENTS_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ContentsLang2", "MainTable" , "MAINTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ContentsLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "Contents" , "CONTENTS"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "Contents", "CONTENTS"); this.ContentsCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresTextS" , "PRESTEXTS"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "PresTextS", "PRESTEXTS"); this.PresTextSCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "Unit" , "UNIT"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "Unit", "UNIT"); this.UnitCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "RefPeriod" , "REFPERIOD"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "RefPeriod", "REFPERIOD"); this.RefPeriodCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ContentsLang2", "BasePeriod" , "BASEPERIOD"); + tmpColumnName = config.ExtractColumnName("ContentsLang2", "BasePeriod", "BASEPERIOD"); this.BasePeriodCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -677,15 +677,15 @@ public class TblContentsTime : Tab public Column4Parameterized TimePeriodCol; internal TblContentsTime(SqlDbConfig_24 config) - : base(config.ExtractAliasName("ContentsTime","CTM"), config.ExtractTableName("ContentsTime","CONTENTSTIME"), config.MetaOwner) + : base(config.ExtractAliasName("ContentsTime", "CTM"), config.ExtractTableName("ContentsTime", "CONTENTSTIME"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ContentsTime", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ContentsTime", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ContentsTime", "TimePeriod", "TIMEPERIOD"); - this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimePeriod",config.GetDataProvider()); + this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimePeriod", config.GetDataProvider()); } @@ -711,15 +711,15 @@ public class TblDataStorage : Tab public Column4Parameterized DatabaseNameCol; internal TblDataStorage(SqlDbConfig_24 config) - : base(config.ExtractAliasName("DataStorage","DST"), config.ExtractTableName("DataStorage","DATASTORAGE"), config.MetaOwner) + : base(config.ExtractAliasName("DataStorage", "DST"), config.ExtractTableName("DataStorage", "DATASTORAGE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("DataStorage", "ProductCode", "PRODUCTCODE"); - this.ProductCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ProductCode",config.GetDataProvider()); + this.ProductCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ProductCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("DataStorage", "ServerName", "SERVERNAME"); - this.ServerNameCol = new Column4Parameterized(tmpColumnName, this.Alias,"ServerName",config.GetDataProvider()); + this.ServerNameCol = new Column4Parameterized(tmpColumnName, this.Alias, "ServerName", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("DataStorage", "DatabaseName", "DATABASENAME"); - this.DatabaseNameCol = new Column4Parameterized(tmpColumnName, this.Alias,"DatabaseName",config.GetDataProvider()); + this.DatabaseNameCol = new Column4Parameterized(tmpColumnName, this.Alias, "DatabaseName", config.GetDataProvider()); } @@ -784,21 +784,21 @@ public class TblFootnote : Tab public Column4Parameterized PresCharacterCol; internal TblFootnote(SqlDbConfig_24 config) - : base(config.ExtractAliasName("Footnote","FNT"), config.ExtractTableName("Footnote","FOOTNOTE"), config.MetaOwner) + : base(config.ExtractAliasName("Footnote", "FNT"), config.ExtractTableName("Footnote", "FOOTNOTE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Footnote", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Footnote", "FootnoteType", "FOOTNOTETYPE"); - this.FootnoteTypeCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteType",config.GetDataProvider()); + this.FootnoteTypeCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteType", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Footnote", "ShowFootnote", "SHOWFOOTNOTE"); - this.ShowFootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"ShowFootnote",config.GetDataProvider()); + this.ShowFootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "ShowFootnote", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Footnote", "MandOpt", "MANDOPT"); - this.MandOptCol = new Column4Parameterized(tmpColumnName, this.Alias,"MandOpt",config.GetDataProvider()); + this.MandOptCol = new Column4Parameterized(tmpColumnName, this.Alias, "MandOpt", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Footnote", "FootnoteText", "FOOTNOTETEXT"); - this.FootnoteTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteText",config.GetDataProvider()); + this.FootnoteTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Footnote", "PresCharacter", "PRESCHARACTER"); - this.PresCharacterCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCharacter",config.GetDataProvider()); + this.PresCharacterCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCharacter", config.GetDataProvider()); } @@ -822,12 +822,12 @@ public class TblFootnoteLang2 : Lang2Tab public Lang2Column4Parameterized FootnoteTextCol; internal TblFootnoteLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteLang2","FN2"), config.ExtractTableName("FootnoteLang2","FOOTNOTE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("FootnoteLang2", "FN2"), config.ExtractTableName("FootnoteLang2", "FOOTNOTE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteNo" , "FOOTNOTENO"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteNo", "FOOTNOTENO"); this.FootnoteNoCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteText" , "FOOTNOTETEXT"); + tmpColumnName = config.ExtractColumnName("FootnoteLang2", "FootnoteText", "FOOTNOTETEXT"); this.FootnoteTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -873,19 +873,19 @@ public class TblFootnoteContTime : Tab public Column4Parameterized CellnoteCol; internal TblFootnoteContTime(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteContTime","FCT"), config.ExtractTableName("FootnoteContTime","FOOTNOTECONTTIME"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContTime", "FCT"), config.ExtractTableName("FootnoteContTime", "FOOTNOTECONTTIME"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContTime", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContTime", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContTime", "TimePeriod", "TIMEPERIOD"); - this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimePeriod",config.GetDataProvider()); + this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimePeriod", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContTime", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContTime", "Cellnote", "CELLNOTE"); - this.CellnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"Cellnote",config.GetDataProvider()); + this.CellnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "Cellnote", config.GetDataProvider()); } @@ -942,23 +942,23 @@ public class TblFootnoteContValue : Tab public Column4Parameterized CellnoteCol; internal TblFootnoteContValue(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteContValue","FCA"), config.ExtractTableName("FootnoteContValue","FOOTNOTECONTVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContValue", "FCA"), config.ExtractTableName("FootnoteContValue", "FOOTNOTECONTVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContValue", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContValue", "Cellnote", "CELLNOTE"); - this.CellnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"Cellnote",config.GetDataProvider()); + this.CellnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "Cellnote", config.GetDataProvider()); } @@ -996,17 +996,17 @@ public class TblFootnoteContVbl : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteContVbl(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteContVbl","FCB"), config.ExtractTableName("FootnoteContVbl","FOOTNOTECONTVBL"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContVbl", "FCB"), config.ExtractTableName("FootnoteContVbl", "FOOTNOTECONTVBL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContVbl", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContVbl", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContVbl", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContVbl", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1038,15 +1038,15 @@ public class TblFootnoteContents : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteContents(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteContents","FCO"), config.ExtractTableName("FootnoteContents","FOOTNOTECONTENTS"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteContents", "FCO"), config.ExtractTableName("FootnoteContents", "FOOTNOTECONTENTS"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteContents", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContents", "Contents", "CONTENTS"); - this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias,"Contents",config.GetDataProvider()); + this.ContentsCol = new Column4Parameterized(tmpColumnName, this.Alias, "Contents", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteContents", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1070,13 +1070,13 @@ public class TblFootnoteGrouping : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteGrouping(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteGrouping","FCO"), config.ExtractTableName("FootnoteGrouping","FOOTNOTEGROUPING"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteGrouping", "FCO"), config.ExtractTableName("FootnoteGrouping", "FOOTNOTEGROUPING"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteGrouping", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteGrouping", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1104,13 +1104,13 @@ public class TblFootnoteMainTable : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteMainTable(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteMainTable","FMT"), config.ExtractTableName("FootnoteMainTable","FOOTNOTEMAINTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMainTable", "FMT"), config.ExtractTableName("FootnoteMainTable", "FOOTNOTEMAINTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMainTable", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMainTable", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1138,15 +1138,15 @@ public class TblFootnoteMaintTime : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteMaintTime(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteMaintTime","FNM"), config.ExtractTableName("FootnoteMaintTime","FOOTNOTEMAINTTIME"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMaintTime", "FNM"), config.ExtractTableName("FootnoteMaintTime", "FOOTNOTEMAINTTIME"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMaintTime", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintTime", "TimePeriod", "TIMEPERIOD"); - this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimePeriod",config.GetDataProvider()); + this.TimePeriodCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimePeriod", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintTime", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1190,19 +1190,19 @@ public class TblFootnoteMaintValue : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteMaintValue(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteMaintValue","FMV"), config.ExtractTableName("FootnoteMaintValue","FOOTNOTEMAINTVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMaintValue", "FMV"), config.ExtractTableName("FootnoteMaintValue", "FOOTNOTEMAINTVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMaintValue", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1232,15 +1232,15 @@ public class TblFootnoteMenuSel : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteMenuSel(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteMenuSel","FMS"), config.ExtractTableName("FootnoteMenuSel","FOOTNOTEMENUSEL"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteMenuSel", "FMS"), config.ExtractTableName("FootnoteMenuSel", "FOOTNOTEMENUSEL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteMenuSel", "Menu", "MENU"); - this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias,"Menu",config.GetDataProvider()); + this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias, "Menu", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMenuSel", "Selection", "SELECTION"); - this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Selection",config.GetDataProvider()); + this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Selection", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteMenuSel", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1272,15 +1272,15 @@ public class TblFootnoteSubTable : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteSubTable(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteSubTable","FST"), config.ExtractTableName("FootnoteSubTable","FOOTNOTESUBTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteSubTable", "FST"), config.ExtractTableName("FootnoteSubTable", "FOOTNOTESUBTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteSubTable", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteSubTable", "SubTable", "SUBTABLE"); - this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"SubTable",config.GetDataProvider()); + this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "SubTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteSubTable", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1312,15 +1312,15 @@ public class TblFootnoteValue : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteValue(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteValue","FVL"), config.ExtractTableName("FootnoteValue","FOOTNOTEVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteValue", "FVL"), config.ExtractTableName("FootnoteValue", "FOOTNOTEVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteValue", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteValue", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteValue", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1358,17 +1358,17 @@ public class TblFootnoteValueSetValue : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteValueSetValue(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteValueSetValue","FVS"), config.ExtractTableName("FootnoteValueSetValue","FOOTNOTEVALUESETVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteValueSetValue", "FVS"), config.ExtractTableName("FootnoteValueSetValue", "FOOTNOTEVALUESETVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteValueSetValue", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteValueSetValue", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteValueSetValue", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteValueSetValue", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1394,13 +1394,13 @@ public class TblFootnoteVariable : Tab public Column4Parameterized FootnoteNoCol; internal TblFootnoteVariable(SqlDbConfig_24 config) - : base(config.ExtractAliasName("FootnoteVariable","FVB"), config.ExtractTableName("FootnoteVariable","FOOTNOTEVARIABLE"), config.MetaOwner) + : base(config.ExtractAliasName("FootnoteVariable", "FVB"), config.ExtractTableName("FootnoteVariable", "FOOTNOTEVARIABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("FootnoteVariable", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("FootnoteVariable", "FootnoteNo", "FOOTNOTENO"); - this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FootnoteNo",config.GetDataProvider()); + this.FootnoteNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FootnoteNo", config.GetDataProvider()); } @@ -1478,27 +1478,27 @@ public class TblGrouping : Tab public Column4Parameterized DefaultInGuiCol; internal TblGrouping(SqlDbConfig_24 config) - : base(config.ExtractAliasName("Grouping","GRP"), config.ExtractTableName("Grouping","GROUPING"), config.MetaOwner) + : base(config.ExtractAliasName("Grouping", "GRP"), config.ExtractTableName("Grouping", "GROUPING"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Grouping", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "Hierarchy", "HIERARCHY"); - this.HierarchyCol = new Column4Parameterized(tmpColumnName, this.Alias,"Hierarchy",config.GetDataProvider()); + this.HierarchyCol = new Column4Parameterized(tmpColumnName, this.Alias, "Hierarchy", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "GroupPres", "GROUPPRES"); - this.GroupPresCol = new Column4Parameterized(tmpColumnName, this.Alias,"GroupPres",config.GetDataProvider()); + this.GroupPresCol = new Column4Parameterized(tmpColumnName, this.Alias, "GroupPres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Grouping", "DefaultInGui", "DEFAULTINGUI"); - this.DefaultInGuiCol = new Column4Parameterized(tmpColumnName, this.Alias,"DefaultInGui",config.GetDataProvider()); + this.DefaultInGuiCol = new Column4Parameterized(tmpColumnName, this.Alias, "DefaultInGui", config.GetDataProvider()); } @@ -1534,14 +1534,14 @@ public class TblGroupingLang2 : Lang2Tab public Lang2Column4Parameterized SortCodeCol; internal TblGroupingLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("GroupingLang2","GR2"), config.ExtractTableName("GroupingLang2","GROUPING_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("GroupingLang2", "GR2"), config.ExtractTableName("GroupingLang2", "GROUPING_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("GroupingLang2", "Grouping" , "GROUPING"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("GroupingLang2", "Grouping", "GROUPING"); this.GroupingCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("GroupingLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("GroupingLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -1578,17 +1578,17 @@ public class TblGroupingLevel : Tab public Column4Parameterized GeoAreaNoCol; internal TblGroupingLevel(SqlDbConfig_24 config) - : base(config.ExtractAliasName("GroupingLevel","GRP"), config.ExtractTableName("GroupingLevel","GROUPINGLEVEL"), config.MetaOwner) + : base(config.ExtractAliasName("GroupingLevel", "GRP"), config.ExtractTableName("GroupingLevel", "GROUPINGLEVEL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("GroupingLevel", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("GroupingLevel", "LevelNo", "LEVELNO"); - this.LevelNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"LevelNo",config.GetDataProvider()); + this.LevelNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "LevelNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("GroupingLevel", "LevelText", "LEVELTEXT"); - this.LevelTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"LevelText",config.GetDataProvider()); + this.LevelTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "LevelText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("GroupingLevel", "GeoAreaNo", "GEOAREANO"); - this.GeoAreaNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"GeoAreaNo",config.GetDataProvider()); + this.GeoAreaNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "GeoAreaNo", config.GetDataProvider()); } @@ -1615,14 +1615,14 @@ public class TblGroupingLevelLang2 : Lang2Tab public Lang2Column4Parameterized LevelTextCol; internal TblGroupingLevelLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("GroupingLevelLang2","GR2"), config.ExtractTableName("GroupingLevelLang2","GROUPINGLEVEL_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("GroupingLevelLang2", "GR2"), config.ExtractTableName("GroupingLevelLang2", "GROUPINGLEVEL_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "Grouping" , "GROUPING"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "Grouping", "GROUPING"); this.GroupingCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "LevelNo" , "LEVELNO"); + tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "LevelNo", "LEVELNO"); this.LevelNoCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "LevelText" , "LEVELTEXT"); + tmpColumnName = config.ExtractColumnName("GroupingLevelLang2", "LevelText", "LEVELTEXT"); this.LevelTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -1700,27 +1700,27 @@ public class TblLink : Tab public Column4Parameterized DescriptionCol; internal TblLink(SqlDbConfig_24 config) - : base(config.ExtractAliasName("Link","LNK"), config.ExtractTableName("Link","LINK"), config.MetaOwner) + : base(config.ExtractAliasName("Link", "LNK"), config.ExtractTableName("Link", "LINK"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Link", "LinkId", "LINKID"); - this.LinkIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkId",config.GetDataProvider()); + this.LinkIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "Link", "LINK"); - this.LinkCol = new Column4Parameterized(tmpColumnName, this.Alias,"Link",config.GetDataProvider()); + this.LinkCol = new Column4Parameterized(tmpColumnName, this.Alias, "Link", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "LinkType", "LINKTYPE"); - this.LinkTypeCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkType",config.GetDataProvider()); + this.LinkTypeCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkType", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "LinkFormat", "LINKFORMAT"); - this.LinkFormatCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkFormat",config.GetDataProvider()); + this.LinkFormatCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkFormat", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "LinkText", "LINKTEXT"); - this.LinkTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkText",config.GetDataProvider()); + this.LinkTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "PresCategory", "PRESCATEGORY"); - this.PresCategoryCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCategory",config.GetDataProvider()); + this.PresCategoryCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCategory", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "LinkPres", "LINKPRES"); - this.LinkPresCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkPres",config.GetDataProvider()); + this.LinkPresCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkPres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Link", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); } @@ -1757,18 +1757,18 @@ public class TblLinkLang2 : Lang2Tab public Lang2Column4Parameterized DescriptionCol; internal TblLinkLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("LinkLang2","LN2"), config.ExtractTableName("LinkLang2","LINK_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("LinkLang2", "LN2"), config.ExtractTableName("LinkLang2", "LINK_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkId" , "LINKID"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkId", "LINKID"); this.LinkIdCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "Link" , "LINK"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "Link", "LINK"); this.LinkCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkText" , "LINKTEXT"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "LinkText", "LINKTEXT"); this.LinkTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("LinkLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("LinkLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -1797,15 +1797,15 @@ public class TblLinkMenuSelection : Tab public Column4Parameterized LinkIdCol; internal TblLinkMenuSelection(SqlDbConfig_24 config) - : base(config.ExtractAliasName("LinkMenuSelection","LMS"), config.ExtractTableName("LinkMenuSelection","LINKMENUSELECTION"), config.MetaOwner) + : base(config.ExtractAliasName("LinkMenuSelection", "LMS"), config.ExtractTableName("LinkMenuSelection", "LINKMENUSELECTION"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("LinkMenuSelection", "Menu", "MENU"); - this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias,"Menu",config.GetDataProvider()); + this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias, "Menu", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("LinkMenuSelection", "Selection", "SELECTION"); - this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Selection",config.GetDataProvider()); + this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Selection", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("LinkMenuSelection", "LinkId", "LINKID"); - this.LinkIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"LinkId",config.GetDataProvider()); + this.LinkIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "LinkId", config.GetDataProvider()); } @@ -1906,35 +1906,35 @@ public class TblMainTable : Tab public Column4Parameterized TimeScaleCol; internal TblMainTable(SqlDbConfig_24 config) - : base(config.ExtractAliasName("MainTable","MTA"), config.ExtractTableName("MainTable","MAINTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("MainTable", "MTA"), config.ExtractTableName("MainTable", "MAINTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MainTable", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "TableStatus", "TABLESTATUS"); - this.TableStatusCol = new Column4Parameterized(tmpColumnName, this.Alias,"TableStatus",config.GetDataProvider()); + this.TableStatusCol = new Column4Parameterized(tmpColumnName, this.Alias, "TableStatus", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "PresTextS", "PRESTEXTS"); - this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresTextS",config.GetDataProvider()); + this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresTextS", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "ContentsVariable", "CONTENTSVARIABLE"); - this.ContentsVariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"ContentsVariable",config.GetDataProvider()); + this.ContentsVariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "ContentsVariable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "TableId", "TABLEID"); - this.TableIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"TableId",config.GetDataProvider()); + this.TableIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "TableId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "PresCategory", "PRESCATEGORY"); - this.PresCategoryCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCategory",config.GetDataProvider()); + this.PresCategoryCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCategory", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "FirstPublished", "FIRSTPUBLISHED"); - this.FirstPublishedCol = new Column4Parameterized(tmpColumnName, this.Alias,"FirstPublished",config.GetDataProvider()); + this.FirstPublishedCol = new Column4Parameterized(tmpColumnName, this.Alias, "FirstPublished", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "SpecCharExists", "SPECCHAREXISTS"); - this.SpecCharExistsCol = new Column4Parameterized(tmpColumnName, this.Alias,"SpecCharExists",config.GetDataProvider()); + this.SpecCharExistsCol = new Column4Parameterized(tmpColumnName, this.Alias, "SpecCharExists", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "SubjectCode", "SUBJECTCODE"); - this.SubjectCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SubjectCode",config.GetDataProvider()); + this.SubjectCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SubjectCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "ProductCode", "PRODUCTCODE"); - this.ProductCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ProductCode",config.GetDataProvider()); + this.ProductCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ProductCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTable", "TimeScale", "TIMESCALE"); - this.TimeScaleCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimeScale",config.GetDataProvider()); + this.TimeScaleCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimeScale", config.GetDataProvider()); } @@ -1978,16 +1978,16 @@ public class TblMainTableLang2 : Lang2Tab public Lang2Column4Parameterized ContentsVariableCol; internal TblMainTableLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("MainTableLang2","MT2"), config.ExtractTableName("MainTableLang2","MAINTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("MainTableLang2", "MT2"), config.ExtractTableName("MainTableLang2", "MAINTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("MainTableLang2", "MainTable" , "MAINTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("MainTableLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresTextS" , "PRESTEXTS"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "PresTextS", "PRESTEXTS"); this.PresTextSCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MainTableLang2", "ContentsVariable" , "CONTENTSVARIABLE"); + tmpColumnName = config.ExtractColumnName("MainTableLang2", "ContentsVariable", "CONTENTSVARIABLE"); this.ContentsVariableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -2024,15 +2024,15 @@ public class TblMainTablePerson : Tab public Column4Parameterized RolePersonCol; internal TblMainTablePerson(SqlDbConfig_24 config) - : base(config.ExtractAliasName("MainTablePerson","MTP"), config.ExtractTableName("MainTablePerson","MAINTABLEPERSON"), config.MetaOwner) + : base(config.ExtractAliasName("MainTablePerson", "MTP"), config.ExtractTableName("MainTablePerson", "MAINTABLEPERSON"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MainTablePerson", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTablePerson", "PersonCode", "PERSONCODE"); - this.PersonCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"PersonCode",config.GetDataProvider()); + this.PersonCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "PersonCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTablePerson", "RolePerson", "ROLEPERSON"); - this.RolePersonCol = new Column4Parameterized(tmpColumnName, this.Alias,"RolePerson",config.GetDataProvider()); + this.RolePersonCol = new Column4Parameterized(tmpColumnName, this.Alias, "RolePerson", config.GetDataProvider()); } @@ -2075,19 +2075,19 @@ public class TblMainTableVariableHierarchy : Tab public Column4Parameterized AllLevelsStoredCol; internal TblMainTableVariableHierarchy(SqlDbConfig_24 config) - : base(config.ExtractAliasName("MainTableVariableHierarchy","MTP"), config.ExtractTableName("MainTableVariableHierarchy","MAINTABLEVARIABLEHIERARCHY"), config.MetaOwner) + : base(config.ExtractAliasName("MainTableVariableHierarchy", "MTP"), config.ExtractTableName("MainTableVariableHierarchy", "MAINTABLEVARIABLEHIERARCHY"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "ShowLevels", "SHOWLEVELS"); - this.ShowLevelsCol = new Column4Parameterized(tmpColumnName, this.Alias,"ShowLevels",config.GetDataProvider()); + this.ShowLevelsCol = new Column4Parameterized(tmpColumnName, this.Alias, "ShowLevels", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MainTableVariableHierarchy", "AllLevelsStored", "ALLLEVELSSTORED"); - this.AllLevelsStoredCol = new Column4Parameterized(tmpColumnName, this.Alias,"AllLevelsStored",config.GetDataProvider()); + this.AllLevelsStoredCol = new Column4Parameterized(tmpColumnName, this.Alias, "AllLevelsStored", config.GetDataProvider()); } @@ -2151,27 +2151,27 @@ public class TblMenuSelection : Tab public Column4Parameterized MetaIdCol; internal TblMenuSelection(SqlDbConfig_24 config) - : base(config.ExtractAliasName("MenuSelection","MSL"), config.ExtractTableName("MenuSelection","MENUSELECTION"), config.MetaOwner) + : base(config.ExtractAliasName("MenuSelection", "MSL"), config.ExtractTableName("MenuSelection", "MENUSELECTION"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MenuSelection", "Menu", "MENU"); - this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias,"Menu",config.GetDataProvider()); + this.MenuCol = new Column4Parameterized(tmpColumnName, this.Alias, "Menu", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "Selection", "SELECTION"); - this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Selection",config.GetDataProvider()); + this.SelectionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Selection", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "PresTextS", "PRESTEXTS"); - this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresTextS",config.GetDataProvider()); + this.PresTextSCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresTextS", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "LevelNo", "LEVELNO"); - this.LevelNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"LevelNo",config.GetDataProvider()); + this.LevelNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "LevelNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "Presentation", "PRESENTATION"); - this.PresentationCol = new Column4Parameterized(tmpColumnName, this.Alias,"Presentation",config.GetDataProvider()); + this.PresentationCol = new Column4Parameterized(tmpColumnName, this.Alias, "Presentation", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MenuSelection", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); } @@ -2226,22 +2226,22 @@ public class TblMenuSelectionLang2 : Lang2Tab public Lang2Column4Parameterized PresentationCol; internal TblMenuSelectionLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("MenuSelectionLang2","MS2"), config.ExtractTableName("MenuSelectionLang2","MENUSELECTION_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("MenuSelectionLang2", "MS2"), config.ExtractTableName("MenuSelectionLang2", "MENUSELECTION_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Menu" , "MENU"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Menu", "MENU"); this.MenuCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Selection" , "SELECTION"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Selection", "SELECTION"); this.SelectionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresTextS" , "PRESTEXTS"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "PresTextS", "PRESTEXTS"); this.PresTextSCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Presentation" , "PRESENTATION"); + tmpColumnName = config.ExtractColumnName("MenuSelectionLang2", "Presentation", "PRESENTATION"); this.PresentationCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -2329,15 +2329,15 @@ public class TblMetaAdm : Tab public Column4Parameterized DescriptionCol; internal TblMetaAdm(SqlDbConfig_24 config) - : base(config.ExtractAliasName("MetaAdm","MAD"), config.ExtractTableName("MetaAdm","METAADM"), config.MetaOwner) + : base(config.ExtractAliasName("MetaAdm", "MAD"), config.ExtractTableName("MetaAdm", "METAADM"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MetaAdm", "Property", "PROPERTY"); - this.PropertyCol = new Column4Parameterized(tmpColumnName, this.Alias,"Property",config.GetDataProvider()); + this.PropertyCol = new Column4Parameterized(tmpColumnName, this.Alias, "Property", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MetaAdm", "Value", "VALUE"); - this.ValueCol = new Column4Parameterized(tmpColumnName, this.Alias,"Value",config.GetDataProvider()); + this.ValueCol = new Column4Parameterized(tmpColumnName, this.Alias, "Value", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MetaAdm", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); } @@ -2368,15 +2368,15 @@ public class TblMetabaseInfo : Tab public Column4Parameterized DatabaseRoleCol; internal TblMetabaseInfo(SqlDbConfig_24 config) - : base(config.ExtractAliasName("MetabaseInfo","MBI"), config.ExtractTableName("MetabaseInfo","METABASEINFO"), config.MetaOwner) + : base(config.ExtractAliasName("MetabaseInfo", "MBI"), config.ExtractTableName("MetabaseInfo", "METABASEINFO"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("MetabaseInfo", "Model", "MODEL"); - this.ModelCol = new Column4Parameterized(tmpColumnName, this.Alias,"Model",config.GetDataProvider()); + this.ModelCol = new Column4Parameterized(tmpColumnName, this.Alias, "Model", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MetabaseInfo", "ModelVersion", "MODELVERSION"); - this.ModelVersionCol = new Column4Parameterized(tmpColumnName, this.Alias,"ModelVersion",config.GetDataProvider()); + this.ModelVersionCol = new Column4Parameterized(tmpColumnName, this.Alias, "ModelVersion", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("MetabaseInfo", "DatabaseRole", "DATABASEROLE"); - this.DatabaseRoleCol = new Column4Parameterized(tmpColumnName, this.Alias,"DatabaseRole",config.GetDataProvider()); + this.DatabaseRoleCol = new Column4Parameterized(tmpColumnName, this.Alias, "DatabaseRole", config.GetDataProvider()); } @@ -2419,21 +2419,21 @@ public class TblOrganization : Tab public Column4Parameterized MetaIdCol; internal TblOrganization(SqlDbConfig_24 config) - : base(config.ExtractAliasName("Organization","ORG"), config.ExtractTableName("Organization","ORGANIZATION"), config.MetaOwner) + : base(config.ExtractAliasName("Organization", "ORG"), config.ExtractTableName("Organization", "ORGANIZATION"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Organization", "OrganizationCode", "ORGANIZATIONCODE"); - this.OrganizationCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"OrganizationCode",config.GetDataProvider()); + this.OrganizationCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "OrganizationCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Organization", "OrganizationName", "ORGANIZATIONNAME"); - this.OrganizationNameCol = new Column4Parameterized(tmpColumnName, this.Alias,"OrganizationName",config.GetDataProvider()); + this.OrganizationNameCol = new Column4Parameterized(tmpColumnName, this.Alias, "OrganizationName", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Organization", "Department", "DEPARTMENT"); - this.DepartmentCol = new Column4Parameterized(tmpColumnName, this.Alias,"Department",config.GetDataProvider()); + this.DepartmentCol = new Column4Parameterized(tmpColumnName, this.Alias, "Department", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Organization", "Unit", "UNIT"); - this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias,"Unit",config.GetDataProvider()); + this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias, "Unit", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Organization", "WebAddress", "WEBADDRESS"); - this.WebAddressCol = new Column4Parameterized(tmpColumnName, this.Alias,"WebAddress",config.GetDataProvider()); + this.WebAddressCol = new Column4Parameterized(tmpColumnName, this.Alias, "WebAddress", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Organization", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); } @@ -2473,18 +2473,18 @@ public class TblOrganizationLang2 : Lang2Tab public Lang2Column4Parameterized WebAddressCol; internal TblOrganizationLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("OrganizationLang2","OR2"), config.ExtractTableName("OrganizationLang2","ORGANIZATION_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("OrganizationLang2", "OR2"), config.ExtractTableName("OrganizationLang2", "ORGANIZATION_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationCode" , "ORGANIZATIONCODE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationCode", "ORGANIZATIONCODE"); this.OrganizationCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationName" , "ORGANIZATIONNAME"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "OrganizationName", "ORGANIZATIONNAME"); this.OrganizationNameCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Department" , "DEPARTMENT"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Department", "DEPARTMENT"); this.DepartmentCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Unit" , "UNIT"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "Unit", "UNIT"); this.UnitCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("OrganizationLang2", "WebAddress" , "WEBADDRESS"); + tmpColumnName = config.ExtractColumnName("OrganizationLang2", "WebAddress", "WEBADDRESS"); this.WebAddressCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -2544,25 +2544,25 @@ public class TblPerson : Tab public Column4Parameterized EmailCol; internal TblPerson(SqlDbConfig_24 config) - : base(config.ExtractAliasName("Person","PRS"), config.ExtractTableName("Person","PERSON"), config.MetaOwner) + : base(config.ExtractAliasName("Person", "PRS"), config.ExtractTableName("Person", "PERSON"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Person", "PersonCode", "PERSONCODE"); - this.PersonCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"PersonCode",config.GetDataProvider()); + this.PersonCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "PersonCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "OrganizationCode", "ORGANIZATIONCODE"); - this.OrganizationCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"OrganizationCode",config.GetDataProvider()); + this.OrganizationCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "OrganizationCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "Forename", "FORENAME"); - this.ForenameCol = new Column4Parameterized(tmpColumnName, this.Alias,"Forename",config.GetDataProvider()); + this.ForenameCol = new Column4Parameterized(tmpColumnName, this.Alias, "Forename", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "Surname", "SURNAME"); - this.SurnameCol = new Column4Parameterized(tmpColumnName, this.Alias,"Surname",config.GetDataProvider()); + this.SurnameCol = new Column4Parameterized(tmpColumnName, this.Alias, "Surname", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "PhonePrefix", "PHONEPREFIX"); - this.PhonePrefixCol = new Column4Parameterized(tmpColumnName, this.Alias,"PhonePrefix",config.GetDataProvider()); + this.PhonePrefixCol = new Column4Parameterized(tmpColumnName, this.Alias, "PhonePrefix", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "PhoneNo", "PHONENO"); - this.PhoneNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"PhoneNo",config.GetDataProvider()); + this.PhoneNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "PhoneNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "FaxNo", "FAXNO"); - this.FaxNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"FaxNo",config.GetDataProvider()); + this.FaxNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "FaxNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Person", "Email", "EMAIL"); - this.EmailCol = new Column4Parameterized(tmpColumnName, this.Alias,"Email",config.GetDataProvider()); + this.EmailCol = new Column4Parameterized(tmpColumnName, this.Alias, "Email", config.GetDataProvider()); } @@ -2608,21 +2608,21 @@ public class TblSecondaryLanguage : Tab public Column4Parameterized LogDateCol; internal TblSecondaryLanguage(SqlDbConfig_24 config) - : base(config.ExtractAliasName("SecondaryLanguage","SLA"), config.ExtractTableName("SecondaryLanguage","SECONDARYLANGUAGE"), config.MetaOwner) + : base(config.ExtractAliasName("SecondaryLanguage", "SLA"), config.ExtractTableName("SecondaryLanguage", "SECONDARYLANGUAGE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "Language", "LANGUAGE"); - this.LanguageCol = new Column4Parameterized(tmpColumnName, this.Alias,"Language",config.GetDataProvider()); + this.LanguageCol = new Column4Parameterized(tmpColumnName, this.Alias, "Language", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "CompletelyTranslated", "COMPLETELYTRANSLATED"); - this.CompletelyTranslatedCol = new Column4Parameterized(tmpColumnName, this.Alias,"CompletelyTranslated",config.GetDataProvider()); + this.CompletelyTranslatedCol = new Column4Parameterized(tmpColumnName, this.Alias, "CompletelyTranslated", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "Published", "PUBLISHED"); - this.PublishedCol = new Column4Parameterized(tmpColumnName, this.Alias,"Published",config.GetDataProvider()); + this.PublishedCol = new Column4Parameterized(tmpColumnName, this.Alias, "Published", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "UserId", "USERID"); - this.UserIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"UserId",config.GetDataProvider()); + this.UserIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "UserId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SecondaryLanguage", "LogDate", "LOGDATE"); - this.LogDateCol = new Column4Parameterized(tmpColumnName, this.Alias,"LogDate",config.GetDataProvider()); + this.LogDateCol = new Column4Parameterized(tmpColumnName, this.Alias, "LogDate", config.GetDataProvider()); } @@ -2680,21 +2680,21 @@ public class TblSpecialCharacter : Tab public Column4Parameterized PresTextCol; internal TblSpecialCharacter(SqlDbConfig_24 config) - : base(config.ExtractAliasName("SpecialCharacter","SPC"), config.ExtractTableName("SpecialCharacter","SPECIALCHARACTER"), config.MetaOwner) + : base(config.ExtractAliasName("SpecialCharacter", "SPC"), config.ExtractTableName("SpecialCharacter", "SPECIALCHARACTER"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SpecialCharacter", "CharacterType", "CHARACTERTYPE"); - this.CharacterTypeCol = new Column4Parameterized(tmpColumnName, this.Alias,"CharacterType",config.GetDataProvider()); + this.CharacterTypeCol = new Column4Parameterized(tmpColumnName, this.Alias, "CharacterType", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "PresCharacter", "PRESCHARACTER"); - this.PresCharacterCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresCharacter",config.GetDataProvider()); + this.PresCharacterCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresCharacter", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "AggregPossible", "AGGREGPOSSIBLE"); - this.AggregPossibleCol = new Column4Parameterized(tmpColumnName, this.Alias,"AggregPossible",config.GetDataProvider()); + this.AggregPossibleCol = new Column4Parameterized(tmpColumnName, this.Alias, "AggregPossible", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "DataCellPres", "DATACELLPRES"); - this.DataCellPresCol = new Column4Parameterized(tmpColumnName, this.Alias,"DataCellPres",config.GetDataProvider()); + this.DataCellPresCol = new Column4Parameterized(tmpColumnName, this.Alias, "DataCellPres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "DataCellFilled", "DATACELLFILLED"); - this.DataCellFilledCol = new Column4Parameterized(tmpColumnName, this.Alias,"DataCellFilled",config.GetDataProvider()); + this.DataCellFilledCol = new Column4Parameterized(tmpColumnName, this.Alias, "DataCellFilled", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SpecialCharacter", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); } @@ -2725,14 +2725,14 @@ public class TblSpecialCharacterLang2 : Lang2Tab public Lang2Column4Parameterized PresTextCol; internal TblSpecialCharacterLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("SpecialCharacterLang2","SP2"), config.ExtractTableName("SpecialCharacterLang2","SPECIALCHARACTER_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("SpecialCharacterLang2", "SP2"), config.ExtractTableName("SpecialCharacterLang2", "SPECIALCHARACTER_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "CharacterType" , "CHARACTERTYPE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "CharacterType", "CHARACTERTYPE"); this.CharacterTypeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresCharacter" , "PRESCHARACTER"); + tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresCharacter", "PRESCHARACTER"); this.PresCharacterCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("SpecialCharacterLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -2780,17 +2780,17 @@ public class TblSubTable : Tab public Column4Parameterized CleanTableCol; internal TblSubTable(SqlDbConfig_24 config) - : base(config.ExtractAliasName("SubTable","STB"), config.ExtractTableName("SubTable","SUBTABLE"), config.MetaOwner) + : base(config.ExtractAliasName("SubTable", "STB"), config.ExtractTableName("SubTable", "SUBTABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SubTable", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTable", "SubTable", "SUBTABLE"); - this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"SubTable",config.GetDataProvider()); + this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "SubTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTable", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTable", "CleanTable", "CLEANTABLE"); - this.CleanTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"CleanTable",config.GetDataProvider()); + this.CleanTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "CleanTable", config.GetDataProvider()); } @@ -2826,14 +2826,14 @@ public class TblSubTableLang2 : Lang2Tab public Lang2Column4Parameterized PresTextCol; internal TblSubTableLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("SubTableLang2","ST2"), config.ExtractTableName("SubTableLang2","SUBTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("SubTableLang2", "ST2"), config.ExtractTableName("SubTableLang2", "SUBTABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("SubTableLang2", "MainTable" , "MAINTABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("SubTableLang2", "MainTable", "MAINTABLE"); this.MainTableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SubTableLang2", "SubTable" , "SUBTABLE"); + tmpColumnName = config.ExtractColumnName("SubTableLang2", "SubTable", "SUBTABLE"); this.SubTableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("SubTableLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("SubTableLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -2893,25 +2893,25 @@ public class TblSubTableVariable : Tab public Column4Parameterized DefaultInGuiCol; internal TblSubTableVariable(SqlDbConfig_24 config) - : base(config.ExtractAliasName("SubTableVariable","STV"), config.ExtractTableName("SubTableVariable","SUBTABLEVARIABLE"), config.MetaOwner) + : base(config.ExtractAliasName("SubTableVariable", "STV"), config.ExtractTableName("SubTableVariable", "SUBTABLEVARIABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("SubTableVariable", "MainTable", "MAINTABLE"); - this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"MainTable",config.GetDataProvider()); + this.MainTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "MainTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "SubTable", "SUBTABLE"); - this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias,"SubTable",config.GetDataProvider()); + this.SubTableCol = new Column4Parameterized(tmpColumnName, this.Alias, "SubTable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "VariableType", "VARIABLETYPE"); - this.VariableTypeCol = new Column4Parameterized(tmpColumnName, this.Alias,"VariableType",config.GetDataProvider()); + this.VariableTypeCol = new Column4Parameterized(tmpColumnName, this.Alias, "VariableType", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "StoreColumnNo", "STORECOLUMNNO"); - this.StoreColumnNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreColumnNo",config.GetDataProvider()); + this.StoreColumnNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreColumnNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("SubTableVariable", "DefaultInGui", "DEFAULTINGUI"); - this.DefaultInGuiCol = new Column4Parameterized(tmpColumnName, this.Alias,"DefaultInGui",config.GetDataProvider()); + this.DefaultInGuiCol = new Column4Parameterized(tmpColumnName, this.Alias, "DefaultInGui", config.GetDataProvider()); } @@ -2948,17 +2948,17 @@ public class TblTextCatalog : Tab public Column4Parameterized DescriptionCol; internal TblTextCatalog(SqlDbConfig_24 config) - : base(config.ExtractAliasName("TextCatalog","TXC"), config.ExtractTableName("TextCatalog","TEXTCATALOG"), config.MetaOwner) + : base(config.ExtractAliasName("TextCatalog", "TXC"), config.ExtractTableName("TextCatalog", "TEXTCATALOG"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("TextCatalog", "TextCatalogNo", "TEXTCATALOGNO"); - this.TextCatalogNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"TextCatalogNo",config.GetDataProvider()); + this.TextCatalogNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "TextCatalogNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TextCatalog", "TextType", "TEXTTYPE"); - this.TextTypeCol = new Column4Parameterized(tmpColumnName, this.Alias,"TextType",config.GetDataProvider()); + this.TextTypeCol = new Column4Parameterized(tmpColumnName, this.Alias, "TextType", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TextCatalog", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TextCatalog", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); } @@ -2995,16 +2995,16 @@ public class TblTextCatalogLang2 : Lang2Tab public Lang2Column4Parameterized DescriptionCol; internal TblTextCatalogLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("TextCatalogLang2","TX2"), config.ExtractTableName("TextCatalogLang2","TEXTCATALOG_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("TextCatalogLang2", "TX2"), config.ExtractTableName("TextCatalogLang2", "TEXTCATALOG_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextCatalogNo" , "TEXTCATALOGNO"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextCatalogNo", "TEXTCATALOGNO"); this.TextCatalogNoCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextType" , "TEXTTYPE"); + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "TextType", "TEXTTYPE"); this.TextTypeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("TextCatalogLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3082,23 +3082,23 @@ public class TblTimeScale : Tab public Column4Parameterized StoreFormatCol; internal TblTimeScale(SqlDbConfig_24 config) - : base(config.ExtractAliasName("TimeScale","TSC"), config.ExtractTableName("TimeScale","TIMESCALE"), config.MetaOwner) + : base(config.ExtractAliasName("TimeScale", "TSC"), config.ExtractTableName("TimeScale", "TIMESCALE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("TimeScale", "TimeScale", "TIMESCALE"); - this.TimeScaleCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimeScale",config.GetDataProvider()); + this.TimeScaleCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimeScale", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "TimeScalePres", "TIMESCALEPRES"); - this.TimeScalePresCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimeScalePres",config.GetDataProvider()); + this.TimeScalePresCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimeScalePres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "Regular", "REGULAR"); - this.RegularCol = new Column4Parameterized(tmpColumnName, this.Alias,"Regular",config.GetDataProvider()); + this.RegularCol = new Column4Parameterized(tmpColumnName, this.Alias, "Regular", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "TimeUnit", "TIMEUNIT"); - this.TimeUnitCol = new Column4Parameterized(tmpColumnName, this.Alias,"TimeUnit",config.GetDataProvider()); + this.TimeUnitCol = new Column4Parameterized(tmpColumnName, this.Alias, "TimeUnit", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "Frequency", "FREQUENCY"); - this.FrequencyCol = new Column4Parameterized(tmpColumnName, this.Alias,"Frequency",config.GetDataProvider()); + this.FrequencyCol = new Column4Parameterized(tmpColumnName, this.Alias, "Frequency", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("TimeScale", "StoreFormat", "STOREFORMAT"); - this.StoreFormatCol = new Column4Parameterized(tmpColumnName, this.Alias,"StoreFormat",config.GetDataProvider()); + this.StoreFormatCol = new Column4Parameterized(tmpColumnName, this.Alias, "StoreFormat", config.GetDataProvider()); } @@ -3120,12 +3120,12 @@ public class TblTimeScaleLang2 : Lang2Tab public Lang2Column4Parameterized PresTextCol; internal TblTimeScaleLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("TimeScaleLang2","TS2"), config.ExtractTableName("TimeScaleLang2","TIMESCALE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("TimeScaleLang2", "TS2"), config.ExtractTableName("TimeScaleLang2", "TIMESCALE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "TimeScale" , "TIMESCALE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "TimeScale", "TIMESCALE"); this.TimeScaleCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("TimeScaleLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3166,17 +3166,17 @@ public class TblVSValue : Tab public Column4Parameterized SortCodeCol; internal TblVSValue(SqlDbConfig_24 config) - : base(config.ExtractAliasName("VSValue","VVL"), config.ExtractTableName("VSValue","VSVALUE"), config.MetaOwner) + : base(config.ExtractAliasName("VSValue", "VVL"), config.ExtractTableName("VSValue", "VSVALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("VSValue", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("VSValue", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("VSValue", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("VSValue", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); } @@ -3216,16 +3216,16 @@ public class TblVSValueLang2 : Lang2Tab public Lang2Column4Parameterized SortCodeCol; internal TblVSValueLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("VSValueLang2","VV2"), config.ExtractTableName("VSValueLang2","VSVALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("VSValueLang2", "VV2"), config.ExtractTableName("VSValueLang2", "VSVALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueSet" , "VALUESET"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueSet", "VALUESET"); this.ValueSetCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValuePool" , "VALUEPOOL"); + tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueCode" , "VALUECODE"); + tmpColumnName = config.ExtractColumnName("VSValueLang2", "ValueCode", "VALUECODE"); this.ValueCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VSValueLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("VSValueLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3307,25 +3307,25 @@ public class TblValue : Tab public Column4Parameterized FootnoteCol; internal TblValue(SqlDbConfig_24 config) - : base(config.ExtractAliasName("Value","VAL"), config.ExtractTableName("Value","VALUE"), config.MetaOwner) + : base(config.ExtractAliasName("Value", "VAL"), config.ExtractTableName("Value", "VALUE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Value", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "Unit", "UNIT"); - this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias,"Unit",config.GetDataProvider()); + this.UnitCol = new Column4Parameterized(tmpColumnName, this.Alias, "Unit", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "ValueTextS", "VALUETEXTS"); - this.ValueTextSCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueTextS",config.GetDataProvider()); + this.ValueTextSCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueTextS", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "ValueTextL", "VALUETEXTL"); - this.ValueTextLCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueTextL",config.GetDataProvider()); + this.ValueTextLCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueTextL", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Value", "Footnote", "FOOTNOTE"); - this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"Footnote",config.GetDataProvider()); + this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "Footnote", config.GetDataProvider()); } @@ -3395,20 +3395,20 @@ public class TblValueLang2 : Lang2Tab public Lang2Column4Parameterized ValueTextLCol; internal TblValueLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("ValueLang2","VA2"), config.ExtractTableName("ValueLang2","VALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValueLang2", "VA2"), config.ExtractTableName("ValueLang2", "VALUE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValuePool" , "VALUEPOOL"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueCode" , "VALUECODE"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueCode", "VALUECODE"); this.ValueCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "Unit" , "UNIT"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "Unit", "UNIT"); this.UnitCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextS" , "VALUETEXTS"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextS", "VALUETEXTS"); this.ValueTextSCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextL" , "VALUETEXTL"); + tmpColumnName = config.ExtractColumnName("ValueLang2", "ValueTextL", "VALUETEXTL"); this.ValueTextLCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3461,23 +3461,23 @@ public class TblValueGroup : Tab public Column4Parameterized SortCodeCol; internal TblValueGroup(SqlDbConfig_24 config) - : base(config.ExtractAliasName("ValueGroup","VPL"), config.ExtractTableName("ValueGroup","VALUEGROUP"), config.MetaOwner) + : base(config.ExtractAliasName("ValueGroup", "VPL"), config.ExtractTableName("ValueGroup", "VALUEGROUP"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValueGroup", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "GroupCode", "GROUPCODE"); - this.GroupCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"GroupCode",config.GetDataProvider()); + this.GroupCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "GroupCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "ValueCode", "VALUECODE"); - this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueCode",config.GetDataProvider()); + this.ValueCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "GroupLevel", "GROUPLEVEL"); - this.GroupLevelCol = new Column4Parameterized(tmpColumnName, this.Alias,"GroupLevel",config.GetDataProvider()); + this.GroupLevelCol = new Column4Parameterized(tmpColumnName, this.Alias, "GroupLevel", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "ValueLevel", "VALUELEVEL"); - this.ValueLevelCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueLevel",config.GetDataProvider()); + this.ValueLevelCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueLevel", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueGroup", "SortCode", "SORTCODE"); - this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCode",config.GetDataProvider()); + this.SortCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCode", config.GetDataProvider()); } @@ -3514,16 +3514,16 @@ public class TblValueGroupLang2 : Lang2Tab public Lang2Column4Parameterized SortCodeCol; internal TblValueGroupLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("ValueGroupLang2","VL2"), config.ExtractTableName("ValueGroupLang2","VALUEGROUP_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValueGroupLang2", "VL2"), config.ExtractTableName("ValueGroupLang2", "VALUEGROUP_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "Grouping" , "GROUPING"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "Grouping", "GROUPING"); this.GroupingCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "GroupCode" , "GROUPCODE"); + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "GroupCode", "GROUPCODE"); this.GroupCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "ValueCode" , "VALUECODE"); + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "ValueCode", "VALUECODE"); this.ValueCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "SortCode" , "SORTCODE"); + tmpColumnName = config.ExtractColumnName("ValueGroupLang2", "SortCode", "SORTCODE"); this.SortCodeCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3589,23 +3589,23 @@ public class TblValuePool : Tab public Column4Parameterized MetaIdCol; internal TblValuePool(SqlDbConfig_24 config) - : base(config.ExtractAliasName("ValuePool","VPL"), config.ExtractTableName("ValuePool","VALUEPOOL"), config.MetaOwner) + : base(config.ExtractAliasName("ValuePool", "VPL"), config.ExtractTableName("ValuePool", "VALUEPOOL"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValuePool", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "ValuePoolAlias", "VALUEPOOLALIAS"); - this.ValuePoolAliasCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePoolAlias",config.GetDataProvider()); + this.ValuePoolAliasCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePoolAlias", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "ValueTextExists", "VALUETEXTEXISTS"); - this.ValueTextExistsCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueTextExists",config.GetDataProvider()); + this.ValueTextExistsCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueTextExists", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "ValuePres", "VALUEPRES"); - this.ValuePresCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePres",config.GetDataProvider()); + this.ValuePresCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValuePool", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); } @@ -3635,14 +3635,14 @@ public class TblValuePoolLang2 : Lang2Tab public Lang2Column4Parameterized PresTextCol; internal TblValuePoolLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("ValuePoolLang2","VP2"), config.ExtractTableName("ValuePoolLang2","VALUEPOOL_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValuePoolLang2", "VP2"), config.ExtractTableName("ValuePoolLang2", "VALUEPOOL_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePool" , "VALUEPOOL"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePool", "VALUEPOOL"); this.ValuePoolCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePoolAlias" , "VALUEPOOLALIAS"); + tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "ValuePoolAlias", "VALUEPOOLALIAS"); this.ValuePoolAliasCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("ValuePoolLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3742,31 +3742,31 @@ public class TblValueSet : Tab public Column4Parameterized EliminationMethodCol; internal TblValueSet(SqlDbConfig_24 config) - : base(config.ExtractAliasName("ValueSet","VST"), config.ExtractTableName("ValueSet","VALUESET"), config.MetaOwner) + : base(config.ExtractAliasName("ValueSet", "VST"), config.ExtractTableName("ValueSet", "VALUESET"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValueSet", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "Description", "DESCRIPTION"); - this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias,"Description",config.GetDataProvider()); + this.DescriptionCol = new Column4Parameterized(tmpColumnName, this.Alias, "Description", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "ValuePool", "VALUEPOOL"); - this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePool",config.GetDataProvider()); + this.ValuePoolCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePool", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "ValuePres", "VALUEPRES"); - this.ValuePresCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValuePres",config.GetDataProvider()); + this.ValuePresCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValuePres", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "GeoAreaNo", "GEOAREANO"); - this.GeoAreaNoCol = new Column4Parameterized(tmpColumnName, this.Alias,"GeoAreaNo",config.GetDataProvider()); + this.GeoAreaNoCol = new Column4Parameterized(tmpColumnName, this.Alias, "GeoAreaNo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "SortCodeExists", "SORTCODEEXISTS"); - this.SortCodeExistsCol = new Column4Parameterized(tmpColumnName, this.Alias,"SortCodeExists",config.GetDataProvider()); + this.SortCodeExistsCol = new Column4Parameterized(tmpColumnName, this.Alias, "SortCodeExists", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "Footnote", "FOOTNOTE"); - this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"Footnote",config.GetDataProvider()); + this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "Footnote", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "EliminationCode", "ELIMINATIONCODE"); - this.EliminationCodeCol = new Column4Parameterized(tmpColumnName, this.Alias,"EliminationCode",config.GetDataProvider()); + this.EliminationCodeCol = new Column4Parameterized(tmpColumnName, this.Alias, "EliminationCode", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSet", "EliminationMethod", "ELIMINATIONMETHOD"); - this.EliminationMethodCol = new Column4Parameterized(tmpColumnName, this.Alias,"EliminationMethod",config.GetDataProvider()); + this.EliminationMethodCol = new Column4Parameterized(tmpColumnName, this.Alias, "EliminationMethod", config.GetDataProvider()); } @@ -3799,14 +3799,14 @@ public class TblValueSetLang2 : Lang2Tab public Lang2Column4Parameterized DescriptionCol; internal TblValueSetLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("ValueSetLang2","VS2"), config.ExtractTableName("ValueSetLang2","VALUESET_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("ValueSetLang2", "VS2"), config.ExtractTableName("ValueSetLang2", "VALUESET_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("ValueSetLang2", "ValueSet" , "VALUESET"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("ValueSetLang2", "ValueSet", "VALUESET"); this.ValueSetCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueSetLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("ValueSetLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("ValueSetLang2", "Description" , "DESCRIPTION"); + tmpColumnName = config.ExtractColumnName("ValueSetLang2", "Description", "DESCRIPTION"); this.DescriptionCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } @@ -3833,13 +3833,13 @@ public class TblValueSetGrouping : Tab public Column4Parameterized GroupingCol; internal TblValueSetGrouping(SqlDbConfig_24 config) - : base(config.ExtractAliasName("ValueSetGrouping","VBL"), config.ExtractTableName("ValueSetGrouping","VALUESETGROUPING"), config.MetaOwner) + : base(config.ExtractAliasName("ValueSetGrouping", "VBL"), config.ExtractTableName("ValueSetGrouping", "VALUESETGROUPING"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("ValueSetGrouping", "ValueSet", "VALUESET"); - this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias,"ValueSet",config.GetDataProvider()); + this.ValueSetCol = new Column4Parameterized(tmpColumnName, this.Alias, "ValueSet", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("ValueSetGrouping", "Grouping", "GROUPING"); - this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias,"Grouping",config.GetDataProvider()); + this.GroupingCol = new Column4Parameterized(tmpColumnName, this.Alias, "Grouping", config.GetDataProvider()); } @@ -3886,19 +3886,19 @@ public class TblVariable : Tab public Column4Parameterized FootnoteCol; internal TblVariable(SqlDbConfig_24 config) - : base(config.ExtractAliasName("Variable","VBL"), config.ExtractTableName("Variable","VARIABLE"), config.MetaOwner) + : base(config.ExtractAliasName("Variable", "VBL"), config.ExtractTableName("Variable", "VARIABLE"), config.MetaOwner) { - string tmpColumnName =""; + string tmpColumnName = ""; tmpColumnName = config.ExtractColumnName("Variable", "Variable", "VARIABLE"); - this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias,"Variable",config.GetDataProvider()); + this.VariableCol = new Column4Parameterized(tmpColumnName, this.Alias, "Variable", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Variable", "PresText", "PRESTEXT"); - this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias,"PresText",config.GetDataProvider()); + this.PresTextCol = new Column4Parameterized(tmpColumnName, this.Alias, "PresText", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Variable", "VariableInfo", "VARIABLEINFO"); - this.VariableInfoCol = new Column4Parameterized(tmpColumnName, this.Alias,"VariableInfo",config.GetDataProvider()); + this.VariableInfoCol = new Column4Parameterized(tmpColumnName, this.Alias, "VariableInfo", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Variable", "MetaId", "METAID"); - this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias,"MetaId",config.GetDataProvider()); + this.MetaIdCol = new Column4Parameterized(tmpColumnName, this.Alias, "MetaId", config.GetDataProvider()); tmpColumnName = config.ExtractColumnName("Variable", "Footnote", "FOOTNOTE"); - this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias,"Footnote",config.GetDataProvider()); + this.FootnoteCol = new Column4Parameterized(tmpColumnName, this.Alias, "Footnote", config.GetDataProvider()); } @@ -3924,12 +3924,12 @@ public class TblVariableLang2 : Lang2Tab public Lang2Column4Parameterized PresTextCol; internal TblVariableLang2(SqlDbConfig_24 config) - : base(config.ExtractAliasName("VariableLang2","VB2"), config.ExtractTableName("VariableLang2","VARIABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) + : base(config.ExtractAliasName("VariableLang2", "VB2"), config.ExtractTableName("VariableLang2", "VARIABLE_"), config.MetaOwner, config.MetaSuffixByLanguage) { - string tmpColumnName =""; - tmpColumnName = config.ExtractColumnName("VariableLang2", "Variable" , "VARIABLE"); + string tmpColumnName = ""; + tmpColumnName = config.ExtractColumnName("VariableLang2", "Variable", "VARIABLE"); this.VariableCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); - tmpColumnName = config.ExtractColumnName("VariableLang2", "PresText" , "PRESTEXT"); + tmpColumnName = config.ExtractColumnName("VariableLang2", "PresText", "PRESTEXT"); this.PresTextCol = new Lang2Column4Parameterized(tmpColumnName, this.Alias, this.Suffixes); } diff --git a/PCAxis.Sql/DbConfig/SqlDbConfigs.cs b/PCAxis.Sql/DbConfig/SqlDbConfigs.cs index d7ad005..7e07615 100644 --- a/PCAxis.Sql/DbConfig/SqlDbConfigs.cs +++ b/PCAxis.Sql/DbConfig/SqlDbConfigs.cs @@ -1,23 +1,19 @@ -using System; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Xml.Serialization; using System.Xml; -using log4net; - +using System.Xml.XPath; -using PCAxis.Sql.Exceptions; +using log4net; -namespace PCAxis.Sql.DbConfig { +namespace PCAxis.Sql.DbConfig +{ /// /// Configuration of the SQL base read from file. - public class SqlDbConfigs { + public class SqlDbConfigs + { private static readonly ILog log = LogManager.GetLogger(typeof(SqlDbConfigs)); private XPathNavigator nav; - + private SqlDbConfig mDatabase; public SqlDbConfig database; private string mDefaultDbId; @@ -28,26 +24,27 @@ public string DefaultDbId private Dictionary mDataBases; public Dictionary Databases - { - get { return mDataBases; } - } + { + get { return mDataBases; } + } + - private Dictionary mDatabaselistDescById = new Dictionary(); /// /// Use this to select which database to use /// - public Dictionary DatabaselistDescById { + public Dictionary DatabaselistDescById + { get { return mDatabaselistDescById; } } - + public SqlDbConfigs(string SqlDbConfigPath) { XPathDocument doc = new XPathDocument(SqlDbConfigPath); - log.Debug("SqlDbConfigPath = "+SqlDbConfigPath); + log.Debug("SqlDbConfigPath = " + SqlDbConfigPath); nav = doc.CreateNavigator(); //makes list of available databases: XPathNodeIterator dbs = nav.Select("//SqlDbConfig/Database"); @@ -72,7 +69,7 @@ public SqlDbConfigs(string SqlDbConfigPath) mDataBases = new Dictionary(); foreach (string databaseId in mDatabaselistDescById.Keys) - { + { string xPathToDb = "//SqlDbConfig/Database[@id='" + databaseId + "']"; XmlNode node = xdoc.SelectSingleNode(xPathToDb); XmlReader xmlReader = new XmlNodeReader(node); @@ -80,7 +77,7 @@ public SqlDbConfigs(string SqlDbConfigPath) //mDatabase = new SqlDbConfig(xmlReader,nav); mDatabase = SqlDbConfig.GetSqlDbConfig(xmlReader, nav); - mDataBases.Add(databaseId, mDatabase); + mDataBases.Add(databaseId, mDatabase); } } } diff --git a/PCAxis.Sql/DbConfig/SqlDbConfigsStatic.cs b/PCAxis.Sql/DbConfig/SqlDbConfigsStatic.cs index 40ff883..0db9773 100644 --- a/PCAxis.Sql/DbConfig/SqlDbConfigsStatic.cs +++ b/PCAxis.Sql/DbConfig/SqlDbConfigsStatic.cs @@ -1,21 +1,14 @@ using System; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Xml.Serialization; -using System.Xml; using System.Configuration; -using log4net; -using PCAxis.Sql.DbConfig; -namespace PCAxis.Sql.DbConfig +namespace PCAxis.Sql.DbConfig { public static class SqlDbConfigsStatic { - + private static SqlDbConfigs _config; - + private static SqlDbConfig _defaultDatabase; public static SqlDbConfig DefaultDatabase { @@ -28,26 +21,27 @@ public static Dictionary DatabasesDescription get { return _databasesDescription; } } - private static Dictionary _dataBases; + private static Dictionary _dataBases; public static Dictionary DataBases { - get {return _dataBases;} + get { return _dataBases; } + } + public static Dictionary getAvailableDatabases() + { + return _databasesDescription; } - public static Dictionary getAvailableDatabases() - { - return _databasesDescription; - } static SqlDbConfigsStatic() { string configPath = ConfigPath; - if (String.IsNullOrEmpty(configPath) ) { + if (String.IsNullOrEmpty(configPath)) + { throw new ConfigurationErrorsException("Hullo: cant find an entry for dbconfigFile in AppSettings"); } _config = new SqlDbConfigs(configPath); _databasesDescription = _config.DatabaselistDescById; - + _dataBases = _config.Databases; _defaultDatabase = _dataBases[_config.DefaultDbId]; } @@ -66,14 +60,14 @@ public static string ConfigPath string orgBaseDir = AppDomain.CurrentDomain.BaseDirectory; string noBinBaseDir = orgBaseDir.Replace("\\bin\\", "\\"); - string p2 = System.IO.Path.Combine(orgBaseDir , p); + string p2 = System.IO.Path.Combine(orgBaseDir, p); if ((new System.IO.FileInfo(p2)).Exists) { return System.IO.Path.GetFullPath((new Uri(p2)).LocalPath); } - //removing any "\bin" + //removing any "\bin" string p3 = System.IO.Path.Combine(noBinBaseDir, p); if ((new System.IO.FileInfo(p3)).Exists) { diff --git a/PCAxis.Sql/DbConfig/Tab.cs b/PCAxis.Sql/DbConfig/Tab.cs index 622ad69..c168aed 100644 --- a/PCAxis.Sql/DbConfig/Tab.cs +++ b/PCAxis.Sql/DbConfig/Tab.cs @@ -1,19 +1,17 @@ using System; -using System.Collections.Generic; -using System.Text; namespace PCAxis.Sql.DbConfig { public class Tab { - + // The actual name of the table in the database private string localTableName; // The alias of the table private string tableAlias; private string metaOwner; private string nameAndAlias; - + /// /// Local table name /// @@ -21,7 +19,7 @@ public String TableName { get { return localTableName; } } - + /// /// Table alias /// @@ -42,10 +40,10 @@ internal Tab(string tableAlias, string localTableName, string metaOwner) /// metaOwner + localTableName + " " + tableAlias /// /// - public string GetNameAndAlias() - { - return this.nameAndAlias; - } + public string GetNameAndAlias() + { + return this.nameAndAlias; + } - } + } } diff --git a/PCAxis.Sql/Exceptions/Errno2Text.cs b/PCAxis.Sql/Exceptions/Errno2Text.cs index 99cae3b..f36e74e 100644 --- a/PCAxis.Sql/Exceptions/Errno2Text.cs +++ b/PCAxis.Sql/Exceptions/Errno2Text.cs @@ -1,34 +1,38 @@ using System; using System.Collections.Generic; -using System.Text; -namespace PCAxis.Sql.Exceptions +namespace PCAxis.Sql.Exceptions { /// /// Converts error number and any arguments to a text. The language of the text is /// - public class ErrNo2Text { + public class ErrNo2Text + { string outString = ""; string formatString = ""; - - public ErrNo2Text(int errno) { + + public ErrNo2Text(int errno) + { outString = lookupFormatstring(errno); } - public ErrNo2Text(int errno, Object arg0) { + public ErrNo2Text(int errno, Object arg0) + { formatString = lookupFormatstring(errno); outString = String.Format(formatString, arg0); } - public ErrNo2Text(int errno, Object arg0, Object arg1) { + public ErrNo2Text(int errno, Object arg0, Object arg1) + { formatString = lookupFormatstring(errno); outString = String.Format(formatString, arg0, arg1); } - public ErrNo2Text(int errno, Object arg0, Object arg1, Object arg2) { + public ErrNo2Text(int errno, Object arg0, Object arg1, Object arg2) + { formatString = lookupFormatstring(errno); outString = String.Format(formatString, arg0, arg1, arg2); } @@ -40,13 +44,14 @@ public ErrNo2Text(int errno, Object arg0, Object arg1, Object arg2, Object arg3) } - private string lookupFormatstring(int errno){ - string myOut=""; + private string lookupFormatstring(int errno) + { + string myOut = ""; //log.Debug("dllen er på: " + System.Reflection.Assembly.GetAssembly(this.GetType()).Location); //denne må åpne filer og herje, men kan ikke lage feil Dictionary formatStringsByErrNo = new Dictionary(); - formatStringsByErrNo.Add(1,"Not one and only one row for MainTable = {0} Contents = {1}"); + formatStringsByErrNo.Add(1, "Not one and only one row for MainTable = {0} Contents = {1}"); formatStringsByErrNo.Add(2, "Non-eliminated variable with no ValueCodes defined. Variablename={0}"); formatStringsByErrNo.Add(3, "No Datasymbolnumber found for the specified symbolnumber: {0}"); @@ -54,80 +59,84 @@ private string lookupFormatstring(int errno){ formatStringsByErrNo.Add(5, "The database does not support any of the languages requested by the pxs"); formatStringsByErrNo.Add(6, "Specified subtable (= {0} ) does not exists"); formatStringsByErrNo.Add(7, "Variable specified in PXS(code= {0} ) does not exist in database"); - - formatStringsByErrNo.Add(8, "You have to specify timevariable in PXS"); - formatStringsByErrNo.Add(9, "The specified timevariable in PXS cannot be found in the list of variables"); - formatStringsByErrNo.Add(10, "Time variable specified in PXS is not a timevariable"); - - formatStringsByErrNo.Add(11, "You have to select at least 1 value for {0}"); - formatStringsByErrNo.Add(12, "Timeperiod for footnote is not selected"); - formatStringsByErrNo.Add(13, "Contents value is not selected"); - formatStringsByErrNo.Add(14, "Specified Meta model {0} version is not supported"); - formatStringsByErrNo.Add(15, "It's not possible to specify more than one Special character with " + - "DatacellPres set to NO and AggreggPossible set to Yes"); - - formatStringsByErrNo.Add(16, "More than 6 Npm character with DatacellPres=Yes and AggreggPossible=Yes defined"); - formatStringsByErrNo.Add(17, "Invalid combination of DatacellPres and AggreggPossible"); - - formatStringsByErrNo.Add(18, "The MetaAdm proprety {0} has value {1}, but SpecialCharacter table has no such row"); - formatStringsByErrNo.Add(19, "No datasymbols available for DataSymbolNil variable in MetaAdm"); //m.i.a. ? - formatStringsByErrNo.Add(20, "The SpecialCharacter row for {0} (Primary key = {1}) is category {2}, but it shold be {3}."); - - formatStringsByErrNo.Add(21, "No datasymbols available for DataNotAvailable variable in MetaAdm"); - formatStringsByErrNo.Add(22, "No matching entry for {0} found in SpecialCharacter. (Was looking for DataNotAvailable)."); - formatStringsByErrNo.Add(23, "No matching entry for {0} found in SpecialCharacter. (Was looking for DataNoteSum) "); - formatStringsByErrNo.Add(24, "No datasymbols available for DataSymbolSum (Det sto DataNotAvailable, men det må vel være feil) varaible in MetaAdm"); - formatStringsByErrNo.Add(25, "No matching entry for {0} found in SpecialCharacter . (Was looking for DataSymbolSum"); - formatStringsByErrNo.Add(26, "More than 6 Npm character with DatacellPres=Yes and AggreggPossible=Yes defined"); - formatStringsByErrNo.Add(27, "DefaultCodeMissingLine property not set"); - formatStringsByErrNo.Add(28, "DataNotAvailable property not set"); - formatStringsByErrNo.Add(29, "DataSymbolNil property not set"); - formatStringsByErrNo.Add(30, "DataSymbolSum property not set"); - - formatStringsByErrNo.Add(31, "DataSymbol for characterType {0} not set"); - formatStringsByErrNo.Add(32, "DataSymbol{0} property not set"); - formatStringsByErrNo.Add(33, "DataNoteSum property not set"); - formatStringsByErrNo.Add(34, "DataSymbol for magic number {0} not set"); - formatStringsByErrNo.Add(35, "No rows for {0}."); - - formatStringsByErrNo.Add(36, "Not one and only one row for {0}."); - formatStringsByErrNo.Add(37, "Parameter \"connectionString\" is empty/null!"); - formatStringsByErrNo.Add(38, "Parameter \"dataProvider\" is empty/null!"); - formatStringsByErrNo.Add(39, "DataProvider must be one of {0}. not:{1}"); - - formatStringsByErrNo.Add(40, "SqlDbConfig error, \"=USER;\" is present so \"=PASSWORD;\" must be, but it is missing. Add \"=PASSWORD;\" or remove \"=USER;\" . Configstring:\n{0}"); - formatStringsByErrNo.Add(41, "No language with code = {0} "); - //formatStringsByErrNo.Add(42, "No rows found in MetabaseInfo."); - //formatStringsByErrNo.Add(43, "No rows found in SpecialCharacter."); - formatStringsByErrNo.Add(44, "The table (or view) with modelname {0} and local name {0} appears to be empty."); - formatStringsByErrNo.Add(45, "Can't find dll configfile:{0}"); - formatStringsByErrNo.Add(46, "Can't find key=\"{0}\" in appsection of dll configfile: {1}"); - formatStringsByErrNo.Add(47, "The database does not support the requested language (=\"{0}\"). The valid choises are:{1}."); - - formatStringsByErrNo.Add(48, "Multiple Valueset marked as Default for maintable {0} and variable {1}."); - formatStringsByErrNo.Add(49, "Multiple sortorder for maintable {0}, variable {1} and valueset {2}."); - - formatStringsByErrNo.Add(500, "For database id = {1}. Missing Code \"element\" for {0} in SqlDbConfig. Please add a Code element with codeName {0} and an codeValue to the Codes element for the database."); - formatStringsByErrNo.Add(501, "For database id = {1} and Code element with codeName attribute {0} in SqlDbConfig. Missing attribute {2} on that element. Is the sPeLliNg OK?"); - - formatStringsByErrNo.Add(503, "For database id = {1}. Missing Keyword element for {0} in SqlDbConfig. Please add a Keyword element with modelName {0} and an keywordName to the Keywords element for the database."); - formatStringsByErrNo.Add(504, "For database id = {1} and Keyword element with modelname {0} in SqlDbConfig. Missing attribute {2} on that element. Is the sPeLliNg OK?"); - - formatStringsByErrNo.Add(510, "For the database with id = {0}. Missing Table-element with modelName {1} in SqlDbConfig."); - formatStringsByErrNo.Add(511, "For the database with id = {0}. Missing column-element with modelName {2} in the table-element with modelName {1} in SqlDbConfig."); - formatStringsByErrNo.Add(512, "For the database with id = {0}. Missing attribute {3} in the column-element with modelName {2} in the table-element with modelName {1} in SqlDbConfig."); + + formatStringsByErrNo.Add(8, "You have to specify timevariable in PXS"); + formatStringsByErrNo.Add(9, "The specified timevariable in PXS cannot be found in the list of variables"); + formatStringsByErrNo.Add(10, "Time variable specified in PXS is not a timevariable"); + + formatStringsByErrNo.Add(11, "You have to select at least 1 value for {0}"); + formatStringsByErrNo.Add(12, "Timeperiod for footnote is not selected"); + formatStringsByErrNo.Add(13, "Contents value is not selected"); + formatStringsByErrNo.Add(14, "Specified Meta model {0} version is not supported"); + formatStringsByErrNo.Add(15, "It's not possible to specify more than one Special character with " + + "DatacellPres set to NO and AggreggPossible set to Yes"); + + formatStringsByErrNo.Add(16, "More than 6 Npm character with DatacellPres=Yes and AggreggPossible=Yes defined"); + formatStringsByErrNo.Add(17, "Invalid combination of DatacellPres and AggreggPossible"); + + formatStringsByErrNo.Add(18, "The MetaAdm proprety {0} has value {1}, but SpecialCharacter table has no such row"); + formatStringsByErrNo.Add(19, "No datasymbols available for DataSymbolNil variable in MetaAdm"); //m.i.a. ? + formatStringsByErrNo.Add(20, "The SpecialCharacter row for {0} (Primary key = {1}) is category {2}, but it shold be {3}."); + + formatStringsByErrNo.Add(21, "No datasymbols available for DataNotAvailable variable in MetaAdm"); + formatStringsByErrNo.Add(22, "No matching entry for {0} found in SpecialCharacter. (Was looking for DataNotAvailable)."); + formatStringsByErrNo.Add(23, "No matching entry for {0} found in SpecialCharacter. (Was looking for DataNoteSum) "); + formatStringsByErrNo.Add(24, "No datasymbols available for DataSymbolSum (Det sto DataNotAvailable, men det må vel være feil) varaible in MetaAdm"); + formatStringsByErrNo.Add(25, "No matching entry for {0} found in SpecialCharacter . (Was looking for DataSymbolSum"); + formatStringsByErrNo.Add(26, "More than 6 Npm character with DatacellPres=Yes and AggreggPossible=Yes defined"); + formatStringsByErrNo.Add(27, "DefaultCodeMissingLine property not set"); + formatStringsByErrNo.Add(28, "DataNotAvailable property not set"); + formatStringsByErrNo.Add(29, "DataSymbolNil property not set"); + formatStringsByErrNo.Add(30, "DataSymbolSum property not set"); + + formatStringsByErrNo.Add(31, "DataSymbol for characterType {0} not set"); + formatStringsByErrNo.Add(32, "DataSymbol{0} property not set"); + formatStringsByErrNo.Add(33, "DataNoteSum property not set"); + formatStringsByErrNo.Add(34, "DataSymbol for magic number {0} not set"); + formatStringsByErrNo.Add(35, "No rows for {0}."); + + formatStringsByErrNo.Add(36, "Not one and only one row for {0}."); + formatStringsByErrNo.Add(37, "Parameter \"connectionString\" is empty/null!"); + formatStringsByErrNo.Add(38, "Parameter \"dataProvider\" is empty/null!"); + formatStringsByErrNo.Add(39, "DataProvider must be one of {0}. not:{1}"); + + formatStringsByErrNo.Add(40, "SqlDbConfig error, \"=USER;\" is present so \"=PASSWORD;\" must be, but it is missing. Add \"=PASSWORD;\" or remove \"=USER;\" . Configstring:\n{0}"); + formatStringsByErrNo.Add(41, "No language with code = {0} "); + //formatStringsByErrNo.Add(42, "No rows found in MetabaseInfo."); + //formatStringsByErrNo.Add(43, "No rows found in SpecialCharacter."); + formatStringsByErrNo.Add(44, "The table (or view) with modelname {0} and local name {0} appears to be empty."); + formatStringsByErrNo.Add(45, "Can't find dll configfile:{0}"); + formatStringsByErrNo.Add(46, "Can't find key=\"{0}\" in appsection of dll configfile: {1}"); + formatStringsByErrNo.Add(47, "The database does not support the requested language (=\"{0}\"). The valid choises are:{1}."); + + formatStringsByErrNo.Add(48, "Multiple Valueset marked as Default for maintable {0} and variable {1}."); + formatStringsByErrNo.Add(49, "Multiple sortorder for maintable {0}, variable {1} and valueset {2}."); + + formatStringsByErrNo.Add(500, "For database id = {1}. Missing Code \"element\" for {0} in SqlDbConfig. Please add a Code element with codeName {0} and an codeValue to the Codes element for the database."); + formatStringsByErrNo.Add(501, "For database id = {1} and Code element with codeName attribute {0} in SqlDbConfig. Missing attribute {2} on that element. Is the sPeLliNg OK?"); + + formatStringsByErrNo.Add(503, "For database id = {1}. Missing Keyword element for {0} in SqlDbConfig. Please add a Keyword element with modelName {0} and an keywordName to the Keywords element for the database."); + formatStringsByErrNo.Add(504, "For database id = {1} and Keyword element with modelname {0} in SqlDbConfig. Missing attribute {2} on that element. Is the sPeLliNg OK?"); + + formatStringsByErrNo.Add(510, "For the database with id = {0}. Missing Table-element with modelName {1} in SqlDbConfig."); + formatStringsByErrNo.Add(511, "For the database with id = {0}. Missing column-element with modelName {2} in the table-element with modelName {1} in SqlDbConfig."); + formatStringsByErrNo.Add(512, "For the database with id = {0}. Missing attribute {3} in the column-element with modelName {2} in the table-element with modelName {1} in SqlDbConfig."); //Bugs: - formatStringsByErrNo.Add(10000, "Both Type to be compared must be of the same type"); + formatStringsByErrNo.Add(10000, "Both Type to be compared must be of the same type"); - if(formatStringsByErrNo.ContainsKey(errno)){ + if (formatStringsByErrNo.ContainsKey(errno)) + { myOut = formatStringsByErrNo[errno]; - } else { - myOut = "Error with internal errorcode = " + errno.ToString()+" has occured. This error has no text."; + } + else + { + myOut = "Error with internal errorcode = " + errno.ToString() + " has occured. This error has no text."; } return myOut; } - public string getText() { + public string getText() + { return outString; } diff --git a/PCAxis.Sql/Exceptions/WarnNo2Text.cs b/PCAxis.Sql/Exceptions/WarnNo2Text.cs index 77a0047..70a2006 100644 --- a/PCAxis.Sql/Exceptions/WarnNo2Text.cs +++ b/PCAxis.Sql/Exceptions/WarnNo2Text.cs @@ -1,57 +1,66 @@ using System; using System.Collections.Generic; -using System.Text; -namespace PCAxis.Sql.Exceptions +namespace PCAxis.Sql.Exceptions { /// /// Converts warning number and any arguments to a text. The language of the text is /// - public class WarnNo2Text { + public class WarnNo2Text + { string outString = ""; string formatString = ""; - - public WarnNo2Text(int warnno) { + + public WarnNo2Text(int warnno) + { outString = lookupFormatstring(warnno); } - public WarnNo2Text(int warnno, Object arg0) { + public WarnNo2Text(int warnno, Object arg0) + { formatString = lookupFormatstring(warnno); outString = String.Format(formatString, arg0); } - public WarnNo2Text(int warnno, Object arg0, Object arg1) { + public WarnNo2Text(int warnno, Object arg0, Object arg1) + { formatString = lookupFormatstring(warnno); outString = String.Format(formatString, arg0, arg1); } - public WarnNo2Text(int warnno, Object arg0, Object arg1, Object arg2) { + public WarnNo2Text(int warnno, Object arg0, Object arg1, Object arg2) + { formatString = lookupFormatstring(warnno); outString = String.Format(formatString, arg0, arg1, arg2); } - private string lookupFormatstring(int warnno){ - string myOut=""; + private string lookupFormatstring(int warnno) + { + string myOut = ""; //log.Debug("dllen er på: " + System.Reflection.Assembly.GetAssembly(this.GetType()).Location); //denne må åpne filer og herje, men kan ikke lage feil Dictionary formatStringsByWarnNo = new Dictionary(); - formatStringsByWarnNo.Add(1,"The method or operation is not fully implemented: {0}"); - - + formatStringsByWarnNo.Add(1, "The method or operation is not fully implemented: {0}"); + - if(formatStringsByWarnNo.ContainsKey(warnno)){ + + if (formatStringsByWarnNo.ContainsKey(warnno)) + { myOut = formatStringsByWarnNo[warnno]; - } else { - myOut = "Warning " + warnno.ToString()+" has occured. This warning has no text."; + } + else + { + myOut = "Warning " + warnno.ToString() + " has occured. This warning has no text."; } return myOut; } - public string getText() { + public string getText() + { return outString; } diff --git a/PCAxis.Sql/Exceptions/generated_exceptions.cs b/PCAxis.Sql/Exceptions/generated_exceptions.cs index a4253b3..21f6f9c 100644 --- a/PCAxis.Sql/Exceptions/generated_exceptions.cs +++ b/PCAxis.Sql/Exceptions/generated_exceptions.cs @@ -1,142 +1,149 @@ using System; -using System.Runtime.Serialization; -namespace PCAxis.Sql.Exceptions +namespace PCAxis.Sql.Exceptions { - /// - /// Parent exception for common catching. - /// - [Serializable] - public abstract class PCAxisSqlException : ApplicationException{ - public PCAxisSqlException() : base() { } - public PCAxisSqlException(String message) : base(message) { } - public PCAxisSqlException(String message, Exception innerException) : base(message, innerException) { } - public PCAxisSqlException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - } - - - - /// - /// Something wrong in database, pxs or both - /// - [Serializable] - public class DbPxsMismatchException : PCAxisSqlException{ - public DbPxsMismatchException() : base() { } - public DbPxsMismatchException(String message) : base(message) { } - public DbPxsMismatchException(String message, Exception innerException) : base(message, innerException) { } - public DbPxsMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - public DbPxsMismatchException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } - public DbPxsMismatchException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo,arg0).getText()) { } - public DbPxsMismatchException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } - public DbPxsMismatchException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } - } - - - - /// - /// Something wrong in Config , pxs or both - /// - [Serializable] - public class ConfigPxsMismatchException : PCAxisSqlException{ - public ConfigPxsMismatchException() : base() { } - public ConfigPxsMismatchException(String message) : base(message) { } - public ConfigPxsMismatchException(String message, Exception innerException) : base(message, innerException) { } - public ConfigPxsMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - public ConfigPxsMismatchException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } - public ConfigPxsMismatchException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo,arg0).getText()) { } - public ConfigPxsMismatchException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } - public ConfigPxsMismatchException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } - } - - - - /// - /// Something wrong in database, Config or both - /// - [Serializable] - public class ConfigDbMismatchException : PCAxisSqlException{ - public ConfigDbMismatchException() : base() { } - public ConfigDbMismatchException(String message) : base(message) { } - public ConfigDbMismatchException(String message, Exception innerException) : base(message, innerException) { } - public ConfigDbMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - public ConfigDbMismatchException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } - public ConfigDbMismatchException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo,arg0).getText()) { } - public ConfigDbMismatchException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } - public ConfigDbMismatchException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } - } - - - - /// - /// Something wrong in the database - /// - [Serializable] - public class DbException : PCAxisSqlException{ - public DbException() : base() { } - public DbException(String message) : base(message) { } - public DbException(String message, Exception innerException) : base(message, innerException) { } - public DbException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - public DbException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } - public DbException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo,arg0).getText()) { } - public DbException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } - public DbException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } - public DbException(int ErrNo, Object arg0, Object arg1, Object arg2, Object arg3) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2, arg3).getText()) { } - - } - - - - /// - /// Something wrong in the Config file - /// - [Serializable] - public class ConfigException : PCAxisSqlException{ - public ConfigException() : base() { } - public ConfigException(String message) : base(message) { } - public ConfigException(String message, Exception innerException) : base(message, innerException) { } - public ConfigException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - public ConfigException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } - public ConfigException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo,arg0).getText()) { } - public ConfigException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } - public ConfigException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } - public ConfigException(int ErrNo, Object arg0, Object arg1, Object arg2, Object arg3) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2, arg3).getText()) { } - } - - - - /// - /// Something wrong in the PXS-file - /// - [Serializable] - public class PxsException : PCAxisSqlException{ - public PxsException() : base() { } - public PxsException(String message) : base(message) { } - public PxsException(String message, Exception innerException) : base(message, innerException) { } - public PxsException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - public PxsException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } - public PxsException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo,arg0).getText()) { } - public PxsException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } - public PxsException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } - } - - - - /// - /// Bug in application - /// - [Serializable] - public class BugException : PCAxisSqlException{ - public BugException() : base() { } - public BugException(String message) : base(message) { } - public BugException(String message, Exception innerException) : base(message, innerException) { } - public BugException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - public BugException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } - public BugException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo,arg0).getText()) { } - public BugException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } - public BugException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } - } - + /// + /// Parent exception for common catching. + /// + [Serializable] + public abstract class PCAxisSqlException : ApplicationException + { + public PCAxisSqlException() : base() { } + public PCAxisSqlException(String message) : base(message) { } + public PCAxisSqlException(String message, Exception innerException) : base(message, innerException) { } + public PCAxisSqlException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + } + + + + /// + /// Something wrong in database, pxs or both + /// + [Serializable] + public class DbPxsMismatchException : PCAxisSqlException + { + public DbPxsMismatchException() : base() { } + public DbPxsMismatchException(String message) : base(message) { } + public DbPxsMismatchException(String message, Exception innerException) : base(message, innerException) { } + public DbPxsMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + public DbPxsMismatchException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } + public DbPxsMismatchException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo, arg0).getText()) { } + public DbPxsMismatchException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } + public DbPxsMismatchException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } + } + + + + /// + /// Something wrong in Config , pxs or both + /// + [Serializable] + public class ConfigPxsMismatchException : PCAxisSqlException + { + public ConfigPxsMismatchException() : base() { } + public ConfigPxsMismatchException(String message) : base(message) { } + public ConfigPxsMismatchException(String message, Exception innerException) : base(message, innerException) { } + public ConfigPxsMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + public ConfigPxsMismatchException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } + public ConfigPxsMismatchException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo, arg0).getText()) { } + public ConfigPxsMismatchException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } + public ConfigPxsMismatchException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } + } + + + + /// + /// Something wrong in database, Config or both + /// + [Serializable] + public class ConfigDbMismatchException : PCAxisSqlException + { + public ConfigDbMismatchException() : base() { } + public ConfigDbMismatchException(String message) : base(message) { } + public ConfigDbMismatchException(String message, Exception innerException) : base(message, innerException) { } + public ConfigDbMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + public ConfigDbMismatchException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } + public ConfigDbMismatchException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo, arg0).getText()) { } + public ConfigDbMismatchException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } + public ConfigDbMismatchException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } + } + + + + /// + /// Something wrong in the database + /// + [Serializable] + public class DbException : PCAxisSqlException + { + public DbException() : base() { } + public DbException(String message) : base(message) { } + public DbException(String message, Exception innerException) : base(message, innerException) { } + public DbException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + public DbException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } + public DbException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo, arg0).getText()) { } + public DbException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } + public DbException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } + public DbException(int ErrNo, Object arg0, Object arg1, Object arg2, Object arg3) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2, arg3).getText()) { } + + } + + + + /// + /// Something wrong in the Config file + /// + [Serializable] + public class ConfigException : PCAxisSqlException + { + public ConfigException() : base() { } + public ConfigException(String message) : base(message) { } + public ConfigException(String message, Exception innerException) : base(message, innerException) { } + public ConfigException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + public ConfigException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } + public ConfigException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo, arg0).getText()) { } + public ConfigException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } + public ConfigException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } + public ConfigException(int ErrNo, Object arg0, Object arg1, Object arg2, Object arg3) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2, arg3).getText()) { } + } + + + + /// + /// Something wrong in the PXS-file + /// + [Serializable] + public class PxsException : PCAxisSqlException + { + public PxsException() : base() { } + public PxsException(String message) : base(message) { } + public PxsException(String message, Exception innerException) : base(message, innerException) { } + public PxsException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + public PxsException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } + public PxsException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo, arg0).getText()) { } + public PxsException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } + public PxsException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } + } + + + + /// + /// Bug in application + /// + [Serializable] + public class BugException : PCAxisSqlException + { + public BugException() : base() { } + public BugException(String message) : base(message) { } + public BugException(String message, Exception innerException) : base(message, innerException) { } + public BugException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + public BugException(int ErrNo) : base(new ErrNo2Text(ErrNo).getText()) { } + public BugException(int ErrNo, Object arg0) : base(new ErrNo2Text(ErrNo, arg0).getText()) { } + public BugException(int ErrNo, Object arg0, Object arg1) : base(new ErrNo2Text(ErrNo, arg0, arg1).getText()) { } + public BugException(int ErrNo, Object arg0, Object arg1, Object arg2) : base(new ErrNo2Text(ErrNo, arg0, arg1, arg2).getText()) { } + } + } diff --git a/PCAxis.Sql/Models/GroupedValue.cs b/PCAxis.Sql/Models/GroupedValue.cs index d55fbea..ea4e370 100644 --- a/PCAxis.Sql/Models/GroupedValue.cs +++ b/PCAxis.Sql/Models/GroupedValue.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; namespace PCAxis.Sql.Models { diff --git a/PCAxis.Sql/Models/Grouping.cs b/PCAxis.Sql/Models/Grouping.cs index ad6afed..6d363a3 100644 --- a/PCAxis.Sql/Models/Grouping.cs +++ b/PCAxis.Sql/Models/Grouping.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; namespace PCAxis.Sql.Models { diff --git a/PCAxis.Sql/Models/Value.cs b/PCAxis.Sql/Models/Value.cs index 1cba15b..d1cd823 100644 --- a/PCAxis.Sql/Models/Value.cs +++ b/PCAxis.Sql/Models/Value.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace PCAxis.Sql.Models +namespace PCAxis.Sql.Models { public class Value { diff --git a/PCAxis.Sql/PXSqlKeywords.cs b/PCAxis.Sql/PXSqlKeywords.cs index 38c0645..ffd7c9e 100644 --- a/PCAxis.Sql/PXSqlKeywords.cs +++ b/PCAxis.Sql/PXSqlKeywords.cs @@ -1,12 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace PCAxis.PlugIn.Sql { +namespace PCAxis.PlugIn.Sql +{ /// /// This class contains only static stuff /// - public class PXSqlKeywords { + public class PXSqlKeywords + { //for setpath public const string PXS_QUERY_OBJECT = "PxsQueryObject"; diff --git a/PCAxis.Sql/Parser/PXSqlData.cs b/PCAxis.Sql/Parser/PXSqlData.cs index 21cce67..13efee4 100644 --- a/PCAxis.Sql/Parser/PXSqlData.cs +++ b/PCAxis.Sql/Parser/PXSqlData.cs @@ -6,9 +6,10 @@ namespace PCAxis.Sql.Parser using System.Collections.Generic; using System.Collections.Specialized; - using log4net; using DbConfig; + using log4net; + public abstract class PXSqlData : IDisposable { /// The Log diff --git a/PCAxis.Sql/Parser/PXSqlMeta.cs b/PCAxis.Sql/Parser/PXSqlMeta.cs index baa5f5b..0754fa4 100644 --- a/PCAxis.Sql/Parser/PXSqlMeta.cs +++ b/PCAxis.Sql/Parser/PXSqlMeta.cs @@ -1,13 +1,13 @@ using System; -using System.Collections.Specialized; using System.Collections.Generic; +using System.Collections.Specialized; + +using log4net; using PCAxis.Paxiom; using PCAxis.Sql.DbConfig; using PCAxis.Sql.Pxs; -using log4net; - namespace PCAxis.Sql.Parser { diff --git a/PCAxis.Sql/Parser/PXSqlParseMetaPostData.cs b/PCAxis.Sql/Parser/PXSqlParseMetaPostData.cs index cb25f90..29dd329 100644 --- a/PCAxis.Sql/Parser/PXSqlParseMetaPostData.cs +++ b/PCAxis.Sql/Parser/PXSqlParseMetaPostData.cs @@ -1,9 +1,6 @@ namespace PCAxis.Sql.Parser { using System; - using System.Collections.Generic; - using System.Collections.Specialized; - using PCAxis.PlugIn.Sql; using log4net; @@ -15,14 +12,14 @@ public abstract class PXSqlParseMetaPostData : IDisposable - public static PCAxis.Paxiom.IPXModelParser GetPXSqlParseMetaPostData(PXSqlMeta mPXSqlMeta,PXSqlData mPXSqlData) + public static PCAxis.Paxiom.IPXModelParser GetPXSqlParseMetaPostData(PXSqlMeta mPXSqlMeta, PXSqlData mPXSqlData) { if (mPXSqlMeta.CNMMVersion.Equals("2.1")) { PCAxis.Sql.Parser_21.PXSqlData_21 mPXSqlData_21 = (PCAxis.Sql.Parser_21.PXSqlData_21)mPXSqlData; PCAxis.Sql.Parser_21.PXSqlMeta_21 mPXSqlMeta_21 = (PCAxis.Sql.Parser_21.PXSqlMeta_21)mPXSqlMeta; - return new PCAxis.Sql.Parser_21.PXSqlParseMetaPostData_21(mPXSqlData_21.DataNoteCellEntries,mPXSqlMeta_21); + return new PCAxis.Sql.Parser_21.PXSqlParseMetaPostData_21(mPXSqlData_21.DataNoteCellEntries, mPXSqlMeta_21); } else if (mPXSqlMeta.CNMMVersion.Equals("2.2")) @@ -35,7 +32,7 @@ public static PCAxis.Paxiom.IPXModelParser GetPXSqlParseMetaPostData(PXSqlMeta m { PCAxis.Sql.Parser_23.PXSqlData_23 mPXSqlData_23 = (PCAxis.Sql.Parser_23.PXSqlData_23)mPXSqlData; PCAxis.Sql.Parser_23.PXSqlMeta_23 mPXSqlMeta_23 = (PCAxis.Sql.Parser_23.PXSqlMeta_23)mPXSqlMeta; - return new PCAxis.Sql.Parser_23.PXSqlParseMetaPostData_23(mPXSqlData_23.DataNoteCellEntries, mPXSqlData_23.AttributesEntries,mPXSqlData_23.DefaultAttributes,mPXSqlMeta_23.Attributes,mPXSqlMeta_23.LanguageCodes, mPXSqlData_23.UsedNPMCharacters, mPXSqlMeta_23); + return new PCAxis.Sql.Parser_23.PXSqlParseMetaPostData_23(mPXSqlData_23.DataNoteCellEntries, mPXSqlData_23.AttributesEntries, mPXSqlData_23.DefaultAttributes, mPXSqlMeta_23.Attributes, mPXSqlMeta_23.LanguageCodes, mPXSqlData_23.UsedNPMCharacters, mPXSqlMeta_23); } else if (mPXSqlMeta.CNMMVersion.Equals("2.4")) { diff --git a/PCAxis.Sql/Parser/PxSQLEliniationProvider.cs b/PCAxis.Sql/Parser/PxSQLEliniationProvider.cs index 53f1bda..0913aff 100644 --- a/PCAxis.Sql/Parser/PxSQLEliniationProvider.cs +++ b/PCAxis.Sql/Parser/PxSQLEliniationProvider.cs @@ -1,9 +1,4 @@ -using PCAxis.Sql.DbClient; -using PCAxis.Sql.DbConfig; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using PCAxis.Sql.DbConfig; namespace PCAxis.Sql.Parser { @@ -13,7 +8,7 @@ public class EliminationDataItem public string ValueSet { get; set; } public string EliinationMethod { get; set; } public string EliinationCode { get; set; } - + } public class PxSQLEliniationProvider diff --git a/PCAxis.Sql/Parser/PxSqlParser.cs b/PCAxis.Sql/Parser/PxSqlParser.cs index 800d3c7..0f809ed 100644 --- a/PCAxis.Sql/Parser/PxSqlParser.cs +++ b/PCAxis.Sql/Parser/PxSqlParser.cs @@ -1,10 +1,10 @@ using System; +using log4net; + using PCAxis.Paxiom; using PCAxis.Sql.Parser; -using log4net; - namespace PCAxis.PlugIn.Sql { public abstract class PXSqlParser : IDisposable, PCAxis.Paxiom.IPXModelParser diff --git a/PCAxis.Sql/Parser/PxSqlParserForCodelists.cs b/PCAxis.Sql/Parser/PxSqlParserForCodelists.cs index cec562d..885726e 100644 --- a/PCAxis.Sql/Parser/PxSqlParserForCodelists.cs +++ b/PCAxis.Sql/Parser/PxSqlParserForCodelists.cs @@ -1,16 +1,18 @@ using System; -using PCAxis.Paxiom; - -using PCAxis.Sql.Parser; using log4net; -namespace PCAxis.PlugIn.Sql { +using PCAxis.Paxiom; +using PCAxis.Sql.Parser; + +namespace PCAxis.PlugIn.Sql +{ /// /// Handles the sending of VALUE and CODE to paxiom /// - abstract public class PXSqlParserForCodelists : IDisposable, PCAxis.Paxiom.IPXModelParser { + abstract public class PXSqlParserForCodelists : IDisposable, PCAxis.Paxiom.IPXModelParser + { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlParserForCodelists)); /// @@ -40,14 +42,15 @@ public static PXSqlParserForCodelists GetPXSqlParserForCodelists(PXSqlMeta inPXS } - public abstract void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage); - + public abstract void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage); + /// - /// The Parser for codelists does not use ParseData, but it has to be here to fullfill the PCAxis.Paxiom.IPXModelParser interface. Throws an exception if called. + /// The Parser for codelists does not use ParseData, but it has to be here to fullfill the PCAxis.Paxiom.IPXModelParser interface. Throws an exception if called. /// /// /// - public void ParseData(IPXModelParser.DataHandler handler, int preferredBufferSize) { + public void ParseData(IPXModelParser.DataHandler handler, int preferredBufferSize) + { throw new ApplicationException("BUG"); } diff --git a/PCAxis.Sql/Parser/PxSqlParserForDataCellNote.cs b/PCAxis.Sql/Parser/PxSqlParserForDataCellNote.cs index 6d9c9ac..30e63ce 100644 --- a/PCAxis.Sql/Parser/PxSqlParserForDataCellNote.cs +++ b/PCAxis.Sql/Parser/PxSqlParserForDataCellNote.cs @@ -1,11 +1,11 @@ using System; -using System.Collections.Specialized; using System.Collections.Generic; - -using PCAxis.Paxiom; +using System.Collections.Specialized; using log4net; +using PCAxis.Paxiom; + namespace PCAxis.PlugIn.Sql { /// diff --git a/PCAxis.Sql/Parser_21/ISqlItem.cs b/PCAxis.Sql/Parser_21/ISqlItem.cs index 0a37034..68b6426 100644 --- a/PCAxis.Sql/Parser_21/ISqlItem.cs +++ b/PCAxis.Sql/Parser_21/ISqlItem.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace PCAxis.Sql.Parser_21 { public interface ISqlItem diff --git a/PCAxis.Sql/Parser_21/PXMetaAdmValues.cs b/PCAxis.Sql/Parser_21/PXMetaAdmValues.cs index 876283d..84f2fa8 100644 --- a/PCAxis.Sql/Parser_21/PXMetaAdmValues.cs +++ b/PCAxis.Sql/Parser_21/PXMetaAdmValues.cs @@ -1,30 +1,36 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_21; + using log4net; + using PCAxis.Sql.DbConfig; +using PCAxis.Sql.QueryLib_21; -namespace PCAxis.Sql.Parser_21 { - public class PXMetaAdmValues { +namespace PCAxis.Sql.Parser_21 +{ + public class PXMetaAdmValues + { private static readonly ILog log = LogManager.GetLogger(typeof(PXMetaAdmValues)); #region fields & properties private string _PXCodepage = "iso-8859-1"; //default may be overwritten - public string PXCodepage { + public string PXCodepage + { get { return _PXCodepage; } } private string _PXCharset = "ANSI"; //default may be overwritten - public string PXCharset { + public string PXCharset + { get { return _PXCharset; } } private string _PXAxisVersion = "2000"; //default may be overwritten - public string PXAxisVersion { + public string PXAxisVersion + { get { return _PXAxisVersion; } } @@ -36,7 +42,8 @@ public string PXAxisVersion { private bool _PXDescriptionDefault = false; //default may be overwritten - public bool PXDescriptionDefault { + public bool PXDescriptionDefault + { get { return _PXDescriptionDefault; } } @@ -45,30 +52,39 @@ internal bool AllwaysUseMaintablePrestextSInDynamicTitle { get { return _AllwaysUseMaintablePrestextSInDynamicTitle; } } - + #endregion fields & properties - public PXMetaAdmValues(Dictionary altIBasen, SqlDbConfig_21 dbConfig) { + public PXMetaAdmValues(Dictionary altIBasen, SqlDbConfig_21 dbConfig) + { SqlDbConfig_21.DbKeywords Keywords = dbConfig.Keywords; //PXCodepage - if (Keywords.Optional_PXCodepage != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXCodepage)) { + if (Keywords.Optional_PXCodepage != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXCodepage)) + { _PXCodepage = altIBasen[Keywords.Optional_PXCodepage].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXCodepage + " not found in table with modelname MetaAdm."); } } //PXDescriptionDefault - if (Keywords.Optional_PXDescriptionDefault != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXDescriptionDefault)) { + if (Keywords.Optional_PXDescriptionDefault != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXDescriptionDefault)) + { _PXDescriptionDefault = altIBasen[Keywords.Optional_PXDescriptionDefault].Value.Equals(dbConfig.Codes.Yes); - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXDescriptionDefault + " not found in table with modelname MetaAdm."); } } @@ -86,19 +102,27 @@ public PXMetaAdmValues(Dictionary altIBasen, SqlDbConfig_21 } //PXCharset - if (Keywords.Optional_PXCharset != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXCharset)) { + if (Keywords.Optional_PXCharset != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXCharset)) + { _PXCharset = altIBasen[Keywords.Optional_PXCharset].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXCharset + " not found in table with modelname MetaAdm."); } } //PXAxisVersion - if (Keywords.Optional_PXAxisVersion != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXAxisVersion)) { + if (Keywords.Optional_PXAxisVersion != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXAxisVersion)) + { _PXAxisVersion = altIBasen[Keywords.Optional_PXAxisVersion].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXAxisVersion + " not found in table with modelname MetaAdm."); } } @@ -107,7 +131,7 @@ public PXMetaAdmValues(Dictionary altIBasen, SqlDbConfig_21 // _DefaultCodeMissingLine = altIBasen["DefaultCodeMissingLine"].Value; //} else { // log.Error(" Keyword:\"DefaultCodeMissingLine\" not found in table with modelname MetaAdm."); - + //} } } diff --git a/PCAxis.Sql/Parser_21/PXSqlContact.cs b/PCAxis.Sql/Parser_21/PXSqlContact.cs index 04820c9..8ee8348 100644 --- a/PCAxis.Sql/Parser_21/PXSqlContact.cs +++ b/PCAxis.Sql/Parser_21/PXSqlContact.cs @@ -1,12 +1,10 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; -using PCAxis.Sql.QueryLib_21; -using System.Collections.Specialized; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Sql.QueryLib_21; + namespace PCAxis.Sql.Parser_21 { @@ -47,7 +45,8 @@ public PXSqlContact(PXSqlMeta_21 meta, string mMainTableId) personIDs.Add(RoleHead.Key, RoleHead.Value); } } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant add RoleHead", e); } @@ -62,12 +61,13 @@ public PXSqlContact(PXSqlMeta_21 meta, string mMainTableId) personIDs.Add(RoleContact.Key, RoleContact.Value); } } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant add RoleContact", e); } - + bool firstPerson = true; @@ -93,18 +93,19 @@ public PXSqlContact(PXSqlMeta_21 meta, string mMainTableId) - mBigFatContactStringsByLanguage[language] += person.Forename + " " + person.Surname + ", " + org.texts[language].OrganizationName + - "# "+ PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactPhone" , language)+": " + person.PhonePrefix + " " + person.PhoneNo + + mBigFatContactStringsByLanguage[language] += person.Forename + " " + person.Surname + ", " + org.texts[language].OrganizationName + + "# " + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactPhone", language) + ": " + person.PhonePrefix + " " + person.PhoneNo + "#" + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactFax", language) + ": " + person.PhonePrefix + " " + person.FaxNo + "#" + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactEMail", language) + ": " + person.Email; - + } firstPerson = false; } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant find contact info", e); } diff --git a/PCAxis.Sql/Parser_21/PXSqlContent.cs b/PCAxis.Sql/Parser_21/PXSqlContent.cs index 0679c36..100ce55 100644 --- a/PCAxis.Sql/Parser_21/PXSqlContent.cs +++ b/PCAxis.Sql/Parser_21/PXSqlContent.cs @@ -1,147 +1,153 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; -using PCAxis.Sql.QueryLib_21; using System.Collections.Specialized; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; +using PCAxis.Sql.QueryLib_21; + namespace PCAxis.Sql.Parser_21 { - public class PXSqlContent:IComparable + public class PXSqlContent : IComparable { - private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlContent)); - - #region value to be used if row is missing - - /// - /// must be 0, 2 or 3. 0 indicates presCellsZero = yes - /// - private string mCategoryOfCellsInMissingRows = "0"; - public string CategoryOfCellsInMissingRows { - get { return mCategoryOfCellsInMissingRows; } - } - - /// - /// the magicNumber (or 0 when category = 0) - /// - private double mValueOfCellsInMissingRows = 0; - public double ValueOfCellsInMissingRows { - get { return mValueOfCellsInMissingRows; } - } - #endregion value to be used if row is missing - - private ContentsRow mRow; - - /// - /// Contact is per maintable in the database, but per Content in paxiom. Thus we have to send the same contact for all Content. - /// - private PXSqlContact mContact; - - - - public PXSqlContent() { } - public PXSqlContent(ContentsRow row, PXSqlMeta_21 pxsqlMeta, SqlDbConfig_21 config, PXSqlContact contact) { - mRow = row; - mContact = contact; - //pxsqlMeta.MetaQuery.DB.Codes.Copyright1; - mContents = row.Contents; - //mFootnoteContents = row.FootnoteContents; - //mFootnoteTime = row.FootnoteTime; - //mFootnoteValue = row.FootnoteValue; - //mFootnoteVariable = row.FootnoteVariable; - mPresText = new Dictionary(); - mPresTextS = new Dictionary(); - mPresCode = row.PresCode; - - mBasePeriod = new Dictionary(); - mRefPeriod = new Dictionary(); - mUnit = new Dictionary(); - - - foreach (string langCode in pxsqlMeta.LanguageCodes) - { - mPresText[langCode] = row.texts[langCode].PresText; - mPresTextS[langCode] = row.texts[langCode].PresTextS; - mBasePeriod[langCode] = row.texts[langCode].BasePeriod; - mRefPeriod[langCode] = row.texts[langCode].RefPeriod; - mUnit[langCode] = row.texts[langCode].Unit; - } - - mPresDecimals = mRow.PresDecimals; - pxsqlMeta.DecimalHandler.ShowDecimals = mPresDecimals; - pxsqlMeta.DecimalHandler.StoreDecimals = mRow.StoreDecimals; - - mSeasAdj = mRow.SeasAdj.Equals(config.Codes.Yes); - mDayAdj = mRow.DayAdj.Equals(config.Codes.Yes); - mLastUpdatet = mRow.LastUpdated; - mStockFA = PaxiomifyStockFA(mRow.StockFA, config); - mCFPrices = PaxiomifyCFPrices(mRow.CFPrices, config); - - - mAggregPossible = ! mRow.AggregPossible.Equals(config.Codes.No); //not notPossible since yes is default - - #region mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows - if( pxsqlMeta.inPresentationModus && mRow.PresCellsZero.Equals(config.Codes.No)){ - //for version 2.0 use default, - // both 2.1 and 2.2 uses a mRow.PresMissingLine from the SpecialCharacter.CharacterType( which is the primary key) - // or if mRow.PresMissingLine is missing: the default - if (String.Compare(pxsqlMeta.MetaModelVersion, "2.0", false, System.Globalization.CultureInfo.InvariantCulture) > 0) - { - mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineMagic; - if (!( String.IsNullOrEmpty(mRow.PresMissingLine))) - { - mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine); - } - mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString(); - - } - else { - // 2010.11.29 Changed There is no DefaultCodeMissinLine i 2.0. Use the same symbol as DataNotAvialable - //mValueOfCellsInMissingRows = 0; - //mCategoryOfCellsInMissingRows = "3"; - mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataNotAvailableMagic; - mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString(); - - } - - } - #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows - } - - - - private string mContents; - public string Contents - { - get { return mContents;} - set { mContents = value;} - } - - private int mSortOrder; - public int SortOrder - { - get { return mSortOrder; } - set { mSortOrder = value; } - } - - private Dictionary mPresText; - public Dictionary PresText + private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlContent)); + + #region value to be used if row is missing + + /// + /// must be 0, 2 or 3. 0 indicates presCellsZero = yes + /// + private string mCategoryOfCellsInMissingRows = "0"; + public string CategoryOfCellsInMissingRows + { + get { return mCategoryOfCellsInMissingRows; } + } + + /// + /// the magicNumber (or 0 when category = 0) + /// + private double mValueOfCellsInMissingRows = 0; + public double ValueOfCellsInMissingRows + { + get { return mValueOfCellsInMissingRows; } + } + #endregion value to be used if row is missing + + private ContentsRow mRow; + + /// + /// Contact is per maintable in the database, but per Content in paxiom. Thus we have to send the same contact for all Content. + /// + private PXSqlContact mContact; + + + + public PXSqlContent() { } + public PXSqlContent(ContentsRow row, PXSqlMeta_21 pxsqlMeta, SqlDbConfig_21 config, PXSqlContact contact) + { + mRow = row; + mContact = contact; + //pxsqlMeta.MetaQuery.DB.Codes.Copyright1; + mContents = row.Contents; + //mFootnoteContents = row.FootnoteContents; + //mFootnoteTime = row.FootnoteTime; + //mFootnoteValue = row.FootnoteValue; + //mFootnoteVariable = row.FootnoteVariable; + mPresText = new Dictionary(); + mPresTextS = new Dictionary(); + mPresCode = row.PresCode; + + mBasePeriod = new Dictionary(); + mRefPeriod = new Dictionary(); + mUnit = new Dictionary(); + + + foreach (string langCode in pxsqlMeta.LanguageCodes) + { + mPresText[langCode] = row.texts[langCode].PresText; + mPresTextS[langCode] = row.texts[langCode].PresTextS; + mBasePeriod[langCode] = row.texts[langCode].BasePeriod; + mRefPeriod[langCode] = row.texts[langCode].RefPeriod; + mUnit[langCode] = row.texts[langCode].Unit; + } + + mPresDecimals = mRow.PresDecimals; + pxsqlMeta.DecimalHandler.ShowDecimals = mPresDecimals; + pxsqlMeta.DecimalHandler.StoreDecimals = mRow.StoreDecimals; + + mSeasAdj = mRow.SeasAdj.Equals(config.Codes.Yes); + mDayAdj = mRow.DayAdj.Equals(config.Codes.Yes); + mLastUpdatet = mRow.LastUpdated; + mStockFA = PaxiomifyStockFA(mRow.StockFA, config); + mCFPrices = PaxiomifyCFPrices(mRow.CFPrices, config); + + + mAggregPossible = !mRow.AggregPossible.Equals(config.Codes.No); //not notPossible since yes is default + + #region mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows + if (pxsqlMeta.inPresentationModus && mRow.PresCellsZero.Equals(config.Codes.No)) + { + //for version 2.0 use default, + // both 2.1 and 2.2 uses a mRow.PresMissingLine from the SpecialCharacter.CharacterType( which is the primary key) + // or if mRow.PresMissingLine is missing: the default + if (String.Compare(pxsqlMeta.MetaModelVersion, "2.0", false, System.Globalization.CultureInfo.InvariantCulture) > 0) + { + mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineMagic; + if (!(String.IsNullOrEmpty(mRow.PresMissingLine))) + { + mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine); + } + mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString(); + + } + else + { + // 2010.11.29 Changed There is no DefaultCodeMissinLine i 2.0. Use the same symbol as DataNotAvialable + //mValueOfCellsInMissingRows = 0; + //mCategoryOfCellsInMissingRows = "3"; + mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataNotAvailableMagic; + mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString(); + + } + + } + #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows + } + + + + private string mContents; + public string Contents + { + get { return mContents; } + set { mContents = value; } + } + + private int mSortOrder; + public int SortOrder + { + get { return mSortOrder; } + set { mSortOrder = value; } + } + + private Dictionary mPresText; + public Dictionary PresText { get { return mPresText; } set { mPresText = value; } } - private Dictionary mPresTextS; - public Dictionary PresTextS + private Dictionary mPresTextS; + public Dictionary PresTextS { get { return mPresTextS; } set { mPresTextS = value; } } - - private string mPresCode; + + private string mPresCode; public string PresCode { get { return mPresCode; } @@ -156,20 +162,20 @@ public Dictionary UNIT - //Ikke i bruk + //Ikke i bruk - //private string mProducer; - // public string Producer - // { - // get { return mProducer; } - // set { mProducer = value; } - // } + //private string mProducer; + // public string Producer + // { + // get { return mProducer; } + // set { mProducer = value; } + // } #region ContentInfo in Paxiom private Dictionary mRefPeriod; - // private Dictionary mUnit; + // private Dictionary mUnit; private Dictionary mBasePeriod; private string mLastUpdatet; @@ -189,312 +195,339 @@ public Dictionary UNIT // set { mPublished = value; } //} - private string mPresDecimals; - + private string mPresDecimals; + - public string PresCellsZero { + public string PresCellsZero + { get { return mRow.PresCellsZero; } } - public string PresMissingLine { + public string PresMissingLine + { get { return mRow.PresMissingLine; } } - private bool mAggregPossible; + private bool mAggregPossible; public bool AggregPossible { get { return mAggregPossible; } } - - private string mStoreColumnNo; + + private string mStoreColumnNo; public string StoreColumnNo { get { return mStoreColumnNo; } set { mStoreColumnNo = value; } } - private string mStoreFormat; + private string mStoreFormat; public string StoreFormat { get { return mStoreFormat; } set { mStoreFormat = value; } } - private string mStoreNoChar; + private string mStoreNoChar; public string StoreNoChar { get { return mStoreNoChar; } set { mStoreNoChar = value; } } - //private string mStoreDecimals; - // public string StoreDecimals - // { - // get { return mStoreDecimals; } - // set { mStoreDecimals = value; } - // } + //private string mStoreDecimals; + // public string StoreDecimals + // { + // get { return mStoreDecimals; } + // set { mStoreDecimals = value; } + // } - private string mUserid; + private string mUserid; public string Userid { get { return mUserid; } set { mUserid = value; } } - private string mLogDate; + private string mLogDate; public string LogDate { get { return mLogDate; } set { mLogDate = value; } - + + } + + + public int CompareTo(PXSqlContent compPXSqlContent) + { + return mSortOrder.CompareTo(compPXSqlContent.mSortOrder); } - - - public int CompareTo(PXSqlContent compPXSqlContent) - { - return mSortOrder.CompareTo(compPXSqlContent.mSortOrder); - } - - /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - /// - /// - /// - /// - /// - ///
- /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// If value in database equals to CFPricesC code in db config file then set to PXConstant.CFPRICES_CURRENT. - /// If value in database equals to CFPricesF code in db config file then set to PXConstant.CFPRICES_FIXED. - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. Maps the code in dbconfig file to PX PXConstant - /// StockFAS-->STOCKFA_STOCK, StockFAF-->STOCKFA_FLOW,StockFAA-->STOCKFA_AVERAGE. - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// Holds the Contents.Contents from database so it could be referenced back to from paxiom - /// - /// - ///
- ///
- ///
- public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes) - { - - StringCollection values = new StringCollection(); - - //string subkey = this.Contents; - string subkey = this.PresCode; //prescode should be Code i Paxiom. Contents is sent as Reference_is an ouse as code i PXS. - - foreach (string langCode in LanguageCodes) { - - // BASEPERIOD - values.Clear(); - values.Add(this.mBasePeriod[langCode]); - handler(PXKeywords.BASEPERIOD, langCode, subkey, values); - - - // CONTACT - values.Clear(); - values.Add(this.mContact.GetBigFatContactString(langCode)); - handler(PXKeywords.CONTACT, langCode, subkey, values); - - - // REFPERIOD - values.Clear(); - values.Add(this.mRefPeriod[langCode]); - handler(PXKeywords.REFPERIOD, langCode, subkey, values); - - - // UNITS - values.Clear(); - values.Add(this.mUnit[langCode]); - handler(PXKeywords.UNITS, langCode, subkey, values); - - } - - string noLanguage = null; - - // CFPRICES - values.Clear(); - values.Add(this.mCFPrices); - handler(PXKeywords.CFPRICES, noLanguage, subkey, values); - - - // LAST_UPDATED - values.Clear(); - values.Add(this.mLastUpdatet); - handler(PXKeywords.LAST_UPDATED, noLanguage, subkey, values); - - //SEASADJ - values.Clear(); - if (this.mSeasAdj) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.SEASADJ, noLanguage, subkey, values); - - //DAYADJ - values.Clear(); - - if (this.mDayAdj) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.DAYADJ, noLanguage, subkey, values); - - //STOCKFA - values.Clear(); - values.Add(this.mStockFA); - handler(PXKeywords.STOCKFA, noLanguage, subkey, values); - - //PRECISION - if (!String.IsNullOrEmpty(this.mPresDecimals)) - { - values.Clear(); - values.Add(this.mPresDecimals); - String myKey = PXSqlMeta_21.mContVariableCode + "\",\"" + subkey;//for PXModelBuilder.SplittString A","B","C - // not "A","B","C" - log.Debug("Sender precision for " + myKey); - handler(PXKeywords.PRECISION, noLanguage, myKey, values); - } - - - - //REFRENCE_ID Used to hold unique Id of Content in Paxiom. This will be used in pxs to identify selected contents - // The resason why contents is placed in Code fro the value which represent the contents is that this is occupied by PresCode. - values.Clear(); - values.Add(this.Contents); - handler(PXKeywords.REFRENCE_ID, noLanguage, subkey, values); - } - - - - - internal void AdjustPresDecimalsToCommonDecimals(string Decimals) { - log.Debug(Decimals.Equals(mPresDecimals)); - if(Decimals.Equals(mPresDecimals)){ - - mPresDecimals = String.Empty; - } - } - - /** - * Translates database code to Paxiom code for StockFA. - */ - private string PaxiomifyStockFA(string StockFA,SqlDbConfig_21 config) { - string myOut = ""; - if (! String.IsNullOrEmpty(StockFA) ) { - if (StockFA.Equals(config.Codes.StockFAS)) { - myOut = PXConstant.STOCKFA_STOCK; - } else if (StockFA.Equals(config.Codes.StockFAA)) { - myOut = PXConstant.STOCKFA_AVERAGE; - } else if (StockFA.Equals(config.Codes.StockFAF)) { - myOut = PXConstant.STOCKFA_FLOW; - } else { - myOut = PXConstant.STOCKFA_OTHER; - //throw new ApplicationException("Unknown StockFA code:\"" + StockFA + "\""); - } - } - return myOut; - } - /**Translates database code to Paxiom code for CFPrices*/ - private string PaxiomifyCFPrices(string CFPrices, SqlDbConfig_21 config) { - string myOut = ""; - if (! String.IsNullOrEmpty(CFPrices)) { - if (CFPrices.Equals(config.Codes.CFPricesC)) { - myOut = PXConstant.CFPRICES_CURRENT; - } else if (CFPrices.Equals(config.Codes.CFPricesF)) { - myOut = PXConstant.CFPRICES_FIXED; - } else { - throw new ApplicationException("Unknown CFPrices code:\"" + CFPrices + "\""); - } - } - return myOut; - } - } - - - - + + /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + /// + /// + /// + /// + /// + ///
+ /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If value in database equals to CFPricesC code in db config file then set to PXConstant.CFPRICES_CURRENT. + /// If value in database equals to CFPricesF code in db config file then set to PXConstant.CFPRICES_FIXED. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. Maps the code in dbconfig file to PX PXConstant + /// StockFAS-->STOCKFA_STOCK, StockFAF-->STOCKFA_FLOW,StockFAA-->STOCKFA_AVERAGE. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Holds the Contents.Contents from database so it could be referenced back to from paxiom + /// + /// + ///
+ ///
+ ///
+ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes) + { + + StringCollection values = new StringCollection(); + + //string subkey = this.Contents; + string subkey = this.PresCode; //prescode should be Code i Paxiom. Contents is sent as Reference_is an ouse as code i PXS. + + foreach (string langCode in LanguageCodes) + { + + // BASEPERIOD + values.Clear(); + values.Add(this.mBasePeriod[langCode]); + handler(PXKeywords.BASEPERIOD, langCode, subkey, values); + + + // CONTACT + values.Clear(); + values.Add(this.mContact.GetBigFatContactString(langCode)); + handler(PXKeywords.CONTACT, langCode, subkey, values); + + + // REFPERIOD + values.Clear(); + values.Add(this.mRefPeriod[langCode]); + handler(PXKeywords.REFPERIOD, langCode, subkey, values); + + + // UNITS + values.Clear(); + values.Add(this.mUnit[langCode]); + handler(PXKeywords.UNITS, langCode, subkey, values); + + } + + string noLanguage = null; + + // CFPRICES + values.Clear(); + values.Add(this.mCFPrices); + handler(PXKeywords.CFPRICES, noLanguage, subkey, values); + + + // LAST_UPDATED + values.Clear(); + values.Add(this.mLastUpdatet); + handler(PXKeywords.LAST_UPDATED, noLanguage, subkey, values); + + //SEASADJ + values.Clear(); + if (this.mSeasAdj) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.SEASADJ, noLanguage, subkey, values); + + //DAYADJ + values.Clear(); + + if (this.mDayAdj) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.DAYADJ, noLanguage, subkey, values); + + //STOCKFA + values.Clear(); + values.Add(this.mStockFA); + handler(PXKeywords.STOCKFA, noLanguage, subkey, values); + + //PRECISION + if (!String.IsNullOrEmpty(this.mPresDecimals)) + { + values.Clear(); + values.Add(this.mPresDecimals); + String myKey = PXSqlMeta_21.mContVariableCode + "\",\"" + subkey;//for PXModelBuilder.SplittString A","B","C + // not "A","B","C" + log.Debug("Sender precision for " + myKey); + handler(PXKeywords.PRECISION, noLanguage, myKey, values); + } + + + + //REFRENCE_ID Used to hold unique Id of Content in Paxiom. This will be used in pxs to identify selected contents + // The resason why contents is placed in Code fro the value which represent the contents is that this is occupied by PresCode. + values.Clear(); + values.Add(this.Contents); + handler(PXKeywords.REFRENCE_ID, noLanguage, subkey, values); + } + + + + + internal void AdjustPresDecimalsToCommonDecimals(string Decimals) + { + log.Debug(Decimals.Equals(mPresDecimals)); + if (Decimals.Equals(mPresDecimals)) + { + + mPresDecimals = String.Empty; + } + } + + /** + * Translates database code to Paxiom code for StockFA. + */ + private string PaxiomifyStockFA(string StockFA, SqlDbConfig_21 config) + { + string myOut = ""; + if (!String.IsNullOrEmpty(StockFA)) + { + if (StockFA.Equals(config.Codes.StockFAS)) + { + myOut = PXConstant.STOCKFA_STOCK; + } + else if (StockFA.Equals(config.Codes.StockFAA)) + { + myOut = PXConstant.STOCKFA_AVERAGE; + } + else if (StockFA.Equals(config.Codes.StockFAF)) + { + myOut = PXConstant.STOCKFA_FLOW; + } + else + { + myOut = PXConstant.STOCKFA_OTHER; + //throw new ApplicationException("Unknown StockFA code:\"" + StockFA + "\""); + } + } + return myOut; + } + /**Translates database code to Paxiom code for CFPrices*/ + private string PaxiomifyCFPrices(string CFPrices, SqlDbConfig_21 config) + { + string myOut = ""; + if (!String.IsNullOrEmpty(CFPrices)) + { + if (CFPrices.Equals(config.Codes.CFPricesC)) + { + myOut = PXConstant.CFPRICES_CURRENT; + } + else if (CFPrices.Equals(config.Codes.CFPricesF)) + { + myOut = PXConstant.CFPRICES_FIXED; + } + else + { + throw new ApplicationException("Unknown CFPrices code:\"" + CFPrices + "\""); + } + } + return myOut; + } + } + + + + } diff --git a/PCAxis.Sql/Parser_21/PXSqlData_21.cs b/PCAxis.Sql/Parser_21/PXSqlData_21.cs index b202c87..5b29c3a 100644 --- a/PCAxis.Sql/Parser_21/PXSqlData_21.cs +++ b/PCAxis.Sql/Parser_21/PXSqlData_21.cs @@ -1,10 +1,13 @@ -namespace PCAxis.Sql.Parser_21 { +namespace PCAxis.Sql.Parser_21 +{ using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Data; + using log4net; + using PCAxis.Sql.Parser; /// @@ -20,7 +23,8 @@ namespace PCAxis.Sql.Parser_21 { /// Factor_i = 1 /// index = Factor_k*(k-1) + Factor_j*(j-1) + Factor_i(i-1) /// - public class PXSqlData_21:PXSqlData { + public class PXSqlData_21 : PXSqlData + { /// The Log private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlData_21)); #region members and propreties @@ -72,10 +76,10 @@ internal override string[] DataCellNotes return null; //not supported yet in this version } } - + private string sqlString = "select /" + "*+STAR_TRANSFORMATION *" + "/ "; - + /// /// The number of expected in-rows per out-row due to elimination by sum. /// (the product of the number of possible codes for each @@ -105,11 +109,12 @@ internal override string[] DataCellNotes #endregion members and propreties #region contructors - public PXSqlData_21(PXSqlMeta_21 mPXSqlMeta) { + public PXSqlData_21(PXSqlMeta_21 mPXSqlMeta) + { log.Debug("Start PXSqlData mPXSqlMeta.Name: " + mPXSqlMeta.Name); this.mMeta = mPXSqlMeta; - + symbols = mMeta.mPxsqlNpm; @@ -124,11 +129,13 @@ public PXSqlData_21(PXSqlMeta_21 mPXSqlMeta) { this.useSum = hasGrouping || eliminationBySum; - foreach (PXSqlVariable var in mMeta.Stubs) { + foreach (PXSqlVariable var in mMeta.Stubs) + { keysInReverseOutputOrder.Add(var.Name); } - foreach (PXSqlVariable var in mMeta.Headings) { + foreach (PXSqlVariable var in mMeta.Headings) + { keysInReverseOutputOrder.Add(var.Name); } keysInReverseOutputOrder.Reverse(); @@ -138,14 +145,20 @@ public PXSqlData_21(PXSqlMeta_21 mPXSqlMeta) { mValueCount = new Dictionary(numberOfOutputVariables); mIndexFactor = new Dictionary(numberOfOutputVariables); - foreach (PXSqlVariable var in mMeta.Variables.Values) { - if (var.IsEliminatedByValue) { + foreach (PXSqlVariable var in mMeta.Variables.Values) + { + if (var.IsEliminatedByValue) + { log.Debug(var.Name + " Is Eliminated By Value"); keysOfEliminatedByValue.Add(var.Name); - } else if (var.IsContentVariable) { + } + else if (var.IsContentVariable) + { log.Debug(var.Name + " Is Content Variable"); theKeyOfTheContentsVariableVariable = var.Name; - } else if (!var.isSelected) { + } + else if (!var.isSelected) + { log.Debug(var.Name + " Is Eliminated By SUM"); keysOfEliminatedBySum.Add(var.Name); eliminationFactor *= var.TotalNumberOfValuesInDB; @@ -153,17 +166,22 @@ public PXSqlData_21(PXSqlMeta_21 mPXSqlMeta) { } #region init contKeys - if (String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) { //just one contVar + if (String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) + { //just one contVar throw new ApplicationException("Bug"); // the size of ContentsVariableVariable should not influence how it is stored // contKeys.Add( mMeta.FirstContents ); - } else { + } + else + { PXSqlVariable theContentsVariable = mMeta.Variables[theKeyOfTheContentsVariableVariable]; - foreach (PXSqlValue contCode in theContentsVariable.GetValuesForParsing()) { + foreach (PXSqlValue contCode in theContentsVariable.GetValuesForParsing()) + { //contKeys.Add(contCode.ValueCode); contKeys.Add(contCode.ContentsCode); // 2010.05.07 replaces line above because valuecode is now Prescode from contents. New contentscode added to PXSqlValue } - foreach (string contCode in theContentsVariable.Values.Keys) { + foreach (string contCode in theContentsVariable.Values.Keys) + { // contKeys.Add(contCode); } @@ -180,16 +198,19 @@ public PXSqlData_21(PXSqlMeta_21 mPXSqlMeta) { anyDefaultMRNotZero = false; // MR = missing record anyDefaultMROfCat3 = false; // MR = missing record - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { PXSqlContent tmpCont = mMeta.Contents[contCode]; log.Debug("PXSqlContents for " + contCode + " PresCellsZero:" + tmpCont.PresCellsZero + " PresMissingLine:" + tmpCont.PresMissingLine); CategoryOfCellsInMissingRows[contCount2] = tmpCont.CategoryOfCellsInMissingRows; ValueOfCellsInMissingRows[contCount2] = tmpCont.ValueOfCellsInMissingRows; - if (!CategoryOfCellsInMissingRows[contCount2].Equals("0")) { + if (!CategoryOfCellsInMissingRows[contCount2].Equals("0")) + { anyDefaultMRNotZero = true; - if (CategoryOfCellsInMissingRows[contCount2].Equals("3")) { + if (CategoryOfCellsInMissingRows[contCount2].Equals("3")) + { anyDefaultMROfCat3 = true; } } @@ -207,18 +228,21 @@ public PXSqlData_21(PXSqlMeta_21 mPXSqlMeta) { #endregion contructors - private void CreateSqlString() { + private void CreateSqlString() + { int TempNumber = 25; - + string sqlJoinString = ""; string sqlGroupByString = ""; string tempGroupFactorSQL = ""; - foreach (string key in keysInReverseOutputOrder) { + foreach (string key in keysInReverseOutputOrder) + { PXSqlVariable var = mMeta.Variables[key]; - - if (!var.IsContentVariable) { + + if (!var.IsContentVariable) + { #region if (!var.IsContentVariable) var.TempTableNo = TempNumber.ToString(); @@ -232,15 +256,17 @@ private void CreateSqlString() { throw new PCAxis.Sql.Exceptions.DbPxsMismatchException(2, var.Name); } - - if(var.Values.Count != valueCodes.Count ) { + + if (var.Values.Count != valueCodes.Count) + { log.Warn("There seems to be an inconsistency in which values should be included..."); } var.TempTableName = mMeta.MetaQuery.MakeTempTable(var.Name, var.TempTableNo, valueCodes, 500); - } else + } + else { List groupCodes = ((PXSqlVariableClassification)var).GetGroupsForParsing(); @@ -258,13 +284,16 @@ private void CreateSqlString() { sqlJoinString += " JOIN " + var.TempTableName + " ON dt." + key + " = " + var.TempTableName + ".a" + key + " "; - if (useSum) { + if (useSum) + { sqlGroupByString += ", Groupnr" + var.TempTableNo; } - if (npm) { + if (npm) + { //We need the grupp-variables in case of a DataNoteCell - if (useSum) { + if (useSum) + { sqlGroupByString += ", Group" + var.TempTableNo; } DataNoteCellId_Columns.Add("Group" + var.TempTableNo); @@ -274,8 +303,10 @@ private void CreateSqlString() { // done:needGroupingFactor bør vel erstattes med needGroupingFactor && /// - override public double[] CreateMatrix() { + override public double[] CreateMatrix() + { log.Debug("Start CreateMatrix()"); needGroupingFactor = anyDefaultMROfCat3 && hasGrouping; @@ -376,7 +422,8 @@ override public double[] CreateMatrix() { // the factor OfTheContentsVariableVariable: int contFactor = 100;// the value does not matter. it is either overwritten or multiplied by 0 - if (!String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) { + if (!String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) + { contFactor = mIndexFactor[theKeyOfTheContentsVariableVariable]; } @@ -387,19 +434,28 @@ override public double[] CreateMatrix() { //anyDefaultMRNotZero = true; - if (anyDefaultMRNotZero) { - if (String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) { - for (int i = 0; i < mSize; i++) { + if (anyDefaultMRNotZero) + { + if (String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) + { + for (int i = 0; i < mSize; i++) + { myOut[i] = ValueOfCellsInMissingRows[0]; } - } else { + } + else + { int prevFactor = contFactor * contKeys.Count; - for (int cont = 0; cont < contKeys.Count; cont++) { - if (ValueOfCellsInMissingRows[cont] == 0) { + for (int cont = 0; cont < contKeys.Count; cont++) + { + if (ValueOfCellsInMissingRows[cont] == 0) + { continue; //myOut is already 0 } - for (int k = 0; k < mSize; k += prevFactor) { - for (int l = 0; l < contFactor; l++) { + for (int k = 0; k < mSize; k += prevFactor) + { + for (int l = 0; l < contFactor; l++) + { myOut[l + cont * contFactor + k] = ValueOfCellsInMissingRows[cont]; } } @@ -424,20 +480,26 @@ override public double[] CreateMatrix() { bool hasNoMissingRows = true; int missingRowsCnt = 0; log.Debug("npm :" + npm.ToString() + " useSum:" + useSum.ToString() + " Row count: " + myRows.Count.ToString()); - if ((!npm) && (!useSum)) { + if ((!npm) && (!useSum)) + { #region not npm and not useSum - foreach (DataRow sqlRow in myRows) { + foreach (DataRow sqlRow in myRows) + { contCount = 0; mIndex = int.Parse(sqlRow[MINDEX_COL].ToString()); - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { arrayIndex = mIndex + contFactor * contCount; hasBlankCells = int.Parse(sqlRow[contCode + "_NilCnt"].ToString()) > 0; #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value @@ -451,52 +513,73 @@ override public double[] CreateMatrix() { } #endregion not npm and not useSum - } else if ((!npm) && (useSum)) { + } + else if ((!npm) && (useSum)) + { #region not npm and useSum - - foreach (DataRow sqlRow in myRows) { + + foreach (DataRow sqlRow in myRows) + { contCount = 0; mIndex = int.Parse(sqlRow[MINDEX_COL].ToString()); - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { arrayIndex = mIndex + contFactor * contCount; hasBlankCells = int.Parse(sqlRow[contCode + "_NilCnt"].ToString()) > 0; - // log.Debug(sqlRow[contCode].ToString()); - + // log.Debug(sqlRow[contCode].ToString()); + - if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) { + if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) + { //missing rows are ignored #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value - } else { + } + else + { //must look for missing rows - if (needGroupingFactor) { + if (needGroupingFactor) + { hasNoMissingRows = eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) <= int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { hasNoMissingRows = eliminationFactor <= int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (hasNoMissingRows) { + if (hasNoMissingRows) + { #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value - } else { //has missing row (of cat 3) - if (hasBlankCells) {// and blank cells ( = DataNotAvailable = cat. 3 + } + else + { //has missing row (of cat 3) + if (hasBlankCells) + {// and blank cells ( = DataNotAvailable = cat. 3 //if (ValueOfCellsInMissingRows[contCount] != symbols.getDataNotAvailableDouble()) { - if (ValueOfCellsInMissingRows[contCount] != symbols.DataNotAvailableMagic) { + if (ValueOfCellsInMissingRows[contCount] != symbols.DataNotAvailableMagic) + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; } // else myOut[arrayIndex] =ValueOfCellsInMissingRows[contCount] done in init @@ -516,39 +599,54 @@ override public double[] CreateMatrix() { } #endregion not npm and useSum - } else if ((npm) && (!useSum)) { + } + else if ((npm) && (!useSum)) + { #region npm and not useSum - foreach (DataRow sqlRow in myRows) { + foreach (DataRow sqlRow in myRows) + { contCount = 0; mIndex = int.Parse(sqlRow[MINDEX_COL].ToString()); - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { arrayIndex = mIndex + contFactor * contCount; hasBlankCells = int.Parse(sqlRow[contCode + "_NilCnt"].ToString()) > 0; //if blankCellCnt > 0 has cat. 3 missing either for .._XMAX or the default (=DNA) string npmMax = sqlRow[contCode + "_XMAX"].ToString(); - if (String.IsNullOrEmpty(npmMax)) { + if (String.IsNullOrEmpty(npmMax)) + { #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value - } else if (npmMax.StartsWith("B1")) { - if (hasBlankCells) { + } + else if (npmMax.StartsWith("B1")) + { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); addDataNoteCell(npmMax.Substring(2), sqlRow, contCode); } - } else {// cat 2 or 3 + } + else + {// cat 2 or 3 //myOut[arrayIndex] = symbols.getSymbolsNoByCharType(npmMax.Substring(2)); myOut[arrayIndex] = symbols.DataSymbolNMagic(npmMax.Substring(2)); } @@ -565,56 +663,78 @@ override public double[] CreateMatrix() { } #endregion npm and not useSum - } else { // npm && useSum + } + else + { // npm && useSum #region npm and useSum - foreach (DataRow sqlRow in myRows) { + foreach (DataRow sqlRow in myRows) + { contCount = 0; mIndex = int.Parse(sqlRow[MINDEX_COL].ToString()); - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { arrayIndex = mIndex + contFactor * contCount; hasBlankCells = int.Parse(sqlRow[contCode + "_NilCnt"].ToString()) - int.Parse(sqlRow[contCode + "_XCOUNT"].ToString()) > 0; //if blankCellCnt > 0 har type 3 missing enten pga tom/blank celle string npmMax = sqlRow[contCode + "_XMAX"].ToString(); - if (String.IsNullOrEmpty(npmMax)) { + if (String.IsNullOrEmpty(npmMax)) + { #region npmMax missing // the region npmMax missing is a copy from !npm && useSum: - if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) { + if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) + { //missing rows are ignored #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value - } else { + } + else + { //must look for missing rows - if (needGroupingFactor) { + if (needGroupingFactor) + { hasNoMissingRows = eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) <= int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { hasNoMissingRows = eliminationFactor <= int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (hasNoMissingRows) { // no missing rows + if (hasNoMissingRows) + { // no missing rows #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value - } else { //has missing row (of cat 3) - if (hasBlankCells) {// and blank cells ( = DataNotAvailable = cat. 3 + } + else + { //has missing row (of cat 3) + if (hasBlankCells) + {// and blank cells ( = DataNotAvailable = cat. 3 //if (ValueOfCellsInMissingRows[contCount] != symbols.getDataNotAvailableDouble()) { - if (ValueOfCellsInMissingRows[contCount] != symbols.DataNotAvailableMagic) { + if (ValueOfCellsInMissingRows[contCount] != symbols.DataNotAvailableMagic) + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; } // else myOut[arrayIndex] =ValueOfCellsInMissingRows[contCount] done in init @@ -623,35 +743,52 @@ override public double[] CreateMatrix() { } #endregion npmMax missing - } else if (npmMax.StartsWith("C3")) { + } + else if (npmMax.StartsWith("C3")) + { #region npmMax is 3 // value will be a cat.3 : either DataSymbolSum or npmMax string npm3Min = sqlRow[contCode + "_3MIN"].ToString(); - if (!npmMax.Equals("C3" + npm3Min)) { + if (!npmMax.Equals("C3" + npm3Min)) + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; //} else if (hasBlankCells && symbols.getDoubleByCharacterType(npm3Min) != symbols.getDataNotAvailableDouble()) { - } else if (hasBlankCells && symbols.DataSymbolNMagic(npm3Min) != symbols.DataNotAvailableMagic) { + } + else if (hasBlankCells && symbols.DataSymbolNMagic(npm3Min) != symbols.DataNotAvailableMagic) + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; - } else { - if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) { //ignore missing rows + } + else + { + if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) + { //ignore missing rows //myOut[arrayIndex] = symbols.getDoubleByCharacterType(npm3Min); myOut[arrayIndex] = symbols.DataSymbolNMagic(npm3Min); - } else { // must check for missing rows + } + else + { // must check for missing rows //must look for missing rows - if (needGroupingFactor) { + if (needGroupingFactor) + { hasNoMissingRows = 1 > eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) - int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { hasNoMissingRows = 1 > eliminationFactor - int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (hasNoMissingRows) { + if (hasNoMissingRows) + { //myOut[arrayIndex] = symbols.getDoubleByCharacterType(npm3Min); myOut[arrayIndex] = symbols.DataSymbolNMagic(npm3Min); - } else { //has missing row - if (ValueOfCellsInMissingRows[contCount] != symbols.DataSymbolNMagic(npm3Min)) { + } + else + { //has missing row + if (ValueOfCellsInMissingRows[contCount] != symbols.DataSymbolNMagic(npm3Min)) + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; } // else : nmpMax equals the initialization-value @@ -662,27 +799,41 @@ override public double[] CreateMatrix() { #endregion npmMax is 3 //below: npmMax is cat. 1 or 2 but blank cells or missing rows migth give cat.3 - } else if (hasBlankCells) {// must add DataNotAvaliable + } + else if (hasBlankCells) + {// must add DataNotAvaliable #region has blankCell - if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) { //ignore missing rows + if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) + { //ignore missing rows //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { // must look for missing rows - if (needGroupingFactor) { + } + else + { // must look for missing rows + if (needGroupingFactor) + { hasNoMissingRows = 1 > eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) - int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { hasNoMissingRows = 1 > eliminationFactor - int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (hasNoMissingRows) { + if (hasNoMissingRows) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { //has missing rows + } + else + { //has missing rows //if (ValueOfCellsInMissingRows[contCount] == symbols.getDataNotAvailableDouble()) { - if (ValueOfCellsInMissingRows[contCount] == symbols.DataNotAvailableMagic) { + if (ValueOfCellsInMissingRows[contCount] == symbols.DataNotAvailableMagic) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; } @@ -691,61 +842,90 @@ override public double[] CreateMatrix() { } #endregion has blankCell //below: npmMax is cat. 1 or 2 , no blank cells, but missing rows migth give cat.3 - } else if (CategoryOfCellsInMissingRows[contCount].Equals("3")) { + } + else if (CategoryOfCellsInMissingRows[contCount].Equals("3")) + { #region cat missingcells is 3 // must look for missing rows - if (needGroupingFactor) { + if (needGroupingFactor) + { missingRowsCnt = eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) - int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { missingRowsCnt = eliminationFactor - int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (missingRowsCnt < 1) { // no missing rows + if (missingRowsCnt < 1) + { // no missing rows string npm1Min = sqlRow[contCode + "_1MIN"].ToString(); - if (String.IsNullOrEmpty(npm1Min)) {//potential cat2 + if (String.IsNullOrEmpty(npm1Min)) + {//potential cat2 - if (sqlRow["SqlMarx777777"].ToString().Equals(sqlRow[contCode + "_XCOUNT"].ToString())) { + if (sqlRow["SqlMarx777777"].ToString().Equals(sqlRow[contCode + "_XCOUNT"].ToString())) + { // cat 2 ! //myOut[arrayIndex] = symbols.getDoubleByCharacterType(npmMax.Substring(2)); myOut[arrayIndex] = symbols.DataSymbolNMagic(npmMax.Substring(2)); - } else { // normal number + } + else + { // normal number myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } - } else { // cat.1 ! + } + else + { // cat.1 ! myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); - if (npmMax.Equals("B1" + npm1Min)) { + if (npmMax.Equals("B1" + npm1Min)) + { addDataNoteCell(npm1Min, sqlRow, contCode); - } else { + } + else + { addDataNoteSum(sqlRow, contCode); } } } //else has missing rows : myOut[arrayIndex] = init value #endregion cat missingcells is 3 //below:npmMax is cat. 1 or 2 , no blank cells, missing rows are kat 0 or 2 ( cat 1 is not valid) - } else if (npmMax.StartsWith("B1")) { // missing row don't matter + } + else if (npmMax.StartsWith("B1")) + { // missing row don't matter #region npmMax is 1 myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); string npm1Min = sqlRow[contCode + "_1MIN"].ToString(); - if (npmMax.Equals("B1" + npm1Min)) { + if (npmMax.Equals("B1" + npm1Min)) + { addDataNoteCell(npm1Min, sqlRow, contCode); - } else { + } + else + { addDataNoteSum(sqlRow, contCode); } #endregion npmMax is 1 - } else { // //npmMax is cat. 2 , no blank cells, missing rows are kat 0 or 2 + } + else + { // //npmMax is cat. 2 , no blank cells, missing rows are kat 0 or 2 #region npmMax is 2 //all present and missing rows must be cat2 for myOut[arrayIndex] to be cat2 - if (!sqlRow["SqlMarx777777"].ToString().Equals(sqlRow[contCode + "_XCOUNT"])) { + if (!sqlRow["SqlMarx777777"].ToString().Equals(sqlRow[contCode + "_XCOUNT"])) + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); //below: all present rows are cat. 2 - } else if (CategoryOfCellsInMissingRows[contCount].Equals("0")) { + } + else if (CategoryOfCellsInMissingRows[contCount].Equals("0")) + { // must look for missing rows - if (needGroupingFactor) { + if (needGroupingFactor) + { hasNoMissingRows = 1 > eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) - int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { hasNoMissingRows = 1 > eliminationFactor - int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (hasNoMissingRows) { // no missing rows + if (hasNoMissingRows) + { // no missing rows //myOut[arrayIndex] = symbols.getDoubleByCharacterType(npmMax.Substring(2)); myOut[arrayIndex] = symbols.DataSymbolNMagic(npmMax.Substring(2)); } //else myOut[arrayIndex] = 0 but that has been done in init @@ -764,7 +944,8 @@ override public double[] CreateMatrix() { #endregion npm and useSum } - foreach (string key in keysInReverseOutputOrder) { + foreach (string key in keysInReverseOutputOrder) + { log.Debug("key: " + key + " lIndexFactor: " + mIndexFactor[key] + " antVerdier:" + mValueCount[key]); } @@ -784,25 +965,31 @@ override public double[] CreateMatrix() { /// true if sum should be used /// true if npm should be used /// select string for one contents column - private string getContSelectPart(string contCode, bool Sum, bool npm) { + private string getContSelectPart(string contCode, bool Sum, bool npm) + { //SUM(Sysselsatte) Sysselsatte, MAX(Sysselsatte_x) Sysselsatte_xMax, string myOut = ""; - if (Sum) { + if (Sum) + { myOut = " SUM(dt." + contCode + ") AS "; // trenger vi en AS ? - } else { + } + else + { myOut += " dt."; } myOut += contCode + ", "; - if (Sum) { + if (Sum) + { myOut += " SUM"; } myOut += "(CASE WHEN dt." + contCode + " IS NULL THEN 1 ELSE 0 END) AS " + contCode + "_NilCnt, "; - if (npm) { + if (npm) + { //string mo= ; //ver 3,14 myOut += " MAX(" + contCode + "_x) " + contCode + "_xMax ,"; string CodeForNo = "'" + mMeta.MetaQuery.DB.Codes.No + "'"; @@ -817,28 +1004,31 @@ private string getContSelectPart(string contCode, bool Sum, bool npm) { myOut += "\n "; - if (Sum) { + if (Sum) + { myOut += "MAX("; } string[] tmpConcatArray = new string[2]; tmpConcatArray[0] = caseString; - tmpConcatArray[1] = "st." + SpecialCharacter.CharacterType; - + tmpConcatArray[1] = "st." + SpecialCharacter.CharacterType; + myOut += "(SELECT " + mMeta.MetaQuery.GetPxSqlCommand().getConcatString(tmpConcatArray) + " x_x\n"; - -// myOut += "(SELECT CONCAT(" + caseString + ", st." + -// SpecialCharacter.CharacterType + ") x_x\n"; + + // myOut += "(SELECT CONCAT(" + caseString + ", st." + + // SpecialCharacter.CharacterType + ") x_x\n"; myOut += " FROM " + mMeta.MetaQuery.DB.MetaOwner + SpecialCharacter.TableName + " st \n"; myOut += " WHERE st." + SpecialCharacter.CharacterType + " = dt." + contCode + "_X ) \n"; - if (Sum) { + if (Sum) + { myOut += ") "; } myOut += " AS " + contCode + "_xMax, "; myOut += "\n "; - if (Sum) { + if (Sum) + { // min(select st.TeckenTyp from StatMeta.SpecialTecken st // where st.TeckenTyp = dt.Sysselsatte_x and st.Summerbar = 'N') Sysselsatte_xMin_3 myOut += " MIN(("; @@ -872,16 +1062,22 @@ private string getContSelectPart(string contCode, bool Sum, bool npm) { /// creates the FROM part of the sql /// /// - private string getFROMClause() { + private string getFROMClause() + { string myOut = "FROM "; StringCollection tmpTabs = mMeta.GetDataTableNames(); - if (tmpTabs.Count == 1) { + if (tmpTabs.Count == 1) + { myOut += tmpTabs[0]; - } else { + } + else + { myOut += "("; - for (int tabCnt = 0; tabCnt < tmpTabs.Count; tabCnt++) { - if (tabCnt != 0) { + for (int tabCnt = 0; tabCnt < tmpTabs.Count; tabCnt++) + { + if (tabCnt != 0) + { myOut += " union all "; } myOut += " select * from " + tmpTabs[tabCnt] + "\n"; @@ -898,12 +1094,17 @@ private string getFROMClause() { /// /// /// - private void addDataNoteCell(string NPMChacterType, DataRow sqlRow, string contCode) { + private void addDataNoteCell(string NPMChacterType, DataRow sqlRow, string contCode) + { string cellId = ""; - foreach (string colName in DataNoteCellId_Columns) { - if (String.IsNullOrEmpty(colName)) { + foreach (string colName in DataNoteCellId_Columns) + { + if (String.IsNullOrEmpty(colName)) + { cellId = contCode + "," + cellId; - } else { + } + else + { cellId = sqlRow[colName].ToString() + "," + cellId; } } @@ -915,7 +1116,8 @@ private void addDataNoteCell(string NPMChacterType, DataRow sqlRow, string contC log.Warn(new PCAxis.Sql.Exceptions.WarnNo2Text(1, "addDataNoteCell").getText()); } - private void addDataNoteSum(DataRow sqlRow, string contCode) { + private void addDataNoteSum(DataRow sqlRow, string contCode) + { //addDataNoteCell(symbols.getDataNoteSumCharacterType(), sqlRow, contCode); addDataNoteCell(symbols.DataNoteSumCharacterType(), sqlRow, contCode); } @@ -923,8 +1125,10 @@ private void addDataNoteSum(DataRow sqlRow, string contCode) { #region IDisposable implemenatation - override public void Dispose() { - if (mMeta != null) { + override public void Dispose() + { + if (mMeta != null) + { mMeta.Dispose(); } } diff --git a/PCAxis.Sql/Parser_21/PXSqlDecimalStuff.cs b/PCAxis.Sql/Parser_21/PXSqlDecimalStuff.cs index 3fda6ba..e8450ec 100644 --- a/PCAxis.Sql/Parser_21/PXSqlDecimalStuff.cs +++ b/PCAxis.Sql/Parser_21/PXSqlDecimalStuff.cs @@ -1,11 +1,9 @@ using System; -using System.Collections.Generic; -using System.Text; + using log4net; -using PCAxis.Paxiom; -using System.Collections.Specialized; -namespace PCAxis.Sql.Parser_21{ +namespace PCAxis.Sql.Parser_21 +{ /// DECIMALS, SHOWDECIMALS and PRECISION all handle decimals in some way. /// ParseMeta for PRECISION is in PXsqlContents /// @@ -23,55 +21,74 @@ namespace PCAxis.Sql.Parser_21{ ///n is a figure between 1 and 6. The number of decimals for precision must be higher than the number of decimals ///for SHOWDECIMALS to have any effect. /// - internal class PXSqlDecimalStuff { + internal class PXSqlDecimalStuff + { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlDecimalStuff)); internal PXSqlDecimalStuff() { } private int mShowDecimals = 6; private int mStoreDecimals = 0; - - public string ShowDecimals { + + public string ShowDecimals + { get { return mShowDecimals.ToString(); } - set { + set + { int tmpValue = -1; - try { + try + { tmpValue = int.Parse(value); - } catch (Exception e) { + } + catch (Exception e) + { log.Error(e); return; } - if (tmpValue > 6) { + if (tmpValue > 6) + { throw new ApplicationException("Decimal number cannot be higher than 6. Found " + value); - } else if (tmpValue < 0) { + } + else if (tmpValue < 0) + { throw new ApplicationException("Decimal number cannot be lower than 0. Found " + value); } - if (tmpValue < mShowDecimals) { + if (tmpValue < mShowDecimals) + { mShowDecimals = tmpValue; } } } - public string StoreDecimals { + public string StoreDecimals + { get { return mStoreDecimals.ToString(); } - set { + set + { int tmpValue = -1; - try { + try + { tmpValue = int.Parse(value); - } catch (Exception e) { + } + catch (Exception e) + { log.Error(e); return; } - if (tmpValue > 15) { + if (tmpValue > 15) + { throw new ApplicationException("Decimal number cannot be higher than 15. Found " + value); - } else if (tmpValue < 0) { + } + else if (tmpValue < 0) + { throw new ApplicationException("Decimal number cannot be lower than 0. Found " + value); } - if (tmpValue > mStoreDecimals) { + if (tmpValue > mStoreDecimals) + { mStoreDecimals = tmpValue; } } @@ -84,7 +101,7 @@ public string StoreDecimals { // string noLanguage = null; // string subkey = null; - + // values.Add(mStoreDecimals.ToString()); // handler(PXKeywords.DECIMALS, noLanguage, subkey, values); @@ -94,6 +111,6 @@ public string StoreDecimals { //} - + } } diff --git a/PCAxis.Sql/Parser_21/PXSqlGroup.cs b/PCAxis.Sql/Parser_21/PXSqlGroup.cs index cd08c7e..7028ccc 100644 --- a/PCAxis.Sql/Parser_21/PXSqlGroup.cs +++ b/PCAxis.Sql/Parser_21/PXSqlGroup.cs @@ -1,8 +1,6 @@ namespace PCAxis.Sql.Parser_21 { -using System; -using System.Collections.Generic; -using System.Text; + using System.Collections.Generic; /// Stores A = B + C + D + public class PXSqlGroup @@ -15,7 +13,7 @@ public class PXSqlGroup /// Initializes a new instance of the PXSqlGroup class, with the given parentCode /// The code of the parent item - public PXSqlGroup(string parentCode) + public PXSqlGroup(string parentCode) { this.parentCode = parentCode; } @@ -34,7 +32,7 @@ public IList ChildCodes /// Adds a code to the list of codes of the children /// The code of child item - public void AddChildCode(string childCode) + public void AddChildCode(string childCode) { this.childCodes.Add(childCode); } diff --git a/PCAxis.Sql/Parser_21/PXSqlGrouping.cs b/PCAxis.Sql/Parser_21/PXSqlGrouping.cs index 06984d7..9c76ea7 100644 --- a/PCAxis.Sql/Parser_21/PXSqlGrouping.cs +++ b/PCAxis.Sql/Parser_21/PXSqlGrouping.cs @@ -2,12 +2,13 @@ { using System; using System.Collections.Generic; - using System.Text; using System.Collections.Specialized; - using PCAxis.Sql.QueryLib_21; - using PCAxis.Paxiom; + using log4net; + using PCAxis.Paxiom; + using PCAxis.Sql.QueryLib_21; + public class PXSqlGrouping { @@ -21,7 +22,7 @@ public GroupingIncludesType IncludeType get { return mIncludeType; } //set { mIncludeType = value; } } - + private string mValuePoolId; public string ValuePoolId { @@ -36,8 +37,8 @@ public string GroupingId set { mGroupingId = value; } } - private Dictionary mPresText; - public Dictionary PresText + private Dictionary mPresText; + public Dictionary PresText { get { return mPresText; } set { mPresText = value; } @@ -84,24 +85,24 @@ public List Groups private PXSqlVariableClassification variable; private string valuePoolValueTextExists; - + private GroupingIncludesType mDefaultIncludeType; //for Selection without grouping id in from pxs - public PXSqlGrouping(GroupingRow groupingRow, PXSqlMeta_21 meta,PXSqlVariableClassification var,GroupingIncludesType include) + public PXSqlGrouping(GroupingRow groupingRow, PXSqlMeta_21 meta, PXSqlVariableClassification var, GroupingIncludesType include) { Init(groupingRow, meta, var); //TODO overriding include from paxiom, have to discuss how paxion can override database default. this.mIncludeType = include; - // DONE, is now passed to paxiom as part of GroupingInfo ... this.mIncludeType = this.mDefaultIncludeType; + // DONE, is now passed to paxiom as part of GroupingInfo ... this.mIncludeType = this.mDefaultIncludeType; //TODO end StringCollection tempParentList = new StringCollection(); mGroups = new List(); PXSqlGroup tmpGroup = null; - foreach (VSGroupRow myRow in meta.MetaQuery.GetVSGroupRowsSorted(mValuePoolId, mValuesetIds, mGroupingId,meta.MainLanguageCode)) + foreach (VSGroupRow myRow in meta.MetaQuery.GetVSGroupRowsSorted(mValuePoolId, mValuesetIds, mGroupingId, meta.MainLanguageCode)) { if (!tempParentList.Contains(myRow.GroupCode)) @@ -149,14 +150,14 @@ public PXSqlGrouping(PXSqlMeta_21 meta, PXSqlVariableClassification var, List tempList = meta.MetaQuery.GetVSGroupRow(mValuePoolId, mValuesetIds, mGroupingId,group.ParentCode); + List tempList = meta.MetaQuery.GetVSGroupRow(mValuePoolId, mValuesetIds, mGroupingId, group.ParentCode); if (tempList.Count > 0) { - foreach(VSGroupRow row in tempList) - { - group.AddChildCode(row.ValueCode); + foreach (VSGroupRow row in tempList) + { + group.AddChildCode(row.ValueCode); } } else @@ -184,7 +185,7 @@ public PXSqlGrouping(GroupingRow groupingRow, PXSqlMeta_21 meta,PXSqlVariableCla } } // Add the values to valuecollection of this variable - AddValues(mValuePoolId,outputCodes, valuePoolValueTextExists); + AddValues(mValuePoolId, outputCodes, valuePoolValueTextExists); } @@ -199,10 +200,11 @@ internal List GetGroupsForParsing() public List GetValuesForParsing() { - if (this.meta.inSelectionModus && ! this.meta.ConstructedFromPxs) + if (this.meta.inSelectionModus && !this.meta.ConstructedFromPxs) { return GetValuesForParsingWhenSelection(); - } else + } + else { return GetValuesForParsingWhenPresentation(); } @@ -227,22 +229,24 @@ private List GetValuesForParsingWhenSelection() { foreach (PXSqlGroup group in this.mGroups) { - + tempValuesList.Add(var.Values[group.ParentCode]); //todo; sortert etter gruppe sorteringskode } - } else if (this.mIncludeType == GroupingIncludesType.SingleValues) + } + else if (this.mIncludeType == GroupingIncludesType.SingleValues) { foreach (PXSqlGroup group in this.mGroups) { foreach (string childCode in group.ChildCodes) tempValuesList.Add(var.Values[childCode]); //todo; sortert etter gruppe sorteringskode } - } else if (this.IncludeType == GroupingIncludesType.All) + } + else if (this.IncludeType == GroupingIncludesType.All) { - + foreach (PXSqlGroup group in this.mGroups) { - + tempValuesList.Add(var.Values[group.ParentCode]); //todo; sortert etter gruppe sorteringskode foreach (string childCode in group.ChildCodes) { @@ -253,8 +257,9 @@ private List GetValuesForParsingWhenSelection() } //tempValuesList.Sort(PXSqlValue.SortByVsValue()); - // if ( this.meta.MetaQuery.metaVersionLE("2.0")) { - if ( this.meta.MetaQuery.metaVersionLE("2.1")) { + // if ( this.meta.MetaQuery.metaVersionLE("2.0")) { + if (this.meta.MetaQuery.metaVersionLE("2.1")) + { tempValuesList.Sort(PXSqlValue.SortByValue()); } @@ -275,7 +280,7 @@ private void Init(GroupingRow groupingRow, PXSqlMeta_21 meta, PXSqlVariableClass this.mGroupPres = groupingRow.GroupPres; this.mGeoAreaNo = groupingRow.GeoAreaNo; this.PresText = new Dictionary(); - this.Description = groupingRow.Description; + this.Description = groupingRow.Description; foreach (string langCode in meta.LanguageCodes) { this.PresText[langCode] = groupingRow.texts[langCode].PresText; @@ -294,8 +299,8 @@ private void Init(GroupingRow groupingRow, PXSqlMeta_21 meta, PXSqlVariableClass mDefaultIncludeType = GroupingIncludesType.All; break; default: - mDefaultIncludeType = GroupingIncludesType.AggregatedValues; - break; + mDefaultIncludeType = GroupingIncludesType.AggregatedValues; + break; } } @@ -312,12 +317,12 @@ private void AddValues(string valuePoolId, StringCollection valueList, string va PXSqlValue tempValue; foreach (ValueRow row in this.meta.MetaQuery.GetValueRowsByValuePool(valuePoolId, valueList, valuePoolValueTextExists)) { - - tempValue = new PXSqlValue(row,meta.LanguageCodes, meta.MainLanguageCode); + + tempValue = new PXSqlValue(row, meta.LanguageCodes, meta.MainLanguageCode); if (this.variable.Values.ContainsKey(tempValue.ValueCode)) { log.Debug("Already contains code =" + tempValue.ValueCode); - } + } else { this.variable.Values.Add(tempValue.ValueCode, tempValue); @@ -334,19 +339,19 @@ internal Grouping GetPaxiomGrouping() Grouping paxGrouping = new Grouping(); paxGrouping.Name = this.GroupingId; paxGrouping.ID = this.GroupingId; - // if(this.mIncludeType.Equals(GroupingIncludesType.All)) // removed for test advanced grouping px-web + // if(this.mIncludeType.Equals(GroupingIncludesType.All)) // removed for test advanced grouping px-web { foreach (PXSqlGroup group in this.mGroups) { Group paxGroup = new Group(); paxGroup.GroupCode = group.ParentCode;//the Name is in the value list(leaves paxGroup.Name empty) - //paxGroup.Name = this.variable.Values[group.ParentCode].ValueTextL[meta.MainLanguageCode]; //todo piv test + //paxGroup.Name = this.variable.Values[group.ParentCode].ValueTextL[meta.MainLanguageCode]; //todo piv test List groupChildValueList = new List(); foreach (String childCode in group.ChildCodes) { GroupChildValue paxGCV = new GroupChildValue(); paxGCV.Code = childCode; - // paxGCV.Name = this.variable.Values[childCode].ValueTextL[meta.MainLanguageCode]; // todo test piv + // paxGCV.Name = this.variable.Values[childCode].ValueTextL[meta.MainLanguageCode]; // todo test piv groupChildValueList.Add(paxGCV); } paxGroup.ChildCodes = groupChildValueList; diff --git a/PCAxis.Sql/Parser_21/PXSqlGroupingInfo.cs b/PCAxis.Sql/Parser_21/PXSqlGroupingInfo.cs index 514e033..a809637 100644 --- a/PCAxis.Sql/Parser_21/PXSqlGroupingInfo.cs +++ b/PCAxis.Sql/Parser_21/PXSqlGroupingInfo.cs @@ -1,17 +1,17 @@ namespace PCAxis.Sql.Parser_21 { - using log4net; using System; using System.Collections.Generic; - using System.Text; + + using log4net; public class PXSqlGroupingInfo { /// The logger to log to. (Stylecop wants documentation) private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlGroupingInfos)); - + // not used sorting is done in sql public class SortGroupingInfoHelper : IComparer { @@ -27,8 +27,8 @@ int IComparer.Compare(PXSqlGroupingInfo a, PXSqlGroupingInfo return String.Compare(valA.sortCodeByLanguage[lang], valB.sortCodeByLanguage[lang]); } } - - + + /// Database unique ID private string groupingId; @@ -39,9 +39,9 @@ int IComparer.Compare(PXSqlGroupingInfo a, PXSqlGroupingInfo /// B = BÃ¥de aggregerat värde och ingÃ¥ende värden skall visas ///
private string groupPres; - + /// The texts which may be displayed to users when selecting a grouping from a list of groupings - private Dictionary presTextByLanguage = new Dictionary(); + private Dictionary presTextByLanguage = new Dictionary(); /// Sort order in which the groupings are shown. If SortCode in grouping are set this will be used otherwise PresText private Dictionary sortCodeByLanguage = new Dictionary(); @@ -57,42 +57,45 @@ internal PXSqlGroupingInfo(PCAxis.Sql.QueryLib_21.GroupingRow groupingRow, DbCon *B = BÃ¥de aggregerat värde och ingÃ¥ende värden skall visas */ - if( groupingRow.GroupPres.Equals(ccodes.GroupPresA)) + if (groupingRow.GroupPres.Equals(ccodes.GroupPresA)) { this.groupPres = "AggregatedValues"; } - else if( groupingRow.GroupPres.Equals(ccodes.GroupPresI)) + else if (groupingRow.GroupPres.Equals(ccodes.GroupPresI)) { this.groupPres = "SingleValues"; } - else if( groupingRow.GroupPres.Equals(ccodes.GroupPresB)){ + else if (groupingRow.GroupPres.Equals(ccodes.GroupPresB)) + { this.groupPres = "All"; - } else { - log.Warn("Unknown GroupPres: \""+groupingRow.GroupPres+"\", so \"All\" all is used"); + } + else + { + log.Warn("Unknown GroupPres: \"" + groupingRow.GroupPres + "\", so \"All\" all is used"); log.WarnFormat("These are the GroupPres options: mother {0}, child {1} or all {2}", ccodes.GroupPresA, ccodes.GroupPresI, ccodes.GroupPresB); this.groupPres = "AggregatedValues"; } - - - + + + foreach (KeyValuePair text in groupingRow.texts) { this.presTextByLanguage[text.Key] = text.Value.PresText; - // if (text.Value.SortCode != "") - // { - // this.sortCodeByLanguage[text.Key] = text.Value.SortCode; - // } - // else - // { - // this.sortCodeByLanguage[text.Key] = text.Value.PresText; - // } + // if (text.Value.SortCode != "") + // { + // this.sortCodeByLanguage[text.Key] = text.Value.SortCode; + // } + // else + // { + // this.sortCodeByLanguage[text.Key] = text.Value.PresText; + // } } } - + /// Returns the (database) unique ID of the Grouping diff --git a/PCAxis.Sql/Parser_21/PXSqlGroupingInfos.cs b/PCAxis.Sql/Parser_21/PXSqlGroupingInfos.cs index bb48646..24d1835 100644 --- a/PCAxis.Sql/Parser_21/PXSqlGroupingInfos.cs +++ b/PCAxis.Sql/Parser_21/PXSqlGroupingInfos.cs @@ -2,9 +2,11 @@ { using System.Collections.Generic; using System.Collections.Specialized; - using PCAxis.Paxiom; + using log4net; + using PCAxis.Paxiom; + /// /// Holds the information on which groupings may be used with this variable. This applies to selected variables when build4selection. /// @@ -33,27 +35,27 @@ public List Infos /// The valueSets that apply to this builder internal PXSqlGroupingInfos(PXSqlMeta_21 meta, string variableName, StringCollection valueSetIds) { - foreach ( PCAxis.Sql.QueryLib_21.GroupingRow gRow in meta.MetaQuery.GetRelevantGroupingRows(valueSetIds)) + foreach (PCAxis.Sql.QueryLib_21.GroupingRow gRow in meta.MetaQuery.GetRelevantGroupingRows(valueSetIds)) { - infos.Add(new PXSqlGroupingInfo(gRow,meta.Config.Codes)); + infos.Add(new PXSqlGroupingInfo(gRow, meta.Config.Codes)); } this.variableName = variableName; } - - // internal List GetGroupsSorted(List groupingInfoList,string langCode) - // { - // List sortedGrouposList = new List(); - // foreach (PXSqlGroupingInfo group in groups) - // { - // sortedGrouposList.Add(group); - // } - //return groupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); - //sortedGrouposList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); - //return sortedGrouposList; - // } + // internal List GetGroupsSorted(List groupingInfoList,string langCode) + // { + // List sortedGrouposList = new List(); + // foreach (PXSqlGroupingInfo group in groups) + // { + // sortedGrouposList.Add(group); + // } + //return groupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); + //sortedGrouposList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); + //return sortedGrouposList; + + // } /// Sends the list of Grouping Info to paxiom @@ -85,14 +87,14 @@ internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) //List sortedGroupingInfoList; foreach (string langCode in this.infos[0].PresTextByLanguage.Keys) { - // sortedGroupingInfoList = new List(); - // foreach (PXSqlGroupingInfo info in this.infos) - // { - // sortedGroupingInfoList.Add(info); - // } - // sortedGroupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); - - + // sortedGroupingInfoList = new List(); + // foreach (PXSqlGroupingInfo info in this.infos) + // { + // sortedGroupingInfoList.Add(info); + // } + // sortedGroupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); + + values.Clear(); //foreach (PXSqlGroupingInfo info in sortedGroupingInfoList) foreach (PXSqlGroupingInfo info in this.infos) diff --git a/PCAxis.Sql/Parser_21/PXSqlMaintable.cs b/PCAxis.Sql/Parser_21/PXSqlMaintable.cs index 94ce934..d695aa4 100644 --- a/PCAxis.Sql/Parser_21/PXSqlMaintable.cs +++ b/PCAxis.Sql/Parser_21/PXSqlMaintable.cs @@ -1,11 +1,11 @@ -using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_21; -using PCAxis.Paxiom; using System.Collections.Specialized; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_21; + namespace PCAxis.Sql.Parser_21 { public class PXSqlMaintable @@ -58,17 +58,18 @@ public string SpecCharExists } public bool ContainsOnlyMetaData { - get { + get + { if (TableStatus.Equals(meta.Config.Codes.StatusMeta) || TableStatus.Equals(meta.Config.Codes.StatusEmpty)) { - return true; + return true; } else { return false; } } - } + } //mMainTable[0][mConfig.MainTable.ContentsVariable].ToString().Length != 0 internal bool hasContentsVariable(string someLangCode) @@ -97,7 +98,7 @@ public string getContentsVariable(string langCode) internal string TimeScale { get { return mtRow.TimeScale; } } internal string TableStatus { get { return mtRow.TableStatus; } } - + //MenuSelection.PresText @@ -234,11 +235,11 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCo // TABLEID if (!string.IsNullOrEmpty(this.TableId.Trim(' '))) - { - values.Clear(); - values.Add(this.TableId); - handler(PXKeywords.TABLEID, noLanguage, subkey, values); - + { + values.Clear(); + values.Add(this.TableId); + handler(PXKeywords.TABLEID, noLanguage, subkey, values); + } // SUBJECT-CODE @@ -257,7 +258,7 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCo } // DATABASE - foreach (string langCode in LanguageCodes) + foreach (string langCode in LanguageCodes) { values.Clear(); // values.Add(this.mDataStorageRow.DatabaseName); diff --git a/PCAxis.Sql/Parser_21/PXSqlMeta_21.cs b/PCAxis.Sql/Parser_21/PXSqlMeta_21.cs index 5481410..41d5c7f 100644 --- a/PCAxis.Sql/Parser_21/PXSqlMeta_21.cs +++ b/PCAxis.Sql/Parser_21/PXSqlMeta_21.cs @@ -1,16 +1,17 @@ using System; using System.Collections; -using System.Collections.Specialized; using System.Collections.Generic; -using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Data; + +using log4net; + using PCAxis.Paxiom; using PCAxis.PlugIn; -using System.Data; -using PCAxis.Sql.QueryLib_21; +using PCAxis.PlugIn.Sql; using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; using PCAxis.Sql.Pxs; -using log4net; -using PCAxis.PlugIn.Sql; +using PCAxis.Sql.QueryLib_21; namespace PCAxis.Sql.Parser_21 { @@ -25,9 +26,9 @@ namespace PCAxis.Sql.Parser_21 // fixedStartMovingLast = 3 //} - - public class PXSqlMeta_21 :PCAxis.Sql.Parser.PXSqlMeta + + public class PXSqlMeta_21 : PCAxis.Sql.Parser.PXSqlMeta { #region constants private const string mPresTextOptionCode = "CODE"; @@ -58,7 +59,7 @@ public PxsQuery PxsFile private string mMetaModelVersion; public string MetaModelVersion { get { return mMetaModelVersion; } } //private string instanceModus = "P"; // presentation; - + public string ContensCode { @@ -74,10 +75,10 @@ public string ContensCode } } } - - - - + + + + private PXMetaAdmValues mPXMetaAdmValues; @@ -88,7 +89,7 @@ public PXMetaAdmValues PXMetaAdmValues - + private readonly string mMainTableId; @@ -99,7 +100,7 @@ public PXSqlMaintable MainTable //set { mMainTable = value; } } - + private PXSqlSubTables mSubTables; public PXSqlSubTables SubTables { @@ -170,8 +171,8 @@ public PXSqlVariable ContentsVariable { get { return mContentsVariable; } } - - + + private PXSqlDecimalStuff mDecimalHandler = new PXSqlDecimalStuff(); internal PXSqlDecimalStuff DecimalHandler @@ -182,7 +183,7 @@ internal PXSqlDecimalStuff DecimalHandler private PXSqlValue mValue; - + private Dictionary mContentsVariablePresText = new Dictionary(); public Dictionary ContentsVariablePresText { @@ -256,7 +257,7 @@ public SqlDbConfig_21 Config { get { return mConfig; } } - + //jfi:Hei piv, jeg la denne her. Er det ok? public bool SpecCharExists { @@ -292,7 +293,7 @@ public bool HasGrouping #endregion #region Constructor - + /// /// @@ -308,7 +309,7 @@ public PXSqlMeta_21(string mainTableId, string preferredLang, bool getAllLangs, { log.Info("PXSqlMeta(string mainTableId(=" + mainTableId + "), StringCollection desiredLanguages, SqlDbConfig config, Instancemodus aModus(=" + aModus.ToString() + "))"); this.mMainTableId = mainTableId; - this.mConfig = (SqlDbConfig_21) config; + this.mConfig = (SqlDbConfig_21)config; mMetaQuery = new MetaQuery(this.mConfig, this.SelectedDbInfo); SetLanguageCodesNoPxs(preferredLang, getAllLangs); BuildMeta(); @@ -321,14 +322,14 @@ public PXSqlMeta_21(PxsQuery mPxsObject, string preferredLang, SqlDbConfig confi { log.Debug("PXSqlMeta(PxsQuery mPxsObject, SqlDbConfig config, Instancemodus aModus"); - + //disse er trukket hit for å kunne kjøre med String hovedtabellId. this.mMainTableId = mPxsObject.Query.TableSource; //TODO; denne burde kunne fjernes this.mPxsSubTableId = mPxsObject.Query.SubTable; - this.mConfig = (SqlDbConfig_21) config; + this.mConfig = (SqlDbConfig_21)config; mMetaQuery = new MetaQuery(this.mConfig, this.SelectedDbInfo); @@ -378,9 +379,9 @@ private PxsQuery rearrangePxsQuery(PxsQuery mPxsObject) } } } - + } - + return mPxsObject; } @@ -390,8 +391,8 @@ private PxsQuery rearrangePxsQuery(PxsQuery mPxsObject) private void BuildMeta() { - SetInstanceModus(); - + SetInstanceModus(); + mMetaQuery.LanguageCodes = LanguageCodes; // instanced above, now just set language SetMetaModelVersion(); // sjekker ikke mot pxs if (inPresentationModus) @@ -402,26 +403,26 @@ private void BuildMeta() mPXMetaAdmValues = new PXMetaAdmValues(mMetaQuery.GetMetaAdmAllRows(), mMetaQuery.DB); - SetMainTable(); + SetMainTable(); //mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId), mPxsSubTableId); mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId), mPxsFile, this); - + SetVariables();//ok for pxs == null, men denne kan også hente ut valueSet SetContents(); //må skrives om, men kall til metaQ OK. Bør kanskje legge inn contents som SetHeadingAndStub(); - - + + // hmm petros bruke TIMEVAL nøkkelord for å bestemme om en variabel er tid, men timeval // er ikke obligatorisk og har ingen mening i "valg modus". Johannes trenger å vite om en //variabel er tid for å danne korrekt pxs. // if (instancemodus == Instancemodus.presentation) // { - // SetTimeVal(); Not used. Defined in PXSqlVariableTime + // SetTimeVal(); Not used. Defined in PXSqlVariableTime SetPaxiomMap();//ok for pxs == null, men jeg forstår ikke helt hva den gjør. mEliminatedVariablesExist = CheckEliminatedVariables();//ok for pxs == null SetFootNotes(); // //ok for pxs == null trur eg @@ -454,7 +455,7 @@ private void SetMetaModelVersion() //mMetaModelVersion = 0; mMetaModelVersion = mMetaQuery.MetaModelVersion; - //mMetaModelVersion = "2.0"; //TESTTESTTEST + //mMetaModelVersion = "2.0"; //TESTTESTTEST /* decimal.Parse(mPxsFile.Information.PxsVersion, new System.Globalization.CultureInfo("en-GB").NumberFormat); if (mMetaModelVersion > mMetaQuery.MetaModelVersion) { @@ -653,7 +654,7 @@ private List GetSortedContentsList(string mMainTableId, bool contr PXSqlContent mContent = null; if (this.ConstructedFromPxs) { - int documentOrder = 0; + int documentOrder = 0; foreach (BasicValueType contents in contentsInPxs) { if (altIBasen.ContainsKey(contents.code)) @@ -661,7 +662,7 @@ private List GetSortedContentsList(string mMainTableId, bool contr mContent = new PXSqlContent(altIBasen[contents.code], this, mConfig, contact); mContent.SortOrder = documentOrder; myOut.Add(mContent); - documentOrder++; + documentOrder++; } } @@ -712,7 +713,7 @@ private void SetContents() int counter = 0; foreach (PXSqlContent content in mContents.Values) { - mValue = new PXSqlValue(content,counter); + mValue = new PXSqlValue(content, counter); mValues.Add(mValue.ValueCode, mValue); counter++; } @@ -754,10 +755,10 @@ private void SetVariables() } } mSqlVariable.VariableType = aTVRow.VariableType; - + } - + } private void CheckPxs() @@ -782,8 +783,8 @@ private void CheckPxs() } } - - + + private void SetHeadingAndStub() { @@ -799,10 +800,10 @@ private void SetHeadingAndStub() this.mHeadings = mVariables.GetHeadingSorted(); } - - + + //TODO; flytt denne, tror kanskje heller ikke alt er sagt om GeoArea, det kan settes en dullion steder private void SetPaxiomMap() @@ -810,7 +811,7 @@ private void SetPaxiomMap() foreach (KeyValuePair var in mVariables) { //if (!var.Value.IsContentVariable && !var.Value.IsTimevariable) { - if (var.Value.VariableType == mConfig.Codes.VariableTypeG && var.Value.isSelected && var.Value.ValueSets != null) + if (var.Value.VariableType == mConfig.Codes.VariableTypeG && var.Value.isSelected && var.Value.ValueSets != null) { List GeoAreaValues = new List(); string GeoAreaValue; @@ -843,7 +844,7 @@ private void SetPaxiomMap() } - + private void SetMainTableNotes(RelevantFootNotesRow footNoteRow) @@ -860,7 +861,7 @@ private void SetSubTableNotes(RelevantFootNotesRow footNoteRow) { if (mSubTables[footNoteRow.SubTable].IsSelected) { - mPaxiomNotes.addTableNote( new PXSqlNote(footNoteRow, this) ); + mPaxiomNotes.addTableNote(new PXSqlNote(footNoteRow, this)); } } @@ -1031,8 +1032,8 @@ private void SetFootNotes() /* the CNMM has many footnote types, Paxiom has fewer. * "Upgrade" from "VALUE" or from "Variable" to "Table" where possible*/ - - + + mMenuSelNotes = new PXSqlMenuSelNotes(); mMaintValueNotes = new PXSqlMainTablesValueNotes(); mValueNotes = new PXSqlValueNotes(); @@ -1111,11 +1112,12 @@ private void SetFootNotes() } } - + if (containsAll(outputVariables, varsWhichHasANote)) { mPaxiomNotes.addTableNote(varNotesByNoteNo[noteno][0]); - } else + } + else { mPaxiomNotes.addVariableNotes(varNotesByNoteNo[noteno]); } @@ -1129,9 +1131,10 @@ private void SetFootNotes() Dictionary> conentsNotesByNoteNo = GetNotesByNoteNo(mContentsNotes); - StringCollection outputContentsValues = new StringCollection(); + StringCollection outputContentsValues = new StringCollection(); - foreach (String contentsValue in this.Contents.Keys) { + foreach (String contentsValue in this.Contents.Keys) + { outputContentsValues.Add(contentsValue); } @@ -1147,12 +1150,13 @@ private void SetFootNotes() } - + if (containsAll(outputContentsValues, usedValues)) { mPaxiomNotes.addTableNote(conentsNotesByNoteNo[noteno][0]); - } else + } + else { mPaxiomNotes.addContentsNotes(conentsNotesByNoteNo[noteno]); } @@ -1173,7 +1177,8 @@ private Dictionary> GetNotesByNoteNo(List lon if (NotesByNoteNo.ContainsKey(note.FootNoteNo)) { tmp = NotesByNoteNo[note.FootNoteNo]; - } else + } + else { tmp = new List(); } @@ -1183,7 +1188,7 @@ private Dictionary> GetNotesByNoteNo(List lon return NotesByNoteNo; } - + #endregion #region tja @@ -1211,7 +1216,7 @@ public StringCollection GetDataTableNames() #region helproutines - + //private string CheckMultValuesetElim(List ElimValues) //{ // int numberOfElimA = 0; @@ -1312,7 +1317,7 @@ override public InfoFromPxSqlMeta2PxsQuery GetInfoFromPxSqlMeta2PxsQuery() return myOut; } - + /// Finds the variable and passes to call on to it /// The paxiom Varable, but both this and the name?? @@ -1324,7 +1329,8 @@ override internal void ApplyGrouping(Variable paxiomVariable, string variableCod if (mVariablesClassification.ContainsKey(variableCode)) { mVariablesClassification[variableCode].ApplyGrouping(paxiomVariable, groupingId, include); - } else + } + else { throw new ApplicationException("BUG"); } @@ -1346,11 +1352,12 @@ override internal void ApplyValueSet(string variableCode, string valueSetId) } - override public bool MainTableContainsOnlyMetaData(){ - return this.MainTable.ContainsOnlyMetaData; + override public bool MainTableContainsOnlyMetaData() + { + return this.MainTable.ContainsOnlyMetaData; } - + #region "IPlugIn implementation" diff --git a/PCAxis.Sql/Parser_21/PXSqlNotes.cs b/PCAxis.Sql/Parser_21/PXSqlNotes.cs index b314b92..e57594f 100644 --- a/PCAxis.Sql/Parser_21/PXSqlNotes.cs +++ b/PCAxis.Sql/Parser_21/PXSqlNotes.cs @@ -1,10 +1,11 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; + using PCAxis.Sql.QueryLib_21; -namespace PCAxis.Sql.Parser_21 { +namespace PCAxis.Sql.Parser_21 +{ /// @@ -27,45 +28,55 @@ namespace PCAxis.Sql.Parser_21 { /// /// /// - public class PXSqlNote { + public class PXSqlNote + { protected const string star = "*"; protected string mShowFootNote; - public string ShowFootNote { + public string ShowFootNote + { get { return this.mShowFootNote; } } protected string mMandOpt; - public string MandOpt { + public string MandOpt + { get { return this.mMandOpt; } } protected string mFootNoteNo; - public string FootNoteNo { + public string FootNoteNo + { get { return this.mFootNoteNo; } } protected string mContents; - public string Contents { + public string Contents + { get { return this.mContents; } } protected string mVariable; - public string Variable { + public string Variable + { get { return this.mVariable; } } protected string mValueCode; - public string ValueCode { + public string ValueCode + { get { return this.mValueCode; } } protected string mTimePeriode; - public string TimePeriode { + public string TimePeriode + { get { return this.mTimePeriode; } } protected Dictionary mNotePresTexts; - public Dictionary NotePresTexts { + public Dictionary NotePresTexts + { get { return this.mNotePresTexts; } } protected String mNotePresText; protected const string FootNoteTableContainsOnlyMetadata = "This table contains only metadata"; - protected const string FootNoteTableContainsOnlyMetadataDummyNumber = "-999"; + protected const string FootNoteTableContainsOnlyMetadataDummyNumber = "-999"; - public PXSqlNote(RelevantFootNotesRow footNoteRow, PXSqlMeta_21 mMeta) { + public PXSqlNote(RelevantFootNotesRow footNoteRow, PXSqlMeta_21 mMeta) + { this.mShowFootNote = footNoteRow.ShowFootNote; this.mMandOpt = footNoteRow.MandOpt; this.mFootNoteNo = footNoteRow.FootNoteNo; @@ -98,19 +109,23 @@ public PXSqlNote(PXSqlMeta_21 mMeta) } } - - public abstract class PXSqlGeneralNotes : List { - public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) { + + public abstract class PXSqlGeneralNotes : List + { + public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) + { string keyWord; string subKeyWord; StringCollection parseValue; - foreach (PXSqlNote note in this) { - if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) { + foreach (PXSqlNote note in this) + { + if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "VALUENOTEX"; else keyWord = "VALUENOTE"; - subKeyWord = note.Variable + "\",\"" + note.ValueCode; + subKeyWord = note.Variable + "\",\"" + note.ValueCode; parseValue = new StringCollection(); parseValue.Add(note.NotePresTexts[langCode]); handler(keyWord, langCode, subKeyWord, parseValue); @@ -121,26 +136,31 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl - public class PXSqlValueNotes : PXSqlGeneralNotes {} + public class PXSqlValueNotes : PXSqlGeneralNotes { } - public class PXSqlMainTablesValueNotes : PXSqlGeneralNotes {} + public class PXSqlMainTablesValueNotes : PXSqlGeneralNotes { } public class PXSqlMenuSelNotes : List { } - public class PXSqlContValueNotes : List { + public class PXSqlContValueNotes : List + { private const string star = "*"; - public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) { + public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) + { string keyWord; string subKeyWord; StringCollection parseValue; - if (mMeta.Contents.Count == 1) { - foreach (PXSqlNote note in this) { - if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) { + if (mMeta.Contents.Count == 1) + { + foreach (PXSqlNote note in this) + { + if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "VALUENOTEX"; else keyWord = "VALUENOTE"; - subKeyWord = note.Variable + "\",\"" + note.ValueCode ; + subKeyWord = note.Variable + "\",\"" + note.ValueCode; parseValue = new StringCollection(); parseValue.Add(note.NotePresTexts[langCode]); handler(keyWord, langCode, subKeyWord, parseValue); @@ -148,20 +168,24 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } - else { + else + { List stubAndHead = new List(); stubAndHead.AddRange(mMeta.Stubs); stubAndHead.AddRange(mMeta.Headings); StringCollection CellNoteDimensions; - foreach (PXSqlNote note in this) { + foreach (PXSqlNote note in this) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "CELLNOTEX"; else keyWord = "CELLNOTE"; CellNoteDimensions = new StringCollection(); - foreach (PXSqlVariable var in stubAndHead) { - if (var.IsContentVariable) { - if (var.Values.GetValueByContentsCode(note.Contents) != null) + foreach (PXSqlVariable var in stubAndHead) + { + if (var.IsContentVariable) + { + if (var.Values.GetValueByContentsCode(note.Contents) != null) { CellNoteDimensions.Add(var.Values.GetValueByContentsCode(note.Contents).ValueCode); } @@ -170,7 +194,8 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl else throw new PCAxis.Sql.Exceptions.DbException(12); } - else if (var.Name == note.Variable) { + else if (var.Name == note.Variable) + { if (var.Values.ContainsKey(note.ValueCode)) CellNoteDimensions.Add(note.ValueCode); else @@ -192,16 +217,21 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } } - - public class PXSqlContTimeNotes : List { + + public class PXSqlContTimeNotes : List + { private const string star = "*"; - public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) { + public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) + { string keyWord; string subKeyWord; StringCollection parseValue; - if (mMeta.Contents.Count == 1) { - foreach (PXSqlNote note in this) { - if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) { + if (mMeta.Contents.Count == 1) + { + foreach (PXSqlNote note in this) + { + if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "VALUENOTEX"; else @@ -214,27 +244,32 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } - else { + else + { List stubAndHead = new List(); stubAndHead.AddRange(mMeta.Stubs); stubAndHead.AddRange(mMeta.Headings); StringCollection CellNoteDimensions; - foreach (PXSqlNote note in this) { + foreach (PXSqlNote note in this) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "CELLNOTEX"; else keyWord = "CELLNOTE"; CellNoteDimensions = new StringCollection(); - foreach (PXSqlVariable var in stubAndHead) { - if (var.IsTimevariable) { + foreach (PXSqlVariable var in stubAndHead) + { + if (var.IsTimevariable) + { if (var.Values.ContainsKey(note.TimePeriode)) CellNoteDimensions.Add(note.TimePeriode); else throw new PCAxis.Sql.Exceptions.DbException(12); } - else if (var.IsContentVariable) { - if (var.Values.GetValueByContentsCode(note.Contents) != null) + else if (var.IsContentVariable) + { + if (var.Values.GetValueByContentsCode(note.Contents) != null) { CellNoteDimensions.Add(var.Values.GetValueByContentsCode(note.Contents).ValueCode); } @@ -259,19 +294,25 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } } - - public class PXSqlContentsNotes : List { - + + public class PXSqlContentsNotes : List + { + } - public class PXSqlContVblNotes : List { - public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) { + public class PXSqlContVblNotes : List + { + public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) + { string keyWord; string subKeyWord = null; StringCollection parseValue; - foreach (PXSqlNote note in this) { - if (mMeta.Contents.Count == 1) { - if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) { + foreach (PXSqlNote note in this) + { + if (mMeta.Contents.Count == 1) + { + if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "NOTEX"; else @@ -284,8 +325,10 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } // if more than one contentsvariable is selected the note should be presented different, but there are // no way to parse it to PAXIOm and specify that the note is valid for only one contents. - else { - if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) { + else + { + if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "NOTEX"; else @@ -300,9 +343,10 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } } - - public class PXSqlVariableNotes : List { - + + public class PXSqlVariableNotes : List + { + } @@ -316,8 +360,10 @@ public class PaxiomNotes private List contentsNotes = new List(); //adds tableNote unless it is already added - public void addTableNote(PXSqlNote tableNote) { - if ( ! tableNotes.ContainsKey(tableNote.FootNoteNo)) { + public void addTableNote(PXSqlNote tableNote) + { + if (!tableNotes.ContainsKey(tableNote.FootNoteNo)) + { tableNotes.Add(tableNote.FootNoteNo, tableNote); } } @@ -351,46 +397,46 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl foreach (PXSqlNote note in this.tableNotes.Values) { - if (note.MandOpt == mMeta.Config.Codes.FootnoteM) - keyWord = "NOTEX"; - else - keyWord = "NOTE"; - parseValue = new StringCollection(); - parseValue.Add(note.NotePresTexts[langCode]); - handler(keyWord, langCode, subKeyWord, parseValue); + if (note.MandOpt == mMeta.Config.Codes.FootnoteM) + keyWord = "NOTEX"; + else + keyWord = "NOTE"; + parseValue = new StringCollection(); + parseValue.Add(note.NotePresTexts[langCode]); + handler(keyWord, langCode, subKeyWord, parseValue); } foreach (PXSqlNote note in this.variableNotes) - { - if (note.MandOpt == mMeta.Config.Codes.FootnoteM) - keyWord = "NOTEX"; - else - keyWord = "NOTE"; - subKeyWord = note.Variable; - parseValue = new StringCollection(); - parseValue.Add(note.NotePresTexts[langCode]); - handler(keyWord, langCode, subKeyWord, parseValue); - + { + if (note.MandOpt == mMeta.Config.Codes.FootnoteM) + keyWord = "NOTEX"; + else + keyWord = "NOTE"; + subKeyWord = note.Variable; + parseValue = new StringCollection(); + parseValue.Add(note.NotePresTexts[langCode]); + handler(keyWord, langCode, subKeyWord, parseValue); + } foreach (PXSqlNote note in this.contentsNotes) { - - subKeyWord = mMeta.ContensCode + "\",\"" + mMeta.ContentsVariable.Values.GetValueByContentsCode(note.Contents).ValueCode; - //subKeyWord = mMeta.ContensCode + "," + note.Contents; - if (note.MandOpt == mMeta.Config.Codes.FootnoteM) - keyWord = "VALUENOTEX"; - else - keyWord = "VALUENOTE"; - parseValue = new StringCollection(); - parseValue.Add(note.NotePresTexts[langCode]); - handler(keyWord, langCode, subKeyWord, parseValue); - + subKeyWord = mMeta.ContensCode + "\",\"" + mMeta.ContentsVariable.Values.GetValueByContentsCode(note.Contents).ValueCode; + //subKeyWord = mMeta.ContensCode + "," + note.Contents; + if (note.MandOpt == mMeta.Config.Codes.FootnoteM) + keyWord = "VALUENOTEX"; + else + keyWord = "VALUENOTE"; + + parseValue = new StringCollection(); + parseValue.Add(note.NotePresTexts[langCode]); + handler(keyWord, langCode, subKeyWord, parseValue); + } } @@ -398,36 +444,43 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } - public class PXSqlCellNotes : List { + public class PXSqlCellNotes : List + { private const string star = "*"; - public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) { + public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) + { List stubAndHead = new List(); stubAndHead.AddRange(mMeta.Stubs); stubAndHead.AddRange(mMeta.Headings); StringCollection CellNoteDimensions; string subKeyWord; - string keyWord; + string keyWord; StringCollection parseValue; - foreach (PXSqlNote note in this) { + foreach (PXSqlNote note in this) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "CELLNOTEX"; else keyWord = "CELLNOTE"; CellNoteDimensions = new StringCollection(); - foreach (PXSqlVariable var in stubAndHead) { - if (var.IsTimevariable) { + foreach (PXSqlVariable var in stubAndHead) + { + if (var.IsTimevariable) + { if (var.Values.ContainsKey(note.TimePeriode)) CellNoteDimensions.Add(note.TimePeriode); else CellNoteDimensions.Add(star); } - else if (var.IsContentVariable) { + else if (var.IsContentVariable) + { if (var.Values.ContainsKey(note.Contents)) CellNoteDimensions.Add(note.Contents); else CellNoteDimensions.Add(star); } - else if (var.Name == note.Variable) { + else if (var.Name == note.Variable) + { if (var.Values.ContainsKey(note.ValueCode)) CellNoteDimensions.Add(note.ValueCode); else @@ -450,5 +503,5 @@ public void ParseNote(PXSqlMeta_21 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } - + } diff --git a/PCAxis.Sql/Parser_21/PXSqlNpm.cs b/PCAxis.Sql/Parser_21/PXSqlNpm.cs index 6d07772..e083f7c 100644 --- a/PCAxis.Sql/Parser_21/PXSqlNpm.cs +++ b/PCAxis.Sql/Parser_21/PXSqlNpm.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; -using System.Text; -using System.Data; -using PCAxis.Paxiom; -using PCAxis.Sql.QueryLib_21; using System.Globalization; +using PCAxis.Sql.QueryLib_21; + namespace PCAxis.Sql.Parser_21 { public class PXSqlNpm @@ -37,15 +35,17 @@ public class PXSqlNpm public int maxDatasymbolN = 0; - - public PXSqlNpm(PXSqlMeta_21 mMeta) { + + public PXSqlNpm(PXSqlMeta_21 mMeta) + { this.mMeta = mMeta; metaVersion = mMeta.MetaModelVersion; cat1Counter = 0; cat2Counter = 0; cat3Counter = 0; myMetaAdmVariables = new Dictionary(); - if (metaVersion == "2.0") { + if (metaVersion == "2.0") + { NPMCharacter myNPMCharacter = new NPMCharacter(); //myNPMCharacters = new Dictionary(); myNPMCharacters = new List(); @@ -56,7 +56,8 @@ public PXSqlNpm(PXSqlMeta_21 mMeta) { //TODO; FIX (tja 2.1) myNPMCharacter.presCharacters = new Dictionary(); myNPMCharacter.presTexts = new Dictionary(); - foreach (string lang in mMeta.LanguageCodes) { + foreach (string lang in mMeta.LanguageCodes) + { myNPMCharacter.presCharacters[lang] = ".."; myNPMCharacter.presTexts[lang] = ""; } @@ -88,7 +89,8 @@ public PXSqlNpm(PXSqlMeta_21 mMeta) { //myMetaAdmVariables.Add(myMetaVariable.name, myMetaVariable); //---------------- } - else if (String.Compare(metaVersion, "2.0", false, CultureInfo.InvariantCulture) > 0) { + else if (String.Compare(metaVersion, "2.0", false, CultureInfo.InvariantCulture) > 0) + { //if ((metaVersion == (decimal)2.1) || (metaVersion == (decimal)2.2)) //DataNotAvailable myMetaAdmRow = mMeta.MetaQuery.GetMetaAdmRow(dataNotAvailable); @@ -110,13 +112,15 @@ public PXSqlNpm(PXSqlMeta_21 mMeta) { setNpmCharacters(); setMetaAdm(); maxDatasymbolN = cat3Counter; - } else { - throw new PCAxis.Sql.Exceptions.DbPxsMismatchException(14,mMeta.MetaModelVersion); - + } + else + { + throw new PCAxis.Sql.Exceptions.DbPxsMismatchException(14, mMeta.MetaModelVersion); + } } - + protected void setMetaAdmInfo1(MetaAdmRow myMetaAdmRow) { MetaAdmVariable myMetaVariable = new MetaAdmVariable(); @@ -126,20 +130,23 @@ protected void setMetaAdmInfo1(MetaAdmRow myMetaAdmRow) } - private void setNpmCharacters() { + private void setNpmCharacters() + { Dictionary specialCharacterRows = new Dictionary(); specialCharacterRows = mMeta.MetaQuery.GetSpecialCharacterAllRows(); NPMCharacter myNPMCharacter; npmId = 0; //myNPMCharacters = new Dictionary(); myNPMCharacters = new List(); - foreach (KeyValuePair myRow in specialCharacterRows) { + foreach (KeyValuePair myRow in specialCharacterRows) + { myNPMCharacter = new NPMCharacter(); myNPMCharacter.id = npmId; myNPMCharacter.characterType = myRow.Value.CharacterType; myNPMCharacter.presCharacters = new Dictionary(); myNPMCharacter.presTexts = new Dictionary(); - foreach (string lang in mMeta.LanguageCodes) { + foreach (string lang in mMeta.LanguageCodes) + { myNPMCharacter.presCharacters[lang] = myRow.Value.texts[lang].PresCharacter; myNPMCharacter.presTexts[lang] = myRow.Value.texts[lang].PresText; } @@ -158,35 +165,47 @@ private void setNpmCharacters() { } // Category 1 - if (myNPMCharacter.category == 1) { + if (myNPMCharacter.category == 1) + { cat1Counter++; } // category 2 - else if (myNPMCharacter.category == 2) { + else if (myNPMCharacter.category == 2) + { myNPMCharacter.pcAxisCode = PcAxisCodes.DataSymbol_NIL; cat2Counter++; - if (cat2Counter > 1) { + if (cat2Counter > 1) + { throw new PCAxis.Sql.Exceptions.DbException(15); } } // category 3 - else if (myNPMCharacter.category == 3) { + else if (myNPMCharacter.category == 3) + { // check to se if any of the character is the same as the one specified for DataSymbolSum. - if ((metaVersion == "2.1" && (myNPMCharacter.presCharacters[mMeta.LanguageCodes[0]] == myMetaAdmVariables[dataSymbolSum].value)) || ((metaVersion == "2.2") && (myNPMCharacter.characterType == myMetaAdmVariables[dataSymbolSum].value))) { + if ((metaVersion == "2.1" && (myNPMCharacter.presCharacters[mMeta.LanguageCodes[0]] == myMetaAdmVariables[dataSymbolSum].value)) || ((metaVersion == "2.2") && (myNPMCharacter.characterType == myMetaAdmVariables[dataSymbolSum].value))) + { myNPMCharacter.pcAxisCode = PcAxisCodes.DataSymbol_Sum; dataSymbolSumNpmId = npmId; dataNoteSumSet = true; - } else { + } + else + { cat3Counter++; - if (cat3Counter > 6) { + if (cat3Counter > 6) + { throw new PCAxis.Sql.Exceptions.DbException(16); - } else { + } + else + { myNPMCharacter.dataSymbolNr = cat3Counter; myNPMCharacter.pcAxisCode = PcAxisCodes.getDataSymbolNo(cat3Counter); } } - } else { + } + else + { throw new PCAxis.Sql.Exceptions.DbException(17); } @@ -196,8 +215,9 @@ private void setNpmCharacters() { } } - - protected void setMetaAdm() { + + protected void setMetaAdm() + { MetaAdmVariable varToCheck; // DefaultCodeMissingLine @@ -205,41 +225,52 @@ protected void setMetaAdm() { // should be of category 2 or 3: // check if variables was found in the NPM table. varToCheck = myMetaAdmVariables[defaultCodeMissingLine]; - foreach (NPMCharacter npmChar in myNPMCharacters) { - if ((npmChar.category == 2) || (npmChar.category == 3)) { - if (varToCheck.value == npmChar.characterType) { + foreach (NPMCharacter npmChar in myNPMCharacters) + { + if ((npmChar.category == 2) || (npmChar.category == 3)) + { + if (varToCheck.value == npmChar.characterType) + { varToCheck.npmRef = npmChar.id; defaultCodeMissingLineSet = true; break; } } } - if (!defaultCodeMissingLineSet) { + if (!defaultCodeMissingLineSet) + { throw new PCAxis.Sql.Exceptions.DbException(18); } //DataSymbolNil //DatasymbolNil should be of category 2 varToCheck = myMetaAdmVariables[dataSymbolNIL]; - foreach (NPMCharacter npmChar in myNPMCharacters) { - if (npmChar.category == 2) { - if (((metaVersion == "2.1") && (varToCheck.value == npmChar.presCharacters[mMeta.LanguageCodes[0]])) || ((metaVersion == "2.2") && (varToCheck.value == npmChar.characterType))) { + foreach (NPMCharacter npmChar in myNPMCharacters) + { + if (npmChar.category == 2) + { + if (((metaVersion == "2.1") && (varToCheck.value == npmChar.presCharacters[mMeta.LanguageCodes[0]])) || ((metaVersion == "2.2") && (varToCheck.value == npmChar.characterType))) + { varToCheck.npmRef = npmChar.id; dataSymbolNilSet = true; break; } } } - if (!dataSymbolNilSet) { - if (metaVersion == "2.1") { - if (cat2Counter < 1) { + if (!dataSymbolNilSet) + { + if (metaVersion == "2.1") + { + if (cat2Counter < 1) + { NPMCharacter myNPMCharacter = new NPMCharacter(); myNPMCharacter.id = npmId; myNPMCharacter.category = 2; myNPMCharacter.pcAxisCode = PcAxisCodes.getDatasymbolNil(); Dictionary myPresTexts = new Dictionary(); Dictionary myPresCharacters = new Dictionary(); - foreach (string lang in mMeta.LanguageCodes) { + foreach (string lang in mMeta.LanguageCodes) + { myPresTexts.Add(lang, ""); myPresCharacters.Add(lang, varToCheck.value); } @@ -249,14 +280,18 @@ protected void setMetaAdm() { varToCheck.npmRef = myNPMCharacter.id; npmId++; cat2Counter++; - } else { + } + else + { throw new PCAxis.Sql.Exceptions.DbException(19); } - } else { + } + else + { throw new PCAxis.Sql.Exceptions.DbException(20, dataSymbolNIL); } } - + // DataNotAvailable // DataNotAvailable should be of category 3 varToCheck = myMetaAdmVariables[dataNotAvailable]; @@ -282,8 +317,8 @@ protected void setMetaAdm() { NPMCharacter myNPMCharacter = new NPMCharacter(); myNPMCharacter.id = npmId; myNPMCharacter.category = 3; - myNPMCharacter.dataSymbolNr = cat3Counter+1; - myNPMCharacter.pcAxisCode = PcAxisCodes.getDataSymbolNo(cat3Counter+1); + myNPMCharacter.dataSymbolNr = cat3Counter + 1; + myNPMCharacter.pcAxisCode = PcAxisCodes.getDataSymbolNo(cat3Counter + 1); Dictionary myPresTexts = new Dictionary(); Dictionary myPresCharacters = new Dictionary(); foreach (string lang in mMeta.LanguageCodes) @@ -315,7 +350,7 @@ protected void setMetaAdm() { { if (npmChar.category == 1) { - if (((metaVersion == "2.1") && (varToCheck.value == npmChar.presCharacters[mMeta.LanguageCodes[0]])) || ((metaVersion == "2.2") && (varToCheck.value == npmChar.characterType))) + if (((metaVersion == "2.1") && (varToCheck.value == npmChar.presCharacters[mMeta.LanguageCodes[0]])) || ((metaVersion == "2.2") && (varToCheck.value == npmChar.characterType))) { varToCheck.npmRef = npmChar.id; dataNoteSumSet = true; @@ -327,20 +362,20 @@ protected void setMetaAdm() { { if (metaVersion == "2.1") { - NPMCharacter myNPMCharacter = new NPMCharacter(); - myNPMCharacter.id = npmId; - myNPMCharacter.category = 1; - Dictionary myPresTexts = new Dictionary(); - Dictionary myPresCharacters = new Dictionary(); - foreach (string lang in mMeta.LanguageCodes) - { - myPresTexts.Add(lang, ""); - myPresCharacters.Add(lang, varToCheck.value); - } - myNPMCharacter.presCharacters = myPresCharacters; - myNPMCharacter.presTexts = myPresTexts; - myNPMCharacters.Add(myNPMCharacter); - varToCheck.npmRef = myNPMCharacter.id; + NPMCharacter myNPMCharacter = new NPMCharacter(); + myNPMCharacter.id = npmId; + myNPMCharacter.category = 1; + Dictionary myPresTexts = new Dictionary(); + Dictionary myPresCharacters = new Dictionary(); + foreach (string lang in mMeta.LanguageCodes) + { + myPresTexts.Add(lang, ""); + myPresCharacters.Add(lang, varToCheck.value); + } + myNPMCharacter.presCharacters = myPresCharacters; + myNPMCharacter.presTexts = myPresTexts; + myNPMCharacters.Add(myNPMCharacter); + varToCheck.npmRef = myNPMCharacter.id; cat1Counter++; npmId++; } @@ -352,11 +387,16 @@ protected void setMetaAdm() { //DataSymbolSum varToCheck = myMetaAdmVariables[dataSymbolSum]; - if (dataSymbolSumSet) { + if (dataSymbolSumSet) + { varToCheck.npmRef = dataSymbolSumNpmId; - } else { - if (metaVersion == "2.1") { - if (cat3Counter < 6) { + } + else + { + if (metaVersion == "2.1") + { + if (cat3Counter < 6) + { NPMCharacter myNPMCharacter = new NPMCharacter(); myNPMCharacter.id = npmId; myNPMCharacter.category = 3; @@ -364,7 +404,8 @@ protected void setMetaAdm() { myNPMCharacter.pcAxisCode = PcAxisCodes.getDataSymbolNo(cat3Counter + 1); Dictionary myPresTexts = new Dictionary(); Dictionary myPresCharacters = new Dictionary(); - foreach (string lang in mMeta.LanguageCodes) { + foreach (string lang in mMeta.LanguageCodes) + { myPresTexts.Add(lang, ""); myPresCharacters.Add(lang, varToCheck.value); } @@ -374,12 +415,16 @@ protected void setMetaAdm() { varToCheck.npmRef = myNPMCharacter.id; cat3Counter++; npmId++; - } else { + } + else + { throw new PCAxis.Sql.Exceptions.DbException(24); } - } else { - // throw new PCAxis.Sql.Exceptions.DbException(25, dataSymbolSum); + } + else + { + // throw new PCAxis.Sql.Exceptions.DbException(25, dataSymbolSum); } } @@ -455,7 +500,7 @@ public double DefaultCodeMissingLineMagic foreach (NPMCharacter myChar in myNPMCharacters) { if (myChar.id == myMetaAdmVariables[defaultCodeMissingLine].npmRef) - + return myChar.pcAxisCode; } throw new PCAxis.Sql.Exceptions.DbException(27); @@ -480,10 +525,10 @@ public double DataNotAvailableMagic foreach (NPMCharacter myChar in myNPMCharacters) { if (myChar.id == myMetaAdmVariables[dataNotAvailable].npmRef) - return myChar.pcAxisCode; + return myChar.pcAxisCode; } throw new PCAxis.Sql.Exceptions.DbException(28); - + } } @@ -496,7 +541,7 @@ public string DataNotAvailablePresChar(string lang) } throw new PCAxis.Sql.Exceptions.DbException(28); } - + public double DataSymbolNilMagic { get @@ -513,9 +558,9 @@ public string DataSymbolNilPresChar(string lang) return myChar.presCharacters[lang]; } throw new PCAxis.Sql.Exceptions.DbException(29); - + } - + public double DataSymbolSumMagic { get @@ -532,7 +577,7 @@ public string DataSymbolSumPresChar(string lang) return myChar.presCharacters[lang]; } throw new PCAxis.Sql.Exceptions.DbException(30); - + } // Public Method @@ -568,19 +613,19 @@ public double DataSymbolNMagic(string characterType) return myChar.pcAxisCode; } throw new PCAxis.Sql.Exceptions.DbException(31, characterType); - + } - - public string DataSymbolNPresChar(int symbolNo,string lang) + + public string DataSymbolNPresChar(int symbolNo, string lang) { foreach (NPMCharacter myChar in myNPMCharacters) { - if (myChar.dataSymbolNr== symbolNo) + if (myChar.dataSymbolNr == symbolNo) return myChar.presCharacters[lang]; } throw new PCAxis.Sql.Exceptions.DbException(32, symbolNo); } - + public string DataNoteSumCharacterType() { foreach (NPMCharacter myChar in myNPMCharacters) @@ -588,7 +633,7 @@ public string DataNoteSumCharacterType() if (myChar.id == myMetaAdmVariables[dataNoteSum].npmRef) return myChar.characterType; } - throw new PCAxis.Sql.Exceptions.DbException(33); + throw new PCAxis.Sql.Exceptions.DbException(33); } public string DataNoteSumPresChar(string lang) @@ -599,21 +644,23 @@ public string DataNoteSumPresChar(string lang) return myChar.presCharacters[lang]; } throw new PCAxis.Sql.Exceptions.DbException(33); - + } - internal int GetCategory(double theMagicNumber) { - foreach (NPMCharacter myChar in myNPMCharacters) { + internal int GetCategory(double theMagicNumber) + { + foreach (NPMCharacter myChar in myNPMCharacters) + { if (myChar.pcAxisCode == theMagicNumber) return myChar.category; } - throw new PCAxis.Sql.Exceptions.DbException(34, theMagicNumber.ToString() ); + throw new PCAxis.Sql.Exceptions.DbException(34, theMagicNumber.ToString()); } public NPMCharacter GetNpmBySpeciaCharacterType(string characterType) { - foreach(NPMCharacter myCharacter in myNPMCharacters) + foreach (NPMCharacter myCharacter in myNPMCharacters) { - if (myCharacter.characterType==characterType) + if (myCharacter.characterType == characterType) { return myCharacter; } diff --git a/PCAxis.Sql/Parser_21/PXSqlParseMetaPostData_21.cs b/PCAxis.Sql/Parser_21/PXSqlParseMetaPostData_21.cs index fd78131..bc11636 100644 --- a/PCAxis.Sql/Parser_21/PXSqlParseMetaPostData_21.cs +++ b/PCAxis.Sql/Parser_21/PXSqlParseMetaPostData_21.cs @@ -1,11 +1,11 @@ using System; -using System.Collections.Specialized; using System.Collections.Generic; - -using PCAxis.Paxiom; +using System.Collections.Specialized; using log4net; +using PCAxis.Paxiom; + namespace PCAxis.Sql.Parser_21 { /// @@ -23,7 +23,7 @@ public class PXSqlParseMetaPostData_21 : IDisposable, PCAxis.Paxiom.IPXModelPars /// Receives the data and stores it. /// /// the data - public PXSqlParseMetaPostData_21(Dictionary inDataNoteCellEntries,PCAxis.Sql.Parser_21.PXSqlMeta_21 meta) + public PXSqlParseMetaPostData_21(Dictionary inDataNoteCellEntries, PCAxis.Sql.Parser_21.PXSqlMeta_21 meta) { theDataNoteCellEntries = inDataNoteCellEntries; mMeta = meta; @@ -57,25 +57,25 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string p foreach (KeyValuePair dcn in theDataNoteCellEntries) { - PXSqlNpm.NPMCharacter myNpm = myNpms.GetNpmBySpeciaCharacterType(dcn.Value); - foreach (string lang in mMeta.LanguageCodes) - { - string presCharacter = myNpm.presCharacters[lang]; - values = new StringCollection(); - values.Add(presCharacter); - String myKey = dcn.Key.Replace(",", "\",\"");//for PXModelBuilder.SplittString A","B","C - // not "A","B","C" - handler(keyword, lang, myKey, values); - } + PXSqlNpm.NPMCharacter myNpm = myNpms.GetNpmBySpeciaCharacterType(dcn.Value); + foreach (string lang in mMeta.LanguageCodes) + { + string presCharacter = myNpm.presCharacters[lang]; + values = new StringCollection(); + values.Add(presCharacter); + String myKey = dcn.Key.Replace(",", "\",\"");//for PXModelBuilder.SplittString A","B","C + // not "A","B","C" + handler(keyword, lang, myKey, values); + } // Keep distinct values of special character to get Presetext. - if (!datanoteDistictValues.Contains(dcn.Value)) - { - datanoteDistictValues.Add(dcn.Value); - } + if (!datanoteDistictValues.Contains(dcn.Value)) + { + datanoteDistictValues.Add(dcn.Value); + } } keyword = PXKeywords.NOTE; - foreach(string datanoteDistinctValue in datanoteDistictValues) + foreach (string datanoteDistinctValue in datanoteDistictValues) { PXSqlNpm.NPMCharacter myNpm = myNpms.GetNpmBySpeciaCharacterType(datanoteDistinctValue); foreach (string lang in mMeta.LanguageCodes) @@ -83,10 +83,10 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string p string presText = myNpm.presCharacters[lang] + "=" + myNpm.presTexts[lang]; values = new StringCollection(); values.Add(presText); - handler(keyword, lang,null, values); + handler(keyword, lang, null, values); } } - + } #endregion diff --git a/PCAxis.Sql/Parser_21/PXSqlSubTable.cs b/PCAxis.Sql/Parser_21/PXSqlSubTable.cs index dc14767..8cc43a2 100644 --- a/PCAxis.Sql/Parser_21/PXSqlSubTable.cs +++ b/PCAxis.Sql/Parser_21/PXSqlSubTable.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; using PCAxis.Sql.QueryLib_21; namespace PCAxis.Sql.Parser_21 diff --git a/PCAxis.Sql/Parser_21/PXSqlSubTables.cs b/PCAxis.Sql/Parser_21/PXSqlSubTables.cs index 6304fb9..d97b033 100644 --- a/PCAxis.Sql/Parser_21/PXSqlSubTables.cs +++ b/PCAxis.Sql/Parser_21/PXSqlSubTables.cs @@ -1,40 +1,44 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_21; + using PCAxis.PlugIn.Sql; using PCAxis.Sql.Pxs; -using System.Collections.Specialized; +using PCAxis.Sql.QueryLib_21; namespace PCAxis.Sql.Parser_21 { - public class PXSqlSubTables:Dictionary + public class PXSqlSubTables : Dictionary { - + PxsQuery mPxsQuery; public PXSqlSubTables(Dictionary altIBasen, PxsQuery pPxsQuery, PXSqlMeta_21 pxsqlMeta) - : base() { + : base() + { this.mPxsQuery = pPxsQuery; PXSqlSubTable mSubTable; - foreach (SubTableRow subTableRow in altIBasen.Values) { + foreach (SubTableRow subTableRow in altIBasen.Values) + { mSubTable = new PXSqlSubTable(subTableRow); this.Add(mSubTable.SubTable, mSubTable); } // set selected subtables. if (pPxsQuery == null) { - foreach (PXSqlSubTable subTable in this.Values) { + foreach (PXSqlSubTable subTable in this.Values) + { subTable.IsSelected = true; } - } else { + } + else + { SetSelectedSubTable(pxsqlMeta); } } - - + + /// /// Returns the ids of the subtables marked as selected(All if not a pxs has selected a spesific subtable. @@ -57,39 +61,39 @@ public IEnumerable GetKeysOfSelectedSubTables() private void SetSelectedSubTable(PXSqlMeta_21 pxsqlMeta) { - + Boolean isEqualValueSet; - foreach (KeyValuePair subTable in this) + foreach (KeyValuePair subTable in this) { isEqualValueSet = true; string subTableName = subTable.Value.SubTable; - Dictionary fromDb = pxsqlMeta.MetaQuery.GetSubTableVariableRowskeyVariable(pxsqlMeta.MainTable.MainTable, subTableName); - + Dictionary fromDb = pxsqlMeta.MetaQuery.GetSubTableVariableRowskeyVariable(pxsqlMeta.MainTable.MainTable, subTableName); + foreach (PQVariable pqvariable in mPxsQuery.Query.Variables) - { + { string variableName = pqvariable.code; string selectedValueset = pqvariable.SelectedValueset; if (!fromDb.ContainsKey(variableName)) { - throw new Exception("The variable \"" + variableName + "\" given in the query, does not exist in the database, for the maintable \""+pxsqlMeta.MainTable.MainTable+ "\". Is the query of date? Or the database?"); + throw new Exception("The variable \"" + variableName + "\" given in the query, does not exist in the database, for the maintable \"" + pxsqlMeta.MainTable.MainTable + "\". Is the query of date? Or the database?"); } string valuesetIdFromSubTableVariableRow = fromDb[variableName].ValueSet; if (selectedValueset != valuesetIdFromSubTableVariableRow && selectedValueset != PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS) { isEqualValueSet = false; break; - } + } } if (isEqualValueSet) { - + this[subTableName].IsSelected = true; } } - + } } } diff --git a/PCAxis.Sql/Parser_21/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs b/PCAxis.Sql/Parser_21/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs index 747e67c..a6792db 100644 --- a/PCAxis.Sql/Parser_21/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs +++ b/PCAxis.Sql/Parser_21/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs @@ -1,17 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Text; -using PCAxis.Paxiom; +using System.Collections.Generic; +using System.Collections.Specialized; + using log4net; -using PCAxis.Sql.QueryLib_21; + +using PCAxis.Paxiom; using PCAxis.Sql.DbConfig; -using System.Collections.Specialized; +using PCAxis.Sql.QueryLib_21; -namespace PCAxis.Sql.Parser_21 { +namespace PCAxis.Sql.Parser_21 +{ ///Class for columns in the Content-tabell that are independent of content (they will possibly be /// moved to maintabletable in a later version of the metamodel) - class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent { + class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent + { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlThingsThatWouldBeTheSameInAllPXSqlContent)); @@ -45,25 +47,35 @@ class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent { private bool mOfficialStatistics; private Dictionary nameByLangCode = new Dictionary(); - - internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_21 meta, SqlDbConfig_21 config) { + + internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_21 meta, SqlDbConfig_21 config) + { mStatAuthorityCode = someContentsRow.StatAuthority; string copyright = someContentsRow.Copyright; - if (copyright.Equals(config.Codes.Copyright1) || copyright.Equals(config.Codes.Copyright2)) { + if (copyright.Equals(config.Codes.Copyright1) || copyright.Equals(config.Codes.Copyright2)) + { mCopyright = false; - } else if (copyright.Equals(config.Codes.Copyright3)) { - mCopyright = true ; - } else { + } + else if (copyright.Equals(config.Codes.Copyright3)) + { + mCopyright = true; + } + else + { mCopyright = true; log.Error("The database has copyright=" + copyright + ", but the valid codes from config are " + config.Codes.Copyright1 + "," + config.Codes.Copyright2 + " or " + config.Codes.Copyright3 + "."); } - if (copyright.Equals(config.Codes.Copyright1)) { + if (copyright.Equals(config.Codes.Copyright1)) + { mOfficialStatistics = true; - } else { - mOfficialStatistics = false; + } + else + { + mOfficialStatistics = false; } OrganizationRow org = meta.MetaQuery.GetOrganizationRow(mStatAuthorityCode); - foreach (string language in org.texts.Keys) { + foreach (string language in org.texts.Keys) + { nameByLangCode.Add(language, org.texts[language].OrganizationName); } } @@ -88,13 +100,15 @@ internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContents /// /// /// - public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { + public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) + { StringCollection values = new StringCollection(); string subkey = null; - foreach (string langCode in nameByLangCode.Keys) { + foreach (string langCode in nameByLangCode.Keys) + { // SOURCE values.Clear(); @@ -106,9 +120,12 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { // COPYRIGHT values.Clear(); - if (mCopyright) { + if (mCopyright) + { values.Add(PXConstant.YES); - } else { + } + else + { values.Add(PXConstant.NO); } handler(PXKeywords.COPYRIGHT, noLanguage, subkey, values); diff --git a/PCAxis.Sql/Parser_21/PXSqlTimeScale.cs b/PCAxis.Sql/Parser_21/PXSqlTimeScale.cs index afcd66e..3f682ee 100644 --- a/PCAxis.Sql/Parser_21/PXSqlTimeScale.cs +++ b/PCAxis.Sql/Parser_21/PXSqlTimeScale.cs @@ -1,6 +1,5 @@ using System; -using System.Collections.Generic; -using System.Text; + using PCAxis.Sql.QueryLib_21; namespace PCAxis.Sql.Parser_21 @@ -8,7 +7,7 @@ namespace PCAxis.Sql.Parser_21 public class PXSqlTimeScale { private TimeScaleRow tsRow; - + private bool doTimeScalePres = false; /** True if the timevariable should get its PresText from TIMESCALE,TIMESCALE_ENG ... @@ -26,7 +25,7 @@ public string TimeScale - + public string Regular { get { return tsRow.Regular; } @@ -49,12 +48,12 @@ public string StoreFormat */ public string getPresText(string langCode) { - + return tsRow.texts[langCode].PresText; } - + //Contructor - + public PXSqlTimeScale(TimeScaleRow timeScaleRow, DbConfig.SqlDbConfig_21 sqlDbConfig) { //TODO; Complete member initialization diff --git a/PCAxis.Sql/Parser_21/PXSqlValue.cs b/PCAxis.Sql/Parser_21/PXSqlValue.cs index 9434452..4bf38d0 100644 --- a/PCAxis.Sql/Parser_21/PXSqlValue.cs +++ b/PCAxis.Sql/Parser_21/PXSqlValue.cs @@ -1,10 +1,10 @@ using System; -using System.Collections; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_21; using System.Collections.Specialized; + using log4net; + +using PCAxis.Sql.QueryLib_21; namespace PCAxis.Sql.Parser_21 { public class SortByVsValueHelper : IComparer @@ -13,7 +13,7 @@ int IComparer.Compare(PXSqlValue a, PXSqlValue b) { PXSqlValue valA = a; PXSqlValue valB = b; - return String.Compare(valA.SortCodeVsValue,valB.SortCodeVsValue); + return String.Compare(valA.SortCodeVsValue, valB.SortCodeVsValue); } } public class SortByValueHelper : IComparer @@ -39,7 +39,7 @@ int IComparer.Compare(PXSqlValue a, PXSqlValue b) return 0; } } - public class PXSqlValue:IComparable + public class PXSqlValue : IComparable { #region members private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlValue)); @@ -52,8 +52,8 @@ public class PXSqlValue:IComparable private string mSortCodeValue; private string mSortCodeVsValue; private string mSortCodeDb; // this is the sortorder returned from dababase sort on vsvalue,value - private Dictionary mValueTextS = new Dictionary(); - private Dictionary mValueTextL = new Dictionary(); + private Dictionary mValueTextS = new Dictionary(); + private Dictionary mValueTextL = new Dictionary(); private string mPrecision; private bool mIsSelected; private bool mExistInDb; @@ -69,7 +69,7 @@ public string ContentsCode public string ValueCode { get { return mValueCode; } - set { mValueCode = value;} + set { mValueCode = value; } } public string ValuePool { @@ -77,9 +77,9 @@ public string ValuePool set { mValuePool = value; } } public string ValueSet - { + { get { return mValueSet; } - set { mValueSet = value; } + set { mValueSet = value; } } public int SortCodePxs { @@ -102,7 +102,7 @@ public string SortCodeDb get { return mSortCodeDb; } set { mSortCodeDb = value; } } - public Dictionary ValueTextS + public Dictionary ValueTextS { get { return mValueTextS; } set { mValueTextS = value; } @@ -124,8 +124,8 @@ public bool IsSelected } public bool ExistInDb { - get { return mExistInDb; } - set { mExistInDb = value; } + get { return mExistInDb; } + set { mExistInDb = value; } } //private List mFootNoteRows; //public List FootNoteRows @@ -145,12 +145,13 @@ public bool ExistInDb public PXSqlValue() { - // mFootNotesValue = new List(); + // mFootNotesValue = new List(); } - public PXSqlValue(ValueRow2 myValueRow, StringCollection LanguageCodes, string MainLanguageCode) { - + public PXSqlValue(ValueRow2 myValueRow, StringCollection LanguageCodes, string MainLanguageCode) + { + //this.meta = meta; this.mContentsCode = null; // only for contentsvalues @@ -164,7 +165,8 @@ public PXSqlValue(ValueRow2 myValueRow, StringCollection LanguageCodes, string M this.mSortCodeVsValue = myValueRow.texts[MainLanguageCode].SortCodeVsValue; //this.SecondarySortOrder = myValueRow.ValueSortCode; this.SortCodeDb = myValueRow.SortOrder; - foreach (string langCode in LanguageCodes) { + foreach (string langCode in LanguageCodes) + { this.ValueTextS[langCode] = myValueRow.texts[langCode].ValueTextS; this.ValueTextL[langCode] = myValueRow.texts[langCode].ValueTextL; } @@ -205,18 +207,19 @@ public PXSqlValue(ValueRow myValueRow, StringCollection LanguageCodes, string Ma /// /// Used as ValueCode, ValueTextS and ValueTextL /// - public PXSqlValue(string timeCode, StringCollection LanguageCodes) - { + public PXSqlValue(string timeCode, StringCollection LanguageCodes) + { //this.meta = meta; - this.mContentsCode = null; // only for contentsvalues + this.mContentsCode = null; // only for contentsvalues this.ValueCode = timeCode; this.SortCodePxs = 0; // is sometimes overridden from outside - this.mSortCodeValue = timeCode; + this.mSortCodeValue = timeCode; this.mSortCodeVsValue = "0"; //hmmm this.SortCodeDb = "0"; //hmmm - foreach (string langCode in LanguageCodes) { + foreach (string langCode in LanguageCodes) + { this.ValueTextS[langCode] = timeCode; this.ValueTextL[langCode] = timeCode; } @@ -233,9 +236,9 @@ public PXSqlValue(PXSqlContent content, int sortCode) this.ValueTextS = content.PresTextS; // SortCodePxs and SortCode are now set to the same value. Maybe no a good thing if sortorder should be reset to db // default after read from pxs. //TODO send two sortcodes from PXSQlMeta. - this.SortCodePxs = sortCode; - this.mSortCodeValue = sortCode.ToString(); - + this.SortCodePxs = sortCode; + this.mSortCodeValue = sortCode.ToString(); + } @@ -245,7 +248,7 @@ public int CompareTo(object obj) { if (this.GetType() != obj.GetType()) { - throw new PCAxis.Sql.Exceptions.BugException(10000); + throw new PCAxis.Sql.Exceptions.BugException(10000); } else { @@ -261,7 +264,7 @@ public int CompareTo(object obj) } } } - public static IComparer SortByVsValue() + public static IComparer SortByVsValue() { return (IComparer)new SortByVsValueHelper(); } diff --git a/PCAxis.Sql/Parser_21/PXSqlValuePool.cs b/PCAxis.Sql/Parser_21/PXSqlValuePool.cs index ccf6658..b9314a3 100644 --- a/PCAxis.Sql/Parser_21/PXSqlValuePool.cs +++ b/PCAxis.Sql/Parser_21/PXSqlValuePool.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_21; -using System.Collections.Specialized; + using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_21; namespace PCAxis.Sql.Parser_21 { @@ -40,10 +39,10 @@ public Dictionary PresText { get { return mPresText; } } - // public string Description - // { - // get { return vpRow.Description; } - // } + // public string Description + // { + // get { return vpRow.Description; } + // } /// /// Which texts exists (long/short/extra/none) @@ -58,10 +57,10 @@ public string ValuePres { get { return vpRow.ValuePres; } } - // public string KDBId - // { - // get { return vpRow.KDBId; } - // } + // public string KDBId + // { + // get { return vpRow.KDBId; } + // } // Depending of if it's a primary or secondary language, Doamin is read from different columns in database table ValuePool. // Valuepool if primary and ValuePoolEng(2.0) ValuePoolAlias (later). A solution could be to add a property here called Domain. @@ -84,15 +83,20 @@ public Dictionary Domain /// For config.codes public PXSqlValuepool(QueryLib_21.ValuePoolRow inRow, PXSqlMeta_21 meta) { - + this.vpRow = inRow; - - if( this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsN) ) { - this.mValueTextOption = PXConstant.VALUETEXTOPTION_NOTEXT; - } else if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsX) ) { - this.mValueTextOption = PXConstant.VALUETEXTOPTION_TOOLONG; - } else { - this.mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; + + if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsN)) + { + this.mValueTextOption = PXConstant.VALUETEXTOPTION_NOTEXT; + } + else if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsX)) + { + this.mValueTextOption = PXConstant.VALUETEXTOPTION_TOOLONG; + } + else + { + this.mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; } mPresText = new Dictionary(); @@ -105,6 +109,6 @@ public PXSqlValuepool(QueryLib_21.ValuePoolRow inRow, PXSqlMeta_21 meta) } - + } } diff --git a/PCAxis.Sql/Parser_21/PXSqlValueSet.cs b/PCAxis.Sql/Parser_21/PXSqlValueSet.cs index ac5dd78..f2cb7ec 100644 --- a/PCAxis.Sql/Parser_21/PXSqlValueSet.cs +++ b/PCAxis.Sql/Parser_21/PXSqlValueSet.cs @@ -1,27 +1,24 @@ - using System; +using System; using System.Collections.Generic; -using System.Text; - -using PCAxis.Sql.QueryLib_21; namespace PCAxis.Sql.Parser_21 { public class PXSqlValueSet { #region - + private string mValueSet; //private string mPresText; private Dictionary mPresText = new Dictionary(); - + private string elimination; //private PXSqlValuepool mValuePool; private string mValuePoolId; private string mValuePres; private string mGeoAreaNo; - + private string mSortCodeExists; - + private int mNumberOfValues; /// @@ -41,22 +38,22 @@ public List SortedListOfCodes public string ValueSet { get { return this.mValueSet; } - + } - + public Dictionary PresText { get { return this.mPresText; } - + } - - + + public string Elimination { get { return this.elimination; } } - + public string ValuePoolId { get { return this.mValuePoolId; } @@ -65,22 +62,22 @@ public string ValuePoolId public string ValuePres { get { return this.mValuePres; } - + } public string GeoAreaNo { get { return this.mGeoAreaNo; } - + } - + public string SortCodeExists { get { return mSortCodeExists; } - + } - + public int NumberOfValues { get { return mNumberOfValues; } @@ -88,36 +85,40 @@ public int NumberOfValues } public PXSqlValueSet() { } - public PXSqlValueSet(QueryLib_21.ValueSetRow inRow) { - + public PXSqlValueSet(QueryLib_21.ValueSetRow inRow) + { + this.mValueSet = inRow.ValueSet; this.elimination = inRow.Elimination; this.mSortCodeExists = inRow.SortCodeExists; - this.mValuePoolId = inRow.ValuePool; + this.mValuePoolId = inRow.ValuePool; this.mValuePres = inRow.ValuePres; this.mGeoAreaNo = inRow.GeoAreaNo; - - foreach (string langCode in inRow.texts.Keys) { - + + foreach (string langCode in inRow.texts.Keys) + { + //PresText came in version 2.1 and is optional ... desciption is up to 200 chars string asPresText = inRow.texts[langCode].PresText; - if (String.IsNullOrEmpty(asPresText)) { + if (String.IsNullOrEmpty(asPresText)) + { asPresText = inRow.texts[langCode].Description; int gridPosition = asPresText.IndexOf('#'); - if (gridPosition > 0) { + if (gridPosition > 0) + { asPresText = asPresText.Substring(0, gridPosition); } } mPresText[langCode] = asPresText; - + } - //private int mNumberOfValues; is set outside class. Bad thing? Yes + //private int mNumberOfValues; is set outside class. Bad thing? Yes } //for magic all - public PXSqlValueSet(Dictionary presText, string valuePoolId, string elimination, string sortCodeExists,string valuePres) + public PXSqlValueSet(Dictionary presText, string valuePoolId, string elimination, string sortCodeExists, string valuePres) { this.mValueSet = PCAxis.PlugIn.Sql.PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS; this.mPresText = presText; diff --git a/PCAxis.Sql/Parser_21/PXSqlVariable.cs b/PCAxis.Sql/Parser_21/PXSqlVariable.cs index f95739e..693105a 100644 --- a/PCAxis.Sql/Parser_21/PXSqlVariable.cs +++ b/PCAxis.Sql/Parser_21/PXSqlVariable.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_21; + using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; using PCAxis.PlugIn.Sql; +using PCAxis.Sql.QueryLib_21; namespace PCAxis.Sql.Parser_21 { @@ -43,7 +42,7 @@ public abstract class PXSqlVariable : IComparable, ISqlItem private string mVariableType; private String mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; - + //protected const string allValuesets = "_ALL_"; protected string selectedValueset; public string SelectedValueset @@ -204,13 +203,17 @@ public Dictionary ValueSets public PXSqlValuepool ValuePool { get { return mValuePool; } - set { mValuePool = value; - if (mValuePool == null) + set { - mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; - } else { - mValueTextOption = mValuePool.ValueTextOption; - } + mValuePool = value; + if (mValuePool == null) + { + mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; + } + else + { + mValueTextOption = mValuePool.ValueTextOption; + } } } @@ -249,7 +252,7 @@ public PXSqlVariable(string name, PXSqlMeta_21 meta, bool isContVar, bool isTime } #endregion constructors - + protected virtual void SetPresText() @@ -322,7 +325,7 @@ internal virtual void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler { StringCollection values = new StringCollection(); string subkey = this.Name; - + //VARIABLENAME //OBS located in PXSQLBuilder near SetVariableName @@ -335,7 +338,7 @@ internal virtual void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler // PRESTEXT ParsePresTextOption(handler, LanguageCodes, preferredLanguage); - + // VALUE_TEXT_OPTION ParseValueTextOption(handler); @@ -433,7 +436,7 @@ internal virtual void ParseCodeAndValues(PCAxis.Paxiom.IPXModelParser.MetaHandle //VALUES and Codes List _values = this.GetValuesForParsing(); //VALUES - if (! this.mValueTextOption.Equals(PXConstant.VALUETEXTOPTION_NOTEXT)) + if (!this.mValueTextOption.Equals(PXConstant.VALUETEXTOPTION_NOTEXT)) { // if ( this.PresTextOption.Equals(this.meta.Config.Codes.ValuePresC)) foreach (string langCode in LanguageCodes) @@ -469,13 +472,13 @@ internal virtual void ParseCodeAndValues(PCAxis.Paxiom.IPXModelParser.MetaHandle { if (this.ValuePool.ValuePres.Equals(meta.Config.Codes.ValuePresB) || this.ValuePool.ValuePres.Equals(meta.Config.Codes.ValuePresT)) { - if (val.ValueTextL[langCode].Length>0) + if (val.ValueTextL[langCode].Length > 0) { values.Add(val.ValueTextL[langCode]); } else { - throw new ApplicationException("Long valuetext should be used according to Valuepool.Valuepres, but long text doesn't exist. ValuePool=" + val.ValuePool + " Valuecode= " + val.ValueCode); + throw new ApplicationException("Long valuetext should be used according to Valuepool.Valuepres, but long text doesn't exist. ValuePool=" + val.ValuePool + " Valuecode= " + val.ValueCode); } } else if (this.ValuePool.ValuePres.Equals(meta.Config.Codes.ValuePresA) || this.ValuePool.ValuePres.Equals(meta.Config.Codes.ValuePresS)) @@ -489,7 +492,7 @@ internal virtual void ParseCodeAndValues(PCAxis.Paxiom.IPXModelParser.MetaHandle throw new ApplicationException("Short valuetext should be used according to Valuepool.Valuepres, but short text doesn't exist. ValuePool=" + val.ValuePool + " Valuecode= " + val.ValueCode); } } - else + else { // ValuePres = C if (val.ValueTextL[langCode].Length > 0) @@ -506,7 +509,7 @@ internal virtual void ParseCodeAndValues(PCAxis.Paxiom.IPXModelParser.MetaHandle } } } - + handler(PXKeywords.VALUES, langCode, subkey, values); } } diff --git a/PCAxis.Sql/Parser_21/PXSqlVariableClassification.cs b/PCAxis.Sql/Parser_21/PXSqlVariableClassification.cs index 2496a4f..d802e78 100644 --- a/PCAxis.Sql/Parser_21/PXSqlVariableClassification.cs +++ b/PCAxis.Sql/Parser_21/PXSqlVariableClassification.cs @@ -1,13 +1,14 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_21; -using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; -using PCAxis.PlugIn.Sql; using System.Data; + using log4net; + +using PCAxis.Paxiom; +using PCAxis.PlugIn.Sql; +using PCAxis.Sql.Pxs; +using PCAxis.Sql.QueryLib_21; namespace PCAxis.Sql.Parser_21 { public class PXSqlVariableClassification : PXSqlVariable @@ -265,8 +266,8 @@ internal void SetValues(StringCollection selSubTables, PQVariable var) // Defines a dictionary to hold all the sortorders. Necessary because of the wildcards Dictionary mDefinedSortorder = new Dictionary(); bool usesGrouping = false; - - + + string mPxsSubTableId = meta.PxsFile.Query.SubTable; @@ -289,7 +290,7 @@ internal void SetValues(StringCollection selSubTables, PQVariable var) DataSet mValueInfoTbl = meta.MetaQuery.GetValueWildCardBySubTable(meta.MainTable.MainTable, var.code, mPxsSubTableId, val.code); DataRowCollection mValueInfo = mValueInfoTbl.Tables[0].Rows; - + foreach (DataRow row in mValueInfo) { string mTempCode = row[meta.MetaQuery.DB.Value.ValueCode].ToString(); @@ -312,7 +313,7 @@ internal void SetValues(StringCollection selSubTables, PQVariable var) documentOrder++; } - #endregion foreach var.Values.Items + #endregion foreach var.Values.Items // mSelectedValues now contains all the selected values, including those defined by wildcards @@ -321,7 +322,7 @@ internal void SetValues(StringCollection selSubTables, PQVariable var) List mSortedValues = new List(); ValueRowDictionary mValueRowDictionary = meta.MetaQuery.GetValueRowDictionary(meta.MainTable.MainTable, selSubTables, var.code, mSelectedValues, this.ValuePool.ValueTextExists); - + // todo; fortsette her Dictionary mValueRows = mValueRowDictionary.ValueRows; @@ -697,7 +698,7 @@ private string CheckMultValuesetElim(List ElimValues) //jfi sep 2015. This: //if ((numberOfElimA == ElimValues.Count - 1) && (numberOfElimOtherCode == 1)) //was found to be too strict in VariablerOgVerdimengder-4.doc - + if ((numberOfElimOtherCode == 1)) { return elimOtherCode; @@ -875,12 +876,14 @@ private void ParseValueSetKeywords(PCAxis.Paxiom.IPXModelParser.MetaHandler hand if (meta.inPresentationModus) { parseValueSet = true; - }else + } + else { if ((this.ValueSets.Values.Count > 1) || (this.groupingInfos.Infos.Count > 0)) { parseValueSet = true; - }else + } + else { parseValueSet = false; } diff --git a/PCAxis.Sql/Parser_21/PXSqlVariableContents.cs b/PCAxis.Sql/Parser_21/PXSqlVariableContents.cs index 98d1743..39c64a9 100644 --- a/PCAxis.Sql/Parser_21/PXSqlVariableContents.cs +++ b/PCAxis.Sql/Parser_21/PXSqlVariableContents.cs @@ -1,17 +1,18 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_21; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_21; + namespace PCAxis.Sql.Parser_21 { class PXSqlVariableContents : PXSqlVariable { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableContents)); - + #region contructor public PXSqlVariableContents(String name, PXSqlMeta_21 meta) : base(name, meta, true, false, false) @@ -21,7 +22,7 @@ public PXSqlVariableContents(String name, PXSqlMeta_21 meta) if (!meta.ConstructedFromPxs) { mIndex = mStoreColumnNo; - } + } SetDefaultPresTextOption(); SetPresText(); } @@ -78,8 +79,9 @@ private void SetDefaultPresTextOption() /// /// /// - internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) { - + internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) + { + base.ParseMeta(handler, LanguageCodes, preferredLanguage); //CONTVARIABLE @@ -96,14 +98,14 @@ internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handle string tmpAggregPossible = PXConstant.YES; foreach (PXSqlContent pxsqlCont in meta.Contents.Values) { - - if (! pxsqlCont.AggregPossible) + + if (!pxsqlCont.AggregPossible) { tmpAggregPossible = PXConstant.NO; break; } } - + values.Clear(); values.Add(tmpAggregPossible); handler(PXKeywords.AGGREGALLOWED, language, subkey, values); @@ -112,7 +114,8 @@ internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handle log.Debug("meta.Contents.Values.Count=" + meta.Contents.Values.Count.ToString()); // "ContentInfo" // og PXKeywords.PRECISION - foreach (PXSqlContent pxsqlCont in meta.Contents.Values) { + foreach (PXSqlContent pxsqlCont in meta.Contents.Values) + { pxsqlCont.ParseMeta(handler, LanguageCodes); } diff --git a/PCAxis.Sql/Parser_21/PXSqlVariableTime.cs b/PCAxis.Sql/Parser_21/PXSqlVariableTime.cs index 15d4b01..9c09415 100644 --- a/PCAxis.Sql/Parser_21/PXSqlVariableTime.cs +++ b/PCAxis.Sql/Parser_21/PXSqlVariableTime.cs @@ -1,41 +1,40 @@ -using System; +using System.Collections; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_21; -using PCAxis.Paxiom; - -using System.Collections; -using log4net; +using log4net; +using PCAxis.Paxiom; using PCAxis.Sql.Pxs; +using PCAxis.Sql.QueryLib_21; namespace PCAxis.Sql.Parser_21 { - public class PXSqlVariableTime:PXSqlVariable + public class PXSqlVariableTime : PXSqlVariable { - private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableTime)); - #region props - private PXSqlTimeScale mTimeScale; - - - private StringCollection mTimeVal; - public StringCollection TimeVal { - get { return mTimeVal; } - } - private bool mHasTimeVal; - public bool HasTimeVal { - get { return mHasTimeVal; } - } - //private bool mTableContainsMetaOnly; - #endregion props - - - #region contructor + private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableTime)); + #region props + private PXSqlTimeScale mTimeScale; + + + private StringCollection mTimeVal; + public StringCollection TimeVal + { + get { return mTimeVal; } + } + private bool mHasTimeVal; + public bool HasTimeVal + { + get { return mHasTimeVal; } + } + //private bool mTableContainsMetaOnly; + #endregion props + + + #region contructor public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_21 meta) - :base(aTVRow.Variable,meta,false,true,false) + : base(aTVRow.Variable, meta, false, true, false) { mStoreColumnNo = int.Parse(aTVRow.StoreColumnNo); if (!meta.ConstructedFromPxs) @@ -44,9 +43,9 @@ public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_21 meta) } SetSelected(); SetPresText(); - SetDefaultPresTextOption(); + SetDefaultPresTextOption(); SetTimeValues(); - mTimeScale = new PXSqlTimeScale(meta.MetaQuery.GetTimeScaleRow(meta.MainTable.TimeScale),meta.Config); + mTimeScale = new PXSqlTimeScale(meta.MetaQuery.GetTimeScaleRow(meta.MainTable.TimeScale), meta.Config); SetTimeVal(); PossiblyResetPresText(); @@ -54,7 +53,7 @@ public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_21 meta) } - #endregion + #endregion internal void SetSelected() { this.mIsSelected = false; @@ -67,10 +66,10 @@ internal void SetSelected() { this.mIsSelected = true; } - } + } internal override List GetValuesForParsing() { - if ((meta.inPresentationModus) && meta.ConstructedFromPxs ) + if ((meta.inPresentationModus) && meta.ConstructedFromPxs) { if ((int)meta.PxsFile.Query.Time.TimeOption == 0) { @@ -102,20 +101,22 @@ internal override List GetValuesForParsing() /// /// /// - internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) { - base.ParseMeta(handler, LanguageCodes, preferredLanguage); - //log.Debug("PPPPPPPPPPPPPPPPPParsing"); - //TIMEVAL - if (mHasTimeVal) { - - string language = null; - string subkey = this.Name; - StringCollection values = this.mTimeVal; - handler(PXKeywords.TIMEVAL, language, subkey, values); - values = null; - } - - } + internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) + { + base.ParseMeta(handler, LanguageCodes, preferredLanguage); + //log.Debug("PPPPPPPPPPPPPPPPPParsing"); + //TIMEVAL + if (mHasTimeVal) + { + + string language = null; + string subkey = this.Name; + StringCollection values = this.mTimeVal; + handler(PXKeywords.TIMEVAL, language, subkey, values); + values = null; + } + + } private void SetDefaultPresTextOption() @@ -127,58 +128,59 @@ private void SetDefaultPresTextOption() - private void SetTimeVal() { - - - string timeUnit; - if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitA) - timeUnit = "A1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitH) - timeUnit = "H1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitM) - timeUnit = "M1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitQ) - timeUnit = "Q1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitW) - timeUnit = "W1"; - else - { - log.Warn("Wrong Timeunit:" + mTimeScale.TimeUnit); - timeUnit = mTimeScale.TimeUnit; - } - - mTimeVal = new StringCollection(); - mTimeVal.Add("TLIST("+timeUnit+")"); - mHasTimeVal = true; - if (!meta.MainTable.ContainsOnlyMetaData) - { - string lowestSelectedTime; - string highestSelectedTime; - ArrayList selectedTimeCodes = new ArrayList(); - foreach (KeyValuePair val in mValues) - { - selectedTimeCodes.Add(val.Value.ValueCode); - } - selectedTimeCodes.Sort(); - lowestSelectedTime = selectedTimeCodes[0].ToString(); - highestSelectedTime = selectedTimeCodes[selectedTimeCodes.Count - 1].ToString(); - ArrayList allTimeCodes = TimeValueCodesSortedChronologicaly(); - int startIndexAllTimes = allTimeCodes.IndexOf(lowestSelectedTime); - int endIndexAllTimes = allTimeCodes.IndexOf(highestSelectedTime); - for (int i = startIndexAllTimes; i <= endIndexAllTimes; i++) - { - mTimeVal.Add(allTimeCodes[i].ToString()); - if (!selectedTimeCodes.Contains(allTimeCodes[i])) - { - //TODO; Dette gjøres midlertidig for Ã¥ sørge for at Timeval - //vises i serialiseringen - mTimeVal.Clear(); - mTimeVal.Add("TLIST(" + timeUnit + ")"); - break; - } - } - } - } + private void SetTimeVal() + { + + + string timeUnit; + if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitA) + timeUnit = "A1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitH) + timeUnit = "H1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitM) + timeUnit = "M1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitQ) + timeUnit = "Q1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitW) + timeUnit = "W1"; + else + { + log.Warn("Wrong Timeunit:" + mTimeScale.TimeUnit); + timeUnit = mTimeScale.TimeUnit; + } + + mTimeVal = new StringCollection(); + mTimeVal.Add("TLIST(" + timeUnit + ")"); + mHasTimeVal = true; + if (!meta.MainTable.ContainsOnlyMetaData) + { + string lowestSelectedTime; + string highestSelectedTime; + ArrayList selectedTimeCodes = new ArrayList(); + foreach (KeyValuePair val in mValues) + { + selectedTimeCodes.Add(val.Value.ValueCode); + } + selectedTimeCodes.Sort(); + lowestSelectedTime = selectedTimeCodes[0].ToString(); + highestSelectedTime = selectedTimeCodes[selectedTimeCodes.Count - 1].ToString(); + ArrayList allTimeCodes = TimeValueCodesSortedChronologicaly(); + int startIndexAllTimes = allTimeCodes.IndexOf(lowestSelectedTime); + int endIndexAllTimes = allTimeCodes.IndexOf(highestSelectedTime); + for (int i = startIndexAllTimes; i <= endIndexAllTimes; i++) + { + mTimeVal.Add(allTimeCodes[i].ToString()); + if (!selectedTimeCodes.Contains(allTimeCodes[i])) + { + //TODO; Dette gjøres midlertidig for Ã¥ sørge for at Timeval + //vises i serialiseringen + mTimeVal.Clear(); + mTimeVal.Add("TLIST(" + timeUnit + ")"); + break; + } + } + } + } /** @@ -188,33 +190,35 @@ private void PossiblyResetPresText() { if (mTimeScale.UsePresTextFromTimeScale) { - List keys = new List(this.PresText.Keys); - + List keys = new List(this.PresText.Keys); + foreach (string langCode in keys) { - this.PresText[langCode] = mTimeScale.getPresText(langCode); + this.PresText[langCode] = mTimeScale.getPresText(langCode); } - + } } private ArrayList TimeValueCodesSortedChronologicaly() - { - ArrayList sortedTimeValues = new ArrayList(); - System.Data.DataSet mTimeInfoTbl = meta.MetaQuery.GetAllTimeValues(meta.MainTable.MainTable, "asc"); - - foreach (System.Data.DataRow row in mTimeInfoTbl.Tables[0].Rows) { - - sortedTimeValues.Add(row[meta.MetaQuery.DB.ContentsTime.TimePeriod].ToString()); - } - sortedTimeValues.Sort(); - return sortedTimeValues; - } - - - private void SetTimeValues() { + { + ArrayList sortedTimeValues = new ArrayList(); + System.Data.DataSet mTimeInfoTbl = meta.MetaQuery.GetAllTimeValues(meta.MainTable.MainTable, "asc"); + + foreach (System.Data.DataRow row in mTimeInfoTbl.Tables[0].Rows) + { + + sortedTimeValues.Add(row[meta.MetaQuery.DB.ContentsTime.TimePeriod].ToString()); + } + sortedTimeValues.Sort(); + return sortedTimeValues; + } + + + private void SetTimeValues() + { // time variable values //lage flere overloads databasespørringer avhengig av timeopt //mValues = new Dictionary(); diff --git a/PCAxis.Sql/Parser_21/PXSqlVariables.cs b/PCAxis.Sql/Parser_21/PXSqlVariables.cs index 9942f24..d7ec9e0 100644 --- a/PCAxis.Sql/Parser_21/PXSqlVariables.cs +++ b/PCAxis.Sql/Parser_21/PXSqlVariables.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_21; + +using log4net; + using PCAxis.Paxiom; using PCAxis.Sql.Pxs; -using log4net; namespace PCAxis.Sql.Parser_21 { @@ -22,13 +21,14 @@ public PXSqlVariables(PXSqlMeta_21 meta) internal void setStubHeadPxs() { - int highestUsedStubIndex = 0 ; + int highestUsedStubIndex = 0; if (meta.PxsFile.Presentation.Stub != null) - foreach ( AxisType stub in meta.PxsFile.Presentation.Stub) + foreach (AxisType stub in meta.PxsFile.Presentation.Stub) { //mSqlVariable = this[stub.code]; this[stub.code].Index = stub.index; - if(stub.index > highestUsedStubIndex ) { + if (stub.index > highestUsedStubIndex) + { highestUsedStubIndex = stub.index; } this[stub.code].IsStub = true; @@ -39,13 +39,15 @@ internal void setStubHeadPxs() foreach (AxisType heading in meta.PxsFile.Presentation.Heading) { //mSqlVariable = this[heading.code]; - this[heading.code].Index = heading.index; - this[heading.code].IsHeading = true; + this[heading.code].Index = heading.index; + this[heading.code].IsHeading = true; } } - foreach (PXSqlVariable tmpVar in this.Values) { - if (tmpVar.isSelected && (!tmpVar.IsHeading) && (!tmpVar.IsStub)) { + foreach (PXSqlVariable tmpVar in this.Values) + { + if (tmpVar.isSelected && (!tmpVar.IsHeading) && (!tmpVar.IsStub)) + { log.Warn("Variable " + tmpVar.Name + " isSelected, but neither Heading nor Stub. Setting it to stub"); highestUsedStubIndex++; tmpVar.IsStub = true; @@ -66,18 +68,18 @@ internal void setStubHeadDefault() { if (tmpVar.IsTimevariable) { - // tmpVar.Index = 1; + // tmpVar.Index = 1; tmpVar.IsHeading = true; } else if (tmpVar.IsContentVariable) { - // tmpVar.Index = 2; + // tmpVar.Index = 2; tmpVar.IsHeading = true; } else { - // tmpVar.Index = stubIndex; - // stubIndex++; + // tmpVar.Index = stubIndex; + // stubIndex++; tmpVar.IsStub = true; } } @@ -113,12 +115,12 @@ internal List GetHeadingSorted() } } } - mHeadings.Sort(); - return mHeadings; + mHeadings.Sort(); + return mHeadings; } internal List GetStubSorted() { - List mStubs = new List(); + List mStubs = new List(); foreach (PXSqlVariable var in this.Values) { if (var.isSelected) @@ -160,5 +162,5 @@ internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, String } } - + diff --git a/PCAxis.Sql/Parser_21/PXSqlVariablesClassification.cs b/PCAxis.Sql/Parser_21/PXSqlVariablesClassification.cs index 5f67992..914c698 100644 --- a/PCAxis.Sql/Parser_21/PXSqlVariablesClassification.cs +++ b/PCAxis.Sql/Parser_21/PXSqlVariablesClassification.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_21; -using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; -using log4net; +using System.Collections.Generic; namespace PCAxis.Sql.Parser_21 { diff --git a/PCAxis.Sql/Parser_21/ParseMetaIndependentOfMaintable.cs b/PCAxis.Sql/Parser_21/ParseMetaIndependentOfMaintable.cs index 6026263..e14477c 100644 --- a/PCAxis.Sql/Parser_21/ParseMetaIndependentOfMaintable.cs +++ b/PCAxis.Sql/Parser_21/ParseMetaIndependentOfMaintable.cs @@ -1,10 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Collections.Specialized; -using PCAxis.Paxiom; +using System.Collections.Specialized; + using log4net; +using PCAxis.Paxiom; + namespace PCAxis.Sql.Parser_21 { @@ -13,92 +12,96 @@ namespace PCAxis.Sql.Parser_21 /// public class ParseMetaIndependentOfMaintable { - private static readonly ILog log = LogManager.GetLogger(typeof(ParseMetaIndependentOfMaintable)); - - internal ParseMetaIndependentOfMaintable() { } - - /// "ANSI" - /// "2000" hei - /// System.DateTime.UtcNow - /// - /// - /// If there exists a Optional_PXCodepage entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "iso-8859-1" - /// - /// - ///
- ///
- ///
- /// - /// - /// If there exists a Optional_PXAxisVersion entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "2000" - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// If there exists a Optional_PXCharset entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "ANSI" - /// - /// - ///
- ///
- ///
- /// - /// - /// If there exists a Optional_PXDescriptionDefault entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise false - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") - /// - /// - /// - internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, PXMetaAdmValues metaAdm ) { - string noLanguage = null; - string subkey = null; - StringCollection values = new StringCollection(); - - values.Add(metaAdm.PXCharset); - handler(PXKeywords.CHARSET, noLanguage, subkey, values); - - - values.Clear(); - values.Add(metaAdm.PXAxisVersion); - handler(PXKeywords.AXIS_VERSION, noLanguage, subkey, values); - - values.Clear(); - values.Add(metaAdm.PXCodepage); - handler(PXKeywords.CODEPAGE, noLanguage, subkey, values); - - values.Clear(); - if (metaAdm.PXDescriptionDefault) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.DESCRIPTIONDEFAULT, noLanguage, subkey, values); - - values.Clear(); - - // string nowString = System.DateTime.UtcNow.ToString("yyyyMMdd hh:mm"); bug 193 wrong time - // string nowString = System.DateTime.Now.ToString(); - // string nowString = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm"); - // ørebro vedtak(beslut). - //ørebro 27.11.2012 Nytt formatvedtak + private static readonly ILog log = LogManager.GetLogger(typeof(ParseMetaIndependentOfMaintable)); + + internal ParseMetaIndependentOfMaintable() { } + + /// "ANSI" + /// "2000" hei + /// System.DateTime.UtcNow + /// + /// + /// If there exists a Optional_PXCodepage entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "iso-8859-1" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If there exists a Optional_PXAxisVersion entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "2000" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// If there exists a Optional_PXCharset entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "ANSI" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If there exists a Optional_PXDescriptionDefault entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise false + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") + /// + /// + /// + internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, PXMetaAdmValues metaAdm) + { + string noLanguage = null; + string subkey = null; + StringCollection values = new StringCollection(); + + values.Add(metaAdm.PXCharset); + handler(PXKeywords.CHARSET, noLanguage, subkey, values); + + + values.Clear(); + values.Add(metaAdm.PXAxisVersion); + handler(PXKeywords.AXIS_VERSION, noLanguage, subkey, values); + + values.Clear(); + values.Add(metaAdm.PXCodepage); + handler(PXKeywords.CODEPAGE, noLanguage, subkey, values); + + values.Clear(); + if (metaAdm.PXDescriptionDefault) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.DESCRIPTIONDEFAULT, noLanguage, subkey, values); + + values.Clear(); + + // string nowString = System.DateTime.UtcNow.ToString("yyyyMMdd hh:mm"); bug 193 wrong time + // string nowString = System.DateTime.Now.ToString(); + // string nowString = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm"); + // ørebro vedtak(beslut). + //ørebro 27.11.2012 Nytt formatvedtak //string nowString = System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz"); - string nowString = System.DateTime.Now.ToString("yyyyMMdd HH:mm"); + string nowString = System.DateTime.Now.ToString("yyyyMMdd HH:mm"); + + values.Add(nowString); - values.Add(nowString); - - handler(PXKeywords.CREATION_DATE, noLanguage, subkey, values); - } + handler(PXKeywords.CREATION_DATE, noLanguage, subkey, values); + } } diff --git a/PCAxis.Sql/Parser_21/PxSqlParserForCodelists_21.cs b/PCAxis.Sql/Parser_21/PxSqlParserForCodelists_21.cs index 06f7f41..56ee105 100644 --- a/PCAxis.Sql/Parser_21/PxSqlParserForCodelists_21.cs +++ b/PCAxis.Sql/Parser_21/PxSqlParserForCodelists_21.cs @@ -13,12 +13,12 @@ public class PXSqlParserForCodelists_21 : PCAxis.PlugIn.Sql.PXSqlParserForCodeli { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlParserForCodelists_21)); - + //private List _variables; private List _variables; - + private PXSqlMeta_21 mPXSqlMeta; - + #region Constructors @@ -27,38 +27,39 @@ public class PXSqlParserForCodelists_21 : PCAxis.PlugIn.Sql.PXSqlParserForCodeli ///
/// PXSqlMeta holding variables /// Name of the vaiable - public PXSqlParserForCodelists_21(PXSqlMeta_21 inPXSqlMeta, String variableCode) { - mPXSqlMeta = inPXSqlMeta; - _variables = new List(); - _variables.Add(inPXSqlMeta.VariablesClassification[variableCode]); + public PXSqlParserForCodelists_21(PXSqlMeta_21 inPXSqlMeta, String variableCode) + { + mPXSqlMeta = inPXSqlMeta; + _variables = new List(); + _variables.Add(inPXSqlMeta.VariablesClassification[variableCode]); } #endregion - + /// /// Sends the data /// /// /// - public override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) - { - foreach (PXSqlVariableClassification variable in _variables) - { - - variable.ParseForApplyValueSet(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); - } + public override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) + { + foreach (PXSqlVariableClassification variable in _variables) + { + variable.ParseForApplyValueSet(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); + } + + + } - } - /// - /// IDisposable implemenatation + /// IDisposable implemenatation /// - override public void Dispose() - { + override public void Dispose() + { mPXSqlMeta = null; } diff --git a/PCAxis.Sql/Parser_21/PxSqlParser_21.cs b/PCAxis.Sql/Parser_21/PxSqlParser_21.cs index 5e7b490..b6d02da 100644 --- a/PCAxis.Sql/Parser_21/PxSqlParser_21.cs +++ b/PCAxis.Sql/Parser_21/PxSqlParser_21.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Specialized; -using PCAxis.Paxiom; //ny @@ -8,6 +7,8 @@ using log4net; +using PCAxis.Paxiom; + namespace PCAxis.Sql.Parser_21 { public class PXSqlParser_21 : PCAxis.PlugIn.Sql.PXSqlParser @@ -24,7 +25,8 @@ public class PXSqlParser_21 : PCAxis.PlugIn.Sql.PXSqlParser public PXSqlParser_21() { } - public PXSqlParser_21(PXSqlMeta_21 inPXSqlMeta) { + public PXSqlParser_21(PXSqlMeta_21 inPXSqlMeta) + { mPXSqlMeta = inPXSqlMeta; if (mPXSqlMeta.inPresentationModus) @@ -85,18 +87,21 @@ public PXSqlParser_21(PXSqlMeta_21 inPXSqlMeta) { /// /// /// - override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) { + override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) + { string keyword; - + string noLanguage = null; string subkey = null; StringCollection values; - if (mHasParsedMeta) { + if (mHasParsedMeta) + { return; } - if (mPXSqlMeta.HasLanguage) { + if (mPXSqlMeta.HasLanguage) + { // Language keyword = PXKeywords.LANGUAGE; values = new StringCollection(); @@ -106,7 +111,8 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, // Languages keyword = PXKeywords.LANGUAGES; values = new StringCollection(); - foreach (string lang in mPXSqlMeta.LanguageCodes) { + foreach (string lang in mPXSqlMeta.LanguageCodes) + { values.Add(lang); } handler(keyword, noLanguage, subkey, values); @@ -123,7 +129,8 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, - foreach (PXSqlVariable var in mPXSqlMeta.Variables.Values) { + foreach (PXSqlVariable var in mPXSqlMeta.Variables.Values) + { var.ParseMeta(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); } @@ -133,44 +140,51 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, // Footnotes #region Footnotes //CellNote - foreach (string langCode in mPXSqlMeta.LanguageCodes) { + foreach (string langCode in mPXSqlMeta.LanguageCodes) + { mPXSqlMeta.CellNotes.ParseNote(mPXSqlMeta, handler, langCode); } //MainTableNote + SubTableNote + VariableNotes + ContentsNotes - foreach (string langCode in mPXSqlMeta.LanguageCodes) { + foreach (string langCode in mPXSqlMeta.LanguageCodes) + { mPXSqlMeta.PaxiomNotes.ParseNote(mPXSqlMeta, handler, langCode); } - + //MaintValueNotes - foreach (string langCode in mPXSqlMeta.LanguageCodes) { + foreach (string langCode in mPXSqlMeta.LanguageCodes) + { mPXSqlMeta.MaintValueNotes.ParseNote(mPXSqlMeta, handler, langCode); } //ValueNotes - foreach (string langCode in mPXSqlMeta.LanguageCodes) { + foreach (string langCode in mPXSqlMeta.LanguageCodes) + { mPXSqlMeta.ValueNotes.ParseNote(mPXSqlMeta, handler, langCode); } //ContValueNotes - foreach (string langCode in mPXSqlMeta.LanguageCodes) { + foreach (string langCode in mPXSqlMeta.LanguageCodes) + { mPXSqlMeta.ContValueNotes.ParseNote(mPXSqlMeta, handler, langCode); } //ContTimeNotes - foreach (string langCode in mPXSqlMeta.LanguageCodes) { + foreach (string langCode in mPXSqlMeta.LanguageCodes) + { mPXSqlMeta.ContTimeNotes.ParseNote(mPXSqlMeta, handler, langCode); } - + //ContVblNotes - foreach (string langCode in mPXSqlMeta.LanguageCodes) { + foreach (string langCode in mPXSqlMeta.LanguageCodes) + { mPXSqlMeta.ContVblNotes.ParseNote(mPXSqlMeta, handler, langCode); } - - + + #endregion Footnotes #region NPMish stuff - if (mPXSqlMeta.inPresentationModus ) + if (mPXSqlMeta.inPresentationModus) { if (String.Compare(mPXSqlMeta.MetaModelVersion, "2.0", false, System.Globalization.CultureInfo.InvariantCulture) > 0) { @@ -232,12 +246,14 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, /// /// IDisposable implemenatation /// - override public void Dispose() { - if (mPXSqlMeta != null) { + override public void Dispose() + { + if (mPXSqlMeta != null) + { mPXSqlMeta.Dispose(); } } - + } } diff --git a/PCAxis.Sql/Parser_21/PxSqlValues.cs b/PCAxis.Sql/Parser_21/PxSqlValues.cs index 803791b..1d7593a 100644 --- a/PCAxis.Sql/Parser_21/PxSqlValues.cs +++ b/PCAxis.Sql/Parser_21/PxSqlValues.cs @@ -1,16 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Text; -using log4net; +using System.Collections.Generic; + +using log4net; namespace PCAxis.Sql.Parser_21 { - public class PxSqlValues:Dictionary + public class PxSqlValues : Dictionary { #region contants - private static readonly ILog log = LogManager.GetLogger(typeof(PxSqlValues)); - + private static readonly ILog log = LogManager.GetLogger(typeof(PxSqlValues)); + #endregion internal List GetValuesForSelectedValueset(string selectedValueset) { @@ -21,7 +20,7 @@ internal List GetValuesForSelectedValueset(string selectedValueset) valuesetsValues.Add(value); else if (value.ValueSet == selectedValueset) - valuesetsValues.Add(value); + valuesetsValues.Add(value); } return valuesetsValues; } @@ -39,7 +38,7 @@ internal List GetValuesSortedByVSValue(List values) } internal List GetValuesSortedByValue(List values) { - + List sortedValueList = new List(); foreach (PXSqlValue value in values) { diff --git a/PCAxis.Sql/Parser_21/SqlCollection.cs b/PCAxis.Sql/Parser_21/SqlCollection.cs index fa76844..a5e3004 100644 --- a/PCAxis.Sql/Parser_21/SqlCollection.cs +++ b/PCAxis.Sql/Parser_21/SqlCollection.cs @@ -1,18 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Text; using System.Collections.Specialized; namespace PCAxis.Sql.Parser_21 { - // brukes ikke lenger da generisk dictionary benyttes istedet - class SqlCollection: NameObjectCollectionBase where T:ISqlItem + // brukes ikke lenger da generisk dictionary benyttes istedet + class SqlCollection : NameObjectCollectionBase where T : ISqlItem { #region add public void Add(T collItem) { - base.BaseAdd(collItem.Name,collItem); + base.BaseAdd(collItem.Name, collItem); } #endregion #region remove @@ -22,7 +18,7 @@ public void Remove(T collItem) } #endregion #region locate - public T Item (string Name) + public T Item(string Name) { return (T)base.BaseGet(Name/*.ToUpper()*/); diff --git a/PCAxis.Sql/Parser_21/Texts.cs b/PCAxis.Sql/Parser_21/Texts.cs index bdd227c..71d1bd1 100644 --- a/PCAxis.Sql/Parser_21/Texts.cs +++ b/PCAxis.Sql/Parser_21/Texts.cs @@ -1,13 +1,11 @@ -using System; using System.Collections.Generic; -using System.Text; namespace PCAxis.Sql.Parser_21 { // This class should read from a configuration file. class Texts { - private Dictionary mPaxiomAnd; + private Dictionary mPaxiomAnd; public Dictionary PaxiomAnd { get { return mPaxiomAnd; } @@ -28,16 +26,16 @@ public Dictionary PaxiomType } public Texts() { - mPaxiomAnd = new Dictionary(); + mPaxiomAnd = new Dictionary(); mPaxiomBy = new Dictionary(); mPaxiomType = new Dictionary(); - mPaxiomAnd["en"] = "and"; - mPaxiomBy["en"] = "by"; - mPaxiomType["en"] = "type"; - mPaxiomAnd["no"] = "og"; - mPaxiomBy["no"] = "etter"; - mPaxiomType["no"] = "type"; + mPaxiomAnd["en"] = "and"; + mPaxiomBy["en"] = "by"; + mPaxiomType["en"] = "type"; + mPaxiomAnd["no"] = "og"; + mPaxiomBy["no"] = "etter"; + mPaxiomType["no"] = "type"; } } diff --git a/PCAxis.Sql/Parser_22/ISqlItem.cs b/PCAxis.Sql/Parser_22/ISqlItem.cs index 1ddd335..f137864 100644 --- a/PCAxis.Sql/Parser_22/ISqlItem.cs +++ b/PCAxis.Sql/Parser_22/ISqlItem.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace PCAxis.Sql.Parser_22 { public interface ISqlItem diff --git a/PCAxis.Sql/Parser_22/PXMetaAdmValues.cs b/PCAxis.Sql/Parser_22/PXMetaAdmValues.cs index 9093f63..21f5a47 100644 --- a/PCAxis.Sql/Parser_22/PXMetaAdmValues.cs +++ b/PCAxis.Sql/Parser_22/PXMetaAdmValues.cs @@ -1,16 +1,19 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_22; + using log4net; + using PCAxis.Sql.DbConfig; +using PCAxis.Sql.QueryLib_22; -namespace PCAxis.Sql.Parser_22 { +namespace PCAxis.Sql.Parser_22 +{ /// /// Gets the values from the MetaAdm table or their defaults. /// - public class PXMetaAdmValues { + public class PXMetaAdmValues + { private static readonly ILog log = LogManager.GetLogger(typeof(PXMetaAdmValues)); @@ -21,7 +24,8 @@ public class PXMetaAdmValues { /// /// returns the PXCodepage from database (optional) or the default /// - internal string PXCodepage { + internal string PXCodepage + { get { return _PXCodepage; } } @@ -29,7 +33,8 @@ internal string PXCodepage { /// /// returns the PXCharset from database (optional) or the default /// - internal string PXCharset { + internal string PXCharset + { get { return _PXCharset; } } @@ -37,7 +42,8 @@ internal string PXCharset { /// /// returns the PXAxisVersion from database (optional) or the default /// - internal string PXAxisVersion { + internal string PXAxisVersion + { get { return _PXAxisVersion; } } @@ -46,7 +52,8 @@ internal string PXAxisVersion { /// /// returns the PXDescriptionDefault from database (optional) or the default /// - internal bool PXDescriptionDefault { + internal bool PXDescriptionDefault + { get { return _PXDescriptionDefault; } } @@ -63,7 +70,8 @@ internal bool AllwaysUseMaintablePrestextSInDynamicTitle /// /// Gets the ID for DataNotAvailable /// - internal string DataNotAvailable{ + internal string DataNotAvailable + { get { return _DataNotAvailable; } } @@ -103,7 +111,7 @@ internal string DefaultCodeMissingLine { get { return _DefaultCodeMissingLine; } } - + #endregion fields & properties @@ -122,68 +130,76 @@ public PXMetaAdmValues(MetaQuery mMetaQuery) if (altIBasen.ContainsKey(Keywords.DataNotAvailable)) { _DataNotAvailable = altIBasen[Keywords.DataNotAvailable].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataNotAvailable + " not found in table with modelname MetaAdm."); - } - - if (altIBasen.ContainsKey(Keywords.DataNoteSum)) - { - _DataNoteSum = altIBasen[Keywords.DataNoteSum].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataNoteSum + " not found in table with modelname MetaAdm."); - } - - - if (altIBasen.ContainsKey(Keywords.DataSymbolNIL)) - { - _DataSymbolNIL = altIBasen[Keywords.DataSymbolNIL].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataSymbolNIL + " not found in table with modelname MetaAdm."); - } - - if (altIBasen.ContainsKey(Keywords.DataSymbolSum)) - { - _DataSymbolSum = altIBasen[Keywords.DataSymbolSum].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataSymbolSum + " not found in table with modelname MetaAdm."); - } - - - if (altIBasen.ContainsKey(Keywords.DefaultCodeMissingLine)) - { - _DefaultCodeMissingLine = altIBasen[Keywords.DefaultCodeMissingLine].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DefaultCodeMissingLine + " not found in table with modelname MetaAdm."); - } + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataNotAvailable + " not found in table with modelname MetaAdm."); + } + + if (altIBasen.ContainsKey(Keywords.DataNoteSum)) + { + _DataNoteSum = altIBasen[Keywords.DataNoteSum].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataNoteSum + " not found in table with modelname MetaAdm."); + } + + + if (altIBasen.ContainsKey(Keywords.DataSymbolNIL)) + { + _DataSymbolNIL = altIBasen[Keywords.DataSymbolNIL].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataSymbolNIL + " not found in table with modelname MetaAdm."); + } + + if (altIBasen.ContainsKey(Keywords.DataSymbolSum)) + { + _DataSymbolSum = altIBasen[Keywords.DataSymbolSum].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataSymbolSum + " not found in table with modelname MetaAdm."); + } + + + if (altIBasen.ContainsKey(Keywords.DefaultCodeMissingLine)) + { + _DefaultCodeMissingLine = altIBasen[Keywords.DefaultCodeMissingLine].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DefaultCodeMissingLine + " not found in table with modelname MetaAdm."); + } //Optional //PXCodepage - if (Keywords.Optional_PXCodepage != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXCodepage)) { + if (Keywords.Optional_PXCodepage != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXCodepage)) + { _PXCodepage = altIBasen[Keywords.Optional_PXCodepage].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXCodepage + " not found in table with modelname MetaAdm."); } } //PXDescriptionDefault - if (Keywords.Optional_PXDescriptionDefault != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXDescriptionDefault)) { + if (Keywords.Optional_PXDescriptionDefault != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXDescriptionDefault)) + { _PXDescriptionDefault = altIBasen[Keywords.Optional_PXDescriptionDefault].Value.Equals(dbConfig.Codes.Yes); - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXDescriptionDefault + " not found in table with modelname MetaAdm."); } } @@ -202,29 +218,37 @@ public PXMetaAdmValues(MetaQuery mMetaQuery) //PXCharset - if (Keywords.Optional_PXCharset != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXCharset)) { + if (Keywords.Optional_PXCharset != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXCharset)) + { _PXCharset = altIBasen[Keywords.Optional_PXCharset].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXCharset + " not found in table with modelname MetaAdm."); } } //PXAxisVersion - if (Keywords.Optional_PXAxisVersion != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXAxisVersion)) { + if (Keywords.Optional_PXAxisVersion != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXAxisVersion)) + { _PXAxisVersion = altIBasen[Keywords.Optional_PXAxisVersion].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXAxisVersion + " not found in table with modelname MetaAdm."); } } } - - - + + + } } diff --git a/PCAxis.Sql/Parser_22/PXSqlContact.cs b/PCAxis.Sql/Parser_22/PXSqlContact.cs index 9053d86..1b15130 100644 --- a/PCAxis.Sql/Parser_22/PXSqlContact.cs +++ b/PCAxis.Sql/Parser_22/PXSqlContact.cs @@ -1,12 +1,10 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; -using PCAxis.Sql.QueryLib_22; -using System.Collections.Specialized; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Sql.QueryLib_22; + namespace PCAxis.Sql.Parser_22 { @@ -40,21 +38,22 @@ public PXSqlContact(PXSqlMeta_22 meta, string mMainTableId) Dictionary personIDs = new Dictionary(); try { - foreach (KeyValuePair RoleHead in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleHead,false)) + foreach (KeyValuePair RoleHead in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleHead, false)) { if (!personIDs.ContainsKey(RoleHead.Key)) { personIDs.Add(RoleHead.Key, RoleHead.Value); } } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant add RoleHead", e); } try { - foreach (KeyValuePair RoleContact in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleContact,false)) + foreach (KeyValuePair RoleContact in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleContact, false)) { if (!personIDs.ContainsKey(RoleContact.Key)) @@ -62,12 +61,13 @@ public PXSqlContact(PXSqlMeta_22 meta, string mMainTableId) personIDs.Add(RoleContact.Key, RoleContact.Value); } } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant add RoleContact", e); } - + bool firstPerson = true; @@ -93,18 +93,19 @@ public PXSqlContact(PXSqlMeta_22 meta, string mMainTableId) - mBigFatContactStringsByLanguage[language] += person.Forename + " " + person.Surname + ", " + org.texts[language].OrganizationName + - "# "+ PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactPhone", language)+": " + person.PhonePrefix + " " + person.PhoneNo + + mBigFatContactStringsByLanguage[language] += person.Forename + " " + person.Surname + ", " + org.texts[language].OrganizationName + + "# " + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactPhone", language) + ": " + person.PhonePrefix + " " + person.PhoneNo + "#" + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactFax", language) + ": " + person.PhonePrefix + " " + person.FaxNo + "#" + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactEMail", language) + ": " + person.Email; - + } firstPerson = false; } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant find contact info", e); } diff --git a/PCAxis.Sql/Parser_22/PXSqlContent.cs b/PCAxis.Sql/Parser_22/PXSqlContent.cs index ff32491..e55cb0b 100644 --- a/PCAxis.Sql/Parser_22/PXSqlContent.cs +++ b/PCAxis.Sql/Parser_22/PXSqlContent.cs @@ -1,136 +1,141 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; -using PCAxis.Sql.QueryLib_22; using System.Collections.Specialized; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; +using PCAxis.Sql.QueryLib_22; + namespace PCAxis.Sql.Parser_22 { - public class PXSqlContent:IComparable + public class PXSqlContent : IComparable { - private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlContent)); - - #region value to be used if row is missing - - /// - /// must be 0, 2 or 3. 0 indicates presCellsZero = yes - /// - private string mCategoryOfCellsInMissingRows = "0"; - public string CategoryOfCellsInMissingRows { - get { return mCategoryOfCellsInMissingRows; } - } - - /// - /// the magicNumber (or 0 when category = 0) - /// - private double mValueOfCellsInMissingRows = 0; - public double ValueOfCellsInMissingRows { - get { return mValueOfCellsInMissingRows; } - } - #endregion value to be used if row is missing - - private ContentsRow mRow; - - /// - /// Contact is per maintable in the database, but per Content in paxiom. Thus we have to send the same contact for all Content. - /// - private PXSqlContact mContact; - - - - public PXSqlContent() { } - public PXSqlContent(ContentsRow row, PXSqlMeta_22 pxsqlMeta, SqlDbConfig_22 config, PXSqlContact contact) { - mRow = row; - mContact = contact; - //pxsqlMeta.MetaQuery.DB.Codes.Copyright1; - mContents = row.Contents; - //mFootnoteContents = row.FootnoteContents; - //mFootnoteTime = row.FootnoteTime; - //mFootnoteValue = row.FootnoteValue; - //mFootnoteVariable = row.FootnoteVariable; - mPresText = new Dictionary(); - mPresTextS = new Dictionary(); - mPresCode = row.PresCode; - - mBasePeriod = new Dictionary(); - mRefPeriod = new Dictionary(); - mUnit = new Dictionary(); - - - foreach (string langCode in pxsqlMeta.LanguageCodes) - { - mPresText[langCode] = row.texts[langCode].PresText; - mPresTextS[langCode] = row.texts[langCode].PresTextS; - mBasePeriod[langCode] = row.texts[langCode].BasePeriod; - mRefPeriod[langCode] = row.texts[langCode].RefPeriod; - mUnit[langCode] = row.texts[langCode].Unit; - } - - mPresDecimals = mRow.PresDecimals; - pxsqlMeta.DecimalHandler.ShowDecimals = mPresDecimals; - pxsqlMeta.DecimalHandler.StoreDecimals = mRow.StoreDecimals; - - mSeasAdj = mRow.SeasAdj.Equals(config.Codes.Yes); - mDayAdj = mRow.DayAdj.Equals(config.Codes.Yes); - mLastUpdatet = mRow.LastUpdated; - mStockFA = PaxiomifyStockFA(mRow.StockFA, config); - mCFPrices = PaxiomifyCFPrices(mRow.CFPrices, config); - - - mAggregPossible = ! mRow.AggregPossible.Equals(config.Codes.No); //not notPossible since yes is default - - #region mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows - if( pxsqlMeta.inPresentationModus && mRow.PresCellsZero.Equals(config.Codes.No)){ - - // both 2.1 and 2.2 uses a mRow.PresMissingLine from the SpecialCharacter.CharacterType( which is the primary key) - // or if mRow.PresMissingLine is missing: the default - - mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineMagic; - if (!( String.IsNullOrEmpty(mRow.PresMissingLine))) - { - mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine); - } - mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString(); - - } - #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows - } - - - - private string mContents; - public string Contents - { - get { return mContents;} - set { mContents = value;} - } - - private int mSortOrder; - public int SortOrder - { - get { return mSortOrder; } - set { mSortOrder = value; } - } - - private Dictionary mPresText; - public Dictionary PresText + private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlContent)); + + #region value to be used if row is missing + + /// + /// must be 0, 2 or 3. 0 indicates presCellsZero = yes + /// + private string mCategoryOfCellsInMissingRows = "0"; + public string CategoryOfCellsInMissingRows + { + get { return mCategoryOfCellsInMissingRows; } + } + + /// + /// the magicNumber (or 0 when category = 0) + /// + private double mValueOfCellsInMissingRows = 0; + public double ValueOfCellsInMissingRows + { + get { return mValueOfCellsInMissingRows; } + } + #endregion value to be used if row is missing + + private ContentsRow mRow; + + /// + /// Contact is per maintable in the database, but per Content in paxiom. Thus we have to send the same contact for all Content. + /// + private PXSqlContact mContact; + + + + public PXSqlContent() { } + public PXSqlContent(ContentsRow row, PXSqlMeta_22 pxsqlMeta, SqlDbConfig_22 config, PXSqlContact contact) + { + mRow = row; + mContact = contact; + //pxsqlMeta.MetaQuery.DB.Codes.Copyright1; + mContents = row.Contents; + //mFootnoteContents = row.FootnoteContents; + //mFootnoteTime = row.FootnoteTime; + //mFootnoteValue = row.FootnoteValue; + //mFootnoteVariable = row.FootnoteVariable; + mPresText = new Dictionary(); + mPresTextS = new Dictionary(); + mPresCode = row.PresCode; + + mBasePeriod = new Dictionary(); + mRefPeriod = new Dictionary(); + mUnit = new Dictionary(); + + + foreach (string langCode in pxsqlMeta.LanguageCodes) + { + mPresText[langCode] = row.texts[langCode].PresText; + mPresTextS[langCode] = row.texts[langCode].PresTextS; + mBasePeriod[langCode] = row.texts[langCode].BasePeriod; + mRefPeriod[langCode] = row.texts[langCode].RefPeriod; + mUnit[langCode] = row.texts[langCode].Unit; + } + + mPresDecimals = mRow.PresDecimals; + pxsqlMeta.DecimalHandler.ShowDecimals = mPresDecimals; + pxsqlMeta.DecimalHandler.StoreDecimals = mRow.StoreDecimals; + + mSeasAdj = mRow.SeasAdj.Equals(config.Codes.Yes); + mDayAdj = mRow.DayAdj.Equals(config.Codes.Yes); + mLastUpdatet = mRow.LastUpdated; + mStockFA = PaxiomifyStockFA(mRow.StockFA, config); + mCFPrices = PaxiomifyCFPrices(mRow.CFPrices, config); + + + mAggregPossible = !mRow.AggregPossible.Equals(config.Codes.No); //not notPossible since yes is default + + #region mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows + if (pxsqlMeta.inPresentationModus && mRow.PresCellsZero.Equals(config.Codes.No)) + { + + // both 2.1 and 2.2 uses a mRow.PresMissingLine from the SpecialCharacter.CharacterType( which is the primary key) + // or if mRow.PresMissingLine is missing: the default + + mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineMagic; + if (!(String.IsNullOrEmpty(mRow.PresMissingLine))) + { + mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine); + } + mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString(); + + } + #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows + } + + + + private string mContents; + public string Contents + { + get { return mContents; } + set { mContents = value; } + } + + private int mSortOrder; + public int SortOrder + { + get { return mSortOrder; } + set { mSortOrder = value; } + } + + private Dictionary mPresText; + public Dictionary PresText { get { return mPresText; } set { mPresText = value; } } - private Dictionary mPresTextS; - public Dictionary PresTextS + private Dictionary mPresTextS; + public Dictionary PresTextS { get { return mPresTextS; } set { mPresTextS = value; } } - - private string mPresCode; + + private string mPresCode; public string PresCode { get { return mPresCode; } @@ -145,20 +150,20 @@ public Dictionary UNIT - //Ikke i bruk + //Ikke i bruk - //private string mProducer; - // public string Producer - // { - // get { return mProducer; } - // set { mProducer = value; } - // } + //private string mProducer; + // public string Producer + // { + // get { return mProducer; } + // set { mProducer = value; } + // } #region ContentInfo in Paxiom private Dictionary mRefPeriod; - // private Dictionary mUnit; + // private Dictionary mUnit; private Dictionary mBasePeriod; private string mLastUpdatet; @@ -178,312 +183,339 @@ public Dictionary UNIT // set { mPublished = value; } //} - private string mPresDecimals; - + private string mPresDecimals; + - public string PresCellsZero { + public string PresCellsZero + { get { return mRow.PresCellsZero; } } - public string PresMissingLine { + public string PresMissingLine + { get { return mRow.PresMissingLine; } } - private bool mAggregPossible; + private bool mAggregPossible; public bool AggregPossible { get { return mAggregPossible; } } - - private string mStoreColumnNo; + + private string mStoreColumnNo; public string StoreColumnNo { get { return mStoreColumnNo; } set { mStoreColumnNo = value; } } - private string mStoreFormat; + private string mStoreFormat; public string StoreFormat { get { return mStoreFormat; } set { mStoreFormat = value; } } - private string mStoreNoChar; + private string mStoreNoChar; public string StoreNoChar { get { return mStoreNoChar; } set { mStoreNoChar = value; } } - //private string mStoreDecimals; - // public string StoreDecimals - // { - // get { return mStoreDecimals; } - // set { mStoreDecimals = value; } - // } + //private string mStoreDecimals; + // public string StoreDecimals + // { + // get { return mStoreDecimals; } + // set { mStoreDecimals = value; } + // } - private string mUserid; + private string mUserid; public string Userid { get { return mUserid; } set { mUserid = value; } } - private string mLogDate; + private string mLogDate; public string LogDate { get { return mLogDate; } set { mLogDate = value; } - + + } + + + public int CompareTo(PXSqlContent compPXSqlContent) + { + return mSortOrder.CompareTo(compPXSqlContent.mSortOrder); } - - - public int CompareTo(PXSqlContent compPXSqlContent) - { - return mSortOrder.CompareTo(compPXSqlContent.mSortOrder); - } - - /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - /// - /// - /// - /// - /// - ///
- /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// If value in database equals to CFPricesC code in db config file then set to PXConstant.CFPRICES_CURRENT. - /// If value in database equals to CFPricesF code in db config file then set to PXConstant.CFPRICES_FIXED. - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. Maps the code in dbconfig file to PX PXConstant - /// StockFAS-->STOCKFA_STOCK, StockFAF-->STOCKFA_FLOW,StockFAA-->STOCKFA_AVERAGE. - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// Holds the Contents.Contents from database so it could be referenced back to from paxiom - /// - /// - ///
- ///
- ///
- public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes) - { - - StringCollection values = new StringCollection(); - - //string subkey = this.Contents; - string subkey = this.PresCode; //prescode should be Code i Paxiom. Contents is sent as Reference_is an ouse as code i PXS. - - foreach (string langCode in LanguageCodes) { - - // BASEPERIOD - values.Clear(); - values.Add(this.mBasePeriod[langCode]); - handler(PXKeywords.BASEPERIOD, langCode, subkey, values); - - - // CONTACT - values.Clear(); - values.Add(this.mContact.GetBigFatContactString(langCode)); - handler(PXKeywords.CONTACT, langCode, subkey, values); - - - // REFPERIOD - values.Clear(); - values.Add(this.mRefPeriod[langCode]); - handler(PXKeywords.REFPERIOD, langCode, subkey, values); - - - // UNITS - values.Clear(); - values.Add(this.mUnit[langCode]); - handler(PXKeywords.UNITS, langCode, subkey, values); - - } - - string noLanguage = null; - - // CFPRICES - values.Clear(); - values.Add(this.mCFPrices); - handler(PXKeywords.CFPRICES, noLanguage, subkey, values); - - - // LAST_UPDATED - values.Clear(); - values.Add(this.mLastUpdatet); - handler(PXKeywords.LAST_UPDATED, noLanguage, subkey, values); - - //SEASADJ - values.Clear(); - if (this.mSeasAdj) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.SEASADJ, noLanguage, subkey, values); - - //DAYADJ - values.Clear(); - - if (this.mDayAdj) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.DAYADJ, noLanguage, subkey, values); - - //STOCKFA - values.Clear(); - values.Add(this.mStockFA); - handler(PXKeywords.STOCKFA, noLanguage, subkey, values); - - //PRECISION - if (!String.IsNullOrEmpty(this.mPresDecimals)) - { - values.Clear(); - values.Add(this.mPresDecimals); - String myKey = PXSqlMeta_22.mContVariableCode + "\",\"" + subkey;//for PXModelBuilder.SplittString A","B","C - // not "A","B","C" - log.Debug("Sender precision for " + myKey); - handler(PXKeywords.PRECISION, noLanguage, myKey, values); - } - - - - //REFRENCE_ID Used to hold unique Id of Content in Paxiom. This will be used in pxs to identify selected contents - // The resason why contents is placed in Code fro the value which represent the contents is that this is occupied by PresCode. - values.Clear(); - values.Add(this.Contents); - handler(PXKeywords.REFRENCE_ID, noLanguage, subkey, values); - } - - - - - internal void AdjustPresDecimalsToCommonDecimals(string Decimals) { - log.Debug(Decimals.Equals(mPresDecimals)); - if(Decimals.Equals(mPresDecimals)){ - - mPresDecimals = String.Empty; - } - } - - /** - * Translates database code to Paxiom code for StockFA. - */ - private string PaxiomifyStockFA(string StockFA,SqlDbConfig_22 config) { - string myOut = ""; - if (! String.IsNullOrEmpty(StockFA) ) { - if (StockFA.Equals(config.Codes.StockFAS)) { - myOut = PXConstant.STOCKFA_STOCK; - } else if (StockFA.Equals(config.Codes.StockFAA)) { - myOut = PXConstant.STOCKFA_AVERAGE; - } else if (StockFA.Equals(config.Codes.StockFAF)) { - myOut = PXConstant.STOCKFA_FLOW; - } else { - myOut = PXConstant.STOCKFA_OTHER; - //throw new ApplicationException("Unknown StockFA code:\"" + StockFA + "\""); - } - } - return myOut; - } - /**Translates database code to Paxiom code for CFPrices*/ - private string PaxiomifyCFPrices(string CFPrices, SqlDbConfig_22 config) { - string myOut = ""; - if (! String.IsNullOrEmpty(CFPrices)) { - if (CFPrices.Equals(config.Codes.CFPricesC)) { - myOut = PXConstant.CFPRICES_CURRENT; - } else if (CFPrices.Equals(config.Codes.CFPricesF)) { - myOut = PXConstant.CFPRICES_FIXED; - } else { - throw new ApplicationException("Unknown CFPrices code:\"" + CFPrices + "\""); - } - } - return myOut; - } - } - - - - + + /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + /// + /// + /// + /// + /// + ///
+ /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If value in database equals to CFPricesC code in db config file then set to PXConstant.CFPRICES_CURRENT. + /// If value in database equals to CFPricesF code in db config file then set to PXConstant.CFPRICES_FIXED. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. Maps the code in dbconfig file to PX PXConstant + /// StockFAS-->STOCKFA_STOCK, StockFAF-->STOCKFA_FLOW,StockFAA-->STOCKFA_AVERAGE. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Holds the Contents.Contents from database so it could be referenced back to from paxiom + /// + /// + ///
+ ///
+ ///
+ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes) + { + + StringCollection values = new StringCollection(); + + //string subkey = this.Contents; + string subkey = this.PresCode; //prescode should be Code i Paxiom. Contents is sent as Reference_is an ouse as code i PXS. + + foreach (string langCode in LanguageCodes) + { + + // BASEPERIOD + values.Clear(); + values.Add(this.mBasePeriod[langCode]); + handler(PXKeywords.BASEPERIOD, langCode, subkey, values); + + + // CONTACT + values.Clear(); + values.Add(this.mContact.GetBigFatContactString(langCode)); + handler(PXKeywords.CONTACT, langCode, subkey, values); + + + // REFPERIOD + values.Clear(); + values.Add(this.mRefPeriod[langCode]); + handler(PXKeywords.REFPERIOD, langCode, subkey, values); + + + // UNITS + values.Clear(); + values.Add(this.mUnit[langCode]); + handler(PXKeywords.UNITS, langCode, subkey, values); + + } + + string noLanguage = null; + + // CFPRICES + values.Clear(); + values.Add(this.mCFPrices); + handler(PXKeywords.CFPRICES, noLanguage, subkey, values); + + + // LAST_UPDATED + values.Clear(); + values.Add(this.mLastUpdatet); + handler(PXKeywords.LAST_UPDATED, noLanguage, subkey, values); + + //SEASADJ + values.Clear(); + if (this.mSeasAdj) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.SEASADJ, noLanguage, subkey, values); + + //DAYADJ + values.Clear(); + + if (this.mDayAdj) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.DAYADJ, noLanguage, subkey, values); + + //STOCKFA + values.Clear(); + values.Add(this.mStockFA); + handler(PXKeywords.STOCKFA, noLanguage, subkey, values); + + //PRECISION + if (!String.IsNullOrEmpty(this.mPresDecimals)) + { + values.Clear(); + values.Add(this.mPresDecimals); + String myKey = PXSqlMeta_22.mContVariableCode + "\",\"" + subkey;//for PXModelBuilder.SplittString A","B","C + // not "A","B","C" + log.Debug("Sender precision for " + myKey); + handler(PXKeywords.PRECISION, noLanguage, myKey, values); + } + + + + //REFRENCE_ID Used to hold unique Id of Content in Paxiom. This will be used in pxs to identify selected contents + // The resason why contents is placed in Code fro the value which represent the contents is that this is occupied by PresCode. + values.Clear(); + values.Add(this.Contents); + handler(PXKeywords.REFRENCE_ID, noLanguage, subkey, values); + } + + + + + internal void AdjustPresDecimalsToCommonDecimals(string Decimals) + { + log.Debug(Decimals.Equals(mPresDecimals)); + if (Decimals.Equals(mPresDecimals)) + { + + mPresDecimals = String.Empty; + } + } + + /** + * Translates database code to Paxiom code for StockFA. + */ + private string PaxiomifyStockFA(string StockFA, SqlDbConfig_22 config) + { + string myOut = ""; + if (!String.IsNullOrEmpty(StockFA)) + { + if (StockFA.Equals(config.Codes.StockFAS)) + { + myOut = PXConstant.STOCKFA_STOCK; + } + else if (StockFA.Equals(config.Codes.StockFAA)) + { + myOut = PXConstant.STOCKFA_AVERAGE; + } + else if (StockFA.Equals(config.Codes.StockFAF)) + { + myOut = PXConstant.STOCKFA_FLOW; + } + else + { + myOut = PXConstant.STOCKFA_OTHER; + //throw new ApplicationException("Unknown StockFA code:\"" + StockFA + "\""); + } + } + return myOut; + } + /**Translates database code to Paxiom code for CFPrices*/ + private string PaxiomifyCFPrices(string CFPrices, SqlDbConfig_22 config) + { + string myOut = ""; + if (!String.IsNullOrEmpty(CFPrices)) + { + if (CFPrices.Equals(config.Codes.CFPricesC)) + { + myOut = PXConstant.CFPRICES_CURRENT; + } + else if (CFPrices.Equals(config.Codes.CFPricesF)) + { + myOut = PXConstant.CFPRICES_FIXED; + } + else + { + throw new ApplicationException("Unknown CFPrices code:\"" + CFPrices + "\""); + } + } + return myOut; + } + } + + + + } diff --git a/PCAxis.Sql/Parser_22/PXSqlData_22.cs b/PCAxis.Sql/Parser_22/PXSqlData_22.cs index 4acd398..11d5f24 100644 --- a/PCAxis.Sql/Parser_22/PXSqlData_22.cs +++ b/PCAxis.Sql/Parser_22/PXSqlData_22.cs @@ -1,12 +1,15 @@ -namespace PCAxis.Sql.Parser_22 { +namespace PCAxis.Sql.Parser_22 +{ using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Data; + using log4net; + using PCAxis.Sql.Parser; /// @@ -22,7 +25,8 @@ namespace PCAxis.Sql.Parser_22 { /// Factor_i = 1 /// index = Factor_k*(k-1) + Factor_j*(j-1) + Factor_i(i-1) /// - public class PXSqlData_22:PXSqlData { + public class PXSqlData_22 : PXSqlData + { /// The Log private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlData_22)); #region members and propreties @@ -47,7 +51,7 @@ public class PXSqlData_22:PXSqlData { - + /// /// keys of the Output Variables in Reversed Output order. (Is List so that in can be reversed.) /// @@ -76,10 +80,10 @@ internal override string[] DataCellNotes return null; //not supported yet in this version } } - + private string sqlString = "select /" + "*+STAR_TRANSFORMATION *" + "/ "; - + /// /// The number of expected in-rows per out-row due to elimination by sum. /// (the product of the number of possible codes for each @@ -109,17 +113,18 @@ internal override string[] DataCellNotes #endregion members and propreties #region contructors - public PXSqlData_22(PXSqlMeta_22 mPXSqlMeta) { + public PXSqlData_22(PXSqlMeta_22 mPXSqlMeta) + { log.Debug("Start PXSqlData mPXSqlMeta.Name: " + mPXSqlMeta.Name); this.mMeta = mPXSqlMeta; - + symbols = mMeta.mPxsqlNpm; this.npm = mMeta.SpecCharExists; this.hasGrouping = mMeta.Variables.HasAnyoneGroupingOnNonstoredData(); -// .HasAnyoneGrouping(); + // .HasAnyoneGrouping(); this.eliminationBySum = mMeta.EliminatedVariablesExist; @@ -129,21 +134,27 @@ public PXSqlData_22(PXSqlMeta_22 mPXSqlMeta) { this.useSum = hasGrouping || eliminationBySum; - variableIDsInReverseOutputOrder = mMeta.GetVariableIDsInReverseOutputOrder(); + variableIDsInReverseOutputOrder = mMeta.GetVariableIDsInReverseOutputOrder(); numberOfOutputVariables = variableIDsInReverseOutputOrder.Count; mValueCount = new Dictionary(numberOfOutputVariables); mIndexFactor = new Dictionary(numberOfOutputVariables); - foreach (PXSqlVariable var in mMeta.Variables.Values) { - if (var.IsEliminatedByValue) { + foreach (PXSqlVariable var in mMeta.Variables.Values) + { + if (var.IsEliminatedByValue) + { log.Debug(var.Name + " Is Eliminated By Value"); keysOfEliminatedByValue.Add(var.Name); - } else if (var.IsContentVariable) { + } + else if (var.IsContentVariable) + { log.Debug(var.Name + " Is Content Variable"); theKeyOfTheContentsVariableVariable = var.Name; - } else if (!var.isSelected) { + } + else if (!var.isSelected) + { log.Debug(var.Name + " Is Eliminated By SUM"); keysOfEliminatedBySum.Add(var.Name); eliminationFactor *= var.TotalNumberOfValuesInDB; @@ -151,17 +162,22 @@ public PXSqlData_22(PXSqlMeta_22 mPXSqlMeta) { } #region init contKeys - if (String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) { //just one contVar + if (String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) + { //just one contVar throw new ApplicationException("Bug"); // the size of ContentsVariableVariable should not influence how it is stored // contKeys.Add( mMeta.FirstContents ); - } else { + } + else + { PXSqlVariable theContentsVariable = mMeta.Variables[theKeyOfTheContentsVariableVariable]; - foreach (PXSqlValue contCode in theContentsVariable.GetValuesForParsing()) { + foreach (PXSqlValue contCode in theContentsVariable.GetValuesForParsing()) + { //contKeys.Add(contCode.ValueCode); contKeys.Add(contCode.ContentsCode); // 2010.05.07 replaces line above because valuecode is now Prescode from contents. New contentscode added to PXSqlValue } - foreach (string contCode in theContentsVariable.Values.Keys) { + foreach (string contCode in theContentsVariable.Values.Keys) + { // contKeys.Add(contCode); } @@ -178,16 +194,19 @@ public PXSqlData_22(PXSqlMeta_22 mPXSqlMeta) { anyDefaultMRNotZero = false; // MR = missing record anyDefaultMROfCat3 = false; // MR = missing record - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { PXSqlContent tmpCont = mMeta.Contents[contCode]; log.Debug("PXSqlContents for " + contCode + " PresCellsZero:" + tmpCont.PresCellsZero + " PresMissingLine:" + tmpCont.PresMissingLine); CategoryOfCellsInMissingRows[contCount2] = tmpCont.CategoryOfCellsInMissingRows; ValueOfCellsInMissingRows[contCount2] = tmpCont.ValueOfCellsInMissingRows; - if (!CategoryOfCellsInMissingRows[contCount2].Equals("0")) { + if (!CategoryOfCellsInMissingRows[contCount2].Equals("0")) + { anyDefaultMRNotZero = true; - if (CategoryOfCellsInMissingRows[contCount2].Equals("3")) { + if (CategoryOfCellsInMissingRows[contCount2].Equals("3")) + { anyDefaultMROfCat3 = true; } } @@ -205,18 +224,21 @@ public PXSqlData_22(PXSqlMeta_22 mPXSqlMeta) { #endregion contructors - private void CreateSqlString() { + private void CreateSqlString() + { int TempNumber = 25; - + string sqlJoinString = ""; string sqlGroupByString = ""; string tempGroupFactorSQL = ""; - foreach (string key in variableIDsInReverseOutputOrder) { + foreach (string key in variableIDsInReverseOutputOrder) + { PXSqlVariable var = mMeta.Variables[key]; - - if (!var.IsContentVariable) { + + if (!var.IsContentVariable) + { #region if (!var.IsContentVariable) var.TempTableNo = TempNumber.ToString(); @@ -232,7 +254,7 @@ private void CreateSqlString() { var.TempTableName = mMeta.MetaQuery.MakeTempTable(var.Name, var.TempTableNo, groupCodes, 500, needGroupingFactor && var.UsesGroupingOnNonstoredData()); - } + } else { @@ -252,13 +274,16 @@ private void CreateSqlString() { sqlJoinString += " JOIN " + var.TempTableName + " ON dt." + key + " = " + var.TempTableName + ".a" + key + " "; - if (useSum) { + if (useSum) + { sqlGroupByString += ", Groupnr" + var.TempTableNo; } - if (npm) { + if (npm) + { //We need the grupp-variables in case of a DataNoteCell - if (useSum) { + if (useSum) + { sqlGroupByString += ", Group" + var.TempTableNo; } DataNoteCellId_Columns.Add("Group" + var.TempTableNo); @@ -266,8 +291,10 @@ private void CreateSqlString() { } // tempGroupFactorSQL will be used in an UPDATE statement to adjust the GroupFactor in the temptables - if (needGroupingFactor && var.UsesGroupingOnNonstoredData()) { - if (!String.IsNullOrEmpty(tempGroupFactorSQL)) { + if (needGroupingFactor && var.UsesGroupingOnNonstoredData()) + { + if (!String.IsNullOrEmpty(tempGroupFactorSQL)) + { tempGroupFactorSQL += " * "; } tempGroupFactorSQL += "MAX(GroupFactor" + var.TempTableNo + ")"; @@ -276,8 +303,10 @@ private void CreateSqlString() { #endregion sql #endregion } // (!var.IsContentVariable) - else { - if (npm) { + else + { + if (npm) + { DataNoteCellId_Columns.Add(""); } log.Debug(" is ContentVariable "); @@ -289,10 +318,14 @@ private void CreateSqlString() { // INDEXFACTOR string lPrevKey = ""; - foreach (string key in variableIDsInReverseOutputOrder) { - if (String.IsNullOrEmpty(lPrevKey)) { + foreach (string key in variableIDsInReverseOutputOrder) + { + if (String.IsNullOrEmpty(lPrevKey)) + { mIndexFactor.Add(key, 1); - } else { + } + else + { mIndexFactor.Add(key, mIndexFactor[lPrevKey] * mValueCount[lPrevKey]); } lPrevKey = key; @@ -303,11 +336,13 @@ private void CreateSqlString() { // CONTENTS - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { sqlString += getContSelectPart(contCode, useSum, npm); } - if (useSum) { + if (useSum) + { sqlString += " COUNT(*) AS SqlMarx777777, "; } //else { // sqlString += " 1 SqlMarx777777 , "; @@ -317,8 +352,10 @@ private void CreateSqlString() { string mindexSQLString = " ("; - foreach (string key in variableIDsInReverseOutputOrder) { - if (key.Equals(theKeyOfTheContentsVariableVariable)) { + foreach (string key in variableIDsInReverseOutputOrder) + { + if (key.Equals(theKeyOfTheContentsVariableVariable)) + { continue; } mindexSQLString += " " + mIndexFactor[key] + @@ -328,7 +365,8 @@ private void CreateSqlString() { sqlString += mindexSQLString; - if (needGroupingFactor) { + if (needGroupingFactor) + { sqlString += ", " + tempGroupFactorSQL + " GroupFactor "; } @@ -337,14 +375,17 @@ private void CreateSqlString() { sqlString += getFROMClause() + sqlJoinString; sqlString += "\n WHERE 1=1 "; - foreach (string key in keysOfEliminatedByValue) { - foreach (PXSqlValue val in mMeta.Variables[key].Values.Values) { // there will only be one + foreach (string key in keysOfEliminatedByValue) + { + foreach (PXSqlValue val in mMeta.Variables[key].Values.Values) + { // there will only be one sqlString += " AND " + key + " = '" + val.ValueCode + "'"; } } // GROUP BY - if (useSum) { + if (useSum) + { sqlString += " GROUP BY " + sqlGroupByString.Substring(1); } @@ -356,7 +397,8 @@ private void CreateSqlString() { /// creates and executes the sqlString and returns a double array /// /// - override public double[] CreateMatrix() { + override public double[] CreateMatrix() + { log.Debug("Start CreateMatrix()"); needGroupingFactor = anyDefaultMROfCat3 && hasGrouping; @@ -368,7 +410,8 @@ override public double[] CreateMatrix() { // the factor OfTheContentsVariableVariable: int contFactor = 100;// the value does not matter. it is either overwritten or multiplied by 0 - if (!String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) { + if (!String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) + { contFactor = mIndexFactor[theKeyOfTheContentsVariableVariable]; } @@ -379,19 +422,28 @@ override public double[] CreateMatrix() { //anyDefaultMRNotZero = true; - if (anyDefaultMRNotZero) { - if (String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) { - for (int i = 0; i < mSize; i++) { + if (anyDefaultMRNotZero) + { + if (String.IsNullOrEmpty(theKeyOfTheContentsVariableVariable)) + { + for (int i = 0; i < mSize; i++) + { myOut[i] = ValueOfCellsInMissingRows[0]; } - } else { + } + else + { int prevFactor = contFactor * contKeys.Count; - for (int cont = 0; cont < contKeys.Count; cont++) { - if (ValueOfCellsInMissingRows[cont] == 0) { + for (int cont = 0; cont < contKeys.Count; cont++) + { + if (ValueOfCellsInMissingRows[cont] == 0) + { continue; //myOut is already 0 } - for (int k = 0; k < mSize; k += prevFactor) { - for (int l = 0; l < contFactor; l++) { + for (int k = 0; k < mSize; k += prevFactor) + { + for (int l = 0; l < contFactor; l++) + { myOut[l + cont * contFactor + k] = ValueOfCellsInMissingRows[cont]; } } @@ -416,20 +468,26 @@ override public double[] CreateMatrix() { bool hasNoMissingRows = true; int missingRowsCnt = 0; log.Debug("npm :" + npm.ToString() + " useSum:" + useSum.ToString() + " Row count: " + myRows.Count.ToString()); - if ((!npm) && (!useSum)) { + if ((!npm) && (!useSum)) + { #region not npm and not useSum - foreach (DataRow sqlRow in myRows) { + foreach (DataRow sqlRow in myRows) + { contCount = 0; mIndex = int.Parse(sqlRow[MINDEX_COL].ToString()); - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { arrayIndex = mIndex + contFactor * contCount; hasBlankCells = int.Parse(sqlRow[contCode + "_NilCnt"].ToString()) > 0; #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value @@ -443,52 +501,73 @@ override public double[] CreateMatrix() { } #endregion not npm and not useSum - } else if ((!npm) && (useSum)) { + } + else if ((!npm) && (useSum)) + { #region not npm and useSum - - foreach (DataRow sqlRow in myRows) { + + foreach (DataRow sqlRow in myRows) + { contCount = 0; mIndex = int.Parse(sqlRow[MINDEX_COL].ToString()); - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { arrayIndex = mIndex + contFactor * contCount; hasBlankCells = int.Parse(sqlRow[contCode + "_NilCnt"].ToString()) > 0; - // log.Debug(sqlRow[contCode].ToString()); - + // log.Debug(sqlRow[contCode].ToString()); + - if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) { + if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) + { //missing rows are ignored #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value - } else { + } + else + { //must look for missing rows - if (needGroupingFactor) { + if (needGroupingFactor) + { hasNoMissingRows = eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) <= int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { hasNoMissingRows = eliminationFactor <= int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (hasNoMissingRows) { + if (hasNoMissingRows) + { #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value - } else { //has missing row (of cat 3) - if (hasBlankCells) {// and blank cells ( = DataNotAvailable = cat. 3 + } + else + { //has missing row (of cat 3) + if (hasBlankCells) + {// and blank cells ( = DataNotAvailable = cat. 3 //if (ValueOfCellsInMissingRows[contCount] != symbols.getDataNotAvailableDouble()) { - if (ValueOfCellsInMissingRows[contCount] != symbols.DataNotAvailableMagic) { + if (ValueOfCellsInMissingRows[contCount] != symbols.DataNotAvailableMagic) + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; } // else myOut[arrayIndex] =ValueOfCellsInMissingRows[contCount] done in init @@ -508,39 +587,54 @@ override public double[] CreateMatrix() { } #endregion not npm and useSum - } else if ((npm) && (!useSum)) { + } + else if ((npm) && (!useSum)) + { #region npm and not useSum - foreach (DataRow sqlRow in myRows) { + foreach (DataRow sqlRow in myRows) + { contCount = 0; mIndex = int.Parse(sqlRow[MINDEX_COL].ToString()); - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { arrayIndex = mIndex + contFactor * contCount; hasBlankCells = int.Parse(sqlRow[contCode + "_NilCnt"].ToString()) > 0; //if blankCellCnt > 0 has cat. 3 missing either for .._XMAX or the default (=DNA) string npmMax = sqlRow[contCode + "_XMAX"].ToString(); - if (String.IsNullOrEmpty(npmMax)) { + if (String.IsNullOrEmpty(npmMax)) + { #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value - } else if (npmMax.StartsWith("B1")) { - if (hasBlankCells) { + } + else if (npmMax.StartsWith("B1")) + { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); addDataNoteCell(npmMax.Substring(2), sqlRow, contCode); } - } else {// cat 2 or 3 + } + else + {// cat 2 or 3 //myOut[arrayIndex] = symbols.getSymbolsNoByCharType(npmMax.Substring(2)); myOut[arrayIndex] = symbols.DataSymbolNMagic(npmMax.Substring(2)); } @@ -557,56 +651,78 @@ override public double[] CreateMatrix() { } #endregion npm and not useSum - } else { // npm && useSum + } + else + { // npm && useSum #region npm and useSum - foreach (DataRow sqlRow in myRows) { + foreach (DataRow sqlRow in myRows) + { contCount = 0; mIndex = int.Parse(sqlRow[MINDEX_COL].ToString()); - foreach (string contCode in contKeys) { + foreach (string contCode in contKeys) + { arrayIndex = mIndex + contFactor * contCount; hasBlankCells = int.Parse(sqlRow[contCode + "_NilCnt"].ToString()) - int.Parse(sqlRow[contCode + "_XCOUNT"].ToString()) > 0; //if blankCellCnt > 0 har type 3 missing enten pga tom/blank celle string npmMax = sqlRow[contCode + "_XMAX"].ToString(); - if (String.IsNullOrEmpty(npmMax)) { + if (String.IsNullOrEmpty(npmMax)) + { #region npmMax missing // the region npmMax missing is a copy from !npm && useSum: - if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) { + if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) + { //missing rows are ignored #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value - } else { + } + else + { //must look for missing rows - if (needGroupingFactor) { + if (needGroupingFactor) + { hasNoMissingRows = eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) <= int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { hasNoMissingRows = eliminationFactor <= int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (hasNoMissingRows) { // no missing rows + if (hasNoMissingRows) + { // no missing rows #region DNA or normal value - if (hasBlankCells) { + if (hasBlankCells) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } #endregion DNA or normal value - } else { //has missing row (of cat 3) - if (hasBlankCells) {// and blank cells ( = DataNotAvailable = cat. 3 + } + else + { //has missing row (of cat 3) + if (hasBlankCells) + {// and blank cells ( = DataNotAvailable = cat. 3 //if (ValueOfCellsInMissingRows[contCount] != symbols.getDataNotAvailableDouble()) { - if (ValueOfCellsInMissingRows[contCount] != symbols.DataNotAvailableMagic) { + if (ValueOfCellsInMissingRows[contCount] != symbols.DataNotAvailableMagic) + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; } // else myOut[arrayIndex] =ValueOfCellsInMissingRows[contCount] done in init @@ -615,35 +731,52 @@ override public double[] CreateMatrix() { } #endregion npmMax missing - } else if (npmMax.StartsWith("C3")) { + } + else if (npmMax.StartsWith("C3")) + { #region npmMax is 3 // value will be a cat.3 : either DataSymbolSum or npmMax string npm3Min = sqlRow[contCode + "_3MIN"].ToString(); - if (!npmMax.Equals("C3" + npm3Min)) { + if (!npmMax.Equals("C3" + npm3Min)) + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; //} else if (hasBlankCells && symbols.getDoubleByCharacterType(npm3Min) != symbols.getDataNotAvailableDouble()) { - } else if (hasBlankCells && symbols.DataSymbolNMagic(npm3Min) != symbols.DataNotAvailableMagic) { + } + else if (hasBlankCells && symbols.DataSymbolNMagic(npm3Min) != symbols.DataNotAvailableMagic) + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; - } else { - if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) { //ignore missing rows + } + else + { + if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) + { //ignore missing rows //myOut[arrayIndex] = symbols.getDoubleByCharacterType(npm3Min); myOut[arrayIndex] = symbols.DataSymbolNMagic(npm3Min); - } else { // must check for missing rows + } + else + { // must check for missing rows //must look for missing rows - if (needGroupingFactor) { + if (needGroupingFactor) + { hasNoMissingRows = 1 > eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) - int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { hasNoMissingRows = 1 > eliminationFactor - int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (hasNoMissingRows) { + if (hasNoMissingRows) + { //myOut[arrayIndex] = symbols.getDoubleByCharacterType(npm3Min); myOut[arrayIndex] = symbols.DataSymbolNMagic(npm3Min); - } else { //has missing row - if (ValueOfCellsInMissingRows[contCount] != symbols.DataSymbolNMagic(npm3Min)) { + } + else + { //has missing row + if (ValueOfCellsInMissingRows[contCount] != symbols.DataSymbolNMagic(npm3Min)) + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; } // else : nmpMax equals the initialization-value @@ -654,27 +787,41 @@ override public double[] CreateMatrix() { #endregion npmMax is 3 //below: npmMax is cat. 1 or 2 but blank cells or missing rows migth give cat.3 - } else if (hasBlankCells) {// must add DataNotAvaliable + } + else if (hasBlankCells) + {// must add DataNotAvaliable #region has blankCell - if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) { //ignore missing rows + if (!CategoryOfCellsInMissingRows[contCount].Equals("3")) + { //ignore missing rows //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { // must look for missing rows - if (needGroupingFactor) { + } + else + { // must look for missing rows + if (needGroupingFactor) + { hasNoMissingRows = 1 > eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) - int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { hasNoMissingRows = 1 > eliminationFactor - int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (hasNoMissingRows) { + if (hasNoMissingRows) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { //has missing rows + } + else + { //has missing rows //if (ValueOfCellsInMissingRows[contCount] == symbols.getDataNotAvailableDouble()) { - if (ValueOfCellsInMissingRows[contCount] == symbols.DataNotAvailableMagic) { + if (ValueOfCellsInMissingRows[contCount] == symbols.DataNotAvailableMagic) + { //myOut[arrayIndex] = symbols.getDataNotAvailableDouble(); myOut[arrayIndex] = symbols.DataNotAvailableMagic; - } else { + } + else + { //myOut[arrayIndex] = symbols.getDataSymbolSumDouble(); myOut[arrayIndex] = symbols.DataSymbolSumMagic; } @@ -683,61 +830,90 @@ override public double[] CreateMatrix() { } #endregion has blankCell //below: npmMax is cat. 1 or 2 , no blank cells, but missing rows migth give cat.3 - } else if (CategoryOfCellsInMissingRows[contCount].Equals("3")) { + } + else if (CategoryOfCellsInMissingRows[contCount].Equals("3")) + { #region cat missingcells is 3 // must look for missing rows - if (needGroupingFactor) { + if (needGroupingFactor) + { missingRowsCnt = eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) - int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { missingRowsCnt = eliminationFactor - int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (missingRowsCnt < 1) { // no missing rows + if (missingRowsCnt < 1) + { // no missing rows string npm1Min = sqlRow[contCode + "_1MIN"].ToString(); - if (String.IsNullOrEmpty(npm1Min)) {//potential cat2 + if (String.IsNullOrEmpty(npm1Min)) + {//potential cat2 - if (sqlRow["SqlMarx777777"].ToString().Equals(sqlRow[contCode + "_XCOUNT"].ToString())) { + if (sqlRow["SqlMarx777777"].ToString().Equals(sqlRow[contCode + "_XCOUNT"].ToString())) + { // cat 2 ! //myOut[arrayIndex] = symbols.getDoubleByCharacterType(npmMax.Substring(2)); myOut[arrayIndex] = symbols.DataSymbolNMagic(npmMax.Substring(2)); - } else { // normal number + } + else + { // normal number myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); } - } else { // cat.1 ! + } + else + { // cat.1 ! myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); - if (npmMax.Equals("B1" + npm1Min)) { + if (npmMax.Equals("B1" + npm1Min)) + { addDataNoteCell(npm1Min, sqlRow, contCode); - } else { + } + else + { addDataNoteSum(sqlRow, contCode); } } } //else has missing rows : myOut[arrayIndex] = init value #endregion cat missingcells is 3 //below:npmMax is cat. 1 or 2 , no blank cells, missing rows are kat 0 or 2 ( cat 1 is not valid) - } else if (npmMax.StartsWith("B1")) { // missing row don't matter + } + else if (npmMax.StartsWith("B1")) + { // missing row don't matter #region npmMax is 1 myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); string npm1Min = sqlRow[contCode + "_1MIN"].ToString(); - if (npmMax.Equals("B1" + npm1Min)) { + if (npmMax.Equals("B1" + npm1Min)) + { addDataNoteCell(npm1Min, sqlRow, contCode); - } else { + } + else + { addDataNoteSum(sqlRow, contCode); } #endregion npmMax is 1 - } else { // //npmMax is cat. 2 , no blank cells, missing rows are kat 0 or 2 + } + else + { // //npmMax is cat. 2 , no blank cells, missing rows are kat 0 or 2 #region npmMax is 2 //all present and missing rows must be cat2 for myOut[arrayIndex] to be cat2 - if (!sqlRow["SqlMarx777777"].ToString().Equals(sqlRow[contCode + "_XCOUNT"])) { + if (!sqlRow["SqlMarx777777"].ToString().Equals(sqlRow[contCode + "_XCOUNT"])) + { myOut[arrayIndex] = double.Parse(sqlRow[contCode].ToString()); //below: all present rows are cat. 2 - } else if (CategoryOfCellsInMissingRows[contCount].Equals("0")) { + } + else if (CategoryOfCellsInMissingRows[contCount].Equals("0")) + { // must look for missing rows - if (needGroupingFactor) { + if (needGroupingFactor) + { hasNoMissingRows = 1 > eliminationFactor * int.Parse(sqlRow["GROUPFACTOR"].ToString()) - int.Parse(sqlRow["SqlMarx777777"].ToString()); - } else { + } + else + { hasNoMissingRows = 1 > eliminationFactor - int.Parse(sqlRow["SqlMarx777777"].ToString()); } - if (hasNoMissingRows) { // no missing rows + if (hasNoMissingRows) + { // no missing rows //myOut[arrayIndex] = symbols.getDoubleByCharacterType(npmMax.Substring(2)); myOut[arrayIndex] = symbols.DataSymbolNMagic(npmMax.Substring(2)); } //else myOut[arrayIndex] = 0 but that has been done in init @@ -756,7 +932,8 @@ override public double[] CreateMatrix() { #endregion npm and useSum } - foreach (string key in variableIDsInReverseOutputOrder) { + foreach (string key in variableIDsInReverseOutputOrder) + { log.Debug("key: " + key + " lIndexFactor: " + mIndexFactor[key] + " antVerdier:" + mValueCount[key]); } @@ -776,25 +953,31 @@ override public double[] CreateMatrix() { /// true if sum should be used /// true if npm should be used /// select string for one contents column - private string getContSelectPart(string contCode, bool Sum, bool npm) { + private string getContSelectPart(string contCode, bool Sum, bool npm) + { //SUM(Sysselsatte) Sysselsatte, MAX(Sysselsatte_x) Sysselsatte_xMax, string myOut = ""; - if (Sum) { + if (Sum) + { myOut = " SUM(dt." + contCode + ") AS "; // trenger vi en AS ? - } else { + } + else + { myOut += " dt."; } myOut += contCode + ", "; - if (Sum) { + if (Sum) + { myOut += " SUM"; } myOut += "(CASE WHEN dt." + contCode + " IS NULL THEN 1 ELSE 0 END) AS " + contCode + "_NilCnt, "; - if (npm) { + if (npm) + { //string mo= ; //ver 3,14 myOut += " MAX(" + contCode + "_x) " + contCode + "_xMax ,"; string CodeForNo = "'" + mMeta.MetaQuery.DB.Codes.No + "'"; @@ -809,28 +992,31 @@ private string getContSelectPart(string contCode, bool Sum, bool npm) { myOut += "\n "; - if (Sum) { + if (Sum) + { myOut += "MAX("; } string[] tmpConcatArray = new string[2]; tmpConcatArray[0] = caseString; tmpConcatArray[1] = "st." + SpecialCharacter.CharacterTypeCol.PureColumnName(); - + myOut += "(SELECT " + mMeta.MetaQuery.GetPxSqlCommand().getConcatString(tmpConcatArray) + " x_x\n"; - -// myOut += "(SELECT CONCAT(" + caseString + ", st." + -// SpecialCharacter.CharacterType + ") x_x\n"; + + // myOut += "(SELECT CONCAT(" + caseString + ", st." + + // SpecialCharacter.CharacterType + ") x_x\n"; myOut += " FROM " + mMeta.MetaQuery.DB.MetaOwner + SpecialCharacter.TableName + " st \n"; myOut += " WHERE st." + SpecialCharacter.CharacterTypeCol.PureColumnName() + " = dt." + contCode + "_X ) \n"; - if (Sum) { + if (Sum) + { myOut += ") "; } myOut += " AS " + contCode + "_xMax, "; myOut += "\n "; - if (Sum) { + if (Sum) + { // min(select st.TeckenTyp from StatMeta.SpecialTecken st // where st.TeckenTyp = dt.Sysselsatte_x and st.Summerbar = 'N') Sysselsatte_xMin_3 myOut += " MIN(("; @@ -864,16 +1050,22 @@ private string getContSelectPart(string contCode, bool Sum, bool npm) { /// creates the FROM part of the sql ///
/// - private string getFROMClause() { + private string getFROMClause() + { string myOut = "FROM "; StringCollection tmpTabs = mMeta.GetDataTableNames(); - if (tmpTabs.Count == 1) { + if (tmpTabs.Count == 1) + { myOut += tmpTabs[0]; - } else { + } + else + { myOut += "("; - for (int tabCnt = 0; tabCnt < tmpTabs.Count; tabCnt++) { - if (tabCnt != 0) { + for (int tabCnt = 0; tabCnt < tmpTabs.Count; tabCnt++) + { + if (tabCnt != 0) + { myOut += " union all "; } myOut += " select * from " + tmpTabs[tabCnt] + "\n"; @@ -890,12 +1082,17 @@ private string getFROMClause() { /// /// /// - private void addDataNoteCell(string NPMChacterType, DataRow sqlRow, string contCode) { + private void addDataNoteCell(string NPMChacterType, DataRow sqlRow, string contCode) + { string cellId = ""; - foreach (string colName in DataNoteCellId_Columns) { - if (String.IsNullOrEmpty(colName)) { + foreach (string colName in DataNoteCellId_Columns) + { + if (String.IsNullOrEmpty(colName)) + { cellId = contCode + "," + cellId; - } else { + } + else + { cellId = sqlRow[colName].ToString() + "," + cellId; } } @@ -907,7 +1104,8 @@ private void addDataNoteCell(string NPMChacterType, DataRow sqlRow, string contC log.Warn(new PCAxis.Sql.Exceptions.WarnNo2Text(1, "addDataNoteCell").getText()); } - private void addDataNoteSum(DataRow sqlRow, string contCode) { + private void addDataNoteSum(DataRow sqlRow, string contCode) + { //addDataNoteCell(symbols.getDataNoteSumCharacterType(), sqlRow, contCode); addDataNoteCell(symbols.DataNoteSumCharacterType(), sqlRow, contCode); } @@ -915,8 +1113,10 @@ private void addDataNoteSum(DataRow sqlRow, string contCode) { #region IDisposable implemenatation - override public void Dispose() { - if (mMeta != null) { + override public void Dispose() + { + if (mMeta != null) + { mMeta.Dispose(); } } diff --git a/PCAxis.Sql/Parser_22/PXSqlDecimalStuff.cs b/PCAxis.Sql/Parser_22/PXSqlDecimalStuff.cs index 2284240..3aaf7b9 100644 --- a/PCAxis.Sql/Parser_22/PXSqlDecimalStuff.cs +++ b/PCAxis.Sql/Parser_22/PXSqlDecimalStuff.cs @@ -1,11 +1,9 @@ using System; -using System.Collections.Generic; -using System.Text; + using log4net; -using PCAxis.Paxiom; -using System.Collections.Specialized; -namespace PCAxis.Sql.Parser_22{ +namespace PCAxis.Sql.Parser_22 +{ /// DECIMALS, SHOWDECIMALS and PRECISION all handle decimals in some way. /// ParseMeta for PRECISION is in PXsqlContents /// @@ -23,55 +21,74 @@ namespace PCAxis.Sql.Parser_22{ ///n is a figure between 1 and 6. The number of decimals for precision must be higher than the number of decimals ///for SHOWDECIMALS to have any effect. /// - internal class PXSqlDecimalStuff { + internal class PXSqlDecimalStuff + { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlDecimalStuff)); internal PXSqlDecimalStuff() { } private int mShowDecimals = 6; private int mStoreDecimals = 0; - - public string ShowDecimals { + + public string ShowDecimals + { get { return mShowDecimals.ToString(); } - set { + set + { int tmpValue = -1; - try { + try + { tmpValue = int.Parse(value); - } catch (Exception e) { + } + catch (Exception e) + { log.Error(e); return; } - if (tmpValue > 6) { + if (tmpValue > 6) + { throw new ApplicationException("Decimal number cannot be higher than 6. Found " + value); - } else if (tmpValue < 0) { + } + else if (tmpValue < 0) + { throw new ApplicationException("Decimal number cannot be lower than 0. Found " + value); } - if (tmpValue < mShowDecimals) { + if (tmpValue < mShowDecimals) + { mShowDecimals = tmpValue; } } } - public string StoreDecimals { + public string StoreDecimals + { get { return mStoreDecimals.ToString(); } - set { + set + { int tmpValue = -1; - try { + try + { tmpValue = int.Parse(value); - } catch (Exception e) { + } + catch (Exception e) + { log.Error(e); return; } - if (tmpValue > 15) { + if (tmpValue > 15) + { throw new ApplicationException("Decimal number cannot be higher than 15. Found " + value); - } else if (tmpValue < 0) { + } + else if (tmpValue < 0) + { throw new ApplicationException("Decimal number cannot be lower than 0. Found " + value); } - if (tmpValue > mStoreDecimals) { + if (tmpValue > mStoreDecimals) + { mStoreDecimals = tmpValue; } } @@ -84,7 +101,7 @@ public string StoreDecimals { // string noLanguage = null; // string subkey = null; - + // values.Add(mStoreDecimals.ToString()); // handler(PXKeywords.DECIMALS, noLanguage, subkey, values); @@ -94,6 +111,6 @@ public string StoreDecimals { //} - + } } diff --git a/PCAxis.Sql/Parser_22/PXSqlGroup.cs b/PCAxis.Sql/Parser_22/PXSqlGroup.cs index 1190752..c13e18f 100644 --- a/PCAxis.Sql/Parser_22/PXSqlGroup.cs +++ b/PCAxis.Sql/Parser_22/PXSqlGroup.cs @@ -1,8 +1,6 @@ namespace PCAxis.Sql.Parser_22 { -using System; -using System.Collections.Generic; -using System.Text; + using System.Collections.Generic; /// Stores A = B + C + D + public class PXSqlGroup @@ -22,7 +20,7 @@ public int GroupLevel } - + private bool isLeaf = false; /// @@ -33,14 +31,14 @@ public bool IsLeaf get { return isLeaf; } } - + /// The list of codes of the children private List childCodes = new List(); /// Initializes a new instance of the PXSqlGroup class, with the given parentCode /// The code of the parent item - internal PXSqlGroup(string parentCode) + internal PXSqlGroup(string parentCode) { this.parentCode = parentCode; } @@ -59,14 +57,14 @@ public IList ChildCodes /// Adds a code to the list of codes of the children /// The code of child item - public void AddChildCode(string childCode) + public void AddChildCode(string childCode) { this.childCodes.Add(childCode); if (parentCode.Equals(childCode)) { isLeaf = true; } - + } } } diff --git a/PCAxis.Sql/Parser_22/PXSqlGrouping.cs b/PCAxis.Sql/Parser_22/PXSqlGrouping.cs index d523dd2..cb76bc0 100644 --- a/PCAxis.Sql/Parser_22/PXSqlGrouping.cs +++ b/PCAxis.Sql/Parser_22/PXSqlGrouping.cs @@ -2,12 +2,13 @@ { using System; using System.Collections.Generic; - using System.Text; using System.Collections.Specialized; - using PCAxis.Sql.QueryLib_22; - using PCAxis.Paxiom; + using log4net; + using PCAxis.Paxiom; + using PCAxis.Sql.QueryLib_22; + public class PXSqlGrouping { @@ -565,7 +566,7 @@ internal Grouping GetPaxiomGrouping() Grouping paxGrouping = new Grouping(); paxGrouping.Name = this.GroupingId; paxGrouping.ID = this.GroupingId; - // if (this.mIncludeType.Equals(GroupingIncludesType.All)) + // if (this.mIncludeType.Equals(GroupingIncludesType.All)) { foreach (PXSqlGroup group in this.mGroups) { diff --git a/PCAxis.Sql/Parser_22/PXSqlGroupingInfo.cs b/PCAxis.Sql/Parser_22/PXSqlGroupingInfo.cs index 9b7e8e4..6c34399 100644 --- a/PCAxis.Sql/Parser_22/PXSqlGroupingInfo.cs +++ b/PCAxis.Sql/Parser_22/PXSqlGroupingInfo.cs @@ -1,16 +1,16 @@ namespace PCAxis.Sql.Parser_22 { - using log4net; using System; using System.Collections.Generic; - using System.Text; + + using log4net; public class PXSqlGroupingInfo { /// The logger to log to. (Stylecop wants documentation) private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlGroupingInfos)); - + // not used sorting is done in sql public class SortGroupingInfoHelper : IComparer @@ -27,7 +27,7 @@ int IComparer.Compare(PXSqlGroupingInfo a, PXSqlGroupingInfo return String.Compare(valA.sortCodeByLanguage[lang], valB.sortCodeByLanguage[lang]); } } - + /// Database unique ID private string groupingId; @@ -41,7 +41,7 @@ int IComparer.Compare(PXSqlGroupingInfo a, PXSqlGroupingInfo /// The texts which may be displayed to users when selecting a grouping from a list of groupings - private Dictionary presTextByLanguage = new Dictionary(); + private Dictionary presTextByLanguage = new Dictionary(); /// Sort order in which the groupings are shown. If SortCode in grouping are set this will be used otherwise PresText private Dictionary sortCodeByLanguage = new Dictionary(); @@ -77,18 +77,18 @@ internal PXSqlGroupingInfo(PCAxis.Sql.QueryLib_22.GroupingRow groupingRow, DbCon this.groupPres = "AggregatedValues"; } - + foreach (KeyValuePair text in groupingRow.texts) { this.presTextByLanguage[text.Key] = text.Value.PresText; - // if (text.Value.SortCode != "") - // { - // this.sortCodeByLanguage[text.Key] = text.Value.SortCode; - // } - // else - // { - // this.sortCodeByLanguage[text.Key] = text.Value.PresText; - // } + // if (text.Value.SortCode != "") + // { + // this.sortCodeByLanguage[text.Key] = text.Value.SortCode; + // } + // else + // { + // this.sortCodeByLanguage[text.Key] = text.Value.PresText; + // } } } diff --git a/PCAxis.Sql/Parser_22/PXSqlGroupingInfos.cs b/PCAxis.Sql/Parser_22/PXSqlGroupingInfos.cs index fca02ec..689e067 100644 --- a/PCAxis.Sql/Parser_22/PXSqlGroupingInfos.cs +++ b/PCAxis.Sql/Parser_22/PXSqlGroupingInfos.cs @@ -2,9 +2,11 @@ { using System.Collections.Generic; using System.Collections.Specialized; - using PCAxis.Paxiom; + using log4net; + using PCAxis.Paxiom; + /// /// Holds the information on which groupings may be used with this variable. This applies to selected variables when build4selection. /// @@ -27,17 +29,17 @@ public List Infos get { return infos; } } - + private StringCollection groupingIDs; - + /// /// the IDs of the groupings which may be used for the variable. /// internal StringCollection GroupingIDs { get { return groupingIDs; } - } + } /// Initializes a new instance of the PXSqlGroupingInfos class, and fills the list of PXSqlGroupingInfo /// Holds the state of the builder @@ -50,38 +52,40 @@ internal PXSqlGroupingInfos(PXSqlMeta_22 meta, string variableName, StringCollec groupingIDs = new StringCollection(); foreach (string valueSetId in valueSetIds) { - foreach (string groupingId in meta.MetaQuery.GetValueSetGroupingRowskeyGrouping(valueSetId, true).Keys) { + foreach (string groupingId in meta.MetaQuery.GetValueSetGroupingRowskeyGrouping(valueSetId, true).Keys) + { groupingIDs.Add(groupingId); } } // finding the ID's of hierarchical groups - foreach (string groupingId in meta.MetaQuery.GetMainTableVariableHierarchyRows_KeyIsGroupingID(meta.MainTable.MainTable,variableName,true).Keys) { - groupingIDs.Add(groupingId); + foreach (string groupingId in meta.MetaQuery.GetMainTableVariableHierarchyRows_KeyIsGroupingID(meta.MainTable.MainTable, variableName, true).Keys) + { + groupingIDs.Add(groupingId); } // creating Info for them; foreach (string groupingId in groupingIDs) { - infos.Add(new PXSqlGroupingInfo(meta.MetaQuery.GetGroupingRow(groupingId) ,meta.Config.Codes)); + infos.Add(new PXSqlGroupingInfo(meta.MetaQuery.GetGroupingRow(groupingId), meta.Config.Codes)); } } - - // internal List GetGroupsSorted(List groupingInfoList,string langCode) - // { - // List sortedGrouposList = new List(); - // foreach (PXSqlGroupingInfo group in groups) - // { - // sortedGrouposList.Add(group); - // } - //return groupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); - //sortedGrouposList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); - //return sortedGrouposList; - // } + // internal List GetGroupsSorted(List groupingInfoList,string langCode) + // { + // List sortedGrouposList = new List(); + // foreach (PXSqlGroupingInfo group in groups) + // { + // sortedGrouposList.Add(group); + // } + //return groupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); + //sortedGrouposList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); + //return sortedGrouposList; + + // } /// Sends the list of Grouping Info to paxiom @@ -113,14 +117,14 @@ internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) //List sortedGroupingInfoList; foreach (string langCode in this.infos[0].PresTextByLanguage.Keys) { - // sortedGroupingInfoList = new List(); - // foreach (PXSqlGroupingInfo info in this.infos) - // { - // sortedGroupingInfoList.Add(info); - // } - // sortedGroupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); - - + // sortedGroupingInfoList = new List(); + // foreach (PXSqlGroupingInfo info in this.infos) + // { + // sortedGroupingInfoList.Add(info); + // } + // sortedGroupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); + + values.Clear(); //foreach (PXSqlGroupingInfo info in sortedGroupingInfoList) foreach (PXSqlGroupingInfo info in this.infos) diff --git a/PCAxis.Sql/Parser_22/PXSqlMaintable.cs b/PCAxis.Sql/Parser_22/PXSqlMaintable.cs index a562708..15c9723 100644 --- a/PCAxis.Sql/Parser_22/PXSqlMaintable.cs +++ b/PCAxis.Sql/Parser_22/PXSqlMaintable.cs @@ -1,11 +1,11 @@ -using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_22; -using PCAxis.Paxiom; using System.Collections.Specialized; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_22; + namespace PCAxis.Sql.Parser_22 { public class PXSqlMaintable @@ -20,7 +20,7 @@ public class PXSqlMaintable private string mSubjectCode; private Dictionary mSubjectAreaByLanguage = new Dictionary(); - + internal PXSqlMaintable(MainTableRow mtRow, DataStorageRow dataStorageRow, MenuSelectionRow menuSelectionRow, PXSqlMeta_22 meta) { this.meta = meta; @@ -50,17 +50,18 @@ internal string SpecCharExists internal bool ContainsOnlyMetaData { - get { + get + { if (TableStatus.Equals(meta.Config.Codes.StatusMeta) || TableStatus.Equals(meta.Config.Codes.StatusEmpty)) { - return true; + return true; } else { return false; } } - } + } //mMainTable[0][mConfig.MainTable.ContentsVariable].ToString().Length != 0 internal bool hasContentsVariable(string someLangCode) @@ -68,10 +69,10 @@ internal bool hasContentsVariable(string someLangCode) return (mtRow.texts[someLangCode].ContentsVariable.Length != 0); } - // public string getPresText(string langCode) - // { - // return mtRow.texts[langCode].PresText; - // } + // public string getPresText(string langCode) + // { + // return mtRow.texts[langCode].PresText; + // } internal string getPresTextS(string langCode) { return mtRow.texts[langCode].PresTextS; @@ -89,7 +90,7 @@ internal string getContentsVariable(string langCode) internal string TimeScale { get { return mtRow.TimeScale; } } internal string TableStatus { get { return mtRow.TableStatus; } } - + //MenuSelection.PresText @@ -226,11 +227,11 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCo // TABLEID if (!string.IsNullOrEmpty(this.TableId.Trim(' '))) - { - values.Clear(); - values.Add(this.TableId); - handler(PXKeywords.TABLEID, noLanguage, subkey, values); - + { + values.Clear(); + values.Add(this.TableId); + handler(PXKeywords.TABLEID, noLanguage, subkey, values); + } // SUBJECT-CODE @@ -249,7 +250,7 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCo } // DATABASE - foreach (string langCode in LanguageCodes) + foreach (string langCode in LanguageCodes) { values.Clear(); // values.Add(this.mDataStorageRow.DatabaseName); diff --git a/PCAxis.Sql/Parser_22/PXSqlMeta_22.cs b/PCAxis.Sql/Parser_22/PXSqlMeta_22.cs index 41a5014..ce5140a 100644 --- a/PCAxis.Sql/Parser_22/PXSqlMeta_22.cs +++ b/PCAxis.Sql/Parser_22/PXSqlMeta_22.cs @@ -1,16 +1,17 @@ using System; using System.Collections; -using System.Collections.Specialized; using System.Collections.Generic; -using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Data; + +using log4net; + using PCAxis.Paxiom; using PCAxis.PlugIn; -using System.Data; -using PCAxis.Sql.QueryLib_22; +using PCAxis.PlugIn.Sql; using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; using PCAxis.Sql.Pxs; -using log4net; -using PCAxis.PlugIn.Sql; +using PCAxis.Sql.QueryLib_22; namespace PCAxis.Sql.Parser_22 { @@ -25,9 +26,9 @@ namespace PCAxis.Sql.Parser_22 // fixedStartMovingLast = 3 //} - - public class PXSqlMeta_22 :PCAxis.Sql.Parser.PXSqlMeta + + public class PXSqlMeta_22 : PCAxis.Sql.Parser.PXSqlMeta { #region constants private const string mPresTextOptionCode = "CODE"; @@ -44,16 +45,16 @@ public class PXSqlMeta_22 :PCAxis.Sql.Parser.PXSqlMeta #region members private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlMeta_22)); - + private PxsQuery mPxsFile; internal PxsQuery PxsFile { get { return mPxsFile; } } internal PXSqlNpm mPxsqlNpm; - + private string mPxsSubTableId; - + internal string ContensCode { @@ -69,10 +70,10 @@ internal string ContensCode } } } - - - - + + + + private PXMetaAdmValues mPXMetaAdmValues; @@ -83,7 +84,7 @@ public PXMetaAdmValues PXMetaAdmValues - + private readonly string mMainTableId; @@ -93,7 +94,7 @@ internal PXSqlMaintable MainTable get { return mMainTable; } } - + private PXSqlSubTables mSubTables; public PXSqlSubTables SubTables { @@ -161,8 +162,8 @@ public PXSqlVariable ContentsVariable { get { return mContentsVariable; } } - - + + private PXSqlDecimalStuff mDecimalHandler = new PXSqlDecimalStuff(); internal PXSqlDecimalStuff DecimalHandler @@ -173,7 +174,7 @@ internal PXSqlDecimalStuff DecimalHandler private PXSqlValue mValue; - + private Dictionary mContentsVariablePresText = new Dictionary(); public Dictionary ContentsVariablePresText { @@ -191,20 +192,20 @@ public bool EliminatedVariablesExist } - + private SqlDbConfig_22 mConfig; public SqlDbConfig_22 Config { get { return mConfig; } } - + //jfi:Hei piv, jeg la denne her. Er det ok? public bool SpecCharExists { get { return MainTable.SpecCharExists.Equals(mMetaQuery.DB.Codes.Yes); } } - + private string mDataTablesPrefix; public string DataTablesPrefix { get { return mDataTablesPrefix; } } @@ -219,12 +220,12 @@ internal PXSqlNotes TheNotes { get { return theNotes; } } - + #endregion #region Constructor - + /// /// @@ -240,7 +241,7 @@ public PXSqlMeta_22(string mainTableId, string preferredLang, bool getAllLangs, { log.Info("PXSqlMeta(string mainTableId(=" + mainTableId + "), StringCollection desiredLanguages, SqlDbConfig config, Instancemodus aModus(=" + aModus.ToString() + "))"); this.mMainTableId = mainTableId; - this.mConfig = (SqlDbConfig_22) config; + this.mConfig = (SqlDbConfig_22)config; mMetaQuery = new MetaQuery(this.mConfig, this.SelectedDbInfo); SetLanguageCodesNoPxs(preferredLang, getAllLangs); BuildMeta(); @@ -253,14 +254,14 @@ public PXSqlMeta_22(PxsQuery mPxsObject, string preferredLang, SqlDbConfig confi { log.Debug("PXSqlMeta(PxsQuery mPxsObject, SqlDbConfig config, Instancemodus aModus"); - + //disse er trukket hit for å kunne kjøre med String hovedtabellId. this.mMainTableId = mPxsObject.Query.TableSource; //TODO; denne burde kunne fjernes this.mPxsSubTableId = mPxsObject.Query.SubTable; - this.mConfig = (SqlDbConfig_22) config; + this.mConfig = (SqlDbConfig_22)config; mMetaQuery = new MetaQuery(this.mConfig, this.SelectedDbInfo); @@ -319,44 +320,44 @@ private PxsQuery rearrangePxsQuery(PxsQuery mPxsObject) private void BuildMeta() { - SetInstanceModus(); - + SetInstanceModus(); + mMetaQuery.LanguageCodes = LanguageCodes; // instanced above, now just set language - mPXMetaAdmValues = new PXMetaAdmValues(mMetaQuery); + mPXMetaAdmValues = new PXMetaAdmValues(mMetaQuery); if (inPresentationModus) { mPxsqlNpm = new PXSqlNpm(this); //trenger valium dette } - - SetMainTable(); + + SetMainTable(); //mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId), mPxsSubTableId); - mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId,false), mPxsFile, this); + mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId, false), mPxsFile, this); + - SetVariables();//ok for pxs == null, men denne kan også hente ut valueSet SetContents(); //må skrives om, men kall til metaQ OK. Bør kanskje legge inn contents som SetHeadingAndStub(); - - + + // hmm petros bruke TIMEVAL nøkkelord for å bestemme om en variabel er tid, men timeval // er ikke obligatorisk og har ingen mening i "valg modus". Johannes trenger å vite om en //variabel er tid for å danne korrekt pxs. // if (instancemodus == Instancemodus.presentation) // { - // SetTimeVal(); Not used. Defined in PXSqlVariableTime + // SetTimeVal(); Not used. Defined in PXSqlVariableTime SetPaxiomMap();//ok for pxs == null, men jeg forstår ikke helt hva den gjør. mEliminatedVariablesExist = CheckEliminatedVariables();//ok for pxs == null - - theNotes = new PXSqlNotes(this,mMainTableId, this.inPresentationModus); + + theNotes = new PXSqlNotes(this, mMainTableId, this.inPresentationModus); mDataTablesPrefix = mMetaQuery.GetDataTablesPrefix(mMainTable.ProductId); CheckPxs(); @@ -375,12 +376,12 @@ private void BuildMeta() #endregion #region Setroutines - + private void SetInstanceModus() { - if (! (this.inPresentationModus || this.inSelectionModus) ) + if (!(this.inPresentationModus || this.inSelectionModus)) { throw new NotImplementedException("BUG"); } @@ -533,7 +534,7 @@ private void SetMainTable() private List GetSortedContentsList(string mMainTableId, bool contructedFromPxs, BasicValueType[] contentsInPxs) { List myOut = new List(); - Dictionary altIBasen = mMetaQuery.GetContentsRows(mMainTableId,false); + Dictionary altIBasen = mMetaQuery.GetContentsRows(mMainTableId, false); //side effect: @@ -552,7 +553,7 @@ private List GetSortedContentsList(string mMainTableId, bool contr PXSqlContent mContent = null; if (this.ConstructedFromPxs) { - int documentOrder = 0; + int documentOrder = 0; foreach (BasicValueType contents in contentsInPxs) { if (altIBasen.ContainsKey(contents.code)) @@ -560,7 +561,7 @@ private List GetSortedContentsList(string mMainTableId, bool contr mContent = new PXSqlContent(altIBasen[contents.code], this, mConfig, contact); mContent.SortOrder = documentOrder; myOut.Add(mContent); - documentOrder++; + documentOrder++; } } @@ -611,7 +612,7 @@ private void SetContents() int counter = 0; foreach (PXSqlContent content in mContents.Values) { - mValue = new PXSqlValue(content,counter); + mValue = new PXSqlValue(content, counter); mValues.Add(mValue.ValueCode, mValue); counter++; } @@ -653,10 +654,10 @@ private void SetVariables() } } mSqlVariable.VariableType = aTVRow.VariableType; - + } - + } private void CheckPxs() @@ -681,8 +682,8 @@ private void CheckPxs() } } - - + + private void SetHeadingAndStub() { @@ -698,10 +699,10 @@ private void SetHeadingAndStub() this.mHeadings = mVariables.GetHeadingSorted(); } - - + + //TODO; flytt denne, tror kanskje heller ikke alt er sagt om GeoArea, det kan settes en dullion steder private void SetPaxiomMap() @@ -709,7 +710,7 @@ private void SetPaxiomMap() foreach (KeyValuePair var in mVariables) { //if (!var.Value.IsContentVariable && !var.Value.IsTimevariable) { - if (var.Value.VariableType == mConfig.Codes.VariableTypeG && var.Value.isSelected && var.Value.ValueSets != null) + if (var.Value.VariableType == mConfig.Codes.VariableTypeG && var.Value.isSelected && var.Value.ValueSets != null) { List GeoAreaValues = new List(); string GeoAreaValue; @@ -742,10 +743,10 @@ private void SetPaxiomMap() } - - + + #endregion #region tja @@ -773,7 +774,7 @@ public StringCollection GetDataTableNames() #region helproutines - + //private string CheckMultValuesetElim(List ElimValues) //{ // int numberOfElimA = 0; @@ -894,7 +895,7 @@ override public InfoFromPxSqlMeta2PxsQuery GetInfoFromPxSqlMeta2PxsQuery() return myOut; } - + /// Finds the variable and passes to call on to it /// The paxiom Varable, but both this and the name?? @@ -906,7 +907,8 @@ override internal void ApplyGrouping(Variable paxiomVariable, string variableCod if (mVariablesClassification.ContainsKey(variableCode)) { mVariablesClassification[variableCode].ApplyGrouping(paxiomVariable, groupingId, include); - } else + } + else { throw new ApplicationException("BUG"); } @@ -928,14 +930,15 @@ override internal void ApplyValueSet(string variableCode, string valueSetId) } - - override public bool MainTableContainsOnlyMetaData(){ - return this.MainTable.ContainsOnlyMetaData; + + override public bool MainTableContainsOnlyMetaData() + { + return this.MainTable.ContainsOnlyMetaData; } - + #region "IPlugIn implementation" diff --git a/PCAxis.Sql/Parser_22/PXSqlNotes.cs b/PCAxis.Sql/Parser_22/PXSqlNotes.cs index 97d495c..8bd2b44 100644 --- a/PCAxis.Sql/Parser_22/PXSqlNotes.cs +++ b/PCAxis.Sql/Parser_22/PXSqlNotes.cs @@ -1,10 +1,11 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; + using PCAxis.Sql.QueryLib_22; -namespace PCAxis.Sql.Parser_22 { +namespace PCAxis.Sql.Parser_22 +{ /// @@ -84,7 +85,7 @@ public PXSqlCellNotes CellNotes // List allRelevantFoonotes; - + private StringCollection showFootnotesCodes; private PXSqlMeta_22 mMeta; @@ -110,7 +111,7 @@ internal PXSqlNotes(PXSqlMeta_22 mMeta, string mMainTableId, bool inPresentation { showFootnotesCodes.Add(mMeta.Config.Codes.FootnoteShowP); } - else + else { showFootnotesCodes.Add(mMeta.Config.Codes.FootnoteShowS); } @@ -120,12 +121,12 @@ internal PXSqlNotes(PXSqlMeta_22 mMeta, string mMainTableId, bool inPresentation //Adding footnotes for grouping allRelevantFoonotes.AddRange(this.getRelevantGroupingNotes(inPresentationModus)); - + this.SetFootNotes(); - + } private List getRelevantGroupingNotes(bool inPresentationModus) @@ -165,7 +166,7 @@ private List getRelevantGroupingNotes(bool inPresentationM - + private void SetMainTableNotes(RelevantFootNotesRow footNoteRow) { @@ -352,8 +353,8 @@ private void SetFootNotes() /* the CNMM has many footnote types, Paxiom has fewer. * "Upgrade" from "VALUE" or from "Variable" to "Table" where possible*/ - - + + mMenuSelNotes = new PXSqlMenuSelNotes(); mMaintValueNotes = new PXSqlMainTablesValueNotes(); mValueNotes = new PXSqlValueNotes(); @@ -371,7 +372,7 @@ private void SetFootNotes() mPaxiomNotes.addTableNote(new PXSqlNote(this.mMeta)); } - + foreach (RelevantFootNotesRow footNoteRow in allRelevantFoonotes) { @@ -435,11 +436,12 @@ private void SetFootNotes() } } - + if (PCAxis.Sql.Parser.PXSqlMeta.containsAll(outputVariables, varsWhichHasANote)) { mPaxiomNotes.addTableNote(varNotesByNoteNo[noteno][0]); - } else + } + else { mPaxiomNotes.addVariableNotes(varNotesByNoteNo[noteno]); } @@ -453,9 +455,10 @@ private void SetFootNotes() Dictionary> conentsNotesByNoteNo = GetNotesByNoteNo(mContentsNotes); - StringCollection outputContentsValues = new StringCollection(); + StringCollection outputContentsValues = new StringCollection(); - foreach (String contentsValue in this.mMeta.Contents.Keys) { + foreach (String contentsValue in this.mMeta.Contents.Keys) + { outputContentsValues.Add(contentsValue); } @@ -476,14 +479,15 @@ private void SetFootNotes() if (PCAxis.Sql.Parser.PXSqlMeta.containsAll(outputContentsValues, usedValues)) { mPaxiomNotes.addTableNote(conentsNotesByNoteNo[noteno][0]); - } else + } + else { mPaxiomNotes.addContentsNotes(conentsNotesByNoteNo[noteno]); } } #endregion - + } @@ -548,7 +552,7 @@ internal void ParseAllNotes(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { mMeta.TheNotes.ContVblNotes.ParseNote(mMeta, handler, langCode); } - + } } @@ -556,45 +560,55 @@ internal void ParseAllNotes(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) - public class PXSqlNote { + public class PXSqlNote + { protected const string star = "*"; protected string mShowFootNote; - public string ShowFootNote { + public string ShowFootNote + { get { return this.mShowFootNote; } } protected string mMandOpt; - public string MandOpt { + public string MandOpt + { get { return this.mMandOpt; } } protected string mFootNoteNo; - public string FootNoteNo { + public string FootNoteNo + { get { return this.mFootNoteNo; } } protected string mContents; - public string Contents { + public string Contents + { get { return this.mContents; } } protected string mVariable; - public string Variable { + public string Variable + { get { return this.mVariable; } } protected string mValueCode; - public string ValueCode { + public string ValueCode + { get { return this.mValueCode; } } protected string mTimePeriode; - public string TimePeriode { + public string TimePeriode + { get { return this.mTimePeriode; } } protected Dictionary mNotePresTexts; - public Dictionary NotePresTexts { + public Dictionary NotePresTexts + { get { return this.mNotePresTexts; } } protected String mNotePresText; protected const string FootNoteTableContainsOnlyMetadata = "This table contains only metadata"; - protected const string FootNoteTableContainsOnlyMetadataDummyNumber = "-999"; + protected const string FootNoteTableContainsOnlyMetadataDummyNumber = "-999"; - public PXSqlNote(RelevantFootNotesRow footNoteRow, PXSqlMeta_22 mMeta) { + public PXSqlNote(RelevantFootNotesRow footNoteRow, PXSqlMeta_22 mMeta) + { this.mShowFootNote = footNoteRow.ShowFootNote; this.mMandOpt = footNoteRow.MandOpt; this.mFootNoteNo = footNoteRow.FootNoteNo; @@ -627,19 +641,23 @@ public PXSqlNote(PXSqlMeta_22 mMeta) } } - - public abstract class PXSqlGeneralNotes : List { - public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) { + + public abstract class PXSqlGeneralNotes : List + { + public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) + { string keyWord; string subKeyWord; StringCollection parseValue; - foreach (PXSqlNote note in this) { - if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) { + foreach (PXSqlNote note in this) + { + if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "VALUENOTEX"; else keyWord = "VALUENOTE"; - subKeyWord = note.Variable + "\",\"" + note.ValueCode; + subKeyWord = note.Variable + "\",\"" + note.ValueCode; parseValue = new StringCollection(); parseValue.Add(note.NotePresTexts[langCode]); handler(keyWord, langCode, subKeyWord, parseValue); @@ -650,26 +668,31 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl - public class PXSqlValueNotes : PXSqlGeneralNotes {} + public class PXSqlValueNotes : PXSqlGeneralNotes { } - public class PXSqlMainTablesValueNotes : PXSqlGeneralNotes {} + public class PXSqlMainTablesValueNotes : PXSqlGeneralNotes { } public class PXSqlMenuSelNotes : List { } - public class PXSqlContValueNotes : List { + public class PXSqlContValueNotes : List + { private const string star = "*"; - public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) { + public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) + { string keyWord; string subKeyWord; StringCollection parseValue; - if (mMeta.Contents.Count == 1) { - foreach (PXSqlNote note in this) { - if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) { + if (mMeta.Contents.Count == 1) + { + foreach (PXSqlNote note in this) + { + if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "VALUENOTEX"; else keyWord = "VALUENOTE"; - subKeyWord = note.Variable + "\",\"" + note.ValueCode ; + subKeyWord = note.Variable + "\",\"" + note.ValueCode; parseValue = new StringCollection(); parseValue.Add(note.NotePresTexts[langCode]); handler(keyWord, langCode, subKeyWord, parseValue); @@ -677,20 +700,24 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } - else { + else + { List stubAndHead = new List(); stubAndHead.AddRange(mMeta.Stubs); stubAndHead.AddRange(mMeta.Headings); StringCollection CellNoteDimensions; - foreach (PXSqlNote note in this) { + foreach (PXSqlNote note in this) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "CELLNOTEX"; else keyWord = "CELLNOTE"; CellNoteDimensions = new StringCollection(); - foreach (PXSqlVariable var in stubAndHead) { - if (var.IsContentVariable) { - if (var.Values.GetValueByContentsCode(note.Contents) != null) + foreach (PXSqlVariable var in stubAndHead) + { + if (var.IsContentVariable) + { + if (var.Values.GetValueByContentsCode(note.Contents) != null) { CellNoteDimensions.Add(var.Values.GetValueByContentsCode(note.Contents).ValueCode); } @@ -699,7 +726,8 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl else throw new PCAxis.Sql.Exceptions.DbException(12); } - else if (var.Name == note.Variable) { + else if (var.Name == note.Variable) + { if (var.Values.ContainsKey(note.ValueCode)) CellNoteDimensions.Add(note.ValueCode); else @@ -721,16 +749,21 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } } - - public class PXSqlContTimeNotes : List { + + public class PXSqlContTimeNotes : List + { private const string star = "*"; - public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) { + public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) + { string keyWord; string subKeyWord; StringCollection parseValue; - if (mMeta.Contents.Count == 1) { - foreach (PXSqlNote note in this) { - if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) { + if (mMeta.Contents.Count == 1) + { + foreach (PXSqlNote note in this) + { + if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "VALUENOTEX"; else @@ -743,27 +776,32 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } - else { + else + { List stubAndHead = new List(); stubAndHead.AddRange(mMeta.Stubs); stubAndHead.AddRange(mMeta.Headings); StringCollection CellNoteDimensions; - foreach (PXSqlNote note in this) { + foreach (PXSqlNote note in this) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "CELLNOTEX"; else keyWord = "CELLNOTE"; CellNoteDimensions = new StringCollection(); - foreach (PXSqlVariable var in stubAndHead) { - if (var.IsTimevariable) { + foreach (PXSqlVariable var in stubAndHead) + { + if (var.IsTimevariable) + { if (var.Values.ContainsKey(note.TimePeriode)) CellNoteDimensions.Add(note.TimePeriode); else throw new PCAxis.Sql.Exceptions.DbException(12); } - else if (var.IsContentVariable) { - if (var.Values.GetValueByContentsCode(note.Contents) != null) + else if (var.IsContentVariable) + { + if (var.Values.GetValueByContentsCode(note.Contents) != null) { CellNoteDimensions.Add(var.Values.GetValueByContentsCode(note.Contents).ValueCode); } @@ -788,19 +826,25 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } } - - public class PXSqlContentsNotes : List { - + + public class PXSqlContentsNotes : List + { + } - public class PXSqlContVblNotes : List { - public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) { + public class PXSqlContVblNotes : List + { + public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) + { string keyWord; string subKeyWord = null; StringCollection parseValue; - foreach (PXSqlNote note in this) { - if (mMeta.Contents.Count == 1) { - if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) { + foreach (PXSqlNote note in this) + { + if (mMeta.Contents.Count == 1) + { + if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "NOTEX"; else @@ -813,8 +857,10 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } // if more than one contentsvariable is selected the note should be presented different, but there are // no way to parse it to PAXIOm and specify that the note is valid for only one contents. - else { - if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) { + else + { + if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB)) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "NOTEX"; else @@ -829,9 +875,10 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } } - - public class PXSqlVariableNotes : List { - + + public class PXSqlVariableNotes : List + { + } @@ -845,8 +892,10 @@ public class PaxiomNotes private List contentsNotes = new List(); //adds tableNote unless it is already added - public void addTableNote(PXSqlNote tableNote) { - if ( ! tableNotes.ContainsKey(tableNote.FootNoteNo)) { + public void addTableNote(PXSqlNote tableNote) + { + if (!tableNotes.ContainsKey(tableNote.FootNoteNo)) + { tableNotes.Add(tableNote.FootNoteNo, tableNote); } } @@ -880,46 +929,46 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl foreach (PXSqlNote note in this.tableNotes.Values) { - if (note.MandOpt == mMeta.Config.Codes.FootnoteM) - keyWord = "NOTEX"; - else - keyWord = "NOTE"; - parseValue = new StringCollection(); - parseValue.Add(note.NotePresTexts[langCode]); - handler(keyWord, langCode, subKeyWord, parseValue); + if (note.MandOpt == mMeta.Config.Codes.FootnoteM) + keyWord = "NOTEX"; + else + keyWord = "NOTE"; + parseValue = new StringCollection(); + parseValue.Add(note.NotePresTexts[langCode]); + handler(keyWord, langCode, subKeyWord, parseValue); } foreach (PXSqlNote note in this.variableNotes) - { - if (note.MandOpt == mMeta.Config.Codes.FootnoteM) - keyWord = "NOTEX"; - else - keyWord = "NOTE"; - subKeyWord = note.Variable; - parseValue = new StringCollection(); - parseValue.Add(note.NotePresTexts[langCode]); - handler(keyWord, langCode, subKeyWord, parseValue); - + { + if (note.MandOpt == mMeta.Config.Codes.FootnoteM) + keyWord = "NOTEX"; + else + keyWord = "NOTE"; + subKeyWord = note.Variable; + parseValue = new StringCollection(); + parseValue.Add(note.NotePresTexts[langCode]); + handler(keyWord, langCode, subKeyWord, parseValue); + } foreach (PXSqlNote note in this.contentsNotes) { - - subKeyWord = mMeta.ContensCode + "\",\"" + mMeta.ContentsVariable.Values.GetValueByContentsCode(note.Contents).ValueCode; - //subKeyWord = mMeta.ContensCode + "," + note.Contents; - if (note.MandOpt == mMeta.Config.Codes.FootnoteM) - keyWord = "VALUENOTEX"; - else - keyWord = "VALUENOTE"; - parseValue = new StringCollection(); - parseValue.Add(note.NotePresTexts[langCode]); - handler(keyWord, langCode, subKeyWord, parseValue); - + subKeyWord = mMeta.ContensCode + "\",\"" + mMeta.ContentsVariable.Values.GetValueByContentsCode(note.Contents).ValueCode; + //subKeyWord = mMeta.ContensCode + "," + note.Contents; + if (note.MandOpt == mMeta.Config.Codes.FootnoteM) + keyWord = "VALUENOTEX"; + else + keyWord = "VALUENOTE"; + + parseValue = new StringCollection(); + parseValue.Add(note.NotePresTexts[langCode]); + handler(keyWord, langCode, subKeyWord, parseValue); + } } @@ -927,36 +976,43 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } - public class PXSqlCellNotes : List { + public class PXSqlCellNotes : List + { private const string star = "*"; - public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) { + public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode) + { List stubAndHead = new List(); stubAndHead.AddRange(mMeta.Stubs); stubAndHead.AddRange(mMeta.Headings); StringCollection CellNoteDimensions; string subKeyWord; - string keyWord; + string keyWord; StringCollection parseValue; - foreach (PXSqlNote note in this) { + foreach (PXSqlNote note in this) + { if (note.MandOpt == mMeta.Config.Codes.FootnoteM) keyWord = "CELLNOTEX"; else keyWord = "CELLNOTE"; CellNoteDimensions = new StringCollection(); - foreach (PXSqlVariable var in stubAndHead) { - if (var.IsTimevariable) { + foreach (PXSqlVariable var in stubAndHead) + { + if (var.IsTimevariable) + { if (var.Values.ContainsKey(note.TimePeriode)) CellNoteDimensions.Add(note.TimePeriode); else CellNoteDimensions.Add(star); } - else if (var.IsContentVariable) { + else if (var.IsContentVariable) + { if (var.Values.ContainsKey(note.Contents)) CellNoteDimensions.Add(note.Contents); else CellNoteDimensions.Add(star); } - else if (var.Name == note.Variable) { + else if (var.Name == note.Variable) + { if (var.Values.ContainsKey(note.ValueCode)) CellNoteDimensions.Add(note.ValueCode); else @@ -979,5 +1035,5 @@ public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandl } } - + } diff --git a/PCAxis.Sql/Parser_22/PXSqlNpm.cs b/PCAxis.Sql/Parser_22/PXSqlNpm.cs index 14db766..777ae9d 100644 --- a/PCAxis.Sql/Parser_22/PXSqlNpm.cs +++ b/PCAxis.Sql/Parser_22/PXSqlNpm.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; -using System.Text; -using System.Data; +using System.Collections.Specialized; + using PCAxis.Paxiom; using PCAxis.Sql.QueryLib_22; -using System.Globalization; -using System.Collections.Specialized; namespace PCAxis.Sql.Parser_22 { diff --git a/PCAxis.Sql/Parser_22/PXSqlParseMetaPostData_22.cs b/PCAxis.Sql/Parser_22/PXSqlParseMetaPostData_22.cs index c074799..e58a33d 100644 --- a/PCAxis.Sql/Parser_22/PXSqlParseMetaPostData_22.cs +++ b/PCAxis.Sql/Parser_22/PXSqlParseMetaPostData_22.cs @@ -1,11 +1,11 @@ using System; -using System.Collections.Specialized; using System.Collections.Generic; - -using PCAxis.Paxiom; +using System.Collections.Specialized; using log4net; +using PCAxis.Paxiom; + namespace PCAxis.Sql.Parser_22 { /// diff --git a/PCAxis.Sql/Parser_22/PXSqlSubTable.cs b/PCAxis.Sql/Parser_22/PXSqlSubTable.cs index 065bce1..cdf7ca4 100644 --- a/PCAxis.Sql/Parser_22/PXSqlSubTable.cs +++ b/PCAxis.Sql/Parser_22/PXSqlSubTable.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; using PCAxis.Sql.QueryLib_22; namespace PCAxis.Sql.Parser_22 diff --git a/PCAxis.Sql/Parser_22/PXSqlSubTables.cs b/PCAxis.Sql/Parser_22/PXSqlSubTables.cs index 82f4209..ee692a1 100644 --- a/PCAxis.Sql/Parser_22/PXSqlSubTables.cs +++ b/PCAxis.Sql/Parser_22/PXSqlSubTables.cs @@ -1,40 +1,44 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_22; + using PCAxis.PlugIn.Sql; using PCAxis.Sql.Pxs; -using System.Collections.Specialized; +using PCAxis.Sql.QueryLib_22; namespace PCAxis.Sql.Parser_22 { - public class PXSqlSubTables:Dictionary + public class PXSqlSubTables : Dictionary { - + PxsQuery mPxsQuery; public PXSqlSubTables(Dictionary altIBasen, PxsQuery pPxsQuery, PXSqlMeta_22 pxsqlMeta) - : base() { + : base() + { this.mPxsQuery = pPxsQuery; PXSqlSubTable mSubTable; - foreach (SubTableRow subTableRow in altIBasen.Values) { + foreach (SubTableRow subTableRow in altIBasen.Values) + { mSubTable = new PXSqlSubTable(subTableRow); this.Add(mSubTable.SubTable, mSubTable); } // set selected subtables. if (pPxsQuery == null) { - foreach (PXSqlSubTable subTable in this.Values) { + foreach (PXSqlSubTable subTable in this.Values) + { subTable.IsSelected = true; } - } else { + } + else + { SetSelectedSubTable(pxsqlMeta); } } - - + + /// /// Returns the ids of the subtables marked as selected(All if not a pxs has selected a spesific subtable. @@ -57,17 +61,17 @@ public IEnumerable GetKeysOfSelectedSubTables() private void SetSelectedSubTable(PXSqlMeta_22 pxsqlMeta) { - + Boolean isEqualValueSet; - foreach (KeyValuePair subTable in this) + foreach (KeyValuePair subTable in this) { isEqualValueSet = true; string subTableName = subTable.Value.SubTable; - Dictionary fromDb = pxsqlMeta.MetaQuery.GetSubTableVariableRowskeyVariable(pxsqlMeta.MainTable.MainTable, subTableName,false); - + Dictionary fromDb = pxsqlMeta.MetaQuery.GetSubTableVariableRowskeyVariable(pxsqlMeta.MainTable.MainTable, subTableName, false); + foreach (PQVariable pqvariable in mPxsQuery.Query.Variables) - { + { string variableName = pqvariable.code; string selectedValueset = pqvariable.SelectedValueset; if (!fromDb.ContainsKey(variableName)) @@ -79,17 +83,17 @@ private void SetSelectedSubTable(PXSqlMeta_22 pxsqlMeta) { isEqualValueSet = false; break; - } + } } if (isEqualValueSet) { - + this[subTableName].IsSelected = true; } } - + } } } diff --git a/PCAxis.Sql/Parser_22/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs b/PCAxis.Sql/Parser_22/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs index e2a909e..559fe88 100644 --- a/PCAxis.Sql/Parser_22/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs +++ b/PCAxis.Sql/Parser_22/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs @@ -1,17 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Text; -using PCAxis.Paxiom; +using System.Collections.Generic; +using System.Collections.Specialized; + using log4net; -using PCAxis.Sql.QueryLib_22; + +using PCAxis.Paxiom; using PCAxis.Sql.DbConfig; -using System.Collections.Specialized; +using PCAxis.Sql.QueryLib_22; -namespace PCAxis.Sql.Parser_22 { +namespace PCAxis.Sql.Parser_22 +{ ///Class for columns in the Content-tabell that are independent of content (they will possibly be /// moved to maintabletable in a later version of the metamodel) - class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent { + class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent + { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlThingsThatWouldBeTheSameInAllPXSqlContent)); @@ -45,25 +47,35 @@ class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent { private bool mOfficialStatistics; private Dictionary nameByLangCode = new Dictionary(); - - internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_22 meta, SqlDbConfig_22 config) { + + internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_22 meta, SqlDbConfig_22 config) + { mStatAuthorityCode = someContentsRow.StatAuthority; string copyright = someContentsRow.Copyright; - if (copyright.Equals(config.Codes.Copyright1) || copyright.Equals(config.Codes.Copyright2)) { + if (copyright.Equals(config.Codes.Copyright1) || copyright.Equals(config.Codes.Copyright2)) + { mCopyright = false; - } else if (copyright.Equals(config.Codes.Copyright3)) { - mCopyright = true ; - } else { + } + else if (copyright.Equals(config.Codes.Copyright3)) + { + mCopyright = true; + } + else + { mCopyright = true; log.Error("The database has copyright=" + copyright + ", but the valid codes from config are " + config.Codes.Copyright1 + "," + config.Codes.Copyright2 + " or " + config.Codes.Copyright3 + "."); } - if (copyright.Equals(config.Codes.Copyright1)) { + if (copyright.Equals(config.Codes.Copyright1)) + { mOfficialStatistics = true; - } else { - mOfficialStatistics = false; + } + else + { + mOfficialStatistics = false; } OrganizationRow org = meta.MetaQuery.GetOrganizationRow(mStatAuthorityCode); - foreach (string language in org.texts.Keys) { + foreach (string language in org.texts.Keys) + { nameByLangCode.Add(language, org.texts[language].OrganizationName); } } @@ -88,13 +100,15 @@ internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContents /// /// /// - public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { + public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) + { StringCollection values = new StringCollection(); string subkey = null; - foreach (string langCode in nameByLangCode.Keys) { + foreach (string langCode in nameByLangCode.Keys) + { // SOURCE values.Clear(); @@ -106,9 +120,12 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { // COPYRIGHT values.Clear(); - if (mCopyright) { + if (mCopyright) + { values.Add(PXConstant.YES); - } else { + } + else + { values.Add(PXConstant.NO); } handler(PXKeywords.COPYRIGHT, noLanguage, subkey, values); diff --git a/PCAxis.Sql/Parser_22/PXSqlTimeScale.cs b/PCAxis.Sql/Parser_22/PXSqlTimeScale.cs index e45863d..6633eec 100644 --- a/PCAxis.Sql/Parser_22/PXSqlTimeScale.cs +++ b/PCAxis.Sql/Parser_22/PXSqlTimeScale.cs @@ -1,6 +1,5 @@ using System; -using System.Collections.Generic; -using System.Text; + using PCAxis.Sql.QueryLib_22; namespace PCAxis.Sql.Parser_22 @@ -8,7 +7,7 @@ namespace PCAxis.Sql.Parser_22 public class PXSqlTimeScale { private TimeScaleRow tsRow; - + private bool doTimeScalePres = false; /// @@ -60,12 +59,12 @@ public string StoreFormat /// public string getPresText(string langCode) { - + return tsRow.texts[langCode].PresText; } - - - + + + /// /// Contructor /// diff --git a/PCAxis.Sql/Parser_22/PXSqlValue.cs b/PCAxis.Sql/Parser_22/PXSqlValue.cs index 8e15ed7..c0a563a 100644 --- a/PCAxis.Sql/Parser_22/PXSqlValue.cs +++ b/PCAxis.Sql/Parser_22/PXSqlValue.cs @@ -1,10 +1,10 @@ using System; -using System.Collections; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_22; using System.Collections.Specialized; + using log4net; + +using PCAxis.Sql.QueryLib_22; namespace PCAxis.Sql.Parser_22 { public class SortByVsValueHelper : IComparer @@ -13,7 +13,7 @@ int IComparer.Compare(PXSqlValue a, PXSqlValue b) { PXSqlValue valA = a; PXSqlValue valB = b; - return String.Compare(valA.SortCodeVsValue,valB.SortCodeVsValue); + return String.Compare(valA.SortCodeVsValue, valB.SortCodeVsValue); } } public class SortByValueHelper : IComparer @@ -39,7 +39,7 @@ int IComparer.Compare(PXSqlValue a, PXSqlValue b) return 0; } } - public class PXSqlValue:IComparable + public class PXSqlValue : IComparable { #region members private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlValue)); @@ -52,8 +52,8 @@ public class PXSqlValue:IComparable private string mSortCodeValue; private string mSortCodeVsValue; private string mSortCodeDb; // this is the sortorder returned from dababase sort on vsvalue,value - private Dictionary mValueTextS = new Dictionary(); - private Dictionary mValueTextL = new Dictionary(); + private Dictionary mValueTextS = new Dictionary(); + private Dictionary mValueTextL = new Dictionary(); private string mPrecision; private bool mIsSelected; private bool mExistInDb; @@ -69,7 +69,7 @@ public string ContentsCode public string ValueCode { get { return mValueCode; } - set { mValueCode = value;} + set { mValueCode = value; } } public string ValuePool { @@ -77,9 +77,9 @@ public string ValuePool set { mValuePool = value; } } public string ValueSet - { + { get { return mValueSet; } - set { mValueSet = value; } + set { mValueSet = value; } } public int SortCodePxs { @@ -102,7 +102,7 @@ public string SortCodeDb get { return mSortCodeDb; } set { mSortCodeDb = value; } } - public Dictionary ValueTextS + public Dictionary ValueTextS { get { return mValueTextS; } set { mValueTextS = value; } @@ -124,8 +124,8 @@ public bool IsSelected } public bool ExistInDb { - get { return mExistInDb; } - set { mExistInDb = value; } + get { return mExistInDb; } + set { mExistInDb = value; } } //private List mFootNoteRows; //public List FootNoteRows @@ -145,12 +145,13 @@ public bool ExistInDb public PXSqlValue() { - // mFootNotesValue = new List(); + // mFootNotesValue = new List(); } - public PXSqlValue(ValueRow2 myValueRow, StringCollection LanguageCodes, string MainLanguageCode) { - + public PXSqlValue(ValueRow2 myValueRow, StringCollection LanguageCodes, string MainLanguageCode) + { + //this.meta = meta; this.mContentsCode = null; // only for contentsvalues @@ -164,7 +165,8 @@ public PXSqlValue(ValueRow2 myValueRow, StringCollection LanguageCodes, string M this.mSortCodeVsValue = myValueRow.texts[MainLanguageCode].SortCodeVsValue; //this.SecondarySortOrder = myValueRow.ValueSortCode; this.SortCodeDb = myValueRow.SortOrder; - foreach (string langCode in LanguageCodes) { + foreach (string langCode in LanguageCodes) + { this.ValueTextS[langCode] = myValueRow.texts[langCode].ValueTextS; this.ValueTextL[langCode] = myValueRow.texts[langCode].ValueTextL; } @@ -205,18 +207,19 @@ public PXSqlValue(ValueRow myValueRow, StringCollection LanguageCodes, string Ma /// /// Used as ValueCode, ValueTextS and ValueTextL /// - public PXSqlValue(string timeCode, StringCollection LanguageCodes) - { + public PXSqlValue(string timeCode, StringCollection LanguageCodes) + { //this.meta = meta; - this.mContentsCode = null; // only for contentsvalues + this.mContentsCode = null; // only for contentsvalues this.ValueCode = timeCode; this.SortCodePxs = 0; // is sometimes overridden from outside - this.mSortCodeValue = timeCode; + this.mSortCodeValue = timeCode; this.mSortCodeVsValue = "0"; //hmmm this.SortCodeDb = "0"; //hmmm - foreach (string langCode in LanguageCodes) { + foreach (string langCode in LanguageCodes) + { this.ValueTextS[langCode] = timeCode; this.ValueTextL[langCode] = timeCode; } @@ -233,9 +236,9 @@ public PXSqlValue(PXSqlContent content, int sortCode) this.ValueTextS = content.PresTextS; // SortCodePxs and SortCode are now set to the same value. Maybe no a good thing if sortorder should be reset to db // default after read from pxs. //TODO send two sortcodes from PXSQlMeta. - this.SortCodePxs = sortCode; - this.mSortCodeValue = sortCode.ToString(); - + this.SortCodePxs = sortCode; + this.mSortCodeValue = sortCode.ToString(); + } @@ -245,7 +248,7 @@ public int CompareTo(object obj) { if (this.GetType() != obj.GetType()) { - throw new PCAxis.Sql.Exceptions.BugException(10000); + throw new PCAxis.Sql.Exceptions.BugException(10000); } else { @@ -261,7 +264,7 @@ public int CompareTo(object obj) } } } - public static IComparer SortByVsValue() + public static IComparer SortByVsValue() { return (IComparer)new SortByVsValueHelper(); } diff --git a/PCAxis.Sql/Parser_22/PXSqlValuePool.cs b/PCAxis.Sql/Parser_22/PXSqlValuePool.cs index 24a3ea1..8559785 100644 --- a/PCAxis.Sql/Parser_22/PXSqlValuePool.cs +++ b/PCAxis.Sql/Parser_22/PXSqlValuePool.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_22; -using System.Collections.Specialized; + using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_22; namespace PCAxis.Sql.Parser_22 { @@ -40,10 +39,10 @@ public Dictionary PresText { get { return mPresText; } } - // public string Description - // { - // get { return vpRow.Description; } - // } + // public string Description + // { + // get { return vpRow.Description; } + // } /// /// Which texts exists (long/short/extra/none) @@ -58,10 +57,10 @@ public string ValuePres { get { return vpRow.ValuePres; } } - // public string KDBId - // { - // get { return vpRow.KDBId; } - // } + // public string KDBId + // { + // get { return vpRow.KDBId; } + // } // Depending of if it's a primary or secondary language, Doamin is read from different columns in database table ValuePool. // Valuepool if primary and ValuePoolEng(2.0) ValuePoolAlias (later). A solution could be to add a property here called Domain. @@ -84,15 +83,20 @@ public Dictionary Domain /// For config.codes public PXSqlValuepool(QueryLib_22.ValuePoolRow inRow, PXSqlMeta_22 meta) { - + this.vpRow = inRow; - - if( this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsN) ) { - this.mValueTextOption = PXConstant.VALUETEXTOPTION_NOTEXT; - } else if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsX) ) { - this.mValueTextOption = PXConstant.VALUETEXTOPTION_TOOLONG; - } else { - this.mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; + + if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsN)) + { + this.mValueTextOption = PXConstant.VALUETEXTOPTION_NOTEXT; + } + else if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsX)) + { + this.mValueTextOption = PXConstant.VALUETEXTOPTION_TOOLONG; + } + else + { + this.mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; } mPresText = new Dictionary(); @@ -105,6 +109,6 @@ public PXSqlValuepool(QueryLib_22.ValuePoolRow inRow, PXSqlMeta_22 meta) } - + } } diff --git a/PCAxis.Sql/Parser_22/PXSqlValueSet.cs b/PCAxis.Sql/Parser_22/PXSqlValueSet.cs index 316201c..de5dd44 100644 --- a/PCAxis.Sql/Parser_22/PXSqlValueSet.cs +++ b/PCAxis.Sql/Parser_22/PXSqlValueSet.cs @@ -1,27 +1,24 @@ - using System; +using System; using System.Collections.Generic; -using System.Text; - -using PCAxis.Sql.QueryLib_22; namespace PCAxis.Sql.Parser_22 { public class PXSqlValueSet { #region - + private string mValueSet; //private string mPresText; private Dictionary mPresText = new Dictionary(); - + private string elimination; //private PXSqlValuepool mValuePool; private string mValuePoolId; private string mValuePres; private string mGeoAreaNo; - + private string mSortCodeExists; - + private int mNumberOfValues; /// @@ -41,22 +38,22 @@ public List SortedListOfCodes public string ValueSet { get { return this.mValueSet; } - + } - + public Dictionary PresText { get { return this.mPresText; } - + } - - + + public string Elimination { get { return this.elimination; } } - + public string ValuePoolId { get { return this.mValuePoolId; } @@ -65,22 +62,22 @@ public string ValuePoolId public string ValuePres { get { return this.mValuePres; } - + } public string GeoAreaNo { get { return this.mGeoAreaNo; } - + } - + public string SortCodeExists { get { return mSortCodeExists; } - + } - + public int NumberOfValues { get { return mNumberOfValues; } @@ -88,36 +85,40 @@ public int NumberOfValues } public PXSqlValueSet() { } - public PXSqlValueSet(QueryLib_22.ValueSetRow inRow) { - + public PXSqlValueSet(QueryLib_22.ValueSetRow inRow) + { + this.mValueSet = inRow.ValueSet; this.elimination = inRow.Elimination; this.mSortCodeExists = inRow.SortCodeExists; - this.mValuePoolId = inRow.ValuePool; + this.mValuePoolId = inRow.ValuePool; this.mValuePres = inRow.ValuePres; this.mGeoAreaNo = inRow.GeoAreaNo; - - foreach (string langCode in inRow.texts.Keys) { - + + foreach (string langCode in inRow.texts.Keys) + { + //PresText came in version 2.1 and is optional ... desciption is up to 200 chars string asPresText = inRow.texts[langCode].PresText; - if (String.IsNullOrEmpty(asPresText)) { + if (String.IsNullOrEmpty(asPresText)) + { asPresText = inRow.texts[langCode].Description; int gridPosition = asPresText.IndexOf('#'); - if (gridPosition > 0) { + if (gridPosition > 0) + { asPresText = asPresText.Substring(0, gridPosition); } } mPresText[langCode] = asPresText; - + } - //private int mNumberOfValues; is set outside class. Bad thing? Yes + //private int mNumberOfValues; is set outside class. Bad thing? Yes } //for magic all - public PXSqlValueSet(Dictionary presText, string valuePoolId, string elimination, string sortCodeExists,string valuePres) + public PXSqlValueSet(Dictionary presText, string valuePoolId, string elimination, string sortCodeExists, string valuePres) { this.mValueSet = PCAxis.PlugIn.Sql.PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS; this.mPresText = presText; diff --git a/PCAxis.Sql/Parser_22/PXSqlVariable.cs b/PCAxis.Sql/Parser_22/PXSqlVariable.cs index 1ef19ff..5ea93af 100644 --- a/PCAxis.Sql/Parser_22/PXSqlVariable.cs +++ b/PCAxis.Sql/Parser_22/PXSqlVariable.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_22; + using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; using PCAxis.PlugIn.Sql; +using PCAxis.Sql.QueryLib_22; namespace PCAxis.Sql.Parser_22 { @@ -44,7 +43,7 @@ public abstract class PXSqlVariable : IComparable, ISqlItem private string mVariableType; private String mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; - + //protected const string allValuesets = "_ALL_"; protected string selectedValueset; public string SelectedValueset @@ -199,13 +198,17 @@ public Dictionary ValueSets public PXSqlValuepool ValuePool { get { return mValuePool; } - set { mValuePool = value; - if (mValuePool == null) + set { - mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; - } else { - mValueTextOption = mValuePool.ValueTextOption; - } + mValuePool = value; + if (mValuePool == null) + { + mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; + } + else + { + mValueTextOption = mValuePool.ValueTextOption; + } } } @@ -244,7 +247,7 @@ public PXSqlVariable(string name, PXSqlMeta_22 meta, bool isContVar, bool isTime } #endregion constructors - + protected virtual void SetPresText() @@ -274,7 +277,7 @@ protected virtual void SetElimForPresentation() /// internal virtual bool UsesGroupingOnNonstoredData() { - return false; + return false; } @@ -327,7 +330,7 @@ internal virtual void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler { StringCollection values = new StringCollection(); string subkey = this.Name; - + //VARIABLENAME //OBS located in PXSQLBuilder near SetVariableName @@ -340,7 +343,7 @@ internal virtual void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler // PRESTEXT ParsePresTextOption(handler, LanguageCodes, preferredLanguage); - + // VALUE_TEXT_OPTION ParseValueTextOption(handler); diff --git a/PCAxis.Sql/Parser_22/PXSqlVariableClassification.cs b/PCAxis.Sql/Parser_22/PXSqlVariableClassification.cs index 7f5b9cd..f20642f 100644 --- a/PCAxis.Sql/Parser_22/PXSqlVariableClassification.cs +++ b/PCAxis.Sql/Parser_22/PXSqlVariableClassification.cs @@ -1,13 +1,14 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_22; -using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; -using PCAxis.PlugIn.Sql; using System.Data; + using log4net; + +using PCAxis.Paxiom; +using PCAxis.PlugIn.Sql; +using PCAxis.Sql.Pxs; +using PCAxis.Sql.QueryLib_22; namespace PCAxis.Sql.Parser_22 { public class PXSqlVariableClassification : PXSqlVariable @@ -70,7 +71,7 @@ internal StringCollection ValusetIds #endregion #region constructors - // public PXSqlVariableClassification() { } + // public PXSqlVariableClassification() { } public PXSqlVariableClassification(MainTableVariableRow aTVRow, PXSqlMeta_22 meta) @@ -105,7 +106,7 @@ public PXSqlVariableClassification(MainTableVariableRow aTVRow, PXSqlMeta_22 met if (this.meta.inSelectionModus) { - + this.groupingInfos = new PXSqlGroupingInfos(this.meta, this.Name, valusetIds); } } @@ -123,7 +124,7 @@ public PXSqlVariableClassification(MainTableVariableRow aTVRow, PXSqlMeta_22 met if (this.aggregationType.Equals("G")) { - + if (String.IsNullOrEmpty(this.aggregatingStructureId)) { throw new ApplicationException("Not implemented yet"); @@ -266,7 +267,7 @@ internal void SetValues(StringCollection selSubTables, PQVariable var) StringCollection mSelectedValues = new StringCollection(); // Defines a dictionary to hold all the sortorders. Necessary because of the wildcards Dictionary mDefinedSortorder = new Dictionary(); - + DataSet mValueInfoTbl; DataRowCollection mValueInfo; string mPxsSubTableId = meta.PxsFile.Query.SubTable; @@ -281,7 +282,7 @@ internal void SetValues(StringCollection selSubTables, PQVariable var) { if (val.Group != null) { - + //currentGrouping = ... //TODO; PXSqlVariableClassification, SetValues: group not implemented yet" throw new NotImplementedException("PXSqlVariableClassification, SetValues: group not implemented yet"); @@ -321,7 +322,7 @@ internal void SetValues(StringCollection selSubTables, PQVariable var) documentOrder++; } - #endregion foreach var.Values.Items + #endregion foreach var.Values.Items // mSelectedValues now contains all the selected values, including those defined by wildcards @@ -404,7 +405,7 @@ internal override bool UsesGroupingOnNonstoredData() { return currentGrouping.isOnNonstoredData(); } - + } @@ -474,22 +475,22 @@ private void SetValueset() //} //else //{ - if (this.pxsQueryVariable == null || this.pxsQueryVariable.SelectedValueset == PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS) - { - tmpList = meta.MetaQuery.GetValueSetRows2(meta.MainTable.MainTable, this.Name); - } - else - //{ - //if (this.pxsQueryVariable.SelectedValueset == PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS) - //{ - // tmpList = meta.MetaQuery.GetValueSetRows2(meta.MainTable.MainTable, this.Name); - //} - //else - { - tmpList.Add(meta.MetaQuery.GetValueSetRow(this.pxsQueryVariable.SelectedValueset)); // for selected valueset without subtable stored in pxs. - } - // } - // } + if (this.pxsQueryVariable == null || this.pxsQueryVariable.SelectedValueset == PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS) + { + tmpList = meta.MetaQuery.GetValueSetRows2(meta.MainTable.MainTable, this.Name); + } + else + //{ + //if (this.pxsQueryVariable.SelectedValueset == PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS) + //{ + // tmpList = meta.MetaQuery.GetValueSetRows2(meta.MainTable.MainTable, this.Name); + //} + //else + { + tmpList.Add(meta.MetaQuery.GetValueSetRow(this.pxsQueryVariable.SelectedValueset)); // for selected valueset without subtable stored in pxs. + } + // } + // } int NumberOfSelectedValueSets = tmpList.Count; mValueSets = new Dictionary(); @@ -901,12 +902,14 @@ private void ParseValueSetKeywords(PCAxis.Paxiom.IPXModelParser.MetaHandler hand if (meta.inPresentationModus) { parseValueSet = true; - }else + } + else { if ((this.ValueSets.Values.Count > 1) || (this.groupingInfos.Infos.Count > 0)) { parseValueSet = true; - }else + } + else { parseValueSet = false; } @@ -1064,7 +1067,7 @@ internal void ParseHierarchyNames(PCAxis.Paxiom.IPXModelParser.MetaHandler handl } values = null; } - + } } \ No newline at end of file diff --git a/PCAxis.Sql/Parser_22/PXSqlVariableContents.cs b/PCAxis.Sql/Parser_22/PXSqlVariableContents.cs index 6358098..aa279cd 100644 --- a/PCAxis.Sql/Parser_22/PXSqlVariableContents.cs +++ b/PCAxis.Sql/Parser_22/PXSqlVariableContents.cs @@ -1,17 +1,18 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_22; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_22; + namespace PCAxis.Sql.Parser_22 { class PXSqlVariableContents : PXSqlVariable { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableContents)); - + #region contructor public PXSqlVariableContents(String name, PXSqlMeta_22 meta) : base(name, meta, true, false, false) @@ -21,7 +22,7 @@ public PXSqlVariableContents(String name, PXSqlMeta_22 meta) if (!meta.ConstructedFromPxs) { mIndex = mStoreColumnNo; - } + } SetDefaultPresTextOption(); SetPresText(); } @@ -78,8 +79,9 @@ private void SetDefaultPresTextOption() /// /// /// - internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) { - + internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) + { + base.ParseMeta(handler, LanguageCodes, preferredLanguage); //CONTVARIABLE @@ -96,14 +98,14 @@ internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handle string tmpAggregPossible = PXConstant.YES; foreach (PXSqlContent pxsqlCont in meta.Contents.Values) { - - if (! pxsqlCont.AggregPossible) + + if (!pxsqlCont.AggregPossible) { tmpAggregPossible = PXConstant.NO; break; } } - + values.Clear(); values.Add(tmpAggregPossible); handler(PXKeywords.AGGREGALLOWED, language, subkey, values); @@ -112,7 +114,8 @@ internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handle log.Debug("meta.Contents.Values.Count=" + meta.Contents.Values.Count.ToString()); // "ContentInfo" // og PXKeywords.PRECISION - foreach (PXSqlContent pxsqlCont in meta.Contents.Values) { + foreach (PXSqlContent pxsqlCont in meta.Contents.Values) + { pxsqlCont.ParseMeta(handler, LanguageCodes); } diff --git a/PCAxis.Sql/Parser_22/PXSqlVariableTime.cs b/PCAxis.Sql/Parser_22/PXSqlVariableTime.cs index 25a0e51..b6277a4 100644 --- a/PCAxis.Sql/Parser_22/PXSqlVariableTime.cs +++ b/PCAxis.Sql/Parser_22/PXSqlVariableTime.cs @@ -1,41 +1,40 @@ -using System; +using System.Collections; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_22; -using PCAxis.Paxiom; - -using System.Collections; -using log4net; +using log4net; +using PCAxis.Paxiom; using PCAxis.Sql.Pxs; +using PCAxis.Sql.QueryLib_22; namespace PCAxis.Sql.Parser_22 { - public class PXSqlVariableTime:PXSqlVariable + public class PXSqlVariableTime : PXSqlVariable { - private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableTime)); - #region props - private PXSqlTimeScale mTimeScale; - - - private StringCollection mTimeVal; - public StringCollection TimeVal { - get { return mTimeVal; } - } - private bool mHasTimeVal; - public bool HasTimeVal { - get { return mHasTimeVal; } - } - //private bool mTableContainsMetaOnly; - #endregion props - - - #region contructor + private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableTime)); + #region props + private PXSqlTimeScale mTimeScale; + + + private StringCollection mTimeVal; + public StringCollection TimeVal + { + get { return mTimeVal; } + } + private bool mHasTimeVal; + public bool HasTimeVal + { + get { return mHasTimeVal; } + } + //private bool mTableContainsMetaOnly; + #endregion props + + + #region contructor public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_22 meta) - :base(aTVRow.Variable,meta,false,true,false) + : base(aTVRow.Variable, meta, false, true, false) { mStoreColumnNo = int.Parse(aTVRow.StoreColumnNo); if (!meta.ConstructedFromPxs) @@ -44,9 +43,9 @@ public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_22 meta) } SetSelected(); SetPresText(); - SetDefaultPresTextOption(); + SetDefaultPresTextOption(); SetTimeValues(); - mTimeScale = new PXSqlTimeScale(meta.MetaQuery.GetTimeScaleRow(meta.MainTable.TimeScale),meta.Config); + mTimeScale = new PXSqlTimeScale(meta.MetaQuery.GetTimeScaleRow(meta.MainTable.TimeScale), meta.Config); SetTimeVal(); PossiblyResetPresText(); @@ -54,7 +53,7 @@ public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_22 meta) } - #endregion + #endregion internal void SetSelected() { this.mIsSelected = false; @@ -67,10 +66,10 @@ internal void SetSelected() { this.mIsSelected = true; } - } + } internal override List GetValuesForParsing() { - if ((meta.inPresentationModus) && meta.ConstructedFromPxs ) + if ((meta.inPresentationModus) && meta.ConstructedFromPxs) { if ((int)meta.PxsFile.Query.Time.TimeOption == 0) { @@ -102,20 +101,22 @@ internal override List GetValuesForParsing() /// /// /// - internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) { - base.ParseMeta(handler, LanguageCodes, preferredLanguage); - //log.Debug("PPPPPPPPPPPPPPPPPParsing"); - //TIMEVAL - if (mHasTimeVal) { - - string language = null; - string subkey = this.Name; - StringCollection values = this.mTimeVal; - handler(PXKeywords.TIMEVAL, language, subkey, values); - values = null; - } - - } + internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) + { + base.ParseMeta(handler, LanguageCodes, preferredLanguage); + //log.Debug("PPPPPPPPPPPPPPPPPParsing"); + //TIMEVAL + if (mHasTimeVal) + { + + string language = null; + string subkey = this.Name; + StringCollection values = this.mTimeVal; + handler(PXKeywords.TIMEVAL, language, subkey, values); + values = null; + } + + } private void SetDefaultPresTextOption() @@ -127,58 +128,59 @@ private void SetDefaultPresTextOption() - private void SetTimeVal() { - - - string timeUnit; - if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitA) - timeUnit = "A1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitH) - timeUnit = "H1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitM) - timeUnit = "M1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitQ) - timeUnit = "Q1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitW) - timeUnit = "W1"; - else - { - log.Warn("Wrong Timeunit:" + mTimeScale.TimeUnit); - timeUnit = mTimeScale.TimeUnit; - } - - mTimeVal = new StringCollection(); - mTimeVal.Add("TLIST("+timeUnit+")"); - mHasTimeVal = true; - if (!meta.MainTable.ContainsOnlyMetaData) - { - string lowestSelectedTime; - string highestSelectedTime; - ArrayList selectedTimeCodes = new ArrayList(); - foreach (KeyValuePair val in mValues) - { - selectedTimeCodes.Add(val.Value.ValueCode); - } - selectedTimeCodes.Sort(); - lowestSelectedTime = selectedTimeCodes[0].ToString(); - highestSelectedTime = selectedTimeCodes[selectedTimeCodes.Count - 1].ToString(); - ArrayList allTimeCodes = TimeValueCodesSortedChronologicaly(); - int startIndexAllTimes = allTimeCodes.IndexOf(lowestSelectedTime); - int endIndexAllTimes = allTimeCodes.IndexOf(highestSelectedTime); - for (int i = startIndexAllTimes; i <= endIndexAllTimes; i++) - { - mTimeVal.Add(allTimeCodes[i].ToString()); - if (!selectedTimeCodes.Contains(allTimeCodes[i])) - { - //TODO; Dette gjøres midlertidig for Ã¥ sørge for at Timeval - //vises i serialiseringen - mTimeVal.Clear(); - mTimeVal.Add("TLIST(" + timeUnit + ")"); - break; - } - } - } - } + private void SetTimeVal() + { + + + string timeUnit; + if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitA) + timeUnit = "A1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitH) + timeUnit = "H1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitM) + timeUnit = "M1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitQ) + timeUnit = "Q1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitW) + timeUnit = "W1"; + else + { + log.Warn("Wrong Timeunit:" + mTimeScale.TimeUnit); + timeUnit = mTimeScale.TimeUnit; + } + + mTimeVal = new StringCollection(); + mTimeVal.Add("TLIST(" + timeUnit + ")"); + mHasTimeVal = true; + if (!meta.MainTable.ContainsOnlyMetaData) + { + string lowestSelectedTime; + string highestSelectedTime; + ArrayList selectedTimeCodes = new ArrayList(); + foreach (KeyValuePair val in mValues) + { + selectedTimeCodes.Add(val.Value.ValueCode); + } + selectedTimeCodes.Sort(); + lowestSelectedTime = selectedTimeCodes[0].ToString(); + highestSelectedTime = selectedTimeCodes[selectedTimeCodes.Count - 1].ToString(); + ArrayList allTimeCodes = TimeValueCodesSortedChronologicaly(); + int startIndexAllTimes = allTimeCodes.IndexOf(lowestSelectedTime); + int endIndexAllTimes = allTimeCodes.IndexOf(highestSelectedTime); + for (int i = startIndexAllTimes; i <= endIndexAllTimes; i++) + { + mTimeVal.Add(allTimeCodes[i].ToString()); + if (!selectedTimeCodes.Contains(allTimeCodes[i])) + { + //TODO; Dette gjøres midlertidig for Ã¥ sørge for at Timeval + //vises i serialiseringen + mTimeVal.Clear(); + mTimeVal.Add("TLIST(" + timeUnit + ")"); + break; + } + } + } + } /** @@ -188,33 +190,35 @@ private void PossiblyResetPresText() { if (mTimeScale.UsePresTextFromTimeScale) { - List keys = new List(this.PresText.Keys); - + List keys = new List(this.PresText.Keys); + foreach (string langCode in keys) { - this.PresText[langCode] = mTimeScale.getPresText(langCode); + this.PresText[langCode] = mTimeScale.getPresText(langCode); } - + } } private ArrayList TimeValueCodesSortedChronologicaly() - { - ArrayList sortedTimeValues = new ArrayList(); - System.Data.DataSet mTimeInfoTbl = meta.MetaQuery.GetAllTimeValues(meta.MainTable.MainTable, "asc"); - - foreach (System.Data.DataRow row in mTimeInfoTbl.Tables[0].Rows) { + { + ArrayList sortedTimeValues = new ArrayList(); + System.Data.DataSet mTimeInfoTbl = meta.MetaQuery.GetAllTimeValues(meta.MainTable.MainTable, "asc"); - sortedTimeValues.Add(row[meta.MetaQuery.DB.ContentsTime.TimePeriodCol.PureColumnName()].ToString()); - } - sortedTimeValues.Sort(); - return sortedTimeValues; - } + foreach (System.Data.DataRow row in mTimeInfoTbl.Tables[0].Rows) + { + sortedTimeValues.Add(row[meta.MetaQuery.DB.ContentsTime.TimePeriodCol.PureColumnName()].ToString()); + } + sortedTimeValues.Sort(); + return sortedTimeValues; + } - private void SetTimeValues() { + + private void SetTimeValues() + { // time variable values //lage flere overloads databasespørringer avhengig av timeopt //mValues = new Dictionary(); diff --git a/PCAxis.Sql/Parser_22/PXSqlVariables.cs b/PCAxis.Sql/Parser_22/PXSqlVariables.cs index 38f9c2c..d69b19d 100644 --- a/PCAxis.Sql/Parser_22/PXSqlVariables.cs +++ b/PCAxis.Sql/Parser_22/PXSqlVariables.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_22; + +using log4net; + using PCAxis.Paxiom; using PCAxis.Sql.Pxs; -using log4net; namespace PCAxis.Sql.Parser_22 { @@ -26,28 +25,29 @@ public PXSqlVariables(PXSqlMeta_22 meta) /// internal bool HasAnyoneGroupingOnNonstoredData() { - - foreach (PXSqlVariable var in this.Values) + + foreach (PXSqlVariable var in this.Values) + { + if (var.UsesGroupingOnNonstoredData()) { - if (var.UsesGroupingOnNonstoredData() ) - { - return true; - } + return true; } - return false; - + } + return false; + } internal void setStubHeadPxs() { - int highestUsedStubIndex = 0 ; + int highestUsedStubIndex = 0; if (meta.PxsFile.Presentation.Stub != null) - foreach ( AxisType stub in meta.PxsFile.Presentation.Stub) + foreach (AxisType stub in meta.PxsFile.Presentation.Stub) { //mSqlVariable = this[stub.code]; this[stub.code].Index = stub.index; - if(stub.index > highestUsedStubIndex ) { + if (stub.index > highestUsedStubIndex) + { highestUsedStubIndex = stub.index; } this[stub.code].IsStub = true; @@ -58,13 +58,15 @@ internal void setStubHeadPxs() foreach (AxisType heading in meta.PxsFile.Presentation.Heading) { //mSqlVariable = this[heading.code]; - this[heading.code].Index = heading.index; - this[heading.code].IsHeading = true; + this[heading.code].Index = heading.index; + this[heading.code].IsHeading = true; } } - foreach (PXSqlVariable tmpVar in this.Values) { - if (tmpVar.isSelected && (!tmpVar.IsHeading) && (!tmpVar.IsStub)) { + foreach (PXSqlVariable tmpVar in this.Values) + { + if (tmpVar.isSelected && (!tmpVar.IsHeading) && (!tmpVar.IsStub)) + { log.Warn("Variable " + tmpVar.Name + " isSelected, but neither Heading nor Stub. Setting it to stub"); highestUsedStubIndex++; tmpVar.IsStub = true; @@ -85,18 +87,18 @@ internal void setStubHeadDefault() { if (tmpVar.IsTimevariable) { - // tmpVar.Index = 1; + // tmpVar.Index = 1; tmpVar.IsHeading = true; } else if (tmpVar.IsContentVariable) { - // tmpVar.Index = 2; + // tmpVar.Index = 2; tmpVar.IsHeading = true; } else { - // tmpVar.Index = stubIndex; - // stubIndex++; + // tmpVar.Index = stubIndex; + // stubIndex++; tmpVar.IsStub = true; } } @@ -132,12 +134,12 @@ internal List GetHeadingSorted() } } } - mHeadings.Sort(); - return mHeadings; + mHeadings.Sort(); + return mHeadings; } internal List GetStubSorted() { - List mStubs = new List(); + List mStubs = new List(); foreach (PXSqlVariable var in this.Values) { if (var.isSelected) @@ -179,5 +181,5 @@ internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, String } } - + diff --git a/PCAxis.Sql/Parser_22/PXSqlVariablesClassification.cs b/PCAxis.Sql/Parser_22/PXSqlVariablesClassification.cs index a54e539..67ac7d6 100644 --- a/PCAxis.Sql/Parser_22/PXSqlVariablesClassification.cs +++ b/PCAxis.Sql/Parser_22/PXSqlVariablesClassification.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_21; -using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; -using log4net; +using System.Collections.Generic; namespace PCAxis.Sql.Parser_22 { diff --git a/PCAxis.Sql/Parser_22/ParseMetaIndependentOfMaintable.cs b/PCAxis.Sql/Parser_22/ParseMetaIndependentOfMaintable.cs index 4d94556..71a4fc6 100644 --- a/PCAxis.Sql/Parser_22/ParseMetaIndependentOfMaintable.cs +++ b/PCAxis.Sql/Parser_22/ParseMetaIndependentOfMaintable.cs @@ -1,10 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Collections.Specialized; -using PCAxis.Paxiom; +using System.Collections.Specialized; + using log4net; +using PCAxis.Paxiom; + namespace PCAxis.Sql.Parser_22 { @@ -13,92 +12,96 @@ namespace PCAxis.Sql.Parser_22 /// public class ParseMetaIndependentOfMaintable { - private static readonly ILog log = LogManager.GetLogger(typeof(ParseMetaIndependentOfMaintable)); - - internal ParseMetaIndependentOfMaintable() { } - - /// "ANSI" - /// "2000" hei - /// System.DateTime.UtcNow - /// - /// - /// If there exists a Optional_PXCodepage entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "iso-8859-1" - /// - /// - ///
- ///
- ///
- /// - /// - /// If there exists a Optional_PXAxisVersion entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "2000" - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// If there exists a Optional_PXCharset entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "ANSI" - /// - /// - ///
- ///
- ///
- /// - /// - /// If there exists a Optional_PXDescriptionDefault entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise false - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") - /// - /// - /// - internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, PXMetaAdmValues metaAdm ) { - string noLanguage = null; - string subkey = null; - StringCollection values = new StringCollection(); - - values.Add(metaAdm.PXCharset); - handler(PXKeywords.CHARSET, noLanguage, subkey, values); - - - values.Clear(); - values.Add(metaAdm.PXAxisVersion); - handler(PXKeywords.AXIS_VERSION, noLanguage, subkey, values); - - values.Clear(); - values.Add(metaAdm.PXCodepage); - handler(PXKeywords.CODEPAGE, noLanguage, subkey, values); - - values.Clear(); - if (metaAdm.PXDescriptionDefault) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.DESCRIPTIONDEFAULT, noLanguage, subkey, values); - - values.Clear(); - - // string nowString = System.DateTime.UtcNow.ToString("yyyyMMdd hh:mm"); bug 193 wrong time - // string nowString = System.DateTime.Now.ToString(); - // string nowString = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm"); - // ørebro vedtak(beslut). - //ørebro 27.11.2012 Nytt formatvedtak + private static readonly ILog log = LogManager.GetLogger(typeof(ParseMetaIndependentOfMaintable)); + + internal ParseMetaIndependentOfMaintable() { } + + /// "ANSI" + /// "2000" hei + /// System.DateTime.UtcNow + /// + /// + /// If there exists a Optional_PXCodepage entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "iso-8859-1" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If there exists a Optional_PXAxisVersion entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "2000" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// If there exists a Optional_PXCharset entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "ANSI" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If there exists a Optional_PXDescriptionDefault entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise false + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") + /// + /// + /// + internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, PXMetaAdmValues metaAdm) + { + string noLanguage = null; + string subkey = null; + StringCollection values = new StringCollection(); + + values.Add(metaAdm.PXCharset); + handler(PXKeywords.CHARSET, noLanguage, subkey, values); + + + values.Clear(); + values.Add(metaAdm.PXAxisVersion); + handler(PXKeywords.AXIS_VERSION, noLanguage, subkey, values); + + values.Clear(); + values.Add(metaAdm.PXCodepage); + handler(PXKeywords.CODEPAGE, noLanguage, subkey, values); + + values.Clear(); + if (metaAdm.PXDescriptionDefault) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.DESCRIPTIONDEFAULT, noLanguage, subkey, values); + + values.Clear(); + + // string nowString = System.DateTime.UtcNow.ToString("yyyyMMdd hh:mm"); bug 193 wrong time + // string nowString = System.DateTime.Now.ToString(); + // string nowString = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm"); + // ørebro vedtak(beslut). + //ørebro 27.11.2012 Nytt formatvedtak //string nowString = System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz"); - string nowString = System.DateTime.Now.ToString("yyyyMMdd HH:mm"); + string nowString = System.DateTime.Now.ToString("yyyyMMdd HH:mm"); + + values.Add(nowString); - values.Add(nowString); - - handler(PXKeywords.CREATION_DATE, noLanguage, subkey, values); - } + handler(PXKeywords.CREATION_DATE, noLanguage, subkey, values); + } } diff --git a/PCAxis.Sql/Parser_22/PxSqlParserForCodelists_22.cs b/PCAxis.Sql/Parser_22/PxSqlParserForCodelists_22.cs index 19802d4..146e62e 100644 --- a/PCAxis.Sql/Parser_22/PxSqlParserForCodelists_22.cs +++ b/PCAxis.Sql/Parser_22/PxSqlParserForCodelists_22.cs @@ -14,12 +14,12 @@ public class PXSqlParserForCodelists_22 : PCAxis.PlugIn.Sql.PXSqlParserForCodeli { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlParserForCodelists_22)); - + //private List _variables; private List _variables; - + private PXSqlMeta_22 mPXSqlMeta; - + #region Constructors @@ -28,38 +28,39 @@ public class PXSqlParserForCodelists_22 : PCAxis.PlugIn.Sql.PXSqlParserForCodeli ///
/// PXSqlMeta holding variables /// Name of the vaiable - public PXSqlParserForCodelists_22(PXSqlMeta_22 inPXSqlMeta, String variableCode) { - mPXSqlMeta = inPXSqlMeta; - _variables = new List(); - _variables.Add(inPXSqlMeta.VariablesClassification[variableCode]); + public PXSqlParserForCodelists_22(PXSqlMeta_22 inPXSqlMeta, String variableCode) + { + mPXSqlMeta = inPXSqlMeta; + _variables = new List(); + _variables.Add(inPXSqlMeta.VariablesClassification[variableCode]); } #endregion - + /// /// Sends the data /// /// /// - public override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) - { - foreach (PXSqlVariableClassification variable in _variables) - { - - variable.ParseForApplyValueSet(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); - } + public override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) + { + foreach (PXSqlVariableClassification variable in _variables) + { + variable.ParseForApplyValueSet(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); + } + + + } - } - /// - /// IDisposable implemenatation + /// IDisposable implemenatation /// - override public void Dispose() - { + override public void Dispose() + { mPXSqlMeta = null; } diff --git a/PCAxis.Sql/Parser_22/PxSqlParser_22.cs b/PCAxis.Sql/Parser_22/PxSqlParser_22.cs index 3afb543..19d6870 100644 --- a/PCAxis.Sql/Parser_22/PxSqlParser_22.cs +++ b/PCAxis.Sql/Parser_22/PxSqlParser_22.cs @@ -1,9 +1,9 @@ -using System; using System.Collections.Specialized; -using PCAxis.Paxiom; using log4net; +using PCAxis.Paxiom; + namespace PCAxis.Sql.Parser_22 { public class PXSqlParser_22 : PCAxis.PlugIn.Sql.PXSqlParser @@ -17,10 +17,11 @@ public class PXSqlParser_22 : PCAxis.PlugIn.Sql.PXSqlParser internal PXSqlNpm symbols; #region Constructor - // public PXSqlParser_22() { } + // public PXSqlParser_22() { } - public PXSqlParser_22(PXSqlMeta_22 inPXSqlMeta) { + public PXSqlParser_22(PXSqlMeta_22 inPXSqlMeta) + { mPXSqlMeta = inPXSqlMeta; if (mPXSqlMeta.inPresentationModus) @@ -81,18 +82,21 @@ public PXSqlParser_22(PXSqlMeta_22 inPXSqlMeta) { /// /// /// - override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) { + override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) + { string keyword; - + string noLanguage = null; string subkey = null; StringCollection values; - if (mHasParsedMeta) { + if (mHasParsedMeta) + { return; } - if (mPXSqlMeta.HasLanguage) { + if (mPXSqlMeta.HasLanguage) + { // Language keyword = PXKeywords.LANGUAGE; values = new StringCollection(); @@ -102,7 +106,8 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, // Languages keyword = PXKeywords.LANGUAGES; values = new StringCollection(); - foreach (string lang in mPXSqlMeta.LanguageCodes) { + foreach (string lang in mPXSqlMeta.LanguageCodes) + { values.Add(lang); } handler(keyword, noLanguage, subkey, values); @@ -119,7 +124,8 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, - foreach (PXSqlVariable var in mPXSqlMeta.Variables.Values) { + foreach (PXSqlVariable var in mPXSqlMeta.Variables.Values) + { var.ParseMeta(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); } @@ -131,13 +137,13 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, mPXSqlMeta.TheNotes.ParseAllNotes(handler); - - + + #endregion Footnotes #region NPMish stuff - if (mPXSqlMeta.inPresentationModus ) + if (mPXSqlMeta.inPresentationModus) { this.symbols.ParseMeta(handler, mPXSqlMeta); } @@ -153,12 +159,14 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, /// /// IDisposable implemenatation /// - override public void Dispose() { - if (mPXSqlMeta != null) { + override public void Dispose() + { + if (mPXSqlMeta != null) + { mPXSqlMeta.Dispose(); } } - + } } diff --git a/PCAxis.Sql/Parser_22/PxSqlValues.cs b/PCAxis.Sql/Parser_22/PxSqlValues.cs index 6899fba..35009b8 100644 --- a/PCAxis.Sql/Parser_22/PxSqlValues.cs +++ b/PCAxis.Sql/Parser_22/PxSqlValues.cs @@ -1,16 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Text; -using log4net; +using System.Collections.Generic; + +using log4net; namespace PCAxis.Sql.Parser_22 { - public class PxSqlValues:Dictionary + public class PxSqlValues : Dictionary { #region contants - private static readonly ILog log = LogManager.GetLogger(typeof(PxSqlValues)); - + private static readonly ILog log = LogManager.GetLogger(typeof(PxSqlValues)); + #endregion internal List GetValuesForSelectedValueset(string selectedValueset) { @@ -21,7 +20,7 @@ internal List GetValuesForSelectedValueset(string selectedValueset) valuesetsValues.Add(value); else if (value.ValueSet == selectedValueset) - valuesetsValues.Add(value); + valuesetsValues.Add(value); } return valuesetsValues; } @@ -39,7 +38,7 @@ internal List GetValuesSortedByVSValue(List values) } internal List GetValuesSortedByValue(List values) { - + List sortedValueList = new List(); foreach (PXSqlValue value in values) { diff --git a/PCAxis.Sql/Parser_22/SqlCollection.cs b/PCAxis.Sql/Parser_22/SqlCollection.cs index b6070eb..1b2d8b0 100644 --- a/PCAxis.Sql/Parser_22/SqlCollection.cs +++ b/PCAxis.Sql/Parser_22/SqlCollection.cs @@ -1,18 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Text; using System.Collections.Specialized; namespace PCAxis.Sql.Parser_22 { - // brukes ikke lenger da generisk dictionary benyttes istedet - class SqlCollection: NameObjectCollectionBase where T:ISqlItem + // brukes ikke lenger da generisk dictionary benyttes istedet + class SqlCollection : NameObjectCollectionBase where T : ISqlItem { #region add public void Add(T collItem) { - base.BaseAdd(collItem.Name,collItem); + base.BaseAdd(collItem.Name, collItem); } #endregion #region remove @@ -22,7 +18,7 @@ public void Remove(T collItem) } #endregion #region locate - public T Item (string Name) + public T Item(string Name) { return (T)base.BaseGet(Name/*.ToUpper()*/); diff --git a/PCAxis.Sql/Parser_22/Texts.cs b/PCAxis.Sql/Parser_22/Texts.cs index 77c6604..bdb1805 100644 --- a/PCAxis.Sql/Parser_22/Texts.cs +++ b/PCAxis.Sql/Parser_22/Texts.cs @@ -1,13 +1,11 @@ -using System; using System.Collections.Generic; -using System.Text; namespace PCAxis.Sql.Parser_22 { // This class should read from a configuration file. class Texts { - private Dictionary mPaxiomAnd; + private Dictionary mPaxiomAnd; public Dictionary PaxiomAnd { get { return mPaxiomAnd; } @@ -28,16 +26,16 @@ public Dictionary PaxiomType } public Texts() { - mPaxiomAnd = new Dictionary(); + mPaxiomAnd = new Dictionary(); mPaxiomBy = new Dictionary(); mPaxiomType = new Dictionary(); - mPaxiomAnd["en"] = "and"; - mPaxiomBy["en"] = "by"; - mPaxiomType["en"] = "type"; - mPaxiomAnd["no"] = "og"; - mPaxiomBy["no"] = "etter"; - mPaxiomType["no"] = "type"; + mPaxiomAnd["en"] = "and"; + mPaxiomBy["en"] = "by"; + mPaxiomType["en"] = "type"; + mPaxiomAnd["no"] = "og"; + mPaxiomBy["no"] = "etter"; + mPaxiomType["no"] = "type"; } } diff --git a/PCAxis.Sql/Parser_23/ISqlItem.cs b/PCAxis.Sql/Parser_23/ISqlItem.cs index 85c5a24..b999a0a 100644 --- a/PCAxis.Sql/Parser_23/ISqlItem.cs +++ b/PCAxis.Sql/Parser_23/ISqlItem.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace PCAxis.Sql.Parser_23 { public interface ISqlItem diff --git a/PCAxis.Sql/Parser_23/PXMetaAdmValues.cs b/PCAxis.Sql/Parser_23/PXMetaAdmValues.cs index 72d7c92..052aa37 100644 --- a/PCAxis.Sql/Parser_23/PXMetaAdmValues.cs +++ b/PCAxis.Sql/Parser_23/PXMetaAdmValues.cs @@ -1,16 +1,19 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_23; + using log4net; + using PCAxis.Sql.DbConfig; +using PCAxis.Sql.QueryLib_23; -namespace PCAxis.Sql.Parser_23 { +namespace PCAxis.Sql.Parser_23 +{ /// /// Gets the values from the MetaAdm table or their defaults. /// - public class PXMetaAdmValues { + public class PXMetaAdmValues + { private static readonly ILog log = LogManager.GetLogger(typeof(PXMetaAdmValues)); @@ -21,7 +24,8 @@ public class PXMetaAdmValues { /// /// returns the PXCodepage from database (optional) or the default /// - internal string PXCodepage { + internal string PXCodepage + { get { return _PXCodepage; } } @@ -29,7 +33,8 @@ internal string PXCodepage { /// /// returns the PXCharset from database (optional) or the default /// - internal string PXCharset { + internal string PXCharset + { get { return _PXCharset; } } @@ -37,7 +42,8 @@ internal string PXCharset { /// /// returns the PXAxisVersion from database (optional) or the default /// - internal string PXAxisVersion { + internal string PXAxisVersion + { get { return _PXAxisVersion; } } @@ -46,7 +52,8 @@ internal string PXAxisVersion { /// /// returns the PXDescriptionDefault from database (optional) or the default /// - internal bool PXDescriptionDefault { + internal bool PXDescriptionDefault + { get { return _PXDescriptionDefault; } } @@ -64,7 +71,8 @@ internal bool AllwaysUseMaintablePrestextSInDynamicTitle /// /// Gets the ID for DataNotAvailable /// - internal string DataNotAvailable{ + internal string DataNotAvailable + { get { return _DataNotAvailable; } } @@ -104,7 +112,7 @@ internal string DefaultCodeMissingLine { get { return _DefaultCodeMissingLine; } } - + #endregion fields & properties @@ -123,68 +131,76 @@ public PXMetaAdmValues(MetaQuery mMetaQuery) if (altIBasen.ContainsKey(Keywords.DataNotAvailable)) { _DataNotAvailable = altIBasen[Keywords.DataNotAvailable].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataNotAvailable + " not found in table with modelname MetaAdm."); - } - - if (altIBasen.ContainsKey(Keywords.DataNoteSum)) - { - _DataNoteSum = altIBasen[Keywords.DataNoteSum].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataNoteSum + " not found in table with modelname MetaAdm."); - } - - - if (altIBasen.ContainsKey(Keywords.DataSymbolNIL)) - { - _DataSymbolNIL = altIBasen[Keywords.DataSymbolNIL].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataSymbolNIL + " not found in table with modelname MetaAdm."); - } - - if (altIBasen.ContainsKey(Keywords.DataSymbolSum)) - { - _DataSymbolSum = altIBasen[Keywords.DataSymbolSum].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataSymbolSum + " not found in table with modelname MetaAdm."); - } - - - if (altIBasen.ContainsKey(Keywords.DefaultCodeMissingLine)) - { - _DefaultCodeMissingLine = altIBasen[Keywords.DefaultCodeMissingLine].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DefaultCodeMissingLine + " not found in table with modelname MetaAdm."); - } + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataNotAvailable + " not found in table with modelname MetaAdm."); + } + + if (altIBasen.ContainsKey(Keywords.DataNoteSum)) + { + _DataNoteSum = altIBasen[Keywords.DataNoteSum].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataNoteSum + " not found in table with modelname MetaAdm."); + } + + + if (altIBasen.ContainsKey(Keywords.DataSymbolNIL)) + { + _DataSymbolNIL = altIBasen[Keywords.DataSymbolNIL].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataSymbolNIL + " not found in table with modelname MetaAdm."); + } + + if (altIBasen.ContainsKey(Keywords.DataSymbolSum)) + { + _DataSymbolSum = altIBasen[Keywords.DataSymbolSum].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataSymbolSum + " not found in table with modelname MetaAdm."); + } + + + if (altIBasen.ContainsKey(Keywords.DefaultCodeMissingLine)) + { + _DefaultCodeMissingLine = altIBasen[Keywords.DefaultCodeMissingLine].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DefaultCodeMissingLine + " not found in table with modelname MetaAdm."); + } //Optional //PXCodepage - if (Keywords.Optional_PXCodepage != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXCodepage)) { + if (Keywords.Optional_PXCodepage != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXCodepage)) + { _PXCodepage = altIBasen[Keywords.Optional_PXCodepage].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXCodepage + " not found in table with modelname MetaAdm."); } } //PXDescriptionDefault - if (Keywords.Optional_PXDescriptionDefault != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXDescriptionDefault)) { + if (Keywords.Optional_PXDescriptionDefault != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXDescriptionDefault)) + { _PXDescriptionDefault = altIBasen[Keywords.Optional_PXDescriptionDefault].Value.Equals(dbConfig.Codes.Yes); - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXDescriptionDefault + " not found in table with modelname MetaAdm."); } } @@ -203,29 +219,37 @@ public PXMetaAdmValues(MetaQuery mMetaQuery) //PXCharset - if (Keywords.Optional_PXCharset != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXCharset)) { + if (Keywords.Optional_PXCharset != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXCharset)) + { _PXCharset = altIBasen[Keywords.Optional_PXCharset].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXCharset + " not found in table with modelname MetaAdm."); } } //PXAxisVersion - if (Keywords.Optional_PXAxisVersion != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXAxisVersion)) { + if (Keywords.Optional_PXAxisVersion != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXAxisVersion)) + { _PXAxisVersion = altIBasen[Keywords.Optional_PXAxisVersion].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXAxisVersion + " not found in table with modelname MetaAdm."); } } } - - - + + + } } diff --git a/PCAxis.Sql/Parser_23/PXSqlAttributes.cs b/PCAxis.Sql/Parser_23/PXSqlAttributes.cs index 8029a75..3ac008b 100644 --- a/PCAxis.Sql/Parser_23/PXSqlAttributes.cs +++ b/PCAxis.Sql/Parser_23/PXSqlAttributes.cs @@ -1,9 +1,7 @@ using System; using System.Collections.Generic; -using System.Collections.Specialized; using System.Linq; -using System.Text; -using PCAxis.Paxiom; + using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 @@ -35,7 +33,7 @@ internal Dictionary AvailableAttributes get { return mAvailableAttributes; } } - string mTheOneAndOnlyAttributeColumn; + string mTheOneAndOnlyAttributeColumn; internal string TheOneAndOnlyAttributeColumn { get { return mTheOneAndOnlyAttributeColumn; } @@ -45,7 +43,7 @@ internal string TheOneAndOnlyAttributeColumn //protected Dictionary _AttributesEntries; - internal PXSqlAttributes( PXSqlMeta_23 meta) + internal PXSqlAttributes(PXSqlMeta_23 meta) { this.mMeta = meta; mAvailableAttributes = mMeta.MetaQuery.GetAttributeRows(meta.MainTable.MainTable, true); @@ -64,9 +62,9 @@ internal PXSqlAttributes( PXSqlMeta_23 meta) /// /// Returns attributes order by sequenceNo /// - private SortedList getAttributesSorted() + private SortedList getAttributesSorted() { - SortedList sortedAttributes = new SortedList(); + SortedList sortedAttributes = new SortedList(); foreach (AttributeRow myAttr in this.mAvailableAttributes.Values) { sortedAttributes.Add(myAttr.SequenceNo, myAttr); diff --git a/PCAxis.Sql/Parser_23/PXSqlContact.cs b/PCAxis.Sql/Parser_23/PXSqlContact.cs index 5bc9568..83fe18d 100644 --- a/PCAxis.Sql/Parser_23/PXSqlContact.cs +++ b/PCAxis.Sql/Parser_23/PXSqlContact.cs @@ -1,12 +1,10 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; -using PCAxis.Sql.QueryLib_23; -using System.Collections.Specialized; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Sql.QueryLib_23; + namespace PCAxis.Sql.Parser_23 { @@ -40,21 +38,22 @@ public PXSqlContact(PXSqlMeta_23 meta, string mMainTableId) Dictionary personIDs = new Dictionary(); try { - foreach (KeyValuePair RoleMain in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleMain,false)) + foreach (KeyValuePair RoleMain in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleMain, false)) { if (!personIDs.ContainsKey(RoleMain.Key)) { personIDs.Add(RoleMain.Key, RoleMain.Value); } } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant add RoleMain", e); } try { - foreach (KeyValuePair RoleContact in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleContact,true)) + foreach (KeyValuePair RoleContact in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleContact, true)) { if (!personIDs.ContainsKey(RoleContact.Key)) @@ -62,12 +61,13 @@ public PXSqlContact(PXSqlMeta_23 meta, string mMainTableId) personIDs.Add(RoleContact.Key, RoleContact.Value); } } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant add RoleContact", e); } - + bool firstPerson = true; @@ -86,7 +86,7 @@ public PXSqlContact(PXSqlMeta_23 meta, string mMainTableId) if (!firstPerson) { //mBigFatContactStringsByLanguage[language] += "#"; - // mBigFatContactStringsByLanguage[language] += "||"; + // mBigFatContactStringsByLanguage[language] += "||"; } @@ -113,7 +113,8 @@ public PXSqlContact(PXSqlMeta_23 meta, string mMainTableId) firstPerson = false; } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant find contact info", e); } diff --git a/PCAxis.Sql/Parser_23/PXSqlContent.cs b/PCAxis.Sql/Parser_23/PXSqlContent.cs index 8f9579c..dbe7e5a 100644 --- a/PCAxis.Sql/Parser_23/PXSqlContent.cs +++ b/PCAxis.Sql/Parser_23/PXSqlContent.cs @@ -1,146 +1,151 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; -using PCAxis.Sql.QueryLib_23; using System.Collections.Specialized; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; +using PCAxis.Sql.QueryLib_23; + namespace PCAxis.Sql.Parser_23 { - public class PXSqlContent:IComparable + public class PXSqlContent : IComparable { - private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlContent)); - - #region value to be used if row is missing - - /// - /// must be 0, 2 or 3. 0 indicates presCellsZero = yes - /// - private string mCategoryOfCellsInMissingRows = "0"; - public string CategoryOfCellsInMissingRows { - get { return mCategoryOfCellsInMissingRows; } - } - - private PXSqlNpm.NPMCharacter mNPMcharacterinMissingRows = null; - - internal PXSqlNpm.NPMCharacter NPMcharacterinMissingRows - { - get { return mNPMcharacterinMissingRows; } - } - - /// - /// the magicNumber (or 0 when category = 0) - /// - private double mValueOfCellsInMissingRows = 0; - public double ValueOfCellsInMissingRows { - get { return mValueOfCellsInMissingRows; } - } - #endregion value to be used if row is missing - - private ContentsRow mRow; - - /// - /// Contact is per maintable in the database, but per Content in paxiom. Thus we have to send the same contact for all Content. - /// - private PXSqlContact mContact; - - - - public PXSqlContent() { } - public PXSqlContent(ContentsRow row, PXSqlMeta_23 pxsqlMeta, SqlDbConfig_23 config, PXSqlContact contact) { - mRow = row; - mContact = contact; - //pxsqlMeta.MetaQuery.DB.Codes.Copyright1; - mContents = row.Contents; - //mFootnoteContents = row.FootnoteContents; - //mFootnoteTime = row.FootnoteTime; - //mFootnoteValue = row.FootnoteValue; - //mFootnoteVariable = row.FootnoteVariable; - mPresText = new Dictionary(); - mPresTextS = new Dictionary(); - mPresCode = row.PresCode; - - mBasePeriod = new Dictionary(); - mRefPeriod = new Dictionary(); - mUnit = new Dictionary(); - - - foreach (string langCode in pxsqlMeta.LanguageCodes) - { - mPresText[langCode] = row.texts[langCode].PresText; - mPresTextS[langCode] = row.texts[langCode].PresTextS; - mBasePeriod[langCode] = row.texts[langCode].BasePeriod; - mRefPeriod[langCode] = row.texts[langCode].RefPeriod; - mUnit[langCode] = row.texts[langCode].Unit; - } - - mPresDecimals = mRow.PresDecimals; - pxsqlMeta.DecimalHandler.ShowDecimals = mPresDecimals; - pxsqlMeta.DecimalHandler.StoreDecimals = mRow.StoreDecimals; - - mSeasAdj = mRow.SeasAdj.Equals(config.Codes.Yes); - mDayAdj = mRow.DayAdj.Equals(config.Codes.Yes); - mLastUpdatet = mRow.LastUpdated; - mStockFA = PaxiomifyStockFA(mRow.StockFA, config); - mCFPrices = PaxiomifyCFPrices(mRow.CFPrices, config); - - - mAggregPossible = ! mRow.AggregPossible.Equals(config.Codes.No); //not notPossible since yes is default - - #region mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows - if( pxsqlMeta.inPresentationModus && mRow.PresCellsZero.Equals(config.Codes.No)){ - - // both 2.1 and 2.2 uses a mRow.PresMissingLine from the SpecialCharacter.CharacterType( which is the primary key) - // or if mRow.PresMissingLine is missing: the default - - mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineMagic; - mNPMcharacterinMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineNPMCharacter; - - if (!( String.IsNullOrEmpty(mRow.PresMissingLine))) - { - mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine); - mNPMcharacterinMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNNPMCharacter(mRow.PresMissingLine); - } - mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString(); - - } - #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows - } - - - - private string mContents; - public string Contents - { - get { return mContents;} - set { mContents = value;} - } - - private int mSortOrder; - public int SortOrder - { - get { return mSortOrder; } - set { mSortOrder = value; } - } - - private Dictionary mPresText; - public Dictionary PresText + private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlContent)); + + #region value to be used if row is missing + + /// + /// must be 0, 2 or 3. 0 indicates presCellsZero = yes + /// + private string mCategoryOfCellsInMissingRows = "0"; + public string CategoryOfCellsInMissingRows + { + get { return mCategoryOfCellsInMissingRows; } + } + + private PXSqlNpm.NPMCharacter mNPMcharacterinMissingRows = null; + + internal PXSqlNpm.NPMCharacter NPMcharacterinMissingRows + { + get { return mNPMcharacterinMissingRows; } + } + + /// + /// the magicNumber (or 0 when category = 0) + /// + private double mValueOfCellsInMissingRows = 0; + public double ValueOfCellsInMissingRows + { + get { return mValueOfCellsInMissingRows; } + } + #endregion value to be used if row is missing + + private ContentsRow mRow; + + /// + /// Contact is per maintable in the database, but per Content in paxiom. Thus we have to send the same contact for all Content. + /// + private PXSqlContact mContact; + + + + public PXSqlContent() { } + public PXSqlContent(ContentsRow row, PXSqlMeta_23 pxsqlMeta, SqlDbConfig_23 config, PXSqlContact contact) + { + mRow = row; + mContact = contact; + //pxsqlMeta.MetaQuery.DB.Codes.Copyright1; + mContents = row.Contents; + //mFootnoteContents = row.FootnoteContents; + //mFootnoteTime = row.FootnoteTime; + //mFootnoteValue = row.FootnoteValue; + //mFootnoteVariable = row.FootnoteVariable; + mPresText = new Dictionary(); + mPresTextS = new Dictionary(); + mPresCode = row.PresCode; + + mBasePeriod = new Dictionary(); + mRefPeriod = new Dictionary(); + mUnit = new Dictionary(); + + + foreach (string langCode in pxsqlMeta.LanguageCodes) + { + mPresText[langCode] = row.texts[langCode].PresText; + mPresTextS[langCode] = row.texts[langCode].PresTextS; + mBasePeriod[langCode] = row.texts[langCode].BasePeriod; + mRefPeriod[langCode] = row.texts[langCode].RefPeriod; + mUnit[langCode] = row.texts[langCode].Unit; + } + + mPresDecimals = mRow.PresDecimals; + pxsqlMeta.DecimalHandler.ShowDecimals = mPresDecimals; + pxsqlMeta.DecimalHandler.StoreDecimals = mRow.StoreDecimals; + + mSeasAdj = mRow.SeasAdj.Equals(config.Codes.Yes); + mDayAdj = mRow.DayAdj.Equals(config.Codes.Yes); + mLastUpdatet = mRow.LastUpdated; + mStockFA = PaxiomifyStockFA(mRow.StockFA, config); + mCFPrices = PaxiomifyCFPrices(mRow.CFPrices, config); + + + mAggregPossible = !mRow.AggregPossible.Equals(config.Codes.No); //not notPossible since yes is default + + #region mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows + if (pxsqlMeta.inPresentationModus && mRow.PresCellsZero.Equals(config.Codes.No)) + { + + // both 2.1 and 2.2 uses a mRow.PresMissingLine from the SpecialCharacter.CharacterType( which is the primary key) + // or if mRow.PresMissingLine is missing: the default + + mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineMagic; + mNPMcharacterinMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineNPMCharacter; + + if (!(String.IsNullOrEmpty(mRow.PresMissingLine))) + { + mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine); + mNPMcharacterinMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNNPMCharacter(mRow.PresMissingLine); + } + mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString(); + + } + #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows + } + + + + private string mContents; + public string Contents + { + get { return mContents; } + set { mContents = value; } + } + + private int mSortOrder; + public int SortOrder + { + get { return mSortOrder; } + set { mSortOrder = value; } + } + + private Dictionary mPresText; + public Dictionary PresText { get { return mPresText; } set { mPresText = value; } } - private Dictionary mPresTextS; - public Dictionary PresTextS + private Dictionary mPresTextS; + public Dictionary PresTextS { get { return mPresTextS; } set { mPresTextS = value; } } - - private string mPresCode; + + private string mPresCode; public string PresCode { get { return mPresCode; } @@ -155,20 +160,20 @@ public Dictionary UNIT - //Ikke i bruk + //Ikke i bruk - //private string mProducer; - // public string Producer - // { - // get { return mProducer; } - // set { mProducer = value; } - // } + //private string mProducer; + // public string Producer + // { + // get { return mProducer; } + // set { mProducer = value; } + // } #region ContentInfo in Paxiom private Dictionary mRefPeriod; - // private Dictionary mUnit; + // private Dictionary mUnit; private Dictionary mBasePeriod; private string mLastUpdatet; @@ -188,322 +193,349 @@ public Dictionary UNIT // set { mPublished = value; } //} - private string mPresDecimals; - + private string mPresDecimals; + - public string PresCellsZero { + public string PresCellsZero + { get { return mRow.PresCellsZero; } } - public string PresMissingLine { + public string PresMissingLine + { get { return mRow.PresMissingLine; } } - private bool mAggregPossible; + private bool mAggregPossible; public bool AggregPossible { get { return mAggregPossible; } } - - private string mStoreColumnNo; + + private string mStoreColumnNo; public string StoreColumnNo { get { return mStoreColumnNo; } set { mStoreColumnNo = value; } } - private string mStoreFormat; + private string mStoreFormat; public string StoreFormat { get { return mStoreFormat; } set { mStoreFormat = value; } } - private string mStoreNoChar; + private string mStoreNoChar; public string StoreNoChar { get { return mStoreNoChar; } set { mStoreNoChar = value; } } - //private string mStoreDecimals; - // public string StoreDecimals - // { - // get { return mStoreDecimals; } - // set { mStoreDecimals = value; } - // } + //private string mStoreDecimals; + // public string StoreDecimals + // { + // get { return mStoreDecimals; } + // set { mStoreDecimals = value; } + // } - private string mUserid; + private string mUserid; public string Userid { get { return mUserid; } set { mUserid = value; } } - private string mLogDate; + private string mLogDate; public string LogDate { get { return mLogDate; } set { mLogDate = value; } - + + } + + + public int CompareTo(PXSqlContent compPXSqlContent) + { + return mSortOrder.CompareTo(compPXSqlContent.mSortOrder); } - - - public int CompareTo(PXSqlContent compPXSqlContent) - { - return mSortOrder.CompareTo(compPXSqlContent.mSortOrder); - } - - /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - /// - /// - /// - /// - /// - ///
- /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// If value in database equals to CFPricesC code in db config file then set to PXConstant.CFPRICES_CURRENT. - /// If value in database equals to CFPricesF code in db config file then set to PXConstant.CFPRICES_FIXED. - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. Maps the code in dbconfig file to PX PXConstant - /// StockFAS-->STOCKFA_STOCK, StockFAF-->STOCKFA_FLOW,StockFAA-->STOCKFA_AVERAGE. - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// Holds the Contents.Contents from database so it could be referenced back to from paxiom - /// - /// - ///
- ///
- ///
- public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes) - { - - StringCollection values = new StringCollection(); - - //string subkey = this.Contents; - string subkey = this.PresCode; //prescode should be Code i Paxiom. Contents is sent as Reference_is an ouse as code i PXS. - - foreach (string langCode in LanguageCodes) { - - // BASEPERIOD - values.Clear(); - values.Add(this.mBasePeriod[langCode]); - handler(PXKeywords.BASEPERIOD, langCode, subkey, values); - - - // CONTACT - values.Clear(); - values.Add(this.mContact.GetBigFatContactString(langCode)); - handler(PXKeywords.CONTACT, langCode, subkey, values); - - - // REFPERIOD - values.Clear(); - values.Add(this.mRefPeriod[langCode]); - handler(PXKeywords.REFPERIOD, langCode, subkey, values); - - - // UNITS - values.Clear(); - values.Add(this.mUnit[langCode]); - handler(PXKeywords.UNITS, langCode, subkey, values); - - } - - string noLanguage = null; - - - // META_ID - if (!String.IsNullOrEmpty(this.mRow.MetaId)) - { - values.Clear(); - values.Add(this.mRow.MetaId); - handler(PXKeywords.META_ID, noLanguage, PXSqlMeta_23.mContVariableCode + "\",\"" +subkey, values); - } - - - // CFPRICES - values.Clear(); - values.Add(this.mCFPrices); - handler(PXKeywords.CFPRICES, noLanguage, subkey, values); - - - // LAST_UPDATED - values.Clear(); - values.Add(this.mLastUpdatet); - handler(PXKeywords.LAST_UPDATED, noLanguage, subkey, values); - - //SEASADJ - values.Clear(); - if (this.mSeasAdj) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.SEASADJ, noLanguage, subkey, values); - - //DAYADJ - values.Clear(); - - if (this.mDayAdj) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.DAYADJ, noLanguage, subkey, values); - - //STOCKFA - values.Clear(); - values.Add(this.mStockFA); - handler(PXKeywords.STOCKFA, noLanguage, subkey, values); - - //PRECISION - if (!String.IsNullOrEmpty(this.mPresDecimals)) - { - values.Clear(); - values.Add(this.mPresDecimals); - String myKey = PXSqlMeta_23.mContVariableCode + "\",\"" + subkey;//for PXModelBuilder.SplittString A","B","C - // not "A","B","C" - log.Debug("Sender precision for " + myKey); - handler(PXKeywords.PRECISION, noLanguage, myKey, values); - } - - - - //REFRENCE_ID Used to hold unique Id of Content in Paxiom. This will be used in pxs to identify selected contents - // The resason why contents is placed in Code fro the value which represent the contents is that this is occupied by PresCode. - values.Clear(); - values.Add(this.Contents); - handler(PXKeywords.REFRENCE_ID, noLanguage, subkey, values); - } - - - - - internal void AdjustPresDecimalsToCommonDecimals(string Decimals) { - log.Debug(Decimals.Equals(mPresDecimals)); - if(Decimals.Equals(mPresDecimals)){ - - mPresDecimals = String.Empty; - } - } - - /** - * Translates database code to Paxiom code for StockFA. - */ - private string PaxiomifyStockFA(string StockFA,SqlDbConfig_23 config) { - string myOut = ""; - if (! String.IsNullOrEmpty(StockFA) ) { - if (StockFA.Equals(config.Codes.StockFAS)) { - myOut = PXConstant.STOCKFA_STOCK; - } else if (StockFA.Equals(config.Codes.StockFAA)) { - myOut = PXConstant.STOCKFA_AVERAGE; - } else if (StockFA.Equals(config.Codes.StockFAF)) { - myOut = PXConstant.STOCKFA_FLOW; - } else { - myOut = PXConstant.STOCKFA_OTHER; - //throw new ApplicationException("Unknown StockFA code:\"" + StockFA + "\""); - } - } - return myOut; - } - /**Translates database code to Paxiom code for CFPrices*/ - private string PaxiomifyCFPrices(string CFPrices, SqlDbConfig_23 config) { - string myOut = ""; - if (! String.IsNullOrEmpty(CFPrices)) { - if (CFPrices.Equals(config.Codes.CFPricesC)) { - myOut = PXConstant.CFPRICES_CURRENT; - } else if (CFPrices.Equals(config.Codes.CFPricesF)) { - myOut = PXConstant.CFPRICES_FIXED; - } else { - throw new ApplicationException("Unknown CFPrices code:\"" + CFPrices + "\""); - } - } - return myOut; - } - } - - - - + + /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + /// + /// + /// + /// + /// + ///
+ /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If value in database equals to CFPricesC code in db config file then set to PXConstant.CFPRICES_CURRENT. + /// If value in database equals to CFPricesF code in db config file then set to PXConstant.CFPRICES_FIXED. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. Maps the code in dbconfig file to PX PXConstant + /// StockFAS-->STOCKFA_STOCK, StockFAF-->STOCKFA_FLOW,StockFAA-->STOCKFA_AVERAGE. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Holds the Contents.Contents from database so it could be referenced back to from paxiom + /// + /// + ///
+ ///
+ ///
+ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes) + { + + StringCollection values = new StringCollection(); + + //string subkey = this.Contents; + string subkey = this.PresCode; //prescode should be Code i Paxiom. Contents is sent as Reference_is an ouse as code i PXS. + + foreach (string langCode in LanguageCodes) + { + + // BASEPERIOD + values.Clear(); + values.Add(this.mBasePeriod[langCode]); + handler(PXKeywords.BASEPERIOD, langCode, subkey, values); + + + // CONTACT + values.Clear(); + values.Add(this.mContact.GetBigFatContactString(langCode)); + handler(PXKeywords.CONTACT, langCode, subkey, values); + + + // REFPERIOD + values.Clear(); + values.Add(this.mRefPeriod[langCode]); + handler(PXKeywords.REFPERIOD, langCode, subkey, values); + + + // UNITS + values.Clear(); + values.Add(this.mUnit[langCode]); + handler(PXKeywords.UNITS, langCode, subkey, values); + + } + + string noLanguage = null; + + + // META_ID + if (!String.IsNullOrEmpty(this.mRow.MetaId)) + { + values.Clear(); + values.Add(this.mRow.MetaId); + handler(PXKeywords.META_ID, noLanguage, PXSqlMeta_23.mContVariableCode + "\",\"" + subkey, values); + } + + + // CFPRICES + values.Clear(); + values.Add(this.mCFPrices); + handler(PXKeywords.CFPRICES, noLanguage, subkey, values); + + + // LAST_UPDATED + values.Clear(); + values.Add(this.mLastUpdatet); + handler(PXKeywords.LAST_UPDATED, noLanguage, subkey, values); + + //SEASADJ + values.Clear(); + if (this.mSeasAdj) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.SEASADJ, noLanguage, subkey, values); + + //DAYADJ + values.Clear(); + + if (this.mDayAdj) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.DAYADJ, noLanguage, subkey, values); + + //STOCKFA + values.Clear(); + values.Add(this.mStockFA); + handler(PXKeywords.STOCKFA, noLanguage, subkey, values); + + //PRECISION + if (!String.IsNullOrEmpty(this.mPresDecimals)) + { + values.Clear(); + values.Add(this.mPresDecimals); + String myKey = PXSqlMeta_23.mContVariableCode + "\",\"" + subkey;//for PXModelBuilder.SplittString A","B","C + // not "A","B","C" + log.Debug("Sender precision for " + myKey); + handler(PXKeywords.PRECISION, noLanguage, myKey, values); + } + + + + //REFRENCE_ID Used to hold unique Id of Content in Paxiom. This will be used in pxs to identify selected contents + // The resason why contents is placed in Code fro the value which represent the contents is that this is occupied by PresCode. + values.Clear(); + values.Add(this.Contents); + handler(PXKeywords.REFRENCE_ID, noLanguage, subkey, values); + } + + + + + internal void AdjustPresDecimalsToCommonDecimals(string Decimals) + { + log.Debug(Decimals.Equals(mPresDecimals)); + if (Decimals.Equals(mPresDecimals)) + { + + mPresDecimals = String.Empty; + } + } + + /** + * Translates database code to Paxiom code for StockFA. + */ + private string PaxiomifyStockFA(string StockFA, SqlDbConfig_23 config) + { + string myOut = ""; + if (!String.IsNullOrEmpty(StockFA)) + { + if (StockFA.Equals(config.Codes.StockFAS)) + { + myOut = PXConstant.STOCKFA_STOCK; + } + else if (StockFA.Equals(config.Codes.StockFAA)) + { + myOut = PXConstant.STOCKFA_AVERAGE; + } + else if (StockFA.Equals(config.Codes.StockFAF)) + { + myOut = PXConstant.STOCKFA_FLOW; + } + else + { + myOut = PXConstant.STOCKFA_OTHER; + //throw new ApplicationException("Unknown StockFA code:\"" + StockFA + "\""); + } + } + return myOut; + } + /**Translates database code to Paxiom code for CFPrices*/ + private string PaxiomifyCFPrices(string CFPrices, SqlDbConfig_23 config) + { + string myOut = ""; + if (!String.IsNullOrEmpty(CFPrices)) + { + if (CFPrices.Equals(config.Codes.CFPricesC)) + { + myOut = PXConstant.CFPRICES_CURRENT; + } + else if (CFPrices.Equals(config.Codes.CFPricesF)) + { + myOut = PXConstant.CFPRICES_FIXED; + } + else + { + throw new ApplicationException("Unknown CFPrices code:\"" + CFPrices + "\""); + } + } + return myOut; + } + } + + + + } diff --git a/PCAxis.Sql/Parser_23/PXSqlData_23.cs b/PCAxis.Sql/Parser_23/PXSqlData_23.cs index 079ee26..8a0e4c4 100644 --- a/PCAxis.Sql/Parser_23/PXSqlData_23.cs +++ b/PCAxis.Sql/Parser_23/PXSqlData_23.cs @@ -7,11 +7,13 @@ namespace PCAxis.Sql.Parser_23 using System.Collections.Generic; using System.Collections.Specialized; using System.Data; + using System.Linq; + using log4net; + using PCAxis.Sql.Parser; using PCAxis.Sql.QueryLib_23; - using System.Linq; - + /// /// @@ -1163,7 +1165,7 @@ private bool ShouldAddDefaultCodeMissingLineNPMCharacter(int rowCount) foreach (string contCode in contKeys) { PXSqlContent content = mMeta.Contents[contCode]; - + if (content.PresCellsZero == this.mMeta.Config.Codes.No && string.IsNullOrEmpty(content.PresMissingLine)) { return true; diff --git a/PCAxis.Sql/Parser_23/PXSqlDecimalStuff.cs b/PCAxis.Sql/Parser_23/PXSqlDecimalStuff.cs index d5a65d6..03faa72 100644 --- a/PCAxis.Sql/Parser_23/PXSqlDecimalStuff.cs +++ b/PCAxis.Sql/Parser_23/PXSqlDecimalStuff.cs @@ -1,11 +1,9 @@ using System; -using System.Collections.Generic; -using System.Text; + using log4net; -using PCAxis.Paxiom; -using System.Collections.Specialized; -namespace PCAxis.Sql.Parser_23{ +namespace PCAxis.Sql.Parser_23 +{ /// DECIMALS, SHOWDECIMALS and PRECISION all handle decimals in some way. /// ParseMeta for PRECISION is in PXsqlContents /// @@ -23,55 +21,74 @@ namespace PCAxis.Sql.Parser_23{ ///n is a figure between 1 and 6. The number of decimals for precision must be higher than the number of decimals ///for SHOWDECIMALS to have any effect. /// - internal class PXSqlDecimalStuff { + internal class PXSqlDecimalStuff + { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlDecimalStuff)); internal PXSqlDecimalStuff() { } private int mShowDecimals = 6; private int mStoreDecimals = 0; - - public string ShowDecimals { + + public string ShowDecimals + { get { return mShowDecimals.ToString(); } - set { + set + { int tmpValue = -1; - try { + try + { tmpValue = int.Parse(value); - } catch (Exception e) { + } + catch (Exception e) + { log.Error(e); return; } - if (tmpValue > 6) { + if (tmpValue > 6) + { throw new ApplicationException("Decimal number cannot be higher than 6. Found " + value); - } else if (tmpValue < 0) { + } + else if (tmpValue < 0) + { throw new ApplicationException("Decimal number cannot be lower than 0. Found " + value); } - if (tmpValue < mShowDecimals) { + if (tmpValue < mShowDecimals) + { mShowDecimals = tmpValue; } } } - public string StoreDecimals { + public string StoreDecimals + { get { return mStoreDecimals.ToString(); } - set { + set + { int tmpValue = -1; - try { + try + { tmpValue = int.Parse(value); - } catch (Exception e) { + } + catch (Exception e) + { log.Error(e); return; } - if (tmpValue > 15) { + if (tmpValue > 15) + { throw new ApplicationException("Decimal number cannot be higher than 15. Found " + value); - } else if (tmpValue < 0) { + } + else if (tmpValue < 0) + { throw new ApplicationException("Decimal number cannot be lower than 0. Found " + value); } - if (tmpValue > mStoreDecimals) { + if (tmpValue > mStoreDecimals) + { mStoreDecimals = tmpValue; } } @@ -84,7 +101,7 @@ public string StoreDecimals { // string noLanguage = null; // string subkey = null; - + // values.Add(mStoreDecimals.ToString()); // handler(PXKeywords.DECIMALS, noLanguage, subkey, values); @@ -94,6 +111,6 @@ public string StoreDecimals { //} - + } } diff --git a/PCAxis.Sql/Parser_23/PXSqlGroup.cs b/PCAxis.Sql/Parser_23/PXSqlGroup.cs index b8f62f3..bd0c9ee 100644 --- a/PCAxis.Sql/Parser_23/PXSqlGroup.cs +++ b/PCAxis.Sql/Parser_23/PXSqlGroup.cs @@ -1,8 +1,6 @@ namespace PCAxis.Sql.Parser_23 { -using System; -using System.Collections.Generic; -using System.Text; + using System.Collections.Generic; /// Stores A = B + C + D + public class PXSqlGroup @@ -22,7 +20,7 @@ public int GroupLevel } - + private bool isLeaf = false; /// @@ -33,14 +31,14 @@ public bool IsLeaf get { return isLeaf; } } - + /// The list of codes of the children private List childCodes = new List(); /// Initializes a new instance of the PXSqlGroup class, with the given parentCode /// The code of the parent item - internal PXSqlGroup(string parentCode) + internal PXSqlGroup(string parentCode) { this.parentCode = parentCode; } @@ -59,14 +57,14 @@ public IList ChildCodes /// Adds a code to the list of codes of the children /// The code of child item - public void AddChildCode(string childCode) + public void AddChildCode(string childCode) { this.childCodes.Add(childCode); if (parentCode.Equals(childCode)) { isLeaf = true; } - + } } } diff --git a/PCAxis.Sql/Parser_23/PXSqlGrouping.cs b/PCAxis.Sql/Parser_23/PXSqlGrouping.cs index 6fe525c..7880dad 100644 --- a/PCAxis.Sql/Parser_23/PXSqlGrouping.cs +++ b/PCAxis.Sql/Parser_23/PXSqlGrouping.cs @@ -2,12 +2,13 @@ { using System; using System.Collections.Generic; - using System.Text; using System.Collections.Specialized; - using PCAxis.Sql.QueryLib_23; - using PCAxis.Paxiom; + using log4net; + using PCAxis.Paxiom; + using PCAxis.Sql.QueryLib_23; + public class PXSqlGrouping { @@ -507,7 +508,7 @@ private void Init(GroupingRow groupingRow, PXSqlMeta_23 meta, PXSqlVariableClass this.PresText[langCode] = groupingRow.texts[langCode].PresText; } this.SortCode = groupingRow.texts[meta.MainLanguageCode].SortCode; - + //TODO added databasedefault to override value from paxiom, should be possible to do both switch (this.mGroupPres.ToUpper()) { @@ -566,7 +567,7 @@ internal Grouping GetPaxiomGrouping() Grouping paxGrouping = new Grouping(); paxGrouping.Name = this.GroupingId; paxGrouping.ID = this.GroupingId; - // if (this.mIncludeType.Equals(GroupingIncludesType.All)) + // if (this.mIncludeType.Equals(GroupingIncludesType.All)) { foreach (PXSqlGroup group in this.mGroups) { diff --git a/PCAxis.Sql/Parser_23/PXSqlGroupingInfo.cs b/PCAxis.Sql/Parser_23/PXSqlGroupingInfo.cs index 04f4675..d7fa169 100644 --- a/PCAxis.Sql/Parser_23/PXSqlGroupingInfo.cs +++ b/PCAxis.Sql/Parser_23/PXSqlGroupingInfo.cs @@ -1,9 +1,9 @@ namespace PCAxis.Sql.Parser_23 { - using log4net; using System; using System.Collections.Generic; - using System.Text; + + using log4net; public class PXSqlGroupingInfo @@ -28,7 +28,7 @@ int IComparer.Compare(PXSqlGroupingInfo a, PXSqlGroupingInfo return String.Compare(valA.sortCodeByLanguage[lang], valB.sortCodeByLanguage[lang]); } } - + /// Database unique ID private string groupingId; @@ -42,7 +42,7 @@ int IComparer.Compare(PXSqlGroupingInfo a, PXSqlGroupingInfo private string groupPres; /// The texts which may be displayed to users when selecting a grouping from a list of groupings - private Dictionary presTextByLanguage = new Dictionary(); + private Dictionary presTextByLanguage = new Dictionary(); /// Sort order in which the groupings are shown. If SortCode in grouping are set this will be used otherwise PresText private Dictionary sortCodeByLanguage = new Dictionary(); @@ -77,18 +77,18 @@ internal PXSqlGroupingInfo(PCAxis.Sql.QueryLib_23.GroupingRow groupingRow, DbCon this.groupPres = "AggregatedValues"; } - + foreach (KeyValuePair text in groupingRow.texts) { this.presTextByLanguage[text.Key] = text.Value.PresText; - // if (text.Value.SortCode != "") - // { - // this.sortCodeByLanguage[text.Key] = text.Value.SortCode; - // } - // else - // { - // this.sortCodeByLanguage[text.Key] = text.Value.PresText; - // } + // if (text.Value.SortCode != "") + // { + // this.sortCodeByLanguage[text.Key] = text.Value.SortCode; + // } + // else + // { + // this.sortCodeByLanguage[text.Key] = text.Value.PresText; + // } } } diff --git a/PCAxis.Sql/Parser_23/PXSqlGroupingInfos.cs b/PCAxis.Sql/Parser_23/PXSqlGroupingInfos.cs index 6705c89..b5fabd2 100644 --- a/PCAxis.Sql/Parser_23/PXSqlGroupingInfos.cs +++ b/PCAxis.Sql/Parser_23/PXSqlGroupingInfos.cs @@ -2,9 +2,11 @@ { using System.Collections.Generic; using System.Collections.Specialized; - using PCAxis.Paxiom; + using log4net; + using PCAxis.Paxiom; + /// /// Holds the information on which groupings may be used with this variable. This applies to selected variables when build4selection. /// @@ -27,17 +29,17 @@ public List Infos get { return infos; } } - + private StringCollection groupingIDs; - + /// /// the IDs of the groupings which may be used for the variable. /// internal StringCollection GroupingIDs { get { return groupingIDs; } - } + } /// Initializes a new instance of the PXSqlGroupingInfos class, and fills the list of PXSqlGroupingInfo /// Holds the state of the builder @@ -50,39 +52,41 @@ internal PXSqlGroupingInfos(PXSqlMeta_23 meta, string variableName, StringCollec groupingIDs = new StringCollection(); foreach (string valueSetId in valueSetIds) { - foreach (string groupingId in meta.MetaQuery.GetValueSetGroupingRowskeyGrouping(valueSetId, true).Keys) { + foreach (string groupingId in meta.MetaQuery.GetValueSetGroupingRowskeyGrouping(valueSetId, true).Keys) + { groupingIDs.Add(groupingId); } } // finding the ID's of hierarchical groups - foreach (string groupingId in meta.MetaQuery.GetMainTableVariableHierarchyRows_KeyIsGroupingID(meta.MainTable.MainTable,variableName,true).Keys) { - groupingIDs.Add(groupingId); + foreach (string groupingId in meta.MetaQuery.GetMainTableVariableHierarchyRows_KeyIsGroupingID(meta.MainTable.MainTable, variableName, true).Keys) + { + groupingIDs.Add(groupingId); } // creating Info for them; foreach (string groupingId in groupingIDs) { - infos.Add(new PXSqlGroupingInfo(meta.MetaQuery.GetGroupingRow(groupingId),meta.Config.Codes)); + infos.Add(new PXSqlGroupingInfo(meta.MetaQuery.GetGroupingRow(groupingId), meta.Config.Codes)); } } - - // internal List GetGroupsSorted(List groupingInfoList,string langCode) - // { - // List sortedGrouposList = new List(); - // foreach (PXSqlGroupingInfo group in groups) - // { - // sortedGrouposList.Add(group); - // } - //return groupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); - //sortedGrouposList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); - //return sortedGrouposList; - // } + // internal List GetGroupsSorted(List groupingInfoList,string langCode) + // { + // List sortedGrouposList = new List(); + // foreach (PXSqlGroupingInfo group in groups) + // { + // sortedGrouposList.Add(group); + // } + //return groupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); + //sortedGrouposList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); + //return sortedGrouposList; + + // } /// Sends the list of Grouping Info to paxiom @@ -114,14 +118,14 @@ internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) //List sortedGroupingInfoList; foreach (string langCode in this.infos[0].PresTextByLanguage.Keys) { - // sortedGroupingInfoList = new List(); - // foreach (PXSqlGroupingInfo info in this.infos) - // { - // sortedGroupingInfoList.Add(info); - // } - // sortedGroupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); - - + // sortedGroupingInfoList = new List(); + // foreach (PXSqlGroupingInfo info in this.infos) + // { + // sortedGroupingInfoList.Add(info); + // } + // sortedGroupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); + + values.Clear(); //foreach (PXSqlGroupingInfo info in sortedGroupingInfoList) foreach (PXSqlGroupingInfo info in this.infos) diff --git a/PCAxis.Sql/Parser_23/PXSqlMaintable.cs b/PCAxis.Sql/Parser_23/PXSqlMaintable.cs index 37e5163..29b38cf 100644 --- a/PCAxis.Sql/Parser_23/PXSqlMaintable.cs +++ b/PCAxis.Sql/Parser_23/PXSqlMaintable.cs @@ -1,11 +1,12 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_23; -using PCAxis.Paxiom; using System.Collections.Specialized; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_23; + namespace PCAxis.Sql.Parser_23 { public class PXSqlMaintable @@ -20,7 +21,7 @@ public class PXSqlMaintable private string mSubjectCode; private Dictionary mSubjectAreaByLanguage = new Dictionary(); - + internal PXSqlMaintable(MainTableRow mtRow, DataStorageRow dataStorageRow, MenuSelectionRow menuSelectionRow, PXSqlMeta_23 meta) { this.meta = meta; @@ -50,17 +51,18 @@ internal string SpecCharExists internal bool ContainsOnlyMetaData { - get { + get + { if (TableStatus.Equals(meta.Config.Codes.StatusMeta) || TableStatus.Equals(meta.Config.Codes.StatusEmpty)) { - return true; + return true; } else { return false; } } - } + } //mMainTable[0][mConfig.MainTable.ContentsVariable].ToString().Length != 0 internal bool hasContentsVariable(string someLangCode) @@ -68,10 +70,10 @@ internal bool hasContentsVariable(string someLangCode) return (mtRow.texts[someLangCode].ContentsVariable.Length != 0); } - // public string getPresText(string langCode) - // { - // return mtRow.texts[langCode].PresText; - // } + // public string getPresText(string langCode) + // { + // return mtRow.texts[langCode].PresText; + // } internal string getPresTextS(string langCode) { return mtRow.texts[langCode].PresTextS; @@ -89,7 +91,7 @@ internal string getContentsVariable(string langCode) internal string TimeScale { get { return mtRow.TimeScale; } } internal string TableStatus { get { return mtRow.TableStatus; } } - + //MenuSelection.PresText @@ -226,11 +228,11 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCo // TABLEID if (!string.IsNullOrEmpty(this.TableId.Trim(' '))) - { - values.Clear(); - values.Add(this.TableId); - handler(PXKeywords.TABLEID, noLanguage, subkey, values); - + { + values.Clear(); + values.Add(this.TableId); + handler(PXKeywords.TABLEID, noLanguage, subkey, values); + } // SUBJECT-CODE @@ -249,7 +251,7 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCo } // DATABASE - foreach (string langCode in LanguageCodes) + foreach (string langCode in LanguageCodes) { values.Clear(); // values.Add(this.mDataStorageRow.DatabaseName); @@ -263,12 +265,12 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCo // se Reqtest 319. - // FIRST_PUBLISHED - + // FIRST_PUBLISHED + values.Clear(); values.Add(this.mtRow.FirstPublished); - handler(PXKeywords.FIRST_PUBLISHED, null, subkey, values); - + handler(PXKeywords.FIRST_PUBLISHED, null, subkey, values); + // INFOFILE diff --git a/PCAxis.Sql/Parser_23/PXSqlMeta_23.cs b/PCAxis.Sql/Parser_23/PXSqlMeta_23.cs index 39815b4..8fb7f41 100644 --- a/PCAxis.Sql/Parser_23/PXSqlMeta_23.cs +++ b/PCAxis.Sql/Parser_23/PXSqlMeta_23.cs @@ -1,16 +1,17 @@ using System; using System.Collections; -using System.Collections.Specialized; using System.Collections.Generic; -using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Data; + +using log4net; + using PCAxis.Paxiom; using PCAxis.PlugIn; -using System.Data; -using PCAxis.Sql.QueryLib_23; +using PCAxis.PlugIn.Sql; using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; using PCAxis.Sql.Pxs; -using log4net; -using PCAxis.PlugIn.Sql; +using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 { @@ -25,9 +26,9 @@ namespace PCAxis.Sql.Parser_23 // fixedStartMovingLast = 3 //} - - public class PXSqlMeta_23 :PCAxis.Sql.Parser.PXSqlMeta + + public class PXSqlMeta_23 : PCAxis.Sql.Parser.PXSqlMeta { #region constants private const string mPresTextOptionCode = "CODE"; @@ -48,7 +49,7 @@ public class PXSqlMeta_23 :PCAxis.Sql.Parser.PXSqlMeta internal PXSqlAttributes Attributes { get { return mAttributes; } - } + } private PxsQuery mPxsFile; internal PxsQuery PxsFile @@ -56,9 +57,9 @@ internal PxsQuery PxsFile get { return mPxsFile; } } internal PXSqlNpm mPxsqlNpm; - + private string mPxsSubTableId; - + /// /// The ID of the Contents dimention /// @@ -76,10 +77,10 @@ internal string ContensCode } } } - - - - + + + + private PXMetaAdmValues mPXMetaAdmValues; @@ -90,7 +91,7 @@ public PXMetaAdmValues PXMetaAdmValues - + private readonly string mMainTableId; @@ -100,7 +101,7 @@ internal PXSqlMaintable MainTable get { return mMainTable; } } - + private PXSqlSubTables mSubTables; public PXSqlSubTables SubTables { @@ -168,8 +169,8 @@ public PXSqlVariable ContentsVariable { get { return mContentsVariable; } } - - + + private PXSqlDecimalStuff mDecimalHandler = new PXSqlDecimalStuff(); internal PXSqlDecimalStuff DecimalHandler @@ -180,7 +181,7 @@ internal PXSqlDecimalStuff DecimalHandler private PXSqlValue mValue; - + private Dictionary mContentsVariablePresText = new Dictionary(); public Dictionary ContentsVariablePresText { @@ -198,20 +199,20 @@ public bool EliminatedVariablesExist } - + private SqlDbConfig_23 mConfig; public SqlDbConfig_23 Config { get { return mConfig; } } - + //jfi:Hei piv, jeg la denne her. Er det ok? public bool SpecCharExists { get { return MainTable.SpecCharExists.Equals(mMetaQuery.DB.Codes.Yes); } } - + private string mDataTablesPrefix; public string DataTablesPrefix { get { return mDataTablesPrefix; } } @@ -226,12 +227,12 @@ internal PXSqlNotes TheNotes { get { return theNotes; } } - + #endregion #region Constructor - + /// /// @@ -247,7 +248,7 @@ public PXSqlMeta_23(string mainTableId, string preferredLang, bool getAllLangs, { log.Info("PXSqlMeta(string mainTableId(=" + mainTableId + "), StringCollection desiredLanguages, SqlDbConfig config, Instancemodus aModus(=" + aModus.ToString() + "))"); this.mMainTableId = mainTableId; - this.mConfig = (SqlDbConfig_23) config; + this.mConfig = (SqlDbConfig_23)config; mMetaQuery = new MetaQuery(this.mConfig, this.SelectedDbInfo); SetLanguageCodesNoPxs(preferredLang, getAllLangs); BuildMeta(); @@ -260,14 +261,14 @@ public PXSqlMeta_23(PxsQuery mPxsObject, string preferredLang, SqlDbConfig confi { log.Debug("PXSqlMeta(PxsQuery mPxsObject, SqlDbConfig config, Instancemodus aModus"); - + //disse er trukket hit for å kunne kjøre med String hovedtabellId. this.mMainTableId = mPxsObject.Query.TableSource; //TODO; denne burde kunne fjernes this.mPxsSubTableId = mPxsObject.Query.SubTable; - this.mConfig = (SqlDbConfig_23) config; + this.mConfig = (SqlDbConfig_23)config; mMetaQuery = new MetaQuery(this.mConfig, this.SelectedDbInfo); @@ -289,7 +290,7 @@ private PxsQuery rearrangePxsQuery(PxsQuery mPxsObject) { Dictionary valuesetIdByVariableId = new Dictionary(); - Dictionary fromDB = this.MetaQuery.GetSubTableVariableRowskeyVariable(this.mMainTableId, mPxsObject.Query.SubTable,false); + Dictionary fromDB = this.MetaQuery.GetSubTableVariableRowskeyVariable(this.mMainTableId, mPxsObject.Query.SubTable, false); foreach (string variableId in fromDB.Keys) { if (String.IsNullOrEmpty(fromDB[variableId].ValueSet)) @@ -327,27 +328,27 @@ private PxsQuery rearrangePxsQuery(PxsQuery mPxsObject) private void BuildMeta() { - SetInstanceModus(); - + SetInstanceModus(); + mMetaQuery.LanguageCodes = LanguageCodes; // instanced above, now just set language - mPXMetaAdmValues = new PXMetaAdmValues(mMetaQuery); + mPXMetaAdmValues = new PXMetaAdmValues(mMetaQuery); if (inPresentationModus) { mPxsqlNpm = new PXSqlNpm(this); //trenger valium dette } - - SetMainTable(); + + SetMainTable(); //mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId), mPxsSubTableId); - mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId,false), mPxsFile, this); + mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId, false), mPxsFile, this); + - SetVariables();//ok for pxs == null, men denne kan også hente ut valueSet SetContents(); //må skrives om, men kall til metaQ OK. Bør kanskje legge inn contents som @@ -360,11 +361,11 @@ private void BuildMeta() //variabel er tid for å danne korrekt pxs. // if (instancemodus == Instancemodus.presentation) // { - // SetTimeVal(); Not used. Defined in PXSqlVariableTime + // SetTimeVal(); Not used. Defined in PXSqlVariableTime SetPaxiomMap();//ok for pxs == null, men jeg forstår ikke helt hva den gjør. mEliminatedVariablesExist = CheckEliminatedVariables();//ok for pxs == null - - theNotes = new PXSqlNotes(this,mMainTableId, this.inPresentationModus); + + theNotes = new PXSqlNotes(this, mMainTableId, this.inPresentationModus); mDataTablesPrefix = mMetaQuery.GetDataTablesPrefix(mMainTable.ProductCode); CheckPxs(); @@ -383,12 +384,12 @@ private void BuildMeta() #endregion #region Setroutines - + private void SetInstanceModus() { - if (! (this.inPresentationModus || this.inSelectionModus) ) + if (!(this.inPresentationModus || this.inSelectionModus)) { throw new NotImplementedException("BUG"); } @@ -541,7 +542,7 @@ private void SetMainTable() private List GetSortedContentsList(string mMainTableId, bool contructedFromPxs, BasicValueType[] contentsInPxs) { List myOut = new List(); - Dictionary altIBasen = mMetaQuery.GetContentsRows(mMainTableId,false); + Dictionary altIBasen = mMetaQuery.GetContentsRows(mMainTableId, false); //side effect: @@ -560,7 +561,7 @@ private List GetSortedContentsList(string mMainTableId, bool contr PXSqlContent mContent = null; if (this.ConstructedFromPxs) { - int documentOrder = 0; + int documentOrder = 0; foreach (BasicValueType contents in contentsInPxs) { if (altIBasen.ContainsKey(contents.code)) @@ -568,7 +569,7 @@ private List GetSortedContentsList(string mMainTableId, bool contr mContent = new PXSqlContent(altIBasen[contents.code], this, mConfig, contact); mContent.SortOrder = documentOrder; myOut.Add(mContent); - documentOrder++; + documentOrder++; } } @@ -619,7 +620,7 @@ private void SetContents() int counter = 0; foreach (PXSqlContent content in mContents.Values) { - mValue = new PXSqlValue(content,counter); + mValue = new PXSqlValue(content, counter); mValues.Add(mValue.ValueCode, mValue); counter++; } @@ -661,10 +662,10 @@ private void SetVariables() } } mSqlVariable.VariableType = aTVRow.VariableType; - + } - + } private void CheckPxs() @@ -689,8 +690,8 @@ private void CheckPxs() } } - - + + private void SetHeadingAndStub() { @@ -706,10 +707,10 @@ private void SetHeadingAndStub() this.mHeadings = mVariables.GetHeadingSorted(); } - - + + //TODO; flytt denne, tror kanskje heller ikke alt er sagt om GeoArea, det kan settes en dullion steder private void SetPaxiomMap() @@ -717,7 +718,7 @@ private void SetPaxiomMap() foreach (KeyValuePair var in mVariables) { //if (!var.Value.IsContentVariable && !var.Value.IsTimevariable) { - if (var.Value.VariableType == mConfig.Codes.VariableTypeG && var.Value.isSelected && var.Value.ValueSets != null) + if (var.Value.VariableType == mConfig.Codes.VariableTypeG && var.Value.isSelected && var.Value.ValueSets != null) { List GeoAreaValues = new List(); string GeoAreaValue; @@ -749,13 +750,13 @@ private void SetPaxiomMap() } } - private void SetAttributes() - { - mAttributes = new PXSqlAttributes(this); - } + private void SetAttributes() + { + mAttributes = new PXSqlAttributes(this); + } + - #endregion #region tja @@ -783,7 +784,7 @@ public StringCollection GetDataTableNames() #region helproutines - + //private string CheckMultValuesetElim(List ElimValues) //{ // int numberOfElimA = 0; @@ -883,7 +884,7 @@ internal List GetVariableIDsInOutputOrder() return myOut; } - + /// /// Get the IDs of the Variables In Reverse Output Order /// @@ -917,7 +918,7 @@ override public InfoFromPxSqlMeta2PxsQuery GetInfoFromPxSqlMeta2PxsQuery() return myOut; } - + /// Finds the variable and passes to call on to it /// The paxiom Varable, but both this and the name?? @@ -929,7 +930,8 @@ override internal void ApplyGrouping(Variable paxiomVariable, string variableCod if (mVariablesClassification.ContainsKey(variableCode)) { mVariablesClassification[variableCode].ApplyGrouping(paxiomVariable, groupingId, include); - } else + } + else { throw new ApplicationException("BUG"); } @@ -949,14 +951,15 @@ override internal void ApplyValueSet(string variableCode, string valueSetId) throw new ApplicationException("BUG"); } } - - override public bool MainTableContainsOnlyMetaData(){ - return this.MainTable.ContainsOnlyMetaData; + + override public bool MainTableContainsOnlyMetaData() + { + return this.MainTable.ContainsOnlyMetaData; } - + #region "IPlugIn implementation" diff --git a/PCAxis.Sql/Parser_23/PXSqlNotes.cs b/PCAxis.Sql/Parser_23/PXSqlNotes.cs index c23741d..31daa06 100644 --- a/PCAxis.Sql/Parser_23/PXSqlNotes.cs +++ b/PCAxis.Sql/Parser_23/PXSqlNotes.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using PCAxis.Sql.QueryLib_23; + using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 { @@ -435,7 +435,7 @@ private void enrollContValueAndTimeNotes() if (allNoteNos.Count == 0) { return; - //that's a good table! :-) + //that's a good table! :-) } Dictionary footnoteRows = mMeta.MetaQuery.GetFootnoteRows(allNoteNos, true); @@ -447,7 +447,7 @@ private void enrollContValueAndTimeNotes() //this is the list of bad numbers: StringCollection noteNoOfNotSelectedCellnotes = new StringCollection(); - + /// the rows in contValueRaw which has Cellnote = YES Dictionary> contValueCells = new Dictionary>(); @@ -485,7 +485,7 @@ private void enrollContValueAndTimeNotes() foreach (FootnoteContTimeRow footNoteRow in contTimeRaw[noteno]) { isSelected = false; - + if (mContents.ContainsKey(footNoteRow.Contents) && mTimeVariable.Values.ContainsKey(footNoteRow.TimePeriod)) { isSelected = true; @@ -551,7 +551,7 @@ private void enrollContValueAndTimeNotes() foreach (FootnoteContValueRow footNoteRow in contValueRaw[noteno]) { isSelected = false; - + if (mContents.ContainsKey(footNoteRow.Contents)) { if (mVariables.GetSelectedClassificationVarableIds().Contains(footNoteRow.Variable)) @@ -623,7 +623,7 @@ private void enrollContValueAndTimeNotes() #endregion foreach (string noteno in contValueRaw.Keys) - + #region Singlerow notes /// @@ -689,12 +689,12 @@ private void enrollContValueAndTimeNotes() timeperiodlistByContentsByNoteno.Remove(noteno); valuelistByVariableByContentsByNoteno.Remove(noteno); } - + // Dictionary timeperiodlistByContents = new Dictionary(); Dictionary> valueByVariableByContents = new Dictionary>(); - + foreach (string noteno in allNoteNos) @@ -1157,7 +1157,7 @@ override internal void ParseNote(PXSqlMeta_23 mMeta, PCAxis.Paxiom.IPXModelParse StringCollection parseValue; if (this.hasPresCharacter) { - keyWord = PXKeywords.DATANOTE; + keyWord = PXKeywords.DATANOTE; parseValue = new StringCollection(); parseValue.Add(this.presCharacter); diff --git a/PCAxis.Sql/Parser_23/PXSqlNpm.cs b/PCAxis.Sql/Parser_23/PXSqlNpm.cs index 70f0b54..0d59008 100644 --- a/PCAxis.Sql/Parser_23/PXSqlNpm.cs +++ b/PCAxis.Sql/Parser_23/PXSqlNpm.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; -using System.Text; -using System.Data; +using System.Collections.Specialized; + using PCAxis.Paxiom; using PCAxis.Sql.QueryLib_23; -using System.Globalization; -using System.Collections.Specialized; namespace PCAxis.Sql.Parser_23 { diff --git a/PCAxis.Sql/Parser_23/PXSqlParseMetaPostData_23.cs b/PCAxis.Sql/Parser_23/PXSqlParseMetaPostData_23.cs index 20e7f1a..985489e 100644 --- a/PCAxis.Sql/Parser_23/PXSqlParseMetaPostData_23.cs +++ b/PCAxis.Sql/Parser_23/PXSqlParseMetaPostData_23.cs @@ -1,14 +1,13 @@ using System; -using System.Collections.Specialized; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using log4net; + using PCAxis.Paxiom; using PCAxis.Sql.QueryLib_23; -using log4net; -using System.Text; - namespace PCAxis.Sql.Parser_23 { /// @@ -121,7 +120,7 @@ Code below is commented out because it did not work. PXSqlNpm myNpms = mMeta.mPxsqlNpm; StringCollection datanoteDistictValues = new StringCollection(); keyword = PXKeywords.DATANOTECELL; - + foreach (KeyValuePair dcn in theDataNoteCellEntries) { diff --git a/PCAxis.Sql/Parser_23/PXSqlSubTable.cs b/PCAxis.Sql/Parser_23/PXSqlSubTable.cs index f2beb09..74b88c0 100644 --- a/PCAxis.Sql/Parser_23/PXSqlSubTable.cs +++ b/PCAxis.Sql/Parser_23/PXSqlSubTable.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 diff --git a/PCAxis.Sql/Parser_23/PXSqlSubTables.cs b/PCAxis.Sql/Parser_23/PXSqlSubTables.cs index 81e49d5..36a5b7a 100644 --- a/PCAxis.Sql/Parser_23/PXSqlSubTables.cs +++ b/PCAxis.Sql/Parser_23/PXSqlSubTables.cs @@ -1,40 +1,44 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_23; + using PCAxis.PlugIn.Sql; using PCAxis.Sql.Pxs; -using System.Collections.Specialized; +using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 { - public class PXSqlSubTables:Dictionary + public class PXSqlSubTables : Dictionary { - + PxsQuery mPxsQuery; public PXSqlSubTables(Dictionary altIBasen, PxsQuery pPxsQuery, PXSqlMeta_23 pxsqlMeta) - : base() { + : base() + { this.mPxsQuery = pPxsQuery; PXSqlSubTable mSubTable; - foreach (SubTableRow subTableRow in altIBasen.Values) { + foreach (SubTableRow subTableRow in altIBasen.Values) + { mSubTable = new PXSqlSubTable(subTableRow); this.Add(mSubTable.SubTable, mSubTable); } // set selected subtables. if (pPxsQuery == null) { - foreach (PXSqlSubTable subTable in this.Values) { + foreach (PXSqlSubTable subTable in this.Values) + { subTable.IsSelected = true; } - } else { + } + else + { SetSelectedSubTable(pxsqlMeta); } } - - + + /// /// Returns the ids of the subtables marked as selected(All if not a pxs has selected a spesific subtable. @@ -57,17 +61,17 @@ public IEnumerable GetKeysOfSelectedSubTables() private void SetSelectedSubTable(PXSqlMeta_23 pxsqlMeta) { - + Boolean isEqualValueSet; - foreach (KeyValuePair subTable in this) + foreach (KeyValuePair subTable in this) { isEqualValueSet = true; string subTableName = subTable.Value.SubTable; - Dictionary fromDb = pxsqlMeta.MetaQuery.GetSubTableVariableRowskeyVariable(pxsqlMeta.MainTable.MainTable, subTableName,false); - + Dictionary fromDb = pxsqlMeta.MetaQuery.GetSubTableVariableRowskeyVariable(pxsqlMeta.MainTable.MainTable, subTableName, false); + foreach (PQVariable pqvariable in mPxsQuery.Query.Variables) - { + { string variableName = pqvariable.code; string selectedValueset = pqvariable.SelectedValueset; if (!fromDb.ContainsKey(variableName)) @@ -79,17 +83,17 @@ private void SetSelectedSubTable(PXSqlMeta_23 pxsqlMeta) { isEqualValueSet = false; break; - } + } } if (isEqualValueSet) { - + this[subTableName].IsSelected = true; } } - + } } } diff --git a/PCAxis.Sql/Parser_23/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs b/PCAxis.Sql/Parser_23/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs index 6af1efd..c814462 100644 --- a/PCAxis.Sql/Parser_23/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs +++ b/PCAxis.Sql/Parser_23/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs @@ -1,17 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Text; -using PCAxis.Paxiom; +using System.Collections.Generic; +using System.Collections.Specialized; + using log4net; -using PCAxis.Sql.QueryLib_23; + +using PCAxis.Paxiom; using PCAxis.Sql.DbConfig; -using System.Collections.Specialized; +using PCAxis.Sql.QueryLib_23; -namespace PCAxis.Sql.Parser_23 { +namespace PCAxis.Sql.Parser_23 +{ ///Class for columns in the Content-tabell that are independent of content (they will possibly be /// moved to maintabletable in a later version of the metamodel) - class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent { + class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent + { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlThingsThatWouldBeTheSameInAllPXSqlContent)); @@ -45,25 +47,35 @@ class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent { private bool mOfficialStatistics; private Dictionary nameByLangCode = new Dictionary(); - - internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_23 meta, SqlDbConfig_23 config) { + + internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_23 meta, SqlDbConfig_23 config) + { mStatAuthorityCode = someContentsRow.StatAuthority; string copyright = someContentsRow.Copyright; - if (copyright.Equals(config.Codes.Copyright1) || copyright.Equals(config.Codes.Copyright2)) { + if (copyright.Equals(config.Codes.Copyright1) || copyright.Equals(config.Codes.Copyright2)) + { mCopyright = false; - } else if (copyright.Equals(config.Codes.Copyright3)) { - mCopyright = true ; - } else { + } + else if (copyright.Equals(config.Codes.Copyright3)) + { + mCopyright = true; + } + else + { mCopyright = true; log.Error("The database has copyright=" + copyright + ", but the valid codes from config are " + config.Codes.Copyright1 + "," + config.Codes.Copyright2 + " or " + config.Codes.Copyright3 + "."); } - if (copyright.Equals(config.Codes.Copyright1)) { + if (copyright.Equals(config.Codes.Copyright1)) + { mOfficialStatistics = true; - } else { - mOfficialStatistics = false; + } + else + { + mOfficialStatistics = false; } OrganizationRow org = meta.MetaQuery.GetOrganizationRow(mStatAuthorityCode); - foreach (string language in org.texts.Keys) { + foreach (string language in org.texts.Keys) + { nameByLangCode.Add(language, org.texts[language].OrganizationName); } } @@ -88,13 +100,15 @@ internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContents /// /// /// - public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { + public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) + { StringCollection values = new StringCollection(); string subkey = null; - foreach (string langCode in nameByLangCode.Keys) { + foreach (string langCode in nameByLangCode.Keys) + { // SOURCE values.Clear(); @@ -106,9 +120,12 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { // COPYRIGHT values.Clear(); - if (mCopyright) { + if (mCopyright) + { values.Add(PXConstant.YES); - } else { + } + else + { values.Add(PXConstant.NO); } handler(PXKeywords.COPYRIGHT, noLanguage, subkey, values); diff --git a/PCAxis.Sql/Parser_23/PXSqlTimeScale.cs b/PCAxis.Sql/Parser_23/PXSqlTimeScale.cs index 134cc59..deb5743 100644 --- a/PCAxis.Sql/Parser_23/PXSqlTimeScale.cs +++ b/PCAxis.Sql/Parser_23/PXSqlTimeScale.cs @@ -1,6 +1,5 @@ using System; -using System.Collections.Generic; -using System.Text; + using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 @@ -8,7 +7,7 @@ namespace PCAxis.Sql.Parser_23 public class PXSqlTimeScale { private TimeScaleRow tsRow; - + private bool doTimeScalePres = false; /// @@ -60,12 +59,12 @@ public string StoreFormat /// public string getPresText(string langCode) { - + return tsRow.texts[langCode].PresText; } - - - + + + /// /// Contructor /// diff --git a/PCAxis.Sql/Parser_23/PXSqlValue.cs b/PCAxis.Sql/Parser_23/PXSqlValue.cs index 529ad0c..a8b3489 100644 --- a/PCAxis.Sql/Parser_23/PXSqlValue.cs +++ b/PCAxis.Sql/Parser_23/PXSqlValue.cs @@ -1,10 +1,10 @@ using System; -using System.Collections; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_23; using System.Collections.Specialized; + using log4net; + +using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 { public class SortByVsValueHelper : IComparer @@ -13,7 +13,7 @@ int IComparer.Compare(PXSqlValue a, PXSqlValue b) { PXSqlValue valA = a; PXSqlValue valB = b; - return String.Compare(valA.SortCodeVsValue,valB.SortCodeVsValue); + return String.Compare(valA.SortCodeVsValue, valB.SortCodeVsValue); } } public class SortByValueHelper : IComparer @@ -39,7 +39,7 @@ int IComparer.Compare(PXSqlValue a, PXSqlValue b) return 0; } } - public class PXSqlValue:IComparable + public class PXSqlValue : IComparable { #region members private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlValue)); @@ -52,8 +52,8 @@ public class PXSqlValue:IComparable private string mSortCodeValue; private string mSortCodeVsValue; private string mSortCodeDb; // this is the sortorder returned from dababase sort on vsvalue,value - private Dictionary mValueTextS = new Dictionary(); - private Dictionary mValueTextL = new Dictionary(); + private Dictionary mValueTextS = new Dictionary(); + private Dictionary mValueTextL = new Dictionary(); private string mPrecision; private bool mIsSelected; private bool mExistInDb; @@ -75,7 +75,7 @@ public string ContentsCode public string ValueCode { get { return mValueCode; } - set { mValueCode = value;} + set { mValueCode = value; } } public string ValuePool { @@ -83,9 +83,9 @@ public string ValuePool set { mValuePool = value; } } public string ValueSet - { + { get { return mValueSet; } - set { mValueSet = value; } + set { mValueSet = value; } } public int SortCodePxs { @@ -108,7 +108,7 @@ public string SortCodeDb get { return mSortCodeDb; } set { mSortCodeDb = value; } } - public Dictionary ValueTextS + public Dictionary ValueTextS { get { return mValueTextS; } set { mValueTextS = value; } @@ -130,13 +130,13 @@ public bool IsSelected } public bool ExistInDb { - get { return mExistInDb; } - set { mExistInDb = value; } + get { return mExistInDb; } + set { mExistInDb = value; } } - + //private List mFootNoteRows; //public List FootNoteRows //{ @@ -155,12 +155,13 @@ public bool ExistInDb public PXSqlValue() { - // mFootNotesValue = new List(); + // mFootNotesValue = new List(); } - public PXSqlValue(ValueRow2HM myValueRow, StringCollection LanguageCodes, string MainLanguageCode) { - + public PXSqlValue(ValueRow2HM myValueRow, StringCollection LanguageCodes, string MainLanguageCode) + { + //this.meta = meta; this.mContentsCode = null; // only for contentsvalues @@ -174,7 +175,8 @@ public PXSqlValue(ValueRow2HM myValueRow, StringCollection LanguageCodes, string this.mSortCodeVsValue = myValueRow.texts[MainLanguageCode].SortCodeVsValue; //this.SecondarySortOrder = myValueRow.ValueSortCode; this.SortCodeDb = myValueRow.SortOrder; - foreach (string langCode in LanguageCodes) { + foreach (string langCode in LanguageCodes) + { this.ValueTextS[langCode] = myValueRow.texts[langCode].ValueTextS; this.ValueTextL[langCode] = myValueRow.texts[langCode].ValueTextL; } @@ -216,18 +218,19 @@ public PXSqlValue(ValueRowHM myValueRow, StringCollection LanguageCodes, string /// /// Used as ValueCode, ValueTextS and ValueTextL /// - public PXSqlValue(string timeCode, StringCollection LanguageCodes) - { + public PXSqlValue(string timeCode, StringCollection LanguageCodes) + { //this.meta = meta; - this.mContentsCode = null; // only for contentsvalues + this.mContentsCode = null; // only for contentsvalues this.ValueCode = timeCode; this.SortCodePxs = 0; // is sometimes overridden from outside - this.mSortCodeValue = timeCode; + this.mSortCodeValue = timeCode; this.mSortCodeVsValue = "0"; //hmmm this.SortCodeDb = "0"; //hmmm - foreach (string langCode in LanguageCodes) { + foreach (string langCode in LanguageCodes) + { this.ValueTextS[langCode] = timeCode; this.ValueTextL[langCode] = timeCode; } @@ -244,9 +247,9 @@ public PXSqlValue(PXSqlContent content, int sortCode) this.ValueTextS = content.PresTextS; // SortCodePxs and SortCode are now set to the same value. Maybe no a good thing if sortorder should be reset to db // default after read from pxs. //TODO send two sortcodes from PXSQlMeta. - this.SortCodePxs = sortCode; - this.mSortCodeValue = sortCode.ToString(); - + this.SortCodePxs = sortCode; + this.mSortCodeValue = sortCode.ToString(); + } @@ -256,7 +259,7 @@ public int CompareTo(object obj) { if (this.GetType() != obj.GetType()) { - throw new PCAxis.Sql.Exceptions.BugException(10000); + throw new PCAxis.Sql.Exceptions.BugException(10000); } else { @@ -272,7 +275,7 @@ public int CompareTo(object obj) } } } - public static IComparer SortByVsValue() + public static IComparer SortByVsValue() { return (IComparer)new SortByVsValueHelper(); } diff --git a/PCAxis.Sql/Parser_23/PXSqlValuePool.cs b/PCAxis.Sql/Parser_23/PXSqlValuePool.cs index 2f1a47d..7e4e40b 100644 --- a/PCAxis.Sql/Parser_23/PXSqlValuePool.cs +++ b/PCAxis.Sql/Parser_23/PXSqlValuePool.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_23; -using System.Collections.Specialized; + using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 { @@ -40,7 +39,7 @@ public Dictionary PresText { get { return mPresText; } } - + /// /// Which texts exists (long/short/extra/none) @@ -55,7 +54,7 @@ public string ValuePres { get { return vpRow.ValuePres; } } - + // Depending of if it's a primary or secondary language, Doamin is read from different columns in database table ValuePool. // Valuepool if primary and ValuePoolEng(2.0) ValuePoolAlias (later). A solution could be to add a property here called Domain. @@ -83,7 +82,7 @@ public string MetaId /// For config.codes public PXSqlValuepool(QueryLib_23.ValuePoolRow inRow, PXSqlMeta_23 meta) { - + this.vpRow = inRow; if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsN)) @@ -101,13 +100,14 @@ public PXSqlValuepool(QueryLib_23.ValuePoolRow inRow, PXSqlMeta_23 meta) { mPresText[langCode] = vpRow.texts[langCode].PresText; mDomain[langCode] = vpRow.texts[langCode].ValuePoolAlias; - if(String.IsNullOrEmpty(mDomain[langCode])) { + if (String.IsNullOrEmpty(mDomain[langCode])) + { mDomain[langCode] = vpRow.texts[langCode].ValuePoolAlias; } } } - + } } diff --git a/PCAxis.Sql/Parser_23/PXSqlValueSet.cs b/PCAxis.Sql/Parser_23/PXSqlValueSet.cs index ab5c679..ce79797 100644 --- a/PCAxis.Sql/Parser_23/PXSqlValueSet.cs +++ b/PCAxis.Sql/Parser_23/PXSqlValueSet.cs @@ -1,19 +1,16 @@ - using System; +using System; using System.Collections.Generic; -using System.Text; - -using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 { public class PXSqlValueSet { #region - + private string mValueSet; //private string mPresText; private Dictionary mPresText = new Dictionary(); - + private string elimination; //private PXSqlValuepool mValuePool; private string mValuePoolId; @@ -21,9 +18,9 @@ public class PXSqlValueSet private string mGeoAreaNo; private string mMetaId; - + private string mSortCodeExists; - + private int mNumberOfValues; /// @@ -43,13 +40,13 @@ public List SortedListOfCodes public string ValueSet { get { return this.mValueSet; } - + } - + public Dictionary PresText { get { return this.mPresText; } - + } @@ -58,12 +55,12 @@ internal string MetaId { get { return mMetaId; } } - + public string Elimination { get { return this.elimination; } } - + public string ValuePoolId { get { return this.mValuePoolId; } @@ -72,22 +69,22 @@ public string ValuePoolId public string ValuePres { get { return this.mValuePres; } - + } public string GeoAreaNo { get { return this.mGeoAreaNo; } - + } - + public string SortCodeExists { get { return mSortCodeExists; } - + } - + public int NumberOfValues { get { return mNumberOfValues; } @@ -95,36 +92,40 @@ public int NumberOfValues } public PXSqlValueSet() { } - public PXSqlValueSet(QueryLib_23.ValueSetRow inRow) { - + public PXSqlValueSet(QueryLib_23.ValueSetRow inRow) + { + this.mValueSet = inRow.ValueSet; this.elimination = inRow.Elimination; this.mSortCodeExists = inRow.SortCodeExists; - this.mValuePoolId = inRow.ValuePool; + this.mValuePoolId = inRow.ValuePool; this.mValuePres = inRow.ValuePres; this.mGeoAreaNo = inRow.GeoAreaNo; this.mMetaId = inRow.MetaId; - foreach (string langCode in inRow.texts.Keys) { - + foreach (string langCode in inRow.texts.Keys) + { + //PresText came in version 2.1 and is optional ... desciption is up to 200 chars string asPresText = inRow.texts[langCode].PresText; - if (String.IsNullOrEmpty(asPresText)) { + if (String.IsNullOrEmpty(asPresText)) + { asPresText = inRow.texts[langCode].Description; int gridPosition = asPresText.IndexOf('#'); - if (gridPosition > 0) { + if (gridPosition > 0) + { asPresText = asPresText.Substring(0, gridPosition); } } mPresText[langCode] = asPresText; - + } - //private int mNumberOfValues; is set outside class. Bad thing? Yes + //private int mNumberOfValues; is set outside class. Bad thing? Yes } //for magic all - public PXSqlValueSet(Dictionary presText, string valuePoolId, string elimination, string sortCodeExists,string valuePres) + public PXSqlValueSet(Dictionary presText, string valuePoolId, string elimination, string sortCodeExists, string valuePres) { this.mValueSet = PCAxis.PlugIn.Sql.PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS; this.mPresText = presText; diff --git a/PCAxis.Sql/Parser_23/PXSqlVariable.cs b/PCAxis.Sql/Parser_23/PXSqlVariable.cs index b016ca2..a65f895 100644 --- a/PCAxis.Sql/Parser_23/PXSqlVariable.cs +++ b/PCAxis.Sql/Parser_23/PXSqlVariable.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_23; + +using log4net; + using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; using PCAxis.PlugIn.Sql; -using log4net; +using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 { @@ -52,7 +52,7 @@ public abstract class PXSqlVariable : IComparable, ISqlItem private string mVariableType; private String mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; - + //protected const string allValuesets = "_ALL_"; protected string selectedValueset; internal string SelectedValueset @@ -211,14 +211,18 @@ protected internal Dictionary ValueSets protected internal PXSqlValuepool ValuePool { get { return mValuePool; } - protected set { mValuePool = value; - if (mValuePool == null) + protected set { - mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; - } else { - mValueTextOption = mValuePool.ValueTextOption; - this.addMetaId(mValuePool.MetaId); - } + mValuePool = value; + if (mValuePool == null) + { + mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; + } + else + { + mValueTextOption = mValuePool.ValueTextOption; + this.addMetaId(mValuePool.MetaId); + } } } @@ -254,7 +258,7 @@ public PXSqlVariable(string name, PXSqlMeta_23 meta, bool isContVar, bool isTime #endregion constructors - + /// /// The metaID propperty of a Variable in Paxiom, must hold the MetaIds from different tables in CNMM. /// MetaId from tables Variable,ValuePool,ValueSet and Grouping are all mapped to the same in paxiom. @@ -262,10 +266,10 @@ public PXSqlVariable(string name, PXSqlMeta_23 meta, bool isContVar, bool isTime /// a MetaId to be added. If null it is not added internal void addMetaId(string aMetaIdEntry) { - if (! String.IsNullOrEmpty(aMetaIdEntry)) + if (!String.IsNullOrEmpty(aMetaIdEntry)) { - if (!metaids.Contains(aMetaIdEntry)) - { + if (!metaids.Contains(aMetaIdEntry)) + { metaids.Add(aMetaIdEntry); } } @@ -299,16 +303,16 @@ protected virtual void SetElimForPresentation() /// internal virtual bool UsesGroupingOnNonstoredData() { - return false; + return false; } #region CompareTo public int CompareTo(object obj) - { - PXSqlVariable SqlVariableCompare = (PXSqlVariable)obj; - // return this.Index.CompareTo(SqlVariableCompare.Index); //will not compare time-,classification and contens + { + PXSqlVariable SqlVariableCompare = (PXSqlVariable)obj; + // return this.Index.CompareTo(SqlVariableCompare.Index); //will not compare time-,classification and contens if (this.Index == SqlVariableCompare.Index) { return (0); @@ -327,7 +331,7 @@ public int CompareTo(object obj) } } - + #endregion @@ -345,7 +349,7 @@ internal virtual void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler { StringCollection values = new StringCollection(); string subkey = this.Name; - + //VARIABLENAME //OBS located in PXSQLBuilder near SetVariableName @@ -361,7 +365,7 @@ internal virtual void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler // PRESTEXT ParsePresTextOption(handler, LanguageCodes, preferredLanguage); - + // VALUE_TEXT_OPTION ParseValueTextOption(handler); @@ -388,7 +392,7 @@ internal virtual void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler /// private void ParseVariableType(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { - if (this.VariableType != null ) + if (this.VariableType != null) { StringCollection values = new StringCollection(); @@ -612,7 +616,7 @@ internal virtual void ParseCodeAndValues(PCAxis.Paxiom.IPXModelParser.MetaHandle { values.Clear(); values.Add(valuepair.Value); - myKey = this.Name +"\",\"" +valuepair.Key; + myKey = this.Name + "\",\"" + valuepair.Key; handler(PXKeywords.META_ID, noLanguage, myKey, values); } } diff --git a/PCAxis.Sql/Parser_23/PXSqlVariableClassification.cs b/PCAxis.Sql/Parser_23/PXSqlVariableClassification.cs index df54c9f..54f8f27 100644 --- a/PCAxis.Sql/Parser_23/PXSqlVariableClassification.cs +++ b/PCAxis.Sql/Parser_23/PXSqlVariableClassification.cs @@ -1,13 +1,14 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_23; -using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; -using PCAxis.PlugIn.Sql; using System.Data; + using log4net; + +using PCAxis.Paxiom; +using PCAxis.PlugIn.Sql; +using PCAxis.Sql.Pxs; +using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 { public class PXSqlVariableClassification : PXSqlVariable @@ -258,7 +259,7 @@ private void SetValues() // when no pxs internal void SetValues(StringCollection selSubTables) { - + ValueRow2HMDictionary mValueRowDictionary = meta.MetaQuery.GetValueRowDictionary(meta.MainTable.MainTable, selSubTables, this.Name, this.ValuePool.ValueTextExists); Dictionary mValueRows = mValueRowDictionary.ValueRows; @@ -335,7 +336,7 @@ internal void SetValues(StringCollection selSubTables, PQVariable var) documentOrder++; } - #endregion foreach var.Values.Items + #endregion foreach var.Values.Items // mSelectedValues now contains all the selected values, including those defined by wildcards @@ -1045,14 +1046,14 @@ internal bool isCandidateMustSelect() { if (!pxsqlCont.AggregPossible) { - foreach (KeyValuePair vs in this.ValueSets) + foreach (KeyValuePair vs in this.ValueSets) { - if (vs.Value.Elimination== PXConstant.YES) - { + if (vs.Value.Elimination == PXConstant.YES) + { return true; } } - + } } return false; diff --git a/PCAxis.Sql/Parser_23/PXSqlVariableContents.cs b/PCAxis.Sql/Parser_23/PXSqlVariableContents.cs index a1e1d79..0c4c6ea 100644 --- a/PCAxis.Sql/Parser_23/PXSqlVariableContents.cs +++ b/PCAxis.Sql/Parser_23/PXSqlVariableContents.cs @@ -1,17 +1,18 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_23; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_23; + namespace PCAxis.Sql.Parser_23 { class PXSqlVariableContents : PXSqlVariable { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableContents)); - + #region contructor public PXSqlVariableContents(String name, PXSqlMeta_23 meta) : base(name, meta, true, false, false) @@ -21,7 +22,7 @@ public PXSqlVariableContents(String name, PXSqlMeta_23 meta) if (!meta.ConstructedFromPxs) { mIndex = mStoreColumnNo; - } + } SetDefaultPresTextOption(); SetPresText(); } @@ -78,8 +79,9 @@ private void SetDefaultPresTextOption() /// /// /// - internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) { - + internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) + { + base.ParseMeta(handler, LanguageCodes, preferredLanguage); //CONTVARIABLE @@ -96,14 +98,14 @@ internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handle string tmpAggregPossible = PXConstant.YES; foreach (PXSqlContent pxsqlCont in meta.Contents.Values) { - - if (! pxsqlCont.AggregPossible) + + if (!pxsqlCont.AggregPossible) { tmpAggregPossible = PXConstant.NO; break; } } - + values.Clear(); values.Add(tmpAggregPossible); handler(PXKeywords.AGGREGALLOWED, language, subkey, values); @@ -118,7 +120,8 @@ internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handle log.Debug("meta.Contents.Values.Count=" + meta.Contents.Values.Count.ToString()); // "ContentInfo" // og PXKeywords.PRECISION - foreach (PXSqlContent pxsqlCont in meta.Contents.Values) { + foreach (PXSqlContent pxsqlCont in meta.Contents.Values) + { pxsqlCont.ParseMeta(handler, LanguageCodes); } diff --git a/PCAxis.Sql/Parser_23/PXSqlVariableTime.cs b/PCAxis.Sql/Parser_23/PXSqlVariableTime.cs index 478b942..7410317 100644 --- a/PCAxis.Sql/Parser_23/PXSqlVariableTime.cs +++ b/PCAxis.Sql/Parser_23/PXSqlVariableTime.cs @@ -1,41 +1,40 @@ -using System; +using System.Collections; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_23; -using PCAxis.Paxiom; - -using System.Collections; -using log4net; +using log4net; +using PCAxis.Paxiom; using PCAxis.Sql.Pxs; +using PCAxis.Sql.QueryLib_23; namespace PCAxis.Sql.Parser_23 { - public class PXSqlVariableTime:PXSqlVariable + public class PXSqlVariableTime : PXSqlVariable { - private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableTime)); - #region props - private PXSqlTimeScale mTimeScale; - - - private StringCollection mTimeVal; - public StringCollection TimeVal { - get { return mTimeVal; } - } - private bool mHasTimeVal; - public bool HasTimeVal { - get { return mHasTimeVal; } - } - //private bool mTableContainsMetaOnly; - #endregion props - - - #region contructor + private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableTime)); + #region props + private PXSqlTimeScale mTimeScale; + + + private StringCollection mTimeVal; + public StringCollection TimeVal + { + get { return mTimeVal; } + } + private bool mHasTimeVal; + public bool HasTimeVal + { + get { return mHasTimeVal; } + } + //private bool mTableContainsMetaOnly; + #endregion props + + + #region contructor public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_23 meta) - :base(aTVRow.Variable,meta,false,true,false) + : base(aTVRow.Variable, meta, false, true, false) { mStoreColumnNo = int.Parse(aTVRow.StoreColumnNo); if (!meta.ConstructedFromPxs) @@ -44,9 +43,9 @@ public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_23 meta) } SetSelected(); SetPresText(); - SetDefaultPresTextOption(); + SetDefaultPresTextOption(); SetTimeValues(); - mTimeScale = new PXSqlTimeScale(meta.MetaQuery.GetTimeScaleRow(meta.MainTable.TimeScale),meta.Config); + mTimeScale = new PXSqlTimeScale(meta.MetaQuery.GetTimeScaleRow(meta.MainTable.TimeScale), meta.Config); SetTimeVal(); PossiblyResetPresText(); @@ -54,7 +53,7 @@ public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_23 meta) } - #endregion + #endregion internal void SetSelected() { this.mIsSelected = false; @@ -67,10 +66,10 @@ internal void SetSelected() { this.mIsSelected = true; } - } + } internal override List GetValuesForParsing() { - if ((meta.inPresentationModus) && meta.ConstructedFromPxs ) + if ((meta.inPresentationModus) && meta.ConstructedFromPxs) { if ((int)meta.PxsFile.Query.Time.TimeOption == 0) { @@ -102,20 +101,22 @@ internal override List GetValuesForParsing() /// /// /// - internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) { - base.ParseMeta(handler, LanguageCodes, preferredLanguage); + internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) + { + base.ParseMeta(handler, LanguageCodes, preferredLanguage); //log.Debug("PPPPPPPPPPPPPPPPPParsing"); string language; string subkey = this.Name; StringCollection values; //TIMEVAL - if (mHasTimeVal) { - - language = null; - values = this.mTimeVal; - handler(PXKeywords.TIMEVAL, language, subkey, values); - values = null; - } + if (mHasTimeVal) + { + + language = null; + values = this.mTimeVal; + handler(PXKeywords.TIMEVAL, language, subkey, values); + values = null; + } language = null; values = new StringCollection(); values.Clear(); @@ -135,58 +136,59 @@ private void SetDefaultPresTextOption() - private void SetTimeVal() { - - - string timeUnit; - if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitA) - timeUnit = "A1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitH) - timeUnit = "H1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitM) - timeUnit = "M1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitQ) - timeUnit = "Q1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitW) - timeUnit = "W1"; - else - { + private void SetTimeVal() + { + + + string timeUnit; + if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitA) + timeUnit = "A1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitH) + timeUnit = "H1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitM) + timeUnit = "M1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitQ) + timeUnit = "Q1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitW) + timeUnit = "W1"; + else + { log.InfoFormat("Unknown Timeunit:{0}", mTimeScale.TimeUnit); - timeUnit = mTimeScale.TimeUnit; - } - - mTimeVal = new StringCollection(); - mTimeVal.Add("TLIST("+timeUnit+")"); - mHasTimeVal = true; - if (!meta.MainTable.ContainsOnlyMetaData) - { - string lowestSelectedTime; - string highestSelectedTime; - ArrayList selectedTimeCodes = new ArrayList(); - foreach (KeyValuePair val in mValues) - { - selectedTimeCodes.Add(val.Value.ValueCode); - } - selectedTimeCodes.Sort(); - lowestSelectedTime = selectedTimeCodes[0].ToString(); - highestSelectedTime = selectedTimeCodes[selectedTimeCodes.Count - 1].ToString(); - ArrayList allTimeCodes = TimeValueCodesSortedChronologicaly(); - int startIndexAllTimes = allTimeCodes.IndexOf(lowestSelectedTime); - int endIndexAllTimes = allTimeCodes.IndexOf(highestSelectedTime); - for (int i = startIndexAllTimes; i <= endIndexAllTimes; i++) - { - mTimeVal.Add(allTimeCodes[i].ToString()); - if (!selectedTimeCodes.Contains(allTimeCodes[i])) - { - //TODO; Dette gjøres midlertidig for Ã¥ sørge for at Timeval - //vises i serialiseringen - mTimeVal.Clear(); - mTimeVal.Add("TLIST(" + timeUnit + ")"); - break; - } - } - } - } + timeUnit = mTimeScale.TimeUnit; + } + + mTimeVal = new StringCollection(); + mTimeVal.Add("TLIST(" + timeUnit + ")"); + mHasTimeVal = true; + if (!meta.MainTable.ContainsOnlyMetaData) + { + string lowestSelectedTime; + string highestSelectedTime; + ArrayList selectedTimeCodes = new ArrayList(); + foreach (KeyValuePair val in mValues) + { + selectedTimeCodes.Add(val.Value.ValueCode); + } + selectedTimeCodes.Sort(); + lowestSelectedTime = selectedTimeCodes[0].ToString(); + highestSelectedTime = selectedTimeCodes[selectedTimeCodes.Count - 1].ToString(); + ArrayList allTimeCodes = TimeValueCodesSortedChronologicaly(); + int startIndexAllTimes = allTimeCodes.IndexOf(lowestSelectedTime); + int endIndexAllTimes = allTimeCodes.IndexOf(highestSelectedTime); + for (int i = startIndexAllTimes; i <= endIndexAllTimes; i++) + { + mTimeVal.Add(allTimeCodes[i].ToString()); + if (!selectedTimeCodes.Contains(allTimeCodes[i])) + { + //TODO; Dette gjøres midlertidig for Ã¥ sørge for at Timeval + //vises i serialiseringen + mTimeVal.Clear(); + mTimeVal.Add("TLIST(" + timeUnit + ")"); + break; + } + } + } + } /** @@ -196,33 +198,35 @@ private void PossiblyResetPresText() { if (mTimeScale.UsePresTextFromTimeScale) { - List keys = new List(this.PresText.Keys); - + List keys = new List(this.PresText.Keys); + foreach (string langCode in keys) { - this.PresText[langCode] = mTimeScale.getPresText(langCode); + this.PresText[langCode] = mTimeScale.getPresText(langCode); } - + } } private ArrayList TimeValueCodesSortedChronologicaly() - { - ArrayList sortedTimeValues = new ArrayList(); - System.Data.DataSet mTimeInfoTbl = meta.MetaQuery.GetAllTimeValues(meta.MainTable.MainTable, "asc"); - - foreach (System.Data.DataRow row in mTimeInfoTbl.Tables[0].Rows) { + { + ArrayList sortedTimeValues = new ArrayList(); + System.Data.DataSet mTimeInfoTbl = meta.MetaQuery.GetAllTimeValues(meta.MainTable.MainTable, "asc"); - sortedTimeValues.Add(row[meta.MetaQuery.DB.ContentsTime.TimePeriodCol.PureColumnName()].ToString()); - } - sortedTimeValues.Sort(); - return sortedTimeValues; - } + foreach (System.Data.DataRow row in mTimeInfoTbl.Tables[0].Rows) + { + sortedTimeValues.Add(row[meta.MetaQuery.DB.ContentsTime.TimePeriodCol.PureColumnName()].ToString()); + } + sortedTimeValues.Sort(); + return sortedTimeValues; + } - private void SetTimeValues() { + + private void SetTimeValues() + { // time variable values //lage flere overloads databasespørringer avhengig av timeopt //mValues = new Dictionary(); diff --git a/PCAxis.Sql/Parser_23/PXSqlVariables.cs b/PCAxis.Sql/Parser_23/PXSqlVariables.cs index 665275f..d248c7c 100644 --- a/PCAxis.Sql/Parser_23/PXSqlVariables.cs +++ b/PCAxis.Sql/Parser_23/PXSqlVariables.cs @@ -1,13 +1,13 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_23; -using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; using System.Configuration; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.Pxs; + namespace PCAxis.Sql.Parser_23 { public class PXSqlVariables : Dictionary @@ -37,28 +37,29 @@ internal enum DefaultPivot /// internal bool HasAnyoneGroupingOnNonstoredData() { - - foreach (PXSqlVariable var in this.Values) + + foreach (PXSqlVariable var in this.Values) + { + if (var.UsesGroupingOnNonstoredData()) { - if (var.UsesGroupingOnNonstoredData() ) - { - return true; - } + return true; } - return false; - + } + return false; + } internal void setStubHeadPxs() { - int highestUsedStubIndex = 0 ; + int highestUsedStubIndex = 0; if (meta.PxsFile.Presentation.Stub != null) - foreach ( AxisType stub in meta.PxsFile.Presentation.Stub) + foreach (AxisType stub in meta.PxsFile.Presentation.Stub) { //mSqlVariable = this[stub.code]; this[stub.code].Index = stub.index; - if(stub.index > highestUsedStubIndex ) { + if (stub.index > highestUsedStubIndex) + { highestUsedStubIndex = stub.index; } this[stub.code].IsStub = true; @@ -69,13 +70,15 @@ internal void setStubHeadPxs() foreach (AxisType heading in meta.PxsFile.Presentation.Heading) { //mSqlVariable = this[heading.code]; - this[heading.code].Index = heading.index; - this[heading.code].IsHeading = true; + this[heading.code].Index = heading.index; + this[heading.code].IsHeading = true; } } - foreach (PXSqlVariable tmpVar in this.Values) { - if (tmpVar.isSelected && (!tmpVar.IsHeading) && (!tmpVar.IsStub)) { + foreach (PXSqlVariable tmpVar in this.Values) + { + if (tmpVar.isSelected && (!tmpVar.IsHeading) && (!tmpVar.IsStub)) + { log.Warn("Variable " + tmpVar.Name + " isSelected, but neither Heading nor Stub. Setting it to stub"); highestUsedStubIndex++; tmpVar.IsStub = true; @@ -83,11 +86,12 @@ internal void setStubHeadPxs() } } - string shouldPivot = ConfigurationManager.AppSettings["autopivot"]; - if (shouldPivot != null) { + string shouldPivot = ConfigurationManager.AppSettings["autopivot"]; + if (shouldPivot != null) + { if (shouldPivot.ToLower() == "yes") - { - setStubHeadOverridden(); + { + setStubHeadOverridden(); } } } @@ -100,7 +104,7 @@ internal void setStubHeadOverridden() int selectedContentsValuesCount = 0; int selectedTimeContentsValuesCount = 0; int lowestSelectedClassValues = Int32.MaxValue; - string VariableWithLowestSelected=""; + string VariableWithLowestSelected = ""; //int stubIndex = 1;// eller 0 ?????? foreach (PXSqlVariable tmpVar in this.Values) @@ -129,22 +133,27 @@ internal void setStubHeadOverridden() } selectedTimeContentsValuesCount = selectedTimeValuesCount * selectedContentsValuesCount; pivotAlg = DefaultPivot.alg1; - if (selectedTimeContentsValuesCount <= 12 && selectedClassCount > 0){ + if (selectedTimeContentsValuesCount <= 12 && selectedClassCount > 0) + { pivotAlg = DefaultPivot.alg1; } - if (selectedTimeContentsValuesCount > 12 && selectedTimeValuesCount <= 24) { + if (selectedTimeContentsValuesCount > 12 && selectedTimeValuesCount <= 24) + { pivotAlg = DefaultPivot.alg2; } - if(selectedTimeValuesCount > 24){ + if (selectedTimeValuesCount > 24) + { pivotAlg = DefaultPivot.alg3; } - if(selectedTimeContentsValuesCount <= 12 && selectedClassCount == 0){ + if (selectedTimeContentsValuesCount <= 12 && selectedClassCount == 0) + { pivotAlg = DefaultPivot.alg4; } - if ((selectedTimeContentsValuesCount == 1 && selectedClassCount > 1) && (lowestSelectedClassValues <= 24) ){ + if ((selectedTimeContentsValuesCount == 1 && selectedClassCount > 1) && (lowestSelectedClassValues <= 24)) + { pivotAlg = DefaultPivot.alg5; - } - switch(pivotAlg) + } + switch (pivotAlg) { case DefaultPivot.alg1: break; @@ -272,18 +281,18 @@ internal void setStubHeadDefault() { if (tmpVar.IsTimevariable) { - // tmpVar.Index = 1; + // tmpVar.Index = 1; tmpVar.IsHeading = true; } else if (tmpVar.IsContentVariable) { - // tmpVar.Index = 2; + // tmpVar.Index = 2; tmpVar.IsHeading = true; } else { - // tmpVar.Index = stubIndex; - // stubIndex++; + // tmpVar.Index = stubIndex; + // stubIndex++; tmpVar.IsStub = true; } } @@ -319,12 +328,12 @@ internal List GetHeadingSorted() } } } - mHeadings.Sort(); - return mHeadings; + mHeadings.Sort(); + return mHeadings; } internal List GetStubSorted() { - List mStubs = new List(); + List mStubs = new List(); foreach (PXSqlVariable var in this.Values) { if (var.isSelected) @@ -366,5 +375,5 @@ internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, String } } - + diff --git a/PCAxis.Sql/Parser_23/PXSqlVariablesClassification.cs b/PCAxis.Sql/Parser_23/PXSqlVariablesClassification.cs index a6ac226..0e0a9b1 100644 --- a/PCAxis.Sql/Parser_23/PXSqlVariablesClassification.cs +++ b/PCAxis.Sql/Parser_23/PXSqlVariablesClassification.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_21; -using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; -using log4net; +using System.Collections.Generic; namespace PCAxis.Sql.Parser_23 { diff --git a/PCAxis.Sql/Parser_23/ParseMetaIndependentOfMaintable.cs b/PCAxis.Sql/Parser_23/ParseMetaIndependentOfMaintable.cs index 3a91fe1..999322c 100644 --- a/PCAxis.Sql/Parser_23/ParseMetaIndependentOfMaintable.cs +++ b/PCAxis.Sql/Parser_23/ParseMetaIndependentOfMaintable.cs @@ -1,10 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Collections.Specialized; -using PCAxis.Paxiom; +using System.Collections.Specialized; + using log4net; +using PCAxis.Paxiom; + namespace PCAxis.Sql.Parser_23 { @@ -13,92 +12,96 @@ namespace PCAxis.Sql.Parser_23 /// public class ParseMetaIndependentOfMaintable { - private static readonly ILog log = LogManager.GetLogger(typeof(ParseMetaIndependentOfMaintable)); - - internal ParseMetaIndependentOfMaintable() { } - - /// "ANSI" - /// "2000" hei - /// System.DateTime.UtcNow - /// - /// - /// If there exists a Optional_PXCodepage entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "iso-8859-1" - /// - /// - ///
- ///
- ///
- /// - /// - /// If there exists a Optional_PXAxisVersion entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "2000" - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// If there exists a Optional_PXCharset entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "ANSI" - /// - /// - ///
- ///
- ///
- /// - /// - /// If there exists a Optional_PXDescriptionDefault entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise false - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") - /// - /// - /// - internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, PXMetaAdmValues metaAdm ) { - string noLanguage = null; - string subkey = null; - StringCollection values = new StringCollection(); - - values.Add(metaAdm.PXCharset); - handler(PXKeywords.CHARSET, noLanguage, subkey, values); - - - values.Clear(); - values.Add(metaAdm.PXAxisVersion); - handler(PXKeywords.AXIS_VERSION, noLanguage, subkey, values); - - values.Clear(); - values.Add(metaAdm.PXCodepage); - handler(PXKeywords.CODEPAGE, noLanguage, subkey, values); - - values.Clear(); - if (metaAdm.PXDescriptionDefault) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.DESCRIPTIONDEFAULT, noLanguage, subkey, values); - - values.Clear(); - - // string nowString = System.DateTime.UtcNow.ToString("yyyyMMdd hh:mm"); bug 193 wrong time - // string nowString = System.DateTime.Now.ToString(); - // string nowString = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm"); - // ørebro vedtak(beslut). - //ørebro 27.11.2012 Nytt formatvedtak + private static readonly ILog log = LogManager.GetLogger(typeof(ParseMetaIndependentOfMaintable)); + + internal ParseMetaIndependentOfMaintable() { } + + /// "ANSI" + /// "2000" hei + /// System.DateTime.UtcNow + /// + /// + /// If there exists a Optional_PXCodepage entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "iso-8859-1" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If there exists a Optional_PXAxisVersion entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "2000" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// If there exists a Optional_PXCharset entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "ANSI" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If there exists a Optional_PXDescriptionDefault entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise false + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") + /// + /// + /// + internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, PXMetaAdmValues metaAdm) + { + string noLanguage = null; + string subkey = null; + StringCollection values = new StringCollection(); + + values.Add(metaAdm.PXCharset); + handler(PXKeywords.CHARSET, noLanguage, subkey, values); + + + values.Clear(); + values.Add(metaAdm.PXAxisVersion); + handler(PXKeywords.AXIS_VERSION, noLanguage, subkey, values); + + values.Clear(); + values.Add(metaAdm.PXCodepage); + handler(PXKeywords.CODEPAGE, noLanguage, subkey, values); + + values.Clear(); + if (metaAdm.PXDescriptionDefault) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.DESCRIPTIONDEFAULT, noLanguage, subkey, values); + + values.Clear(); + + // string nowString = System.DateTime.UtcNow.ToString("yyyyMMdd hh:mm"); bug 193 wrong time + // string nowString = System.DateTime.Now.ToString(); + // string nowString = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm"); + // ørebro vedtak(beslut). + //ørebro 27.11.2012 Nytt formatvedtak //string nowString = System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz"); - string nowString = System.DateTime.Now.ToString("yyyyMMdd HH:mm"); + string nowString = System.DateTime.Now.ToString("yyyyMMdd HH:mm"); + + values.Add(nowString); - values.Add(nowString); - - handler(PXKeywords.CREATION_DATE, noLanguage, subkey, values); - } + handler(PXKeywords.CREATION_DATE, noLanguage, subkey, values); + } } diff --git a/PCAxis.Sql/Parser_23/PxSqlParserForCodelists_23.cs b/PCAxis.Sql/Parser_23/PxSqlParserForCodelists_23.cs index 55b3fa3..c170d42 100644 --- a/PCAxis.Sql/Parser_23/PxSqlParserForCodelists_23.cs +++ b/PCAxis.Sql/Parser_23/PxSqlParserForCodelists_23.cs @@ -14,12 +14,12 @@ public class PXSqlParserForCodelists_23 : PCAxis.PlugIn.Sql.PXSqlParserForCodeli { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlParserForCodelists_23)); - + //private List _variables; private List _variables; - + private PXSqlMeta_23 mPXSqlMeta; - + #region Constructors @@ -28,38 +28,39 @@ public class PXSqlParserForCodelists_23 : PCAxis.PlugIn.Sql.PXSqlParserForCodeli ///
/// PXSqlMeta holding variables /// Name of the vaiable - public PXSqlParserForCodelists_23(PXSqlMeta_23 inPXSqlMeta, String variableCode) { - mPXSqlMeta = inPXSqlMeta; - _variables = new List(); - _variables.Add(inPXSqlMeta.VariablesClassification[variableCode]); + public PXSqlParserForCodelists_23(PXSqlMeta_23 inPXSqlMeta, String variableCode) + { + mPXSqlMeta = inPXSqlMeta; + _variables = new List(); + _variables.Add(inPXSqlMeta.VariablesClassification[variableCode]); } #endregion - + /// /// Sends the data /// /// /// - public override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) - { - foreach (PXSqlVariableClassification variable in _variables) - { - - variable.ParseForApplyValueSet(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); - } + public override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) + { + foreach (PXSqlVariableClassification variable in _variables) + { + variable.ParseForApplyValueSet(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); + } + + + } - } - /// - /// IDisposable implemenatation + /// IDisposable implemenatation /// - override public void Dispose() - { + override public void Dispose() + { mPXSqlMeta = null; } diff --git a/PCAxis.Sql/Parser_23/PxSqlParser_23.cs b/PCAxis.Sql/Parser_23/PxSqlParser_23.cs index 1833451..d2f1307 100644 --- a/PCAxis.Sql/Parser_23/PxSqlParser_23.cs +++ b/PCAxis.Sql/Parser_23/PxSqlParser_23.cs @@ -1,9 +1,9 @@ -using System; using System.Collections.Specialized; -using PCAxis.Paxiom; using log4net; +using PCAxis.Paxiom; + namespace PCAxis.Sql.Parser_23 { public class PXSqlParser_23 : PCAxis.PlugIn.Sql.PXSqlParser @@ -17,10 +17,11 @@ public class PXSqlParser_23 : PCAxis.PlugIn.Sql.PXSqlParser internal PXSqlNpm symbols; #region Constructor - // public PXSqlParser_23() { } + // public PXSqlParser_23() { } - public PXSqlParser_23(PXSqlMeta_23 inPXSqlMeta) { + public PXSqlParser_23(PXSqlMeta_23 inPXSqlMeta) + { mPXSqlMeta = inPXSqlMeta; if (mPXSqlMeta.inPresentationModus) @@ -81,18 +82,21 @@ public PXSqlParser_23(PXSqlMeta_23 inPXSqlMeta) { /// /// /// - override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) { + override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) + { string keyword; - + string noLanguage = null; string subkey = null; StringCollection values; - if (mHasParsedMeta) { + if (mHasParsedMeta) + { return; } - if (mPXSqlMeta.HasLanguage) { + if (mPXSqlMeta.HasLanguage) + { // Language keyword = PXKeywords.LANGUAGE; values = new StringCollection(); @@ -102,7 +106,8 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, // Languages keyword = PXKeywords.LANGUAGES; values = new StringCollection(); - foreach (string lang in mPXSqlMeta.LanguageCodes) { + foreach (string lang in mPXSqlMeta.LanguageCodes) + { values.Add(lang); } handler(keyword, noLanguage, subkey, values); @@ -119,7 +124,8 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, - foreach (PXSqlVariable var in mPXSqlMeta.Variables.Values) { + foreach (PXSqlVariable var in mPXSqlMeta.Variables.Values) + { var.ParseMeta(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); } @@ -131,13 +137,13 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, mPXSqlMeta.TheNotes.ParseAllNotes(handler); - - + + #endregion Footnotes #region NPMish stuff - if (mPXSqlMeta.inPresentationModus ) + if (mPXSqlMeta.inPresentationModus) { this.symbols.ParseMeta(handler, mPXSqlMeta); } @@ -153,12 +159,14 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, /// /// IDisposable implemenatation /// - override public void Dispose() { - if (mPXSqlMeta != null) { + override public void Dispose() + { + if (mPXSqlMeta != null) + { mPXSqlMeta.Dispose(); } } - + } } diff --git a/PCAxis.Sql/Parser_23/PxSqlValues.cs b/PCAxis.Sql/Parser_23/PxSqlValues.cs index b5b299f..351d9c6 100644 --- a/PCAxis.Sql/Parser_23/PxSqlValues.cs +++ b/PCAxis.Sql/Parser_23/PxSqlValues.cs @@ -1,16 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Text; -using log4net; +using System.Collections.Generic; + +using log4net; namespace PCAxis.Sql.Parser_23 { - public class PxSqlValues:Dictionary + public class PxSqlValues : Dictionary { #region contants - private static readonly ILog log = LogManager.GetLogger(typeof(PxSqlValues)); - + private static readonly ILog log = LogManager.GetLogger(typeof(PxSqlValues)); + #endregion internal List GetValuesForSelectedValueset(string selectedValueset) { @@ -21,7 +20,7 @@ internal List GetValuesForSelectedValueset(string selectedValueset) valuesetsValues.Add(value); else if (value.ValueSet == selectedValueset) - valuesetsValues.Add(value); + valuesetsValues.Add(value); } return valuesetsValues; } @@ -39,7 +38,7 @@ internal List GetValuesSortedByVSValue(List values) } internal List GetValuesSortedByValue(List values) { - + List sortedValueList = new List(); foreach (PXSqlValue value in values) { diff --git a/PCAxis.Sql/Parser_23/SqlCollection.cs b/PCAxis.Sql/Parser_23/SqlCollection.cs index 6ee17d2..89d235b 100644 --- a/PCAxis.Sql/Parser_23/SqlCollection.cs +++ b/PCAxis.Sql/Parser_23/SqlCollection.cs @@ -1,18 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Text; using System.Collections.Specialized; namespace PCAxis.Sql.Parser_23 { - // brukes ikke lenger da generisk dictionary benyttes istedet - class SqlCollection: NameObjectCollectionBase where T:ISqlItem + // brukes ikke lenger da generisk dictionary benyttes istedet + class SqlCollection : NameObjectCollectionBase where T : ISqlItem { #region add public void Add(T collItem) { - base.BaseAdd(collItem.Name,collItem); + base.BaseAdd(collItem.Name, collItem); } #endregion #region remove @@ -22,7 +18,7 @@ public void Remove(T collItem) } #endregion #region locate - public T Item (string Name) + public T Item(string Name) { return (T)base.BaseGet(Name/*.ToUpper()*/); diff --git a/PCAxis.Sql/Parser_23/Texts.cs b/PCAxis.Sql/Parser_23/Texts.cs index 8fd5ea1..cd81283 100644 --- a/PCAxis.Sql/Parser_23/Texts.cs +++ b/PCAxis.Sql/Parser_23/Texts.cs @@ -1,13 +1,11 @@ -using System; using System.Collections.Generic; -using System.Text; namespace PCAxis.Sql.Parser_23 { // This class should read from a configuration file. class Texts { - private Dictionary mPaxiomAnd; + private Dictionary mPaxiomAnd; public Dictionary PaxiomAnd { get { return mPaxiomAnd; } @@ -28,16 +26,16 @@ public Dictionary PaxiomType } public Texts() { - mPaxiomAnd = new Dictionary(); + mPaxiomAnd = new Dictionary(); mPaxiomBy = new Dictionary(); mPaxiomType = new Dictionary(); - mPaxiomAnd["en"] = "and"; - mPaxiomBy["en"] = "by"; - mPaxiomType["en"] = "type"; - mPaxiomAnd["no"] = "og"; - mPaxiomBy["no"] = "etter"; - mPaxiomType["no"] = "type"; + mPaxiomAnd["en"] = "and"; + mPaxiomBy["en"] = "by"; + mPaxiomType["en"] = "type"; + mPaxiomAnd["no"] = "og"; + mPaxiomBy["no"] = "etter"; + mPaxiomType["no"] = "type"; } } diff --git a/PCAxis.Sql/Parser_24/EliminationAux.cs b/PCAxis.Sql/Parser_24/EliminationAux.cs index 18188a8..c742360 100644 --- a/PCAxis.Sql/Parser_24/EliminationAux.cs +++ b/PCAxis.Sql/Parser_24/EliminationAux.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; namespace PCAxis.Sql.Parser_24 { @@ -27,7 +25,7 @@ private string DBCodeForByNotAllowed() return ccodes.EliminationN; } - + public EliminationAux(string eliminationMethod, string eliminationCode, DbConfig.SqlDbConfig_24.Ccodes ccodes) { @@ -74,7 +72,7 @@ public static EliminationAux MergeEliminations(List elims) { numberOfElimA++; } - else if (elimval.EliminationMethod == elimval.DBCodeForByNotAllowed()) + else if (elimval.EliminationMethod == elimval.DBCodeForByNotAllowed()) { numberOfElimN++; } @@ -95,11 +93,11 @@ public static EliminationAux MergeEliminations(List elims) } else { - return new EliminationAux(null,null,elims[0].ccodes); + return new EliminationAux(null, null, elims[0].ccodes); } - + } - + } } \ No newline at end of file diff --git a/PCAxis.Sql/Parser_24/ISqlItem.cs b/PCAxis.Sql/Parser_24/ISqlItem.cs index 1dc5887..446c5c7 100644 --- a/PCAxis.Sql/Parser_24/ISqlItem.cs +++ b/PCAxis.Sql/Parser_24/ISqlItem.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace PCAxis.Sql.Parser_24 { public interface ISqlItem diff --git a/PCAxis.Sql/Parser_24/PXMetaAdmValues.cs b/PCAxis.Sql/Parser_24/PXMetaAdmValues.cs index 1d5a21b..3de2143 100644 --- a/PCAxis.Sql/Parser_24/PXMetaAdmValues.cs +++ b/PCAxis.Sql/Parser_24/PXMetaAdmValues.cs @@ -1,16 +1,19 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_24; + using log4net; + using PCAxis.Sql.DbConfig; +using PCAxis.Sql.QueryLib_24; -namespace PCAxis.Sql.Parser_24 { +namespace PCAxis.Sql.Parser_24 +{ /// /// Gets the values from the MetaAdm table or their defaults. /// - public class PXMetaAdmValues { + public class PXMetaAdmValues + { private static readonly ILog log = LogManager.GetLogger(typeof(PXMetaAdmValues)); @@ -21,7 +24,8 @@ public class PXMetaAdmValues { /// /// returns the PXCodepage from database (optional) or the default /// - internal string PXCodepage { + internal string PXCodepage + { get { return _PXCodepage; } } @@ -29,7 +33,8 @@ internal string PXCodepage { /// /// returns the PXCharset from database (optional) or the default /// - internal string PXCharset { + internal string PXCharset + { get { return _PXCharset; } } @@ -37,7 +42,8 @@ internal string PXCharset { /// /// returns the PXAxisVersion from database (optional) or the default /// - internal string PXAxisVersion { + internal string PXAxisVersion + { get { return _PXAxisVersion; } } @@ -46,7 +52,8 @@ internal string PXAxisVersion { /// /// returns the PXDescriptionDefault from database (optional) or the default /// - internal bool PXDescriptionDefault { + internal bool PXDescriptionDefault + { get { return _PXDescriptionDefault; } } @@ -64,7 +71,8 @@ internal bool AllwaysUseMaintablePrestextSInDynamicTitle /// /// Gets the ID for DataNotAvailable /// - internal string DataNotAvailable{ + internal string DataNotAvailable + { get { return _DataNotAvailable; } } @@ -104,7 +112,7 @@ internal string DefaultCodeMissingLine { get { return _DefaultCodeMissingLine; } } - + #endregion fields & properties @@ -123,68 +131,76 @@ public PXMetaAdmValues(MetaQuery mMetaQuery) if (altIBasen.ContainsKey(Keywords.DataNotAvailable)) { _DataNotAvailable = altIBasen[Keywords.DataNotAvailable].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataNotAvailable + " not found in table with modelname MetaAdm."); - } - - if (altIBasen.ContainsKey(Keywords.DataNoteSum)) - { - _DataNoteSum = altIBasen[Keywords.DataNoteSum].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataNoteSum + " not found in table with modelname MetaAdm."); - } - - - if (altIBasen.ContainsKey(Keywords.DataSymbolNIL)) - { - _DataSymbolNIL = altIBasen[Keywords.DataSymbolNIL].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataSymbolNIL + " not found in table with modelname MetaAdm."); - } - - if (altIBasen.ContainsKey(Keywords.DataSymbolSum)) - { - _DataSymbolSum = altIBasen[Keywords.DataSymbolSum].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DataSymbolSum + " not found in table with modelname MetaAdm."); - } - - - if (altIBasen.ContainsKey(Keywords.DefaultCodeMissingLine)) - { - _DefaultCodeMissingLine = altIBasen[Keywords.DefaultCodeMissingLine].Value; - } - else - { - throw new ApplicationException("Keyword:" + Keywords.DefaultCodeMissingLine + " not found in table with modelname MetaAdm."); - } + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataNotAvailable + " not found in table with modelname MetaAdm."); + } + + if (altIBasen.ContainsKey(Keywords.DataNoteSum)) + { + _DataNoteSum = altIBasen[Keywords.DataNoteSum].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataNoteSum + " not found in table with modelname MetaAdm."); + } + + + if (altIBasen.ContainsKey(Keywords.DataSymbolNIL)) + { + _DataSymbolNIL = altIBasen[Keywords.DataSymbolNIL].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataSymbolNIL + " not found in table with modelname MetaAdm."); + } + + if (altIBasen.ContainsKey(Keywords.DataSymbolSum)) + { + _DataSymbolSum = altIBasen[Keywords.DataSymbolSum].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DataSymbolSum + " not found in table with modelname MetaAdm."); + } + + + if (altIBasen.ContainsKey(Keywords.DefaultCodeMissingLine)) + { + _DefaultCodeMissingLine = altIBasen[Keywords.DefaultCodeMissingLine].Value; + } + else + { + throw new ApplicationException("Keyword:" + Keywords.DefaultCodeMissingLine + " not found in table with modelname MetaAdm."); + } //Optional //PXCodepage - if (Keywords.Optional_PXCodepage != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXCodepage)) { + if (Keywords.Optional_PXCodepage != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXCodepage)) + { _PXCodepage = altIBasen[Keywords.Optional_PXCodepage].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXCodepage + " not found in table with modelname MetaAdm."); } } //PXDescriptionDefault - if (Keywords.Optional_PXDescriptionDefault != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXDescriptionDefault)) { + if (Keywords.Optional_PXDescriptionDefault != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXDescriptionDefault)) + { _PXDescriptionDefault = altIBasen[Keywords.Optional_PXDescriptionDefault].Value.Equals(dbConfig.Codes.Yes); - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXDescriptionDefault + " not found in table with modelname MetaAdm."); } } @@ -203,29 +219,37 @@ public PXMetaAdmValues(MetaQuery mMetaQuery) //PXCharset - if (Keywords.Optional_PXCharset != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXCharset)) { + if (Keywords.Optional_PXCharset != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXCharset)) + { _PXCharset = altIBasen[Keywords.Optional_PXCharset].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXCharset + " not found in table with modelname MetaAdm."); } } //PXAxisVersion - if (Keywords.Optional_PXAxisVersion != null) { - if (altIBasen.ContainsKey(Keywords.Optional_PXAxisVersion)) { + if (Keywords.Optional_PXAxisVersion != null) + { + if (altIBasen.ContainsKey(Keywords.Optional_PXAxisVersion)) + { _PXAxisVersion = altIBasen[Keywords.Optional_PXAxisVersion].Value; - } else { + } + else + { throw new ApplicationException("Keyword:" + Keywords.Optional_PXAxisVersion + " not found in table with modelname MetaAdm."); } } } - - - + + + } } diff --git a/PCAxis.Sql/Parser_24/PXSqlAttributes.cs b/PCAxis.Sql/Parser_24/PXSqlAttributes.cs index 6785c45..0942110 100644 --- a/PCAxis.Sql/Parser_24/PXSqlAttributes.cs +++ b/PCAxis.Sql/Parser_24/PXSqlAttributes.cs @@ -1,9 +1,7 @@ using System; using System.Collections.Generic; -using System.Collections.Specialized; using System.Linq; -using System.Text; -using PCAxis.Paxiom; + using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 @@ -35,7 +33,7 @@ internal Dictionary AvailableAttributes get { return mAvailableAttributes; } } - string mTheOneAndOnlyAttributeColumn; + string mTheOneAndOnlyAttributeColumn; internal string TheOneAndOnlyAttributeColumn { get { return mTheOneAndOnlyAttributeColumn; } @@ -45,7 +43,7 @@ internal string TheOneAndOnlyAttributeColumn //protected Dictionary _AttributesEntries; - internal PXSqlAttributes( PXSqlMeta_24 meta) + internal PXSqlAttributes(PXSqlMeta_24 meta) { this.mMeta = meta; mAvailableAttributes = mMeta.MetaQuery.GetAttributeRows(meta.MainTable.MainTable, true); @@ -64,9 +62,9 @@ internal PXSqlAttributes( PXSqlMeta_24 meta) /// /// Returns attributes order by sequenceNo /// - private SortedList getAttributesSorted() + private SortedList getAttributesSorted() { - SortedList sortedAttributes = new SortedList(); + SortedList sortedAttributes = new SortedList(); foreach (AttributeRow myAttr in this.mAvailableAttributes.Values) { sortedAttributes.Add(myAttr.SequenceNo, myAttr); diff --git a/PCAxis.Sql/Parser_24/PXSqlContact.cs b/PCAxis.Sql/Parser_24/PXSqlContact.cs index f369677..64cbace 100644 --- a/PCAxis.Sql/Parser_24/PXSqlContact.cs +++ b/PCAxis.Sql/Parser_24/PXSqlContact.cs @@ -1,12 +1,10 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; -using PCAxis.Sql.QueryLib_24; -using System.Collections.Specialized; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Sql.QueryLib_24; + namespace PCAxis.Sql.Parser_24 { @@ -40,21 +38,22 @@ public PXSqlContact(PXSqlMeta_24 meta, string mMainTableId) Dictionary personIDs = new Dictionary(); try { - foreach (KeyValuePair RoleMain in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleMain,false)) + foreach (KeyValuePair RoleMain in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleMain, false)) { if (!personIDs.ContainsKey(RoleMain.Key)) { personIDs.Add(RoleMain.Key, RoleMain.Value); } } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant add RoleMain", e); } try { - foreach (KeyValuePair RoleContact in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleContact,true)) + foreach (KeyValuePair RoleContact in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleContact, true)) { if (!personIDs.ContainsKey(RoleContact.Key)) @@ -62,12 +61,13 @@ public PXSqlContact(PXSqlMeta_24 meta, string mMainTableId) personIDs.Add(RoleContact.Key, RoleContact.Value); } } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant add RoleContact", e); } - + bool firstPerson = true; @@ -86,7 +86,7 @@ public PXSqlContact(PXSqlMeta_24 meta, string mMainTableId) if (!firstPerson) { //mBigFatContactStringsByLanguage[language] += "#"; - // mBigFatContactStringsByLanguage[language] += "||"; + // mBigFatContactStringsByLanguage[language] += "||"; } @@ -113,7 +113,8 @@ public PXSqlContact(PXSqlMeta_24 meta, string mMainTableId) firstPerson = false; } - } catch (Exceptions.PCAxisSqlException e) + } + catch (Exceptions.PCAxisSqlException e) { log.Error("Cant find contact info", e); } diff --git a/PCAxis.Sql/Parser_24/PXSqlContent.cs b/PCAxis.Sql/Parser_24/PXSqlContent.cs index d685ff6..7f392ca 100644 --- a/PCAxis.Sql/Parser_24/PXSqlContent.cs +++ b/PCAxis.Sql/Parser_24/PXSqlContent.cs @@ -1,146 +1,151 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; -using PCAxis.Sql.QueryLib_24; using System.Collections.Specialized; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; +using PCAxis.Sql.QueryLib_24; + namespace PCAxis.Sql.Parser_24 { - public class PXSqlContent:IComparable + public class PXSqlContent : IComparable { - private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlContent)); - - #region value to be used if row is missing - - /// - /// must be 0, 2 or 3. 0 indicates presCellsZero = yes - /// - private string mCategoryOfCellsInMissingRows = "0"; - public string CategoryOfCellsInMissingRows { - get { return mCategoryOfCellsInMissingRows; } - } - - private PXSqlNpm.NPMCharacter mNPMcharacterinMissingRows = null; - - internal PXSqlNpm.NPMCharacter NPMcharacterinMissingRows - { - get { return mNPMcharacterinMissingRows; } - } - - /// - /// the magicNumber (or 0 when category = 0) - /// - private double mValueOfCellsInMissingRows = 0; - public double ValueOfCellsInMissingRows { - get { return mValueOfCellsInMissingRows; } - } - #endregion value to be used if row is missing - - private ContentsRow mRow; - - /// - /// Contact is per maintable in the database, but per Content in paxiom. Thus we have to send the same contact for all Content. - /// - private PXSqlContact mContact; - - - - public PXSqlContent() { } - public PXSqlContent(ContentsRow row, PXSqlMeta_24 pxsqlMeta, SqlDbConfig_24 config, PXSqlContact contact) { - mRow = row; - mContact = contact; - //pxsqlMeta.MetaQuery.DB.Codes.Copyright1; - mContents = row.Contents; - //mFootnoteContents = row.FootnoteContents; - //mFootnoteTime = row.FootnoteTime; - //mFootnoteValue = row.FootnoteValue; - //mFootnoteVariable = row.FootnoteVariable; - mPresText = new Dictionary(); - mPresTextS = new Dictionary(); - mPresCode = row.PresCode; - - mBasePeriod = new Dictionary(); - mRefPeriod = new Dictionary(); - mUnit = new Dictionary(); - - - foreach (string langCode in pxsqlMeta.LanguageCodes) - { - mPresText[langCode] = row.texts[langCode].PresText; - mPresTextS[langCode] = row.texts[langCode].PresTextS; - mBasePeriod[langCode] = row.texts[langCode].BasePeriod; - mRefPeriod[langCode] = row.texts[langCode].RefPeriod; - mUnit[langCode] = row.texts[langCode].Unit; - } - - mPresDecimals = mRow.PresDecimals; - pxsqlMeta.DecimalHandler.ShowDecimals = mPresDecimals; - pxsqlMeta.DecimalHandler.StoreDecimals = mRow.StoreDecimals; - - mSeasAdj = mRow.SeasAdj.Equals(config.Codes.Yes); - mDayAdj = mRow.DayAdj.Equals(config.Codes.Yes); - mLastUpdatet = mRow.LastUpdated; - mStockFA = PaxiomifyStockFA(mRow.StockFA, config); - mCFPrices = PaxiomifyCFPrices(mRow.CFPrices, config); - - - mAggregPossible = ! mRow.AggregPossible.Equals(config.Codes.No); //not notPossible since yes is default - - #region mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows - if( pxsqlMeta.inPresentationModus && mRow.PresCellsZero.Equals(config.Codes.No)){ - - // both 2.1 and 2.2 uses a mRow.PresMissingLine from the SpecialCharacter.CharacterType( which is the primary key) - // or if mRow.PresMissingLine is missing: the default - - mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineMagic; - mNPMcharacterinMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineNPMCharacter; - - if (!( String.IsNullOrEmpty(mRow.PresMissingLine))) - { - mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine); - mNPMcharacterinMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNNPMCharacter(mRow.PresMissingLine); - } - mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString(); - - } - #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows - } - - - - private string mContents; - public string Contents - { - get { return mContents;} - set { mContents = value;} - } - - private int mSortOrder; - public int SortOrder - { - get { return mSortOrder; } - set { mSortOrder = value; } - } - - private Dictionary mPresText; - public Dictionary PresText + private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlContent)); + + #region value to be used if row is missing + + /// + /// must be 0, 2 or 3. 0 indicates presCellsZero = yes + /// + private string mCategoryOfCellsInMissingRows = "0"; + public string CategoryOfCellsInMissingRows + { + get { return mCategoryOfCellsInMissingRows; } + } + + private PXSqlNpm.NPMCharacter mNPMcharacterinMissingRows = null; + + internal PXSqlNpm.NPMCharacter NPMcharacterinMissingRows + { + get { return mNPMcharacterinMissingRows; } + } + + /// + /// the magicNumber (or 0 when category = 0) + /// + private double mValueOfCellsInMissingRows = 0; + public double ValueOfCellsInMissingRows + { + get { return mValueOfCellsInMissingRows; } + } + #endregion value to be used if row is missing + + private ContentsRow mRow; + + /// + /// Contact is per maintable in the database, but per Content in paxiom. Thus we have to send the same contact for all Content. + /// + private PXSqlContact mContact; + + + + public PXSqlContent() { } + public PXSqlContent(ContentsRow row, PXSqlMeta_24 pxsqlMeta, SqlDbConfig_24 config, PXSqlContact contact) + { + mRow = row; + mContact = contact; + //pxsqlMeta.MetaQuery.DB.Codes.Copyright1; + mContents = row.Contents; + //mFootnoteContents = row.FootnoteContents; + //mFootnoteTime = row.FootnoteTime; + //mFootnoteValue = row.FootnoteValue; + //mFootnoteVariable = row.FootnoteVariable; + mPresText = new Dictionary(); + mPresTextS = new Dictionary(); + mPresCode = row.PresCode; + + mBasePeriod = new Dictionary(); + mRefPeriod = new Dictionary(); + mUnit = new Dictionary(); + + + foreach (string langCode in pxsqlMeta.LanguageCodes) + { + mPresText[langCode] = row.texts[langCode].PresText; + mPresTextS[langCode] = row.texts[langCode].PresTextS; + mBasePeriod[langCode] = row.texts[langCode].BasePeriod; + mRefPeriod[langCode] = row.texts[langCode].RefPeriod; + mUnit[langCode] = row.texts[langCode].Unit; + } + + mPresDecimals = mRow.PresDecimals; + pxsqlMeta.DecimalHandler.ShowDecimals = mPresDecimals; + pxsqlMeta.DecimalHandler.StoreDecimals = mRow.StoreDecimals; + + mSeasAdj = mRow.SeasAdj.Equals(config.Codes.Yes); + mDayAdj = mRow.DayAdj.Equals(config.Codes.Yes); + mLastUpdatet = mRow.LastUpdated; + mStockFA = PaxiomifyStockFA(mRow.StockFA, config); + mCFPrices = PaxiomifyCFPrices(mRow.CFPrices, config); + + + mAggregPossible = !mRow.AggregPossible.Equals(config.Codes.No); //not notPossible since yes is default + + #region mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows + if (pxsqlMeta.inPresentationModus && mRow.PresCellsZero.Equals(config.Codes.No)) + { + + // both 2.1 and 2.2 uses a mRow.PresMissingLine from the SpecialCharacter.CharacterType( which is the primary key) + // or if mRow.PresMissingLine is missing: the default + + mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineMagic; + mNPMcharacterinMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineNPMCharacter; + + if (!(String.IsNullOrEmpty(mRow.PresMissingLine))) + { + mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine); + mNPMcharacterinMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNNPMCharacter(mRow.PresMissingLine); + } + mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString(); + + } + #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows + } + + + + private string mContents; + public string Contents + { + get { return mContents; } + set { mContents = value; } + } + + private int mSortOrder; + public int SortOrder + { + get { return mSortOrder; } + set { mSortOrder = value; } + } + + private Dictionary mPresText; + public Dictionary PresText { get { return mPresText; } set { mPresText = value; } } - private Dictionary mPresTextS; - public Dictionary PresTextS + private Dictionary mPresTextS; + public Dictionary PresTextS { get { return mPresTextS; } set { mPresTextS = value; } } - - private string mPresCode; + + private string mPresCode; public string PresCode { get { return mPresCode; } @@ -155,20 +160,20 @@ public Dictionary UNIT - //Ikke i bruk + //Ikke i bruk - //private string mProducer; - // public string Producer - // { - // get { return mProducer; } - // set { mProducer = value; } - // } + //private string mProducer; + // public string Producer + // { + // get { return mProducer; } + // set { mProducer = value; } + // } #region ContentInfo in Paxiom private Dictionary mRefPeriod; - // private Dictionary mUnit; + // private Dictionary mUnit; private Dictionary mBasePeriod; private string mLastUpdatet; @@ -188,322 +193,349 @@ public Dictionary UNIT // set { mPublished = value; } //} - private string mPresDecimals; - + private string mPresDecimals; + - public string PresCellsZero { + public string PresCellsZero + { get { return mRow.PresCellsZero; } } - public string PresMissingLine { + public string PresMissingLine + { get { return mRow.PresMissingLine; } } - private bool mAggregPossible; + private bool mAggregPossible; public bool AggregPossible { get { return mAggregPossible; } } - - private string mStoreColumnNo; + + private string mStoreColumnNo; public string StoreColumnNo { get { return mStoreColumnNo; } set { mStoreColumnNo = value; } } - private string mStoreFormat; + private string mStoreFormat; public string StoreFormat { get { return mStoreFormat; } set { mStoreFormat = value; } } - private string mStoreNoChar; + private string mStoreNoChar; public string StoreNoChar { get { return mStoreNoChar; } set { mStoreNoChar = value; } } - //private string mStoreDecimals; - // public string StoreDecimals - // { - // get { return mStoreDecimals; } - // set { mStoreDecimals = value; } - // } + //private string mStoreDecimals; + // public string StoreDecimals + // { + // get { return mStoreDecimals; } + // set { mStoreDecimals = value; } + // } - private string mUserid; + private string mUserid; public string Userid { get { return mUserid; } set { mUserid = value; } } - private string mLogDate; + private string mLogDate; public string LogDate { get { return mLogDate; } set { mLogDate = value; } - + + } + + + public int CompareTo(PXSqlContent compPXSqlContent) + { + return mSortOrder.CompareTo(compPXSqlContent.mSortOrder); } - - - public int CompareTo(PXSqlContent compPXSqlContent) - { - return mSortOrder.CompareTo(compPXSqlContent.mSortOrder); - } - - /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - /// - /// - /// - /// - /// - ///
- /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. - /// - /// - ///
- ///
- ///
- /// - /// - /// If value in database equals to CFPricesC code in db config file then set to PXConstant.CFPRICES_CURRENT. - /// If value in database equals to CFPricesF code in db config file then set to PXConstant.CFPRICES_FIXED. - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// Language dependent. Maps the code in dbconfig file to PX PXConstant - /// StockFAS-->STOCKFA_STOCK, StockFAF-->STOCKFA_FLOW,StockFAA-->STOCKFA_AVERAGE. - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// - /// - ///
- ///
- ///
- /// - /// - /// Holds the Contents.Contents from database so it could be referenced back to from paxiom - /// - /// - ///
- ///
- ///
- public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes) - { - - StringCollection values = new StringCollection(); - - //string subkey = this.Contents; - string subkey = this.PresCode; //prescode should be Code i Paxiom. Contents is sent as Reference_is an ouse as code i PXS. - - foreach (string langCode in LanguageCodes) { - - // BASEPERIOD - values.Clear(); - values.Add(this.mBasePeriod[langCode]); - handler(PXKeywords.BASEPERIOD, langCode, subkey, values); - - - // CONTACT - values.Clear(); - values.Add(this.mContact.GetBigFatContactString(langCode)); - handler(PXKeywords.CONTACT, langCode, subkey, values); - - - // REFPERIOD - values.Clear(); - values.Add(this.mRefPeriod[langCode]); - handler(PXKeywords.REFPERIOD, langCode, subkey, values); - - - // UNITS - values.Clear(); - values.Add(this.mUnit[langCode]); - handler(PXKeywords.UNITS, langCode, subkey, values); - - } - - string noLanguage = null; - - - // META_ID - if (!String.IsNullOrEmpty(this.mRow.MetaId)) - { - values.Clear(); - values.Add(this.mRow.MetaId); - handler(PXKeywords.META_ID, noLanguage, PXSqlMeta_24.mContVariableCode + "\",\"" +subkey, values); - } - - - // CFPRICES - values.Clear(); - values.Add(this.mCFPrices); - handler(PXKeywords.CFPRICES, noLanguage, subkey, values); - - - // LAST_UPDATED - values.Clear(); - values.Add(this.mLastUpdatet); - handler(PXKeywords.LAST_UPDATED, noLanguage, subkey, values); - - //SEASADJ - values.Clear(); - if (this.mSeasAdj) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.SEASADJ, noLanguage, subkey, values); - - //DAYADJ - values.Clear(); - - if (this.mDayAdj) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.DAYADJ, noLanguage, subkey, values); - - //STOCKFA - values.Clear(); - values.Add(this.mStockFA); - handler(PXKeywords.STOCKFA, noLanguage, subkey, values); - - //PRECISION - if (!String.IsNullOrEmpty(this.mPresDecimals)) - { - values.Clear(); - values.Add(this.mPresDecimals); - String myKey = PXSqlMeta_24.mContVariableCode + "\",\"" + subkey;//for PXModelBuilder.SplittString A","B","C - // not "A","B","C" - log.Debug("Sender precision for " + myKey); - handler(PXKeywords.PRECISION, noLanguage, myKey, values); - } - - - - //REFRENCE_ID Used to hold unique Id of Content in Paxiom. This will be used in pxs to identify selected contents - // The resason why contents is placed in Code fro the value which represent the contents is that this is occupied by PresCode. - values.Clear(); - values.Add(this.Contents); - handler(PXKeywords.REFRENCE_ID, noLanguage, subkey, values); - } - - - - - internal void AdjustPresDecimalsToCommonDecimals(string Decimals) { - log.Debug(Decimals.Equals(mPresDecimals)); - if(Decimals.Equals(mPresDecimals)){ - - mPresDecimals = String.Empty; - } - } - - /** - * Translates database code to Paxiom code for StockFA. - */ - private string PaxiomifyStockFA(string StockFA,SqlDbConfig_24 config) { - string myOut = ""; - if (! String.IsNullOrEmpty(StockFA) ) { - if (StockFA.Equals(config.Codes.StockFAS)) { - myOut = PXConstant.STOCKFA_STOCK; - } else if (StockFA.Equals(config.Codes.StockFAA)) { - myOut = PXConstant.STOCKFA_AVERAGE; - } else if (StockFA.Equals(config.Codes.StockFAF)) { - myOut = PXConstant.STOCKFA_FLOW; - } else { - myOut = PXConstant.STOCKFA_OTHER; - //throw new ApplicationException("Unknown StockFA code:\"" + StockFA + "\""); - } - } - return myOut; - } - /**Translates database code to Paxiom code for CFPrices*/ - private string PaxiomifyCFPrices(string CFPrices, SqlDbConfig_24 config) { - string myOut = ""; - if (! String.IsNullOrEmpty(CFPrices)) { - if (CFPrices.Equals(config.Codes.CFPricesC)) { - myOut = PXConstant.CFPRICES_CURRENT; - } else if (CFPrices.Equals(config.Codes.CFPricesF)) { - myOut = PXConstant.CFPRICES_FIXED; - } else { - throw new ApplicationException("Unknown CFPrices code:\"" + CFPrices + "\""); - } - } - return myOut; - } - } - - - - + + /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + /// + /// + /// + /// + /// + ///
+ /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If value in database equals to CFPricesC code in db config file then set to PXConstant.CFPRICES_CURRENT. + /// If value in database equals to CFPricesF code in db config file then set to PXConstant.CFPRICES_FIXED. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Language dependent. Maps the code in dbconfig file to PX PXConstant + /// StockFAS-->STOCKFA_STOCK, StockFAF-->STOCKFA_FLOW,StockFAA-->STOCKFA_AVERAGE. + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// Holds the Contents.Contents from database so it could be referenced back to from paxiom + /// + /// + ///
+ ///
+ ///
+ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes) + { + + StringCollection values = new StringCollection(); + + //string subkey = this.Contents; + string subkey = this.PresCode; //prescode should be Code i Paxiom. Contents is sent as Reference_is an ouse as code i PXS. + + foreach (string langCode in LanguageCodes) + { + + // BASEPERIOD + values.Clear(); + values.Add(this.mBasePeriod[langCode]); + handler(PXKeywords.BASEPERIOD, langCode, subkey, values); + + + // CONTACT + values.Clear(); + values.Add(this.mContact.GetBigFatContactString(langCode)); + handler(PXKeywords.CONTACT, langCode, subkey, values); + + + // REFPERIOD + values.Clear(); + values.Add(this.mRefPeriod[langCode]); + handler(PXKeywords.REFPERIOD, langCode, subkey, values); + + + // UNITS + values.Clear(); + values.Add(this.mUnit[langCode]); + handler(PXKeywords.UNITS, langCode, subkey, values); + + } + + string noLanguage = null; + + + // META_ID + if (!String.IsNullOrEmpty(this.mRow.MetaId)) + { + values.Clear(); + values.Add(this.mRow.MetaId); + handler(PXKeywords.META_ID, noLanguage, PXSqlMeta_24.mContVariableCode + "\",\"" + subkey, values); + } + + + // CFPRICES + values.Clear(); + values.Add(this.mCFPrices); + handler(PXKeywords.CFPRICES, noLanguage, subkey, values); + + + // LAST_UPDATED + values.Clear(); + values.Add(this.mLastUpdatet); + handler(PXKeywords.LAST_UPDATED, noLanguage, subkey, values); + + //SEASADJ + values.Clear(); + if (this.mSeasAdj) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.SEASADJ, noLanguage, subkey, values); + + //DAYADJ + values.Clear(); + + if (this.mDayAdj) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.DAYADJ, noLanguage, subkey, values); + + //STOCKFA + values.Clear(); + values.Add(this.mStockFA); + handler(PXKeywords.STOCKFA, noLanguage, subkey, values); + + //PRECISION + if (!String.IsNullOrEmpty(this.mPresDecimals)) + { + values.Clear(); + values.Add(this.mPresDecimals); + String myKey = PXSqlMeta_24.mContVariableCode + "\",\"" + subkey;//for PXModelBuilder.SplittString A","B","C + // not "A","B","C" + log.Debug("Sender precision for " + myKey); + handler(PXKeywords.PRECISION, noLanguage, myKey, values); + } + + + + //REFRENCE_ID Used to hold unique Id of Content in Paxiom. This will be used in pxs to identify selected contents + // The resason why contents is placed in Code fro the value which represent the contents is that this is occupied by PresCode. + values.Clear(); + values.Add(this.Contents); + handler(PXKeywords.REFRENCE_ID, noLanguage, subkey, values); + } + + + + + internal void AdjustPresDecimalsToCommonDecimals(string Decimals) + { + log.Debug(Decimals.Equals(mPresDecimals)); + if (Decimals.Equals(mPresDecimals)) + { + + mPresDecimals = String.Empty; + } + } + + /** + * Translates database code to Paxiom code for StockFA. + */ + private string PaxiomifyStockFA(string StockFA, SqlDbConfig_24 config) + { + string myOut = ""; + if (!String.IsNullOrEmpty(StockFA)) + { + if (StockFA.Equals(config.Codes.StockFAS)) + { + myOut = PXConstant.STOCKFA_STOCK; + } + else if (StockFA.Equals(config.Codes.StockFAA)) + { + myOut = PXConstant.STOCKFA_AVERAGE; + } + else if (StockFA.Equals(config.Codes.StockFAF)) + { + myOut = PXConstant.STOCKFA_FLOW; + } + else + { + myOut = PXConstant.STOCKFA_OTHER; + //throw new ApplicationException("Unknown StockFA code:\"" + StockFA + "\""); + } + } + return myOut; + } + /**Translates database code to Paxiom code for CFPrices*/ + private string PaxiomifyCFPrices(string CFPrices, SqlDbConfig_24 config) + { + string myOut = ""; + if (!String.IsNullOrEmpty(CFPrices)) + { + if (CFPrices.Equals(config.Codes.CFPricesC)) + { + myOut = PXConstant.CFPRICES_CURRENT; + } + else if (CFPrices.Equals(config.Codes.CFPricesF)) + { + myOut = PXConstant.CFPRICES_FIXED; + } + else + { + throw new ApplicationException("Unknown CFPrices code:\"" + CFPrices + "\""); + } + } + return myOut; + } + } + + + + } diff --git a/PCAxis.Sql/Parser_24/PXSqlData_24.cs b/PCAxis.Sql/Parser_24/PXSqlData_24.cs index 4c3bc85..205595b 100644 --- a/PCAxis.Sql/Parser_24/PXSqlData_24.cs +++ b/PCAxis.Sql/Parser_24/PXSqlData_24.cs @@ -7,11 +7,13 @@ namespace PCAxis.Sql.Parser_24 using System.Collections.Generic; using System.Collections.Specialized; using System.Data; + using System.Linq; + using log4net; + using PCAxis.Sql.Parser; using PCAxis.Sql.QueryLib_24; - using System.Linq; - + /// /// @@ -35,7 +37,7 @@ public class PXSqlData_24 : PXSqlData private const string MINDEX_COL = "MINDEX"; private PXSqlMeta_24 mMeta; - + //these booleans influence the SQL-query private bool npm = false; @@ -1204,7 +1206,7 @@ private bool ShouldAddDefaultCodeMissingLineNPMCharacter(int rowCount) foreach (string contCode in contKeys) { PXSqlContent content = mMeta.Contents[contCode]; - + if (content.PresCellsZero == this.mMeta.Config.Codes.No && string.IsNullOrEmpty(content.PresMissingLine)) { return true; diff --git a/PCAxis.Sql/Parser_24/PXSqlDecimalStuff.cs b/PCAxis.Sql/Parser_24/PXSqlDecimalStuff.cs index 055b84c..9acee99 100644 --- a/PCAxis.Sql/Parser_24/PXSqlDecimalStuff.cs +++ b/PCAxis.Sql/Parser_24/PXSqlDecimalStuff.cs @@ -1,11 +1,9 @@ using System; -using System.Collections.Generic; -using System.Text; + using log4net; -using PCAxis.Paxiom; -using System.Collections.Specialized; -namespace PCAxis.Sql.Parser_24{ +namespace PCAxis.Sql.Parser_24 +{ /// DECIMALS, SHOWDECIMALS and PRECISION all handle decimals in some way. /// ParseMeta for PRECISION is in PXsqlContents /// @@ -23,55 +21,74 @@ namespace PCAxis.Sql.Parser_24{ ///n is a figure between 1 and 6. The number of decimals for precision must be higher than the number of decimals ///for SHOWDECIMALS to have any effect. /// - internal class PXSqlDecimalStuff { + internal class PXSqlDecimalStuff + { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlDecimalStuff)); internal PXSqlDecimalStuff() { } private int mShowDecimals = 6; private int mStoreDecimals = 0; - - public string ShowDecimals { + + public string ShowDecimals + { get { return mShowDecimals.ToString(); } - set { + set + { int tmpValue = -1; - try { + try + { tmpValue = int.Parse(value); - } catch (Exception e) { + } + catch (Exception e) + { log.Error(e); return; } - if (tmpValue > 6) { + if (tmpValue > 6) + { throw new ApplicationException("Decimal number cannot be higher than 6. Found " + value); - } else if (tmpValue < 0) { + } + else if (tmpValue < 0) + { throw new ApplicationException("Decimal number cannot be lower than 0. Found " + value); } - if (tmpValue < mShowDecimals) { + if (tmpValue < mShowDecimals) + { mShowDecimals = tmpValue; } } } - public string StoreDecimals { + public string StoreDecimals + { get { return mStoreDecimals.ToString(); } - set { + set + { int tmpValue = -1; - try { + try + { tmpValue = int.Parse(value); - } catch (Exception e) { + } + catch (Exception e) + { log.Error(e); return; } - if (tmpValue > 15) { + if (tmpValue > 15) + { throw new ApplicationException("Decimal number cannot be higher than 15. Found " + value); - } else if (tmpValue < 0) { + } + else if (tmpValue < 0) + { throw new ApplicationException("Decimal number cannot be lower than 0. Found " + value); } - if (tmpValue > mStoreDecimals) { + if (tmpValue > mStoreDecimals) + { mStoreDecimals = tmpValue; } } @@ -84,7 +101,7 @@ public string StoreDecimals { // string noLanguage = null; // string subkey = null; - + // values.Add(mStoreDecimals.ToString()); // handler(PXKeywords.DECIMALS, noLanguage, subkey, values); @@ -94,6 +111,6 @@ public string StoreDecimals { //} - + } } diff --git a/PCAxis.Sql/Parser_24/PXSqlGroup.cs b/PCAxis.Sql/Parser_24/PXSqlGroup.cs index 591585d..6109ad7 100644 --- a/PCAxis.Sql/Parser_24/PXSqlGroup.cs +++ b/PCAxis.Sql/Parser_24/PXSqlGroup.cs @@ -1,8 +1,6 @@ namespace PCAxis.Sql.Parser_24 { -using System; -using System.Collections.Generic; -using System.Text; + using System.Collections.Generic; /// Stores A = B + C + D + public class PXSqlGroup @@ -22,7 +20,7 @@ public int GroupLevel } - + private bool isLeaf = false; /// @@ -33,14 +31,14 @@ public bool IsLeaf get { return isLeaf; } } - + /// The list of codes of the children private List childCodes = new List(); /// Initializes a new instance of the PXSqlGroup class, with the given parentCode /// The code of the parent item - internal PXSqlGroup(string parentCode) + internal PXSqlGroup(string parentCode) { this.parentCode = parentCode; } @@ -59,14 +57,14 @@ public IList ChildCodes /// Adds a code to the list of codes of the children /// The code of child item - public void AddChildCode(string childCode) + public void AddChildCode(string childCode) { this.childCodes.Add(childCode); if (parentCode.Equals(childCode)) { isLeaf = true; } - + } } } diff --git a/PCAxis.Sql/Parser_24/PXSqlGrouping.cs b/PCAxis.Sql/Parser_24/PXSqlGrouping.cs index f54a7a3..a3fd709 100644 --- a/PCAxis.Sql/Parser_24/PXSqlGrouping.cs +++ b/PCAxis.Sql/Parser_24/PXSqlGrouping.cs @@ -2,13 +2,14 @@ { using System; using System.Collections.Generic; - using System.Text; using System.Collections.Specialized; - using PCAxis.Sql.QueryLib_24; - using PCAxis.Paxiom; - using log4net; using System.Linq; + using log4net; + + using PCAxis.Paxiom; + using PCAxis.Sql.QueryLib_24; + public class PXSqlGrouping { @@ -245,7 +246,7 @@ public PXSqlGrouping(GroupingRow groupingRow, PXSqlMeta_24 meta, PXSqlVariableCl { if (childCodesByParentCode.ContainsKey(group.ParentCode)) { - foreach(var childCode in childCodesByParentCode[group.ParentCode]) + foreach (var childCode in childCodesByParentCode[group.ParentCode]) { group.AddChildCode(childCode); } @@ -516,7 +517,7 @@ private void Init(GroupingRow groupingRow, PXSqlMeta_24 meta, PXSqlVariableClass this.PresText[langCode] = groupingRow.texts[langCode].PresText; } this.SortCode = groupingRow.texts[meta.MainLanguageCode].SortCode; - + //TODO added databasedefault to override value from paxiom, should be possible to do both switch (this.mGroupPres.ToUpper()) { @@ -575,7 +576,7 @@ internal Grouping GetPaxiomGrouping() Grouping paxGrouping = new Grouping(); paxGrouping.Name = this.GroupingId; paxGrouping.ID = this.GroupingId; - // if (this.mIncludeType.Equals(GroupingIncludesType.All)) + // if (this.mIncludeType.Equals(GroupingIncludesType.All)) { foreach (PXSqlGroup group in this.mGroups) { diff --git a/PCAxis.Sql/Parser_24/PXSqlGroupingInfo.cs b/PCAxis.Sql/Parser_24/PXSqlGroupingInfo.cs index bd05d0f..14b9dba 100644 --- a/PCAxis.Sql/Parser_24/PXSqlGroupingInfo.cs +++ b/PCAxis.Sql/Parser_24/PXSqlGroupingInfo.cs @@ -1,9 +1,9 @@ namespace PCAxis.Sql.Parser_24 { - using log4net; using System; using System.Collections.Generic; - using System.Text; + + using log4net; public class PXSqlGroupingInfo @@ -28,7 +28,7 @@ int IComparer.Compare(PXSqlGroupingInfo a, PXSqlGroupingInfo return String.Compare(valA.sortCodeByLanguage[lang], valB.sortCodeByLanguage[lang]); } } - + /// Database unique ID private string groupingId; @@ -42,7 +42,7 @@ int IComparer.Compare(PXSqlGroupingInfo a, PXSqlGroupingInfo private string groupPres; /// The texts which may be displayed to users when selecting a grouping from a list of groupings - private Dictionary presTextByLanguage = new Dictionary(); + private Dictionary presTextByLanguage = new Dictionary(); /// Sort order in which the groupings are shown. If SortCode in grouping are set this will be used otherwise PresText private Dictionary sortCodeByLanguage = new Dictionary(); @@ -76,24 +76,24 @@ internal PXSqlGroupingInfo(PCAxis.Sql.QueryLib_24.GroupingRow groupingRow, DbCon this.groupPres = "AggregatedValues"; } - + foreach (KeyValuePair text in groupingRow.texts) { this.presTextByLanguage[text.Key] = text.Value.PresText; this.sortCodeByLanguage[text.Key] = text.Value.SortCode; - // if (text.Value.SortCode != "") - // { - // this.sortCodeByLanguage[text.Key] = text.Value.SortCode; - // } - // else - // { - // this.sortCodeByLanguage[text.Key] = text.Value.PresText; - // } + // if (text.Value.SortCode != "") + // { + // this.sortCodeByLanguage[text.Key] = text.Value.SortCode; + // } + // else + // { + // this.sortCodeByLanguage[text.Key] = text.Value.PresText; + // } } this.isDefault = !string.IsNullOrEmpty(groupingRow.DefaultInGui) && groupingRow.DefaultInGui == ccodes.Yes; - - this.valueSetIds.AddRange(valueSetIds); + + this.valueSetIds.AddRange(valueSetIds); } diff --git a/PCAxis.Sql/Parser_24/PXSqlGroupingInfos.cs b/PCAxis.Sql/Parser_24/PXSqlGroupingInfos.cs index 24f3802..2eb15dd 100644 --- a/PCAxis.Sql/Parser_24/PXSqlGroupingInfos.cs +++ b/PCAxis.Sql/Parser_24/PXSqlGroupingInfos.cs @@ -2,8 +2,10 @@ { using System.Collections.Generic; using System.Collections.Specialized; - using PCAxis.Paxiom; + using log4net; + + using PCAxis.Paxiom; using PCAxis.Sql.QueryLib_24; /// @@ -28,17 +30,17 @@ public List Infos get { return infos; } } - + private StringCollection groupingIDs; - + /// /// the IDs of the groupings which may be used for the variable. /// internal StringCollection GroupingIDs { get { return groupingIDs; } - } + } /// Initializes a new instance of the PXSqlGroupingInfos class, and fills the list of PXSqlGroupingInfo /// Holds the state of the builder @@ -53,7 +55,8 @@ internal PXSqlGroupingInfos(PXSqlMeta_24 meta, string variableName, StringCollec foreach (string valueSetId in valueSetIds) { - foreach (string groupingId in meta.MetaQuery.GetValueSetGroupingRowskeyGrouping(valueSetId, true).Keys) { + foreach (string groupingId in meta.MetaQuery.GetValueSetGroupingRowskeyGrouping(valueSetId, true).Keys) + { groupingIDs.Add(groupingId); if (!valueSetIdsByGroupingId.ContainsKey(groupingId)) @@ -66,11 +69,12 @@ internal PXSqlGroupingInfos(PXSqlMeta_24 meta, string variableName, StringCollec } // finding the ID's of hierarchical groups - foreach (string groupingId in meta.MetaQuery.GetMainTableVariableHierarchyRows_KeyIsGroupingID(meta.MainTable.MainTable,variableName,true).Keys) { - groupingIDs.Add(groupingId); + foreach (string groupingId in meta.MetaQuery.GetMainTableVariableHierarchyRows_KeyIsGroupingID(meta.MainTable.MainTable, variableName, true).Keys) + { + groupingIDs.Add(groupingId); } - + //MÃ¥ sortere groupingIDs List sortedGroupingRows = meta.MetaQuery.GetGroupingRowsSorted(groupingIDs, false, meta.MainLanguageCode); @@ -81,7 +85,7 @@ internal PXSqlGroupingInfos(PXSqlMeta_24 meta, string variableName, StringCollec } } - + /// Sends the list of Grouping Info to paxiom @@ -113,14 +117,14 @@ internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) //List sortedGroupingInfoList; foreach (string langCode in this.infos[0].PresTextByLanguage.Keys) { - // sortedGroupingInfoList = new List(); - // foreach (PXSqlGroupingInfo info in this.infos) - // { - // sortedGroupingInfoList.Add(info); - // } - // sortedGroupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); - - + // sortedGroupingInfoList = new List(); + // foreach (PXSqlGroupingInfo info in this.infos) + // { + // sortedGroupingInfoList.Add(info); + // } + // sortedGroupingInfoList.Sort(PXSqlGroupingInfo.SortGroupingInfo(langCode)); + + values.Clear(); //foreach (PXSqlGroupingInfo info in sortedGroupingInfoList) foreach (PXSqlGroupingInfo info in this.infos) @@ -150,7 +154,7 @@ internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) values.Add(info.PresTextByLanguage[langCode]); } - + handler(PXKeywords.GROUPING_NAME, langCode, subkey, values); } diff --git a/PCAxis.Sql/Parser_24/PXSqlMaintable.cs b/PCAxis.Sql/Parser_24/PXSqlMaintable.cs index bef6a5f..fef921e 100644 --- a/PCAxis.Sql/Parser_24/PXSqlMaintable.cs +++ b/PCAxis.Sql/Parser_24/PXSqlMaintable.cs @@ -1,11 +1,12 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_24; -using PCAxis.Paxiom; using System.Collections.Specialized; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_24; + namespace PCAxis.Sql.Parser_24 { public class PXSqlMaintable @@ -20,7 +21,7 @@ public class PXSqlMaintable private string mSubjectCode; private Dictionary mSubjectAreaByLanguage = new Dictionary(); - + internal PXSqlMaintable(MainTableRow mtRow, DataStorageRow dataStorageRow, MenuSelectionRow menuSelectionRow, PXSqlMeta_24 meta) { this.meta = meta; @@ -50,17 +51,18 @@ internal string SpecCharExists internal bool ContainsOnlyMetaData { - get { + get + { if (TableStatus.Equals(meta.Config.Codes.StatusMeta) || TableStatus.Equals(meta.Config.Codes.StatusEmpty)) { - return true; + return true; } else { return false; } } - } + } //mMainTable[0][mConfig.MainTable.ContentsVariable].ToString().Length != 0 internal bool hasContentsVariable(string someLangCode) @@ -68,10 +70,10 @@ internal bool hasContentsVariable(string someLangCode) return (mtRow.texts[someLangCode].ContentsVariable.Length != 0); } - // public string getPresText(string langCode) - // { - // return mtRow.texts[langCode].PresText; - // } + // public string getPresText(string langCode) + // { + // return mtRow.texts[langCode].PresText; + // } internal string getPresTextS(string langCode) { return mtRow.texts[langCode].PresTextS; @@ -89,7 +91,7 @@ internal string getContentsVariable(string langCode) internal string TimeScale { get { return mtRow.TimeScale; } } internal string TableStatus { get { return mtRow.TableStatus; } } - + //MenuSelection.PresText @@ -226,11 +228,11 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCo // TABLEID if (!string.IsNullOrEmpty(this.TableId.Trim(' '))) - { - values.Clear(); - values.Add(this.TableId); - handler(PXKeywords.TABLEID, noLanguage, subkey, values); - + { + values.Clear(); + values.Add(this.TableId); + handler(PXKeywords.TABLEID, noLanguage, subkey, values); + } // SUBJECT-CODE @@ -249,7 +251,7 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCo } // DATABASE - foreach (string langCode in LanguageCodes) + foreach (string langCode in LanguageCodes) { values.Clear(); // values.Add(this.mDataStorageRow.DatabaseName); @@ -263,12 +265,12 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCo // se Reqtest 319. - // FIRST_PUBLISHED - + // FIRST_PUBLISHED + values.Clear(); values.Add(this.mtRow.FirstPublished); - handler(PXKeywords.FIRST_PUBLISHED, null, subkey, values); - + handler(PXKeywords.FIRST_PUBLISHED, null, subkey, values); + // INFOFILE diff --git a/PCAxis.Sql/Parser_24/PXSqlMeta_24.cs b/PCAxis.Sql/Parser_24/PXSqlMeta_24.cs index 6c2f7f6..c40f1a1 100644 --- a/PCAxis.Sql/Parser_24/PXSqlMeta_24.cs +++ b/PCAxis.Sql/Parser_24/PXSqlMeta_24.cs @@ -1,17 +1,17 @@ using System; using System.Collections; -using System.Collections.Specialized; using System.Collections.Generic; -using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Data; + +using log4net; + using PCAxis.Paxiom; using PCAxis.PlugIn; -using System.Data; -using PCAxis.Sql.QueryLib_24; +using PCAxis.PlugIn.Sql; using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; using PCAxis.Sql.Pxs; -using log4net; -using PCAxis.PlugIn.Sql; -using System.Linq; +using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 { @@ -26,7 +26,7 @@ namespace PCAxis.Sql.Parser_24 // fixedStartMovingLast = 3 //} - + public class PXSqlMeta_24 : PCAxis.Sql.Parser.PXSqlMeta { @@ -49,7 +49,7 @@ public class PXSqlMeta_24 : PCAxis.Sql.Parser.PXSqlMeta internal PXSqlAttributes Attributes { get { return mAttributes; } - } + } private PxsQuery mPxsFile; internal PxsQuery PxsFile @@ -57,9 +57,9 @@ internal PxsQuery PxsFile get { return mPxsFile; } } internal PXSqlNpm mPxsqlNpm; - + private string mPxsSubTableId; - + /// /// The ID of the Contents dimention /// @@ -77,10 +77,10 @@ internal string ContensCode } } } - - - - + + + + private PXMetaAdmValues mPXMetaAdmValues; @@ -91,7 +91,7 @@ public PXMetaAdmValues PXMetaAdmValues - + private readonly string mMainTableId; @@ -101,7 +101,7 @@ internal PXSqlMaintable MainTable get { return mMainTable; } } - + private PXSqlSubTables mSubTables; public PXSqlSubTables SubTables { @@ -169,8 +169,8 @@ public PXSqlVariable ContentsVariable { get { return mContentsVariable; } } - - + + private PXSqlDecimalStuff mDecimalHandler = new PXSqlDecimalStuff(); internal PXSqlDecimalStuff DecimalHandler @@ -181,7 +181,7 @@ internal PXSqlDecimalStuff DecimalHandler private PXSqlValue mValue; - + private Dictionary mContentsVariablePresText = new Dictionary(); public Dictionary ContentsVariablePresText { @@ -199,20 +199,20 @@ public bool EliminatedVariablesExist } - + private SqlDbConfig_24 mConfig; public SqlDbConfig_24 Config { get { return mConfig; } } - + //jfi:Hei piv, jeg la denne her. Er det ok? public bool SpecCharExists { get { return MainTable.SpecCharExists.Equals(mMetaQuery.DB.Codes.Yes); } } - + private string mDataTablesPrefix; public string DataTablesPrefix { get { return mDataTablesPrefix; } } @@ -227,12 +227,12 @@ internal PXSqlNotes TheNotes { get { return theNotes; } } - + #endregion #region Constructor - + /// /// @@ -248,7 +248,7 @@ public PXSqlMeta_24(string mainTableId, string preferredLang, bool getAllLangs, { log.Info("PXSqlMeta(string mainTableId(=" + mainTableId + "), StringCollection desiredLanguages, SqlDbConfig config, Instancemodus aModus(=" + aModus.ToString() + "))"); this.mMainTableId = mainTableId; - this.mConfig = (SqlDbConfig_24) config; + this.mConfig = (SqlDbConfig_24)config; mMetaQuery = new MetaQuery(this.mConfig, this.SelectedDbInfo, useTempTables); SetLanguageCodesNoPxs(preferredLang, getAllLangs); BuildMeta(); @@ -261,14 +261,14 @@ public PXSqlMeta_24(PxsQuery mPxsObject, string preferredLang, SqlDbConfig confi { log.Debug("PXSqlMeta(PxsQuery mPxsObject, SqlDbConfig config, Instancemodus aModus"); - + //disse er trukket hit for å kunne kjøre med String hovedtabellId. this.mMainTableId = mPxsObject.Query.TableSource; //TODO; denne burde kunne fjernes this.mPxsSubTableId = mPxsObject.Query.SubTable; - this.mConfig = (SqlDbConfig_24) config; + this.mConfig = (SqlDbConfig_24)config; mMetaQuery = new MetaQuery(this.mConfig, this.SelectedDbInfo, useTempTables); @@ -290,7 +290,7 @@ private PxsQuery rearrangePxsQuery(PxsQuery mPxsObject) { Dictionary valuesetIdByVariableId = new Dictionary(); - Dictionary fromDB = this.MetaQuery.GetSubTableVariableRowskeyVariable(this.mMainTableId, mPxsObject.Query.SubTable,false); + Dictionary fromDB = this.MetaQuery.GetSubTableVariableRowskeyVariable(this.mMainTableId, mPxsObject.Query.SubTable, false); foreach (string variableId in fromDB.Keys) { if (String.IsNullOrEmpty(fromDB[variableId].ValueSet)) @@ -328,27 +328,27 @@ private PxsQuery rearrangePxsQuery(PxsQuery mPxsObject) private void BuildMeta() { - SetInstanceModus(); - + SetInstanceModus(); + mMetaQuery.LanguageCodes = LanguageCodes; // instanced above, now just set language - mPXMetaAdmValues = new PXMetaAdmValues(mMetaQuery); + mPXMetaAdmValues = new PXMetaAdmValues(mMetaQuery); if (inPresentationModus) { mPxsqlNpm = new PXSqlNpm(this); //trenger valium dette } - - SetMainTable(); + + SetMainTable(); //mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId), mPxsSubTableId); - mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId,false), mPxsFile, this); + mSubTables = new PXSqlSubTables(mMetaQuery.GetSubTableRows(mMainTableId, false), mPxsFile, this); + - SetVariables();//ok for pxs == null, men denne kan også hente ut valueSet SetContents(); //må skrives om, men kall til metaQ OK. Bør kanskje legge inn contents som @@ -361,11 +361,11 @@ private void BuildMeta() //variabel er tid for å danne korrekt pxs. // if (instancemodus == Instancemodus.presentation) // { - // SetTimeVal(); Not used. Defined in PXSqlVariableTime + // SetTimeVal(); Not used. Defined in PXSqlVariableTime SetPaxiomMap();//ok for pxs == null, men jeg forstår ikke helt hva den gjør. mEliminatedVariablesExist = CheckEliminatedVariables();//ok for pxs == null - - theNotes = new PXSqlNotes(this,mMainTableId, this.inPresentationModus); + + theNotes = new PXSqlNotes(this, mMainTableId, this.inPresentationModus); mDataTablesPrefix = mMetaQuery.GetDataTablesPrefix(mMainTable.ProductCode); CheckPxs(); @@ -384,12 +384,12 @@ private void BuildMeta() #endregion #region Setroutines - + private void SetInstanceModus() { - if (! (this.inPresentationModus || this.inSelectionModus) ) + if (!(this.inPresentationModus || this.inSelectionModus)) { throw new NotImplementedException("BUG"); } @@ -542,7 +542,7 @@ private void SetMainTable() private List GetSortedContentsList(string mMainTableId, bool contructedFromPxs, BasicValueType[] contentsInPxs) { List myOut = new List(); - Dictionary altIBasen = mMetaQuery.GetContentsRows(mMainTableId,false); + Dictionary altIBasen = mMetaQuery.GetContentsRows(mMainTableId, false); //side effect: @@ -561,7 +561,7 @@ private List GetSortedContentsList(string mMainTableId, bool contr PXSqlContent mContent = null; if (this.ConstructedFromPxs) { - int documentOrder = 0; + int documentOrder = 0; foreach (BasicValueType contents in contentsInPxs) { if (altIBasen.ContainsKey(contents.code)) @@ -569,7 +569,7 @@ private List GetSortedContentsList(string mMainTableId, bool contr mContent = new PXSqlContent(altIBasen[contents.code], this, mConfig, contact); mContent.SortOrder = documentOrder; myOut.Add(mContent); - documentOrder++; + documentOrder++; } } @@ -620,7 +620,7 @@ private void SetContents() int counter = 0; foreach (PXSqlContent content in mContents.Values) { - mValue = new PXSqlValue(content,counter); + mValue = new PXSqlValue(content, counter); mValues.Add(mValue.ValueCode, mValue); counter++; } @@ -662,10 +662,10 @@ private void SetVariables() } } mSqlVariable.VariableType = aTVRow.VariableType; - + } - + } private void CheckPxs() @@ -690,8 +690,8 @@ private void CheckPxs() } } - - + + private void SetHeadingAndStub() { @@ -714,7 +714,7 @@ private void SetPaxiomMap() foreach (KeyValuePair var in mVariables) { //if (!var.Value.IsContentVariable && !var.Value.IsTimevariable) { - if (var.Value.VariableType == mConfig.Codes.VariableTypeG && var.Value.isSelected && var.Value.ValueSets != null) + if (var.Value.VariableType == mConfig.Codes.VariableTypeG && var.Value.isSelected && var.Value.ValueSets != null) { List GeoAreaValues = new List(); string GeoAreaValue; @@ -746,13 +746,13 @@ private void SetPaxiomMap() } } - private void SetAttributes() - { - mAttributes = new PXSqlAttributes(this); - } + private void SetAttributes() + { + mAttributes = new PXSqlAttributes(this); + } + - #endregion #region tja @@ -780,7 +780,7 @@ public StringCollection GetDataTableNames() #region helproutines - + //private string CheckMultValuesetElim(List ElimValues) //{ // int numberOfElimA = 0; @@ -880,7 +880,7 @@ internal List GetVariableIDsInOutputOrder() return myOut; } - + /// /// Get the IDs of the Variables In Reverse Output Order /// @@ -914,7 +914,7 @@ override public InfoFromPxSqlMeta2PxsQuery GetInfoFromPxSqlMeta2PxsQuery() return myOut; } - + /// Finds the variable and passes to call on to it /// The paxiom Varable, but both this and the name?? @@ -926,7 +926,8 @@ override internal void ApplyGrouping(Variable paxiomVariable, string variableCod if (mVariablesClassification.ContainsKey(variableCode)) { mVariablesClassification[variableCode].ApplyGrouping(paxiomVariable, groupingId, include, false); - } else + } + else { throw new ApplicationException("BUG"); } @@ -946,14 +947,15 @@ override internal void ApplyValueSet(string variableCode, string valueSetId) throw new ApplicationException("BUG"); } } - - override public bool MainTableContainsOnlyMetaData(){ - return this.MainTable.ContainsOnlyMetaData; + + override public bool MainTableContainsOnlyMetaData() + { + return this.MainTable.ContainsOnlyMetaData; } - + #region "IPlugIn implementation" diff --git a/PCAxis.Sql/Parser_24/PXSqlNotes.cs b/PCAxis.Sql/Parser_24/PXSqlNotes.cs index ca84288..c74fb1f 100644 --- a/PCAxis.Sql/Parser_24/PXSqlNotes.cs +++ b/PCAxis.Sql/Parser_24/PXSqlNotes.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using PCAxis.Sql.QueryLib_24; + using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 { @@ -435,7 +435,7 @@ private void enrollContValueAndTimeNotes() if (allNoteNos.Count == 0) { return; - //that's a good table! :-) + //that's a good table! :-) } Dictionary footnoteRows = mMeta.MetaQuery.GetFootnoteRows(allNoteNos, true); @@ -447,7 +447,7 @@ private void enrollContValueAndTimeNotes() //this is the list of bad numbers: StringCollection noteNoOfNotSelectedCellnotes = new StringCollection(); - + /// the rows in contValueRaw which has Cellnote = YES Dictionary> contValueCells = new Dictionary>(); @@ -485,7 +485,7 @@ private void enrollContValueAndTimeNotes() foreach (FootnoteContTimeRow footNoteRow in contTimeRaw[noteno]) { isSelected = false; - + if (mContents.ContainsKey(footNoteRow.Contents) && mTimeVariable.Values.ContainsKey(footNoteRow.TimePeriod)) { isSelected = true; @@ -551,7 +551,7 @@ private void enrollContValueAndTimeNotes() foreach (FootnoteContValueRow footNoteRow in contValueRaw[noteno]) { isSelected = false; - + if (mContents.ContainsKey(footNoteRow.Contents)) { if (mVariables.GetSelectedClassificationVarableIds().Contains(footNoteRow.Variable)) @@ -623,7 +623,7 @@ private void enrollContValueAndTimeNotes() #endregion foreach (string noteno in contValueRaw.Keys) - + #region Singlerow notes /// @@ -689,12 +689,12 @@ private void enrollContValueAndTimeNotes() timeperiodlistByContentsByNoteno.Remove(noteno); valuelistByVariableByContentsByNoteno.Remove(noteno); } - + // Dictionary timeperiodlistByContents = new Dictionary(); Dictionary> valueByVariableByContents = new Dictionary>(); - + foreach (string noteno in allNoteNos) @@ -1036,7 +1036,7 @@ internal void ParseNotesApplyValueset(PCAxis.Paxiom.IPXModelParser.MetaHandler h { foreach (AttachedNote note in finalNotes) { - if(note.GetType().Name.Equals("ValueAttachedNote")) + if (note.GetType().Name.Equals("ValueAttachedNote")) { string noteVariable = ((ValueAttachedNote)note).Variable; if (vaiableCode.Equals(noteVariable)) @@ -1174,7 +1174,7 @@ override internal void ParseNote(PXSqlMeta_24 mMeta, PCAxis.Paxiom.IPXModelParse StringCollection parseValue; if (this.hasPresCharacter) { - keyWord = PXKeywords.DATANOTE; + keyWord = PXKeywords.DATANOTE; parseValue = new StringCollection(); parseValue.Add(this.presCharacter); diff --git a/PCAxis.Sql/Parser_24/PXSqlNpm.cs b/PCAxis.Sql/Parser_24/PXSqlNpm.cs index 4f70e5e..2bfff48 100644 --- a/PCAxis.Sql/Parser_24/PXSqlNpm.cs +++ b/PCAxis.Sql/Parser_24/PXSqlNpm.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; -using System.Text; -using System.Data; +using System.Collections.Specialized; + using PCAxis.Paxiom; using PCAxis.Sql.QueryLib_24; -using System.Globalization; -using System.Collections.Specialized; namespace PCAxis.Sql.Parser_24 { diff --git a/PCAxis.Sql/Parser_24/PXSqlParseMetaPostData_24.cs b/PCAxis.Sql/Parser_24/PXSqlParseMetaPostData_24.cs index 15a513f..9e917ea 100644 --- a/PCAxis.Sql/Parser_24/PXSqlParseMetaPostData_24.cs +++ b/PCAxis.Sql/Parser_24/PXSqlParseMetaPostData_24.cs @@ -1,14 +1,13 @@ using System; -using System.Collections.Specialized; using System.Collections.Generic; +using System.Collections.Specialized; using System.Linq; +using log4net; + using PCAxis.Paxiom; using PCAxis.Sql.QueryLib_24; -using log4net; -using System.Text; - namespace PCAxis.Sql.Parser_24 { /// @@ -121,7 +120,7 @@ Code below is commented out because it did not work. PXSqlNpm myNpms = mMeta.mPxsqlNpm; StringCollection datanoteDistictValues = new StringCollection(); keyword = PXKeywords.DATANOTECELL; - + foreach (KeyValuePair dcn in theDataNoteCellEntries) { diff --git a/PCAxis.Sql/Parser_24/PXSqlSubTable.cs b/PCAxis.Sql/Parser_24/PXSqlSubTable.cs index 1af0069..92476e1 100644 --- a/PCAxis.Sql/Parser_24/PXSqlSubTable.cs +++ b/PCAxis.Sql/Parser_24/PXSqlSubTable.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 diff --git a/PCAxis.Sql/Parser_24/PXSqlSubTables.cs b/PCAxis.Sql/Parser_24/PXSqlSubTables.cs index de75a5f..051300b 100644 --- a/PCAxis.Sql/Parser_24/PXSqlSubTables.cs +++ b/PCAxis.Sql/Parser_24/PXSqlSubTables.cs @@ -1,40 +1,44 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_24; + using PCAxis.PlugIn.Sql; using PCAxis.Sql.Pxs; -using System.Collections.Specialized; +using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 { - public class PXSqlSubTables:Dictionary + public class PXSqlSubTables : Dictionary { - + PxsQuery mPxsQuery; public PXSqlSubTables(Dictionary altIBasen, PxsQuery pPxsQuery, PXSqlMeta_24 pxsqlMeta) - : base() { + : base() + { this.mPxsQuery = pPxsQuery; PXSqlSubTable mSubTable; - foreach (SubTableRow subTableRow in altIBasen.Values) { + foreach (SubTableRow subTableRow in altIBasen.Values) + { mSubTable = new PXSqlSubTable(subTableRow); this.Add(mSubTable.SubTable, mSubTable); } // set selected subtables. if (pPxsQuery == null) { - foreach (PXSqlSubTable subTable in this.Values) { + foreach (PXSqlSubTable subTable in this.Values) + { subTable.IsSelected = true; } - } else { + } + else + { SetSelectedSubTable(pxsqlMeta); } } - - + + /// /// Returns the ids of the subtables marked as selected(All if not a pxs has selected a spesific subtable. @@ -57,17 +61,17 @@ public IEnumerable GetKeysOfSelectedSubTables() private void SetSelectedSubTable(PXSqlMeta_24 pxsqlMeta) { - + Boolean isEqualValueSet; - foreach (KeyValuePair subTable in this) + foreach (KeyValuePair subTable in this) { isEqualValueSet = true; string subTableName = subTable.Value.SubTable; - Dictionary fromDb = pxsqlMeta.MetaQuery.GetSubTableVariableRowskeyVariable(pxsqlMeta.MainTable.MainTable, subTableName,false); - + Dictionary fromDb = pxsqlMeta.MetaQuery.GetSubTableVariableRowskeyVariable(pxsqlMeta.MainTable.MainTable, subTableName, false); + foreach (PQVariable pqvariable in mPxsQuery.Query.Variables) - { + { string variableName = pqvariable.code; string selectedValueset = pqvariable.SelectedValueset; if (!fromDb.ContainsKey(variableName)) @@ -79,17 +83,17 @@ private void SetSelectedSubTable(PXSqlMeta_24 pxsqlMeta) { isEqualValueSet = false; break; - } + } } if (isEqualValueSet) { - + this[subTableName].IsSelected = true; } } - + } } } diff --git a/PCAxis.Sql/Parser_24/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs b/PCAxis.Sql/Parser_24/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs index bef0e11..d7eeb36 100644 --- a/PCAxis.Sql/Parser_24/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs +++ b/PCAxis.Sql/Parser_24/PXSqlThingsThatWouldBeTheSameInAllPXSqlContent.cs @@ -1,17 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Text; -using PCAxis.Paxiom; +using System.Collections.Generic; +using System.Collections.Specialized; + using log4net; -using PCAxis.Sql.QueryLib_24; + +using PCAxis.Paxiom; using PCAxis.Sql.DbConfig; -using System.Collections.Specialized; +using PCAxis.Sql.QueryLib_24; -namespace PCAxis.Sql.Parser_24 { +namespace PCAxis.Sql.Parser_24 +{ ///Class for columns in the Content-tabell that are independent of content (they will possibly be /// moved to maintabletable in a later version of the metamodel) - class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent { + class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent + { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlThingsThatWouldBeTheSameInAllPXSqlContent)); @@ -45,25 +47,35 @@ class PXSqlThingsThatWouldBeTheSameInAllPXSqlContent { private bool mOfficialStatistics; private Dictionary nameByLangCode = new Dictionary(); - - internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_24 meta, SqlDbConfig_24 config) { + + internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_24 meta, SqlDbConfig_24 config) + { mStatAuthorityCode = someContentsRow.StatAuthority; string copyright = someContentsRow.Copyright; - if (copyright.Equals(config.Codes.Copyright1) || copyright.Equals(config.Codes.Copyright2)) { + if (copyright.Equals(config.Codes.Copyright1) || copyright.Equals(config.Codes.Copyright2)) + { mCopyright = false; - } else if (copyright.Equals(config.Codes.Copyright3)) { - mCopyright = true ; - } else { + } + else if (copyright.Equals(config.Codes.Copyright3)) + { + mCopyright = true; + } + else + { mCopyright = true; log.Error("The database has copyright=" + copyright + ", but the valid codes from config are " + config.Codes.Copyright1 + "," + config.Codes.Copyright2 + " or " + config.Codes.Copyright3 + "."); } - if (copyright.Equals(config.Codes.Copyright1)) { + if (copyright.Equals(config.Codes.Copyright1)) + { mOfficialStatistics = true; - } else { - mOfficialStatistics = false; + } + else + { + mOfficialStatistics = false; } OrganizationRow org = meta.MetaQuery.GetOrganizationRow(mStatAuthorityCode); - foreach (string language in org.texts.Keys) { + foreach (string language in org.texts.Keys) + { nameByLangCode.Add(language, org.texts[language].OrganizationName); } } @@ -88,13 +100,15 @@ internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContents /// /// /// - public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { + public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) + { StringCollection values = new StringCollection(); string subkey = null; - foreach (string langCode in nameByLangCode.Keys) { + foreach (string langCode in nameByLangCode.Keys) + { // SOURCE values.Clear(); @@ -106,9 +120,12 @@ public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { // COPYRIGHT values.Clear(); - if (mCopyright) { + if (mCopyright) + { values.Add(PXConstant.YES); - } else { + } + else + { values.Add(PXConstant.NO); } handler(PXKeywords.COPYRIGHT, noLanguage, subkey, values); diff --git a/PCAxis.Sql/Parser_24/PXSqlTimeScale.cs b/PCAxis.Sql/Parser_24/PXSqlTimeScale.cs index c24dabb..f4afd12 100644 --- a/PCAxis.Sql/Parser_24/PXSqlTimeScale.cs +++ b/PCAxis.Sql/Parser_24/PXSqlTimeScale.cs @@ -1,6 +1,5 @@ using System; -using System.Collections.Generic; -using System.Text; + using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 @@ -8,7 +7,7 @@ namespace PCAxis.Sql.Parser_24 public class PXSqlTimeScale { private TimeScaleRow tsRow; - + private bool doTimeScalePres = false; /// @@ -60,12 +59,12 @@ public string StoreFormat /// public string getPresText(string langCode) { - + return tsRow.texts[langCode].PresText; } - - - + + + /// /// Contructor /// diff --git a/PCAxis.Sql/Parser_24/PXSqlValue.cs b/PCAxis.Sql/Parser_24/PXSqlValue.cs index b205a58..1f113bd 100644 --- a/PCAxis.Sql/Parser_24/PXSqlValue.cs +++ b/PCAxis.Sql/Parser_24/PXSqlValue.cs @@ -1,10 +1,10 @@ using System; -using System.Collections; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_24; using System.Collections.Specialized; + using log4net; + +using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 { public class SortByVsValueHelper : IComparer @@ -13,7 +13,7 @@ int IComparer.Compare(PXSqlValue a, PXSqlValue b) { PXSqlValue valA = a; PXSqlValue valB = b; - return String.Compare(valA.SortCodeVsValue,valB.SortCodeVsValue); + return String.Compare(valA.SortCodeVsValue, valB.SortCodeVsValue); } } public class SortByValueHelper : IComparer @@ -48,7 +48,7 @@ int IComparer.Compare(PXSqlValue a, PXSqlValue b) } - public class PXSqlValue:IComparable + public class PXSqlValue : IComparable { #region members private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlValue)); @@ -61,8 +61,8 @@ public class PXSqlValue:IComparable private string mSortCodeValue; private string mSortCodeVsValue; private string mSortCodeDb; // this is the sortorder returned from dababase sort on vsvalue,value - private Dictionary mValueTextS = new Dictionary(); - private Dictionary mValueTextL = new Dictionary(); + private Dictionary mValueTextS = new Dictionary(); + private Dictionary mValueTextL = new Dictionary(); private string mPrecision; private bool mIsSelected; private bool mExistInDb; @@ -84,7 +84,7 @@ public string ContentsCode public string ValueCode { get { return mValueCode; } - set { mValueCode = value;} + set { mValueCode = value; } } public string ValuePool { @@ -92,9 +92,9 @@ public string ValuePool set { mValuePool = value; } } public string ValueSet - { + { get { return mValueSet; } - set { mValueSet = value; } + set { mValueSet = value; } } public int SortCodePxs { @@ -117,7 +117,7 @@ public string SortCodeDb get { return mSortCodeDb; } set { mSortCodeDb = value; } } - public Dictionary ValueTextS + public Dictionary ValueTextS { get { return mValueTextS; } set { mValueTextS = value; } @@ -139,8 +139,8 @@ public bool IsSelected } public bool ExistInDb { - get { return mExistInDb; } - set { mExistInDb = value; } + get { return mExistInDb; } + set { mExistInDb = value; } } @@ -149,7 +149,7 @@ public bool ExistInDb public bool Default { get; set; } public string MainLanguageCode { get; set; } - + //private List mFootNoteRows; //public List FootNoteRows //{ @@ -168,12 +168,12 @@ public bool ExistInDb public PXSqlValue() { - // mFootNotesValue = new List(); + // mFootNotesValue = new List(); } - public PXSqlValue(ValueRow2HM myValueRow, StringCollection LanguageCodes, string MainLanguageCode) + public PXSqlValue(ValueRow2HM myValueRow, StringCollection LanguageCodes, string MainLanguageCode) { //this.meta = meta; this.MainLanguageCode = MainLanguageCode; @@ -188,7 +188,8 @@ public PXSqlValue(ValueRow2HM myValueRow, StringCollection LanguageCodes, string this.mSortCodeVsValue = myValueRow.texts[MainLanguageCode].SortCodeVsValue; //this.SecondarySortOrder = myValueRow.ValueSortCode; this.SortCodeDb = myValueRow.SortOrder; - foreach (string langCode in LanguageCodes) { + foreach (string langCode in LanguageCodes) + { this.ValueTextS[langCode] = myValueRow.texts[langCode].ValueTextS; this.ValueTextL[langCode] = myValueRow.texts[langCode].ValueTextL; } @@ -230,18 +231,19 @@ public PXSqlValue(ValueRowHM myValueRow, StringCollection LanguageCodes, string /// /// Used as ValueCode, ValueTextS and ValueTextL /// - public PXSqlValue(string timeCode, StringCollection LanguageCodes) - { + public PXSqlValue(string timeCode, StringCollection LanguageCodes) + { //this.meta = meta; - this.mContentsCode = null; // only for contentsvalues + this.mContentsCode = null; // only for contentsvalues this.ValueCode = timeCode; this.SortCodePxs = 0; // is sometimes overridden from outside - this.mSortCodeValue = timeCode; + this.mSortCodeValue = timeCode; this.mSortCodeVsValue = "0"; //hmmm this.SortCodeDb = "0"; //hmmm - foreach (string langCode in LanguageCodes) { + foreach (string langCode in LanguageCodes) + { this.ValueTextS[langCode] = timeCode; this.ValueTextL[langCode] = timeCode; } @@ -258,9 +260,9 @@ public PXSqlValue(PXSqlContent content, int sortCode) this.ValueTextS = content.PresTextS; // SortCodePxs and SortCode are now set to the same value. Maybe no a good thing if sortorder should be reset to db // default after read from pxs. //TODO send two sortcodes from PXSQlMeta. - this.SortCodePxs = sortCode; - this.mSortCodeValue = sortCode.ToString(); - + this.SortCodePxs = sortCode; + this.mSortCodeValue = sortCode.ToString(); + } @@ -270,7 +272,7 @@ public int CompareTo(object obj) { if (this.GetType() != obj.GetType()) { - throw new PCAxis.Sql.Exceptions.BugException(10000); + throw new PCAxis.Sql.Exceptions.BugException(10000); } else { @@ -286,7 +288,7 @@ public int CompareTo(object obj) } } } - public static IComparer SortByVsValue() + public static IComparer SortByVsValue() { return (IComparer)new SortByVsValueHelper(); } diff --git a/PCAxis.Sql/Parser_24/PXSqlValuePool.cs b/PCAxis.Sql/Parser_24/PXSqlValuePool.cs index 234ab5a..05a0c9d 100644 --- a/PCAxis.Sql/Parser_24/PXSqlValuePool.cs +++ b/PCAxis.Sql/Parser_24/PXSqlValuePool.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.QueryLib_24; -using System.Collections.Specialized; + using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 { @@ -40,7 +39,7 @@ public Dictionary PresText { get { return mPresText; } } - + /// /// Which texts exists (long/short/extra/none) @@ -55,7 +54,7 @@ public string ValuePres { get { return vpRow.ValuePres; } } - + // Depending of if it's a primary or secondary language, Doamin is read from different columns in database table ValuePool. // Valuepool if primary and ValuePoolEng(2.0) ValuePoolAlias (later). A solution could be to add a property here called Domain. @@ -83,7 +82,7 @@ public string MetaId /// For config.codes public PXSqlValuepool(QueryLib_24.ValuePoolRow inRow, PXSqlMeta_24 meta) { - + this.vpRow = inRow; if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsN)) @@ -101,13 +100,14 @@ public PXSqlValuepool(QueryLib_24.ValuePoolRow inRow, PXSqlMeta_24 meta) { mPresText[langCode] = vpRow.texts[langCode].PresText; mDomain[langCode] = vpRow.texts[langCode].ValuePoolAlias; - if(String.IsNullOrEmpty(mDomain[langCode])) { + if (String.IsNullOrEmpty(mDomain[langCode])) + { mDomain[langCode] = vpRow.texts[langCode].ValuePoolAlias; } } } - + } } diff --git a/PCAxis.Sql/Parser_24/PXSqlValueSet.cs b/PCAxis.Sql/Parser_24/PXSqlValueSet.cs index fb5570d..4ad879e 100644 --- a/PCAxis.Sql/Parser_24/PXSqlValueSet.cs +++ b/PCAxis.Sql/Parser_24/PXSqlValueSet.cs @@ -1,19 +1,16 @@ - using System; +using System; using System.Collections.Generic; -using System.Text; - -using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 { public class PXSqlValueSet { #region - + private string mValueSet; //private string mPresText; private Dictionary mPresText = new Dictionary(); - + private EliminationAux elimination; //private PXSqlValuepool mValuePool; private string mValuePoolId; @@ -21,9 +18,9 @@ public class PXSqlValueSet private string mGeoAreaNo; private string mMetaId; - + private string mSortCodeExists; - + private int mNumberOfValues; /// @@ -43,13 +40,13 @@ public List SortedListOfCodes public string ValueSet { get { return this.mValueSet; } - + } - + public Dictionary PresText { get { return this.mPresText; } - + } @@ -58,7 +55,7 @@ internal string MetaId { get { return mMetaId; } } - + public string Elimination { get { return this.elimination.GetClassicEliminationValue(); } @@ -77,19 +74,19 @@ public string ValuePoolId public string ValuePres { get { return this.mValuePres; } - + } public string GeoAreaNo { get { return this.mGeoAreaNo; } - + } - + public string SortCodeExists { get { return mSortCodeExists; } - + } public int NumberOfValues @@ -103,34 +100,37 @@ public int NumberOfValues public PXSqlValueSet() { } public PXSqlValueSet(QueryLib_24.ValueSetRow inRow, PXSqlMeta_24 meta, bool isDefaultInGui) { - + this.mValueSet = inRow.ValueSet; this.elimination = new EliminationAux(inRow.EliminationMethod, inRow.EliminationCode, meta.Config.Codes); this.mSortCodeExists = inRow.SortCodeExists; - this.mValuePoolId = inRow.ValuePool; + this.mValuePoolId = inRow.ValuePool; this.mValuePres = inRow.ValuePres; this.mGeoAreaNo = inRow.GeoAreaNo; this.mMetaId = inRow.MetaId; - this.IsDefault = isDefaultInGui; - + this.IsDefault = isDefaultInGui; + - foreach (string langCode in inRow.texts.Keys) { - + foreach (string langCode in inRow.texts.Keys) + { + //PresText came in version 2.1 and is optional ... desciption is up to 200 chars string asPresText = inRow.texts[langCode].PresText; - if (String.IsNullOrEmpty(asPresText)) { + if (String.IsNullOrEmpty(asPresText)) + { asPresText = inRow.texts[langCode].Description; int gridPosition = asPresText.IndexOf('#'); - if (gridPosition > 0) { + if (gridPosition > 0) + { asPresText = asPresText.Substring(0, gridPosition); } } mPresText[langCode] = asPresText; - + } - //private int mNumberOfValues; is set outside class. Bad thing? Yes + //private int mNumberOfValues; is set outside class. Bad thing? Yes } //for magic all diff --git a/PCAxis.Sql/Parser_24/PXSqlVariable.cs b/PCAxis.Sql/Parser_24/PXSqlVariable.cs index 405898e..9333610 100644 --- a/PCAxis.Sql/Parser_24/PXSqlVariable.cs +++ b/PCAxis.Sql/Parser_24/PXSqlVariable.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_24; + +using log4net; + using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; using PCAxis.PlugIn.Sql; -using log4net; +using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 { @@ -52,7 +52,7 @@ public abstract class PXSqlVariable : IComparable, ISqlItem private string mVariableType; private String mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; - + //protected const string allValuesets = "_ALL_"; protected string selectedValueset; internal string SelectedValueset @@ -211,14 +211,18 @@ protected internal Dictionary ValueSets protected internal PXSqlValuepool ValuePool { get { return mValuePool; } - protected set { mValuePool = value; - if (mValuePool == null) + protected set { - mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; - } else { - mValueTextOption = mValuePool.ValueTextOption; - this.addMetaId(mValuePool.MetaId); - } + mValuePool = value; + if (mValuePool == null) + { + mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL; + } + else + { + mValueTextOption = mValuePool.ValueTextOption; + this.addMetaId(mValuePool.MetaId); + } } } @@ -254,7 +258,7 @@ public PXSqlVariable(string name, PXSqlMeta_24 meta, bool isContVar, bool isTime #endregion constructors - + /// /// The metaID propperty of a Variable in Paxiom, must hold the MetaIds from different tables in CNMM. /// MetaId from tables Variable,ValuePool,ValueSet and Grouping are all mapped to the same in paxiom. @@ -262,7 +266,7 @@ public PXSqlVariable(string name, PXSqlMeta_24 meta, bool isContVar, bool isTime /// a MetaId to be added. If null it is not added internal void addMetaId(string aMetaIdEntry) { - if (! String.IsNullOrEmpty(aMetaIdEntry)) + if (!String.IsNullOrEmpty(aMetaIdEntry)) { if (!metaids.Contains(aMetaIdEntry)) { @@ -299,16 +303,16 @@ protected virtual void SetElimForPresentation() /// internal virtual bool UsesGroupingOnNonstoredData() { - return false; + return false; } #region CompareTo public int CompareTo(object obj) - { - PXSqlVariable SqlVariableCompare = (PXSqlVariable)obj; - // return this.Index.CompareTo(SqlVariableCompare.Index); //will not compare time-,classification and contens + { + PXSqlVariable SqlVariableCompare = (PXSqlVariable)obj; + // return this.Index.CompareTo(SqlVariableCompare.Index); //will not compare time-,classification and contens if (this.Index == SqlVariableCompare.Index) { return (0); @@ -327,7 +331,7 @@ public int CompareTo(object obj) } } - + #endregion @@ -345,7 +349,7 @@ internal virtual void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler { StringCollection values = new StringCollection(); string subkey = this.Name; - + //VARIABLENAME //OBS located in PXSQLBuilder near SetVariableName @@ -361,7 +365,7 @@ internal virtual void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler // PRESTEXT ParsePresTextOption(handler, LanguageCodes, preferredLanguage); - + // VALUE_TEXT_OPTION ParseValueTextOption(handler); @@ -388,7 +392,7 @@ internal virtual void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler /// private void ParseVariableType(PCAxis.Paxiom.IPXModelParser.MetaHandler handler) { - if (this.VariableType != null ) + if (this.VariableType != null) { StringCollection values = new StringCollection(); @@ -612,7 +616,7 @@ internal virtual void ParseCodeAndValues(PCAxis.Paxiom.IPXModelParser.MetaHandle { values.Clear(); values.Add(valuepair.Value); - myKey = this.Name +"\",\"" +valuepair.Key; + myKey = this.Name + "\",\"" + valuepair.Key; handler(PXKeywords.META_ID, noLanguage, myKey, values); } } diff --git a/PCAxis.Sql/Parser_24/PXSqlVariableClassification.cs b/PCAxis.Sql/Parser_24/PXSqlVariableClassification.cs index 563e6ae..ae0c66e 100644 --- a/PCAxis.Sql/Parser_24/PXSqlVariableClassification.cs +++ b/PCAxis.Sql/Parser_24/PXSqlVariableClassification.cs @@ -1,15 +1,16 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_24; -using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; -using PCAxis.PlugIn.Sql; using System.Data; -using log4net; using System.Linq; +using log4net; + +using PCAxis.Paxiom; +using PCAxis.PlugIn.Sql; +using PCAxis.Sql.Pxs; +using PCAxis.Sql.QueryLib_24; + namespace PCAxis.Sql.Parser_24 { @@ -1066,14 +1067,14 @@ internal bool isCandidateMustSelect() { if (!pxsqlCont.AggregPossible) { - foreach (KeyValuePair vs in this.ValueSets) + foreach (KeyValuePair vs in this.ValueSets) { - if (vs.Value.Elimination== PXConstant.YES) - { + if (vs.Value.Elimination == PXConstant.YES) + { return true; } } - + } } return false; @@ -1081,7 +1082,7 @@ internal bool isCandidateMustSelect() - internal void ParseForApplyValueSet(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) + internal void ParseForApplyValueSet(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) { string subkey = this.Name; diff --git a/PCAxis.Sql/Parser_24/PXSqlVariableContents.cs b/PCAxis.Sql/Parser_24/PXSqlVariableContents.cs index 7108ecd..f6cacef 100644 --- a/PCAxis.Sql/Parser_24/PXSqlVariableContents.cs +++ b/PCAxis.Sql/Parser_24/PXSqlVariableContents.cs @@ -1,17 +1,18 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_24; -using PCAxis.Paxiom; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.QueryLib_24; + namespace PCAxis.Sql.Parser_24 { class PXSqlVariableContents : PXSqlVariable { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableContents)); - + #region contructor public PXSqlVariableContents(String name, PXSqlMeta_24 meta) : base(name, meta, true, false, false) @@ -21,7 +22,7 @@ public PXSqlVariableContents(String name, PXSqlMeta_24 meta) if (!meta.ConstructedFromPxs) { mIndex = mStoreColumnNo; - } + } SetDefaultPresTextOption(); SetPresText(); } @@ -78,8 +79,9 @@ private void SetDefaultPresTextOption() /// /// /// - internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) { - + internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) + { + base.ParseMeta(handler, LanguageCodes, preferredLanguage); //CONTVARIABLE @@ -96,14 +98,14 @@ internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handle string tmpAggregPossible = PXConstant.YES; foreach (PXSqlContent pxsqlCont in meta.Contents.Values) { - - if (! pxsqlCont.AggregPossible) + + if (!pxsqlCont.AggregPossible) { tmpAggregPossible = PXConstant.NO; break; } } - + values.Clear(); values.Add(tmpAggregPossible); handler(PXKeywords.AGGREGALLOWED, language, subkey, values); @@ -118,7 +120,8 @@ internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handle log.Debug("meta.Contents.Values.Count=" + meta.Contents.Values.Count.ToString()); // "ContentInfo" // og PXKeywords.PRECISION - foreach (PXSqlContent pxsqlCont in meta.Contents.Values) { + foreach (PXSqlContent pxsqlCont in meta.Contents.Values) + { pxsqlCont.ParseMeta(handler, LanguageCodes); } diff --git a/PCAxis.Sql/Parser_24/PXSqlVariableTime.cs b/PCAxis.Sql/Parser_24/PXSqlVariableTime.cs index 5fe69c9..0d9306b 100644 --- a/PCAxis.Sql/Parser_24/PXSqlVariableTime.cs +++ b/PCAxis.Sql/Parser_24/PXSqlVariableTime.cs @@ -1,41 +1,40 @@ -using System; +using System.Collections; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_24; -using PCAxis.Paxiom; - -using System.Collections; -using log4net; +using log4net; +using PCAxis.Paxiom; using PCAxis.Sql.Pxs; +using PCAxis.Sql.QueryLib_24; namespace PCAxis.Sql.Parser_24 { - public class PXSqlVariableTime:PXSqlVariable + public class PXSqlVariableTime : PXSqlVariable { - private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableTime)); - #region props - private PXSqlTimeScale mTimeScale; - - - private StringCollection mTimeVal; - public StringCollection TimeVal { - get { return mTimeVal; } - } - private bool mHasTimeVal; - public bool HasTimeVal { - get { return mHasTimeVal; } - } - //private bool mTableContainsMetaOnly; - #endregion props - - - #region contructor + private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlVariableTime)); + #region props + private PXSqlTimeScale mTimeScale; + + + private StringCollection mTimeVal; + public StringCollection TimeVal + { + get { return mTimeVal; } + } + private bool mHasTimeVal; + public bool HasTimeVal + { + get { return mHasTimeVal; } + } + //private bool mTableContainsMetaOnly; + #endregion props + + + #region contructor public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_24 meta) - :base(aTVRow.Variable,meta,false,true,false) + : base(aTVRow.Variable, meta, false, true, false) { mStoreColumnNo = int.Parse(aTVRow.StoreColumnNo); if (!meta.ConstructedFromPxs) @@ -44,9 +43,9 @@ public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_24 meta) } SetSelected(); SetPresText(); - SetDefaultPresTextOption(); + SetDefaultPresTextOption(); SetTimeValues(); - mTimeScale = new PXSqlTimeScale(meta.MetaQuery.GetTimeScaleRow(meta.MainTable.TimeScale),meta.Config); + mTimeScale = new PXSqlTimeScale(meta.MetaQuery.GetTimeScaleRow(meta.MainTable.TimeScale), meta.Config); SetTimeVal(); PossiblyResetPresText(); @@ -54,7 +53,7 @@ public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_24 meta) } - #endregion + #endregion internal void SetSelected() { this.mIsSelected = false; @@ -67,10 +66,10 @@ internal void SetSelected() { this.mIsSelected = true; } - } + } internal override List GetValuesForParsing() { - if ((meta.inPresentationModus) && meta.ConstructedFromPxs ) + if ((meta.inPresentationModus) && meta.ConstructedFromPxs) { if ((int)meta.PxsFile.Query.Time.TimeOption == 0) { @@ -102,20 +101,22 @@ internal override List GetValuesForParsing() /// /// /// - internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) { - base.ParseMeta(handler, LanguageCodes, preferredLanguage); + internal override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, StringCollection LanguageCodes, string preferredLanguage) + { + base.ParseMeta(handler, LanguageCodes, preferredLanguage); //log.Debug("PPPPPPPPPPPPPPPPPParsing"); string language; string subkey = this.Name; StringCollection values; //TIMEVAL - if (mHasTimeVal) { - - language = null; - values = this.mTimeVal; - handler(PXKeywords.TIMEVAL, language, subkey, values); - values = null; - } + if (mHasTimeVal) + { + + language = null; + values = this.mTimeVal; + handler(PXKeywords.TIMEVAL, language, subkey, values); + values = null; + } language = null; values = new StringCollection(); values.Clear(); @@ -135,58 +136,59 @@ private void SetDefaultPresTextOption() - private void SetTimeVal() { - - - string timeUnit; - if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitA) - timeUnit = "A1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitH) - timeUnit = "H1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitM) - timeUnit = "M1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitQ) - timeUnit = "Q1"; - else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitW) - timeUnit = "W1"; - else - { + private void SetTimeVal() + { + + + string timeUnit; + if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitA) + timeUnit = "A1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitH) + timeUnit = "H1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitM) + timeUnit = "M1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitQ) + timeUnit = "Q1"; + else if (mTimeScale.TimeUnit == meta.Config.Codes.TimeUnitW) + timeUnit = "W1"; + else + { log.InfoFormat("Unknown Timeunit:{0}", mTimeScale.TimeUnit); - timeUnit = mTimeScale.TimeUnit; - } - - mTimeVal = new StringCollection(); - mTimeVal.Add("TLIST("+timeUnit+")"); - mHasTimeVal = true; - if (!meta.MainTable.ContainsOnlyMetaData) - { - string lowestSelectedTime; - string highestSelectedTime; - ArrayList selectedTimeCodes = new ArrayList(); - foreach (KeyValuePair val in mValues) - { - selectedTimeCodes.Add(val.Value.ValueCode); - } - selectedTimeCodes.Sort(); - lowestSelectedTime = selectedTimeCodes[0].ToString(); - highestSelectedTime = selectedTimeCodes[selectedTimeCodes.Count - 1].ToString(); - ArrayList allTimeCodes = TimeValueCodesSortedChronologicaly(); - int startIndexAllTimes = allTimeCodes.IndexOf(lowestSelectedTime); - int endIndexAllTimes = allTimeCodes.IndexOf(highestSelectedTime); - for (int i = startIndexAllTimes; i <= endIndexAllTimes; i++) - { - mTimeVal.Add(allTimeCodes[i].ToString()); - if (!selectedTimeCodes.Contains(allTimeCodes[i])) - { - //TODO; Dette gjøres midlertidig for Ã¥ sørge for at Timeval - //vises i serialiseringen - mTimeVal.Clear(); - mTimeVal.Add("TLIST(" + timeUnit + ")"); - break; - } - } - } - } + timeUnit = mTimeScale.TimeUnit; + } + + mTimeVal = new StringCollection(); + mTimeVal.Add("TLIST(" + timeUnit + ")"); + mHasTimeVal = true; + if (!meta.MainTable.ContainsOnlyMetaData) + { + string lowestSelectedTime; + string highestSelectedTime; + ArrayList selectedTimeCodes = new ArrayList(); + foreach (KeyValuePair val in mValues) + { + selectedTimeCodes.Add(val.Value.ValueCode); + } + selectedTimeCodes.Sort(); + lowestSelectedTime = selectedTimeCodes[0].ToString(); + highestSelectedTime = selectedTimeCodes[selectedTimeCodes.Count - 1].ToString(); + ArrayList allTimeCodes = TimeValueCodesSortedChronologicaly(); + int startIndexAllTimes = allTimeCodes.IndexOf(lowestSelectedTime); + int endIndexAllTimes = allTimeCodes.IndexOf(highestSelectedTime); + for (int i = startIndexAllTimes; i <= endIndexAllTimes; i++) + { + mTimeVal.Add(allTimeCodes[i].ToString()); + if (!selectedTimeCodes.Contains(allTimeCodes[i])) + { + //TODO; Dette gjøres midlertidig for Ã¥ sørge for at Timeval + //vises i serialiseringen + mTimeVal.Clear(); + mTimeVal.Add("TLIST(" + timeUnit + ")"); + break; + } + } + } + } /** @@ -196,33 +198,35 @@ private void PossiblyResetPresText() { if (mTimeScale.UsePresTextFromTimeScale) { - List keys = new List(this.PresText.Keys); - + List keys = new List(this.PresText.Keys); + foreach (string langCode in keys) { - this.PresText[langCode] = mTimeScale.getPresText(langCode); + this.PresText[langCode] = mTimeScale.getPresText(langCode); } - + } } private ArrayList TimeValueCodesSortedChronologicaly() - { - ArrayList sortedTimeValues = new ArrayList(); - System.Data.DataSet mTimeInfoTbl = meta.MetaQuery.GetAllTimeValues(meta.MainTable.MainTable, "asc"); - - foreach (System.Data.DataRow row in mTimeInfoTbl.Tables[0].Rows) { + { + ArrayList sortedTimeValues = new ArrayList(); + System.Data.DataSet mTimeInfoTbl = meta.MetaQuery.GetAllTimeValues(meta.MainTable.MainTable, "asc"); - sortedTimeValues.Add(row[meta.MetaQuery.DB.ContentsTime.TimePeriodCol.PureColumnName()].ToString()); - } - sortedTimeValues.Sort(); - return sortedTimeValues; - } + foreach (System.Data.DataRow row in mTimeInfoTbl.Tables[0].Rows) + { + sortedTimeValues.Add(row[meta.MetaQuery.DB.ContentsTime.TimePeriodCol.PureColumnName()].ToString()); + } + sortedTimeValues.Sort(); + return sortedTimeValues; + } - private void SetTimeValues() { + + private void SetTimeValues() + { // time variable values //lage flere overloads databasespørringer avhengig av timeopt //mValues = new Dictionary(); diff --git a/PCAxis.Sql/Parser_24/PXSqlVariables.cs b/PCAxis.Sql/Parser_24/PXSqlVariables.cs index 3db00bf..5824a65 100644 --- a/PCAxis.Sql/Parser_24/PXSqlVariables.cs +++ b/PCAxis.Sql/Parser_24/PXSqlVariables.cs @@ -1,13 +1,13 @@ using System; using System.Collections.Generic; -using System.Text; using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_24; -using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; using System.Configuration; + using log4net; +using PCAxis.Paxiom; +using PCAxis.Sql.Pxs; + namespace PCAxis.Sql.Parser_24 { public class PXSqlVariables : Dictionary diff --git a/PCAxis.Sql/Parser_24/PXSqlVariablesClassification.cs b/PCAxis.Sql/Parser_24/PXSqlVariablesClassification.cs index 00713ed..70313c5 100644 --- a/PCAxis.Sql/Parser_24/PXSqlVariablesClassification.cs +++ b/PCAxis.Sql/Parser_24/PXSqlVariablesClassification.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Collections.Specialized; -using PCAxis.Sql.QueryLib_21; -using PCAxis.Paxiom; -using PCAxis.Sql.Pxs; -using log4net; +using System.Collections.Generic; namespace PCAxis.Sql.Parser_24 { diff --git a/PCAxis.Sql/Parser_24/ParseMetaIndependentOfMaintable.cs b/PCAxis.Sql/Parser_24/ParseMetaIndependentOfMaintable.cs index 0a735c6..367197d 100644 --- a/PCAxis.Sql/Parser_24/ParseMetaIndependentOfMaintable.cs +++ b/PCAxis.Sql/Parser_24/ParseMetaIndependentOfMaintable.cs @@ -1,10 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Collections.Specialized; -using PCAxis.Paxiom; +using System.Collections.Specialized; + using log4net; +using PCAxis.Paxiom; + namespace PCAxis.Sql.Parser_24 { @@ -13,92 +12,96 @@ namespace PCAxis.Sql.Parser_24 /// public class ParseMetaIndependentOfMaintable { - private static readonly ILog log = LogManager.GetLogger(typeof(ParseMetaIndependentOfMaintable)); - - internal ParseMetaIndependentOfMaintable() { } - - /// "ANSI" - /// "2000" hei - /// System.DateTime.UtcNow - /// - /// - /// If there exists a Optional_PXCodepage entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "iso-8859-1" - /// - /// - ///
- ///
- ///
- /// - /// - /// If there exists a Optional_PXAxisVersion entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "2000" - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// If there exists a Optional_PXCharset entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "ANSI" - /// - /// - ///
- ///
- ///
- /// - /// - /// If there exists a Optional_PXDescriptionDefault entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise false - /// - /// - ///
- ///
- ///
- /// - /// - /// - /// System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") - /// - /// - /// - internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, PXMetaAdmValues metaAdm ) { - string noLanguage = null; - string subkey = null; - StringCollection values = new StringCollection(); - - values.Add(metaAdm.PXCharset); - handler(PXKeywords.CHARSET, noLanguage, subkey, values); - - - values.Clear(); - values.Add(metaAdm.PXAxisVersion); - handler(PXKeywords.AXIS_VERSION, noLanguage, subkey, values); - - values.Clear(); - values.Add(metaAdm.PXCodepage); - handler(PXKeywords.CODEPAGE, noLanguage, subkey, values); - - values.Clear(); - if (metaAdm.PXDescriptionDefault) { - values.Add(PXConstant.YES); - } else { - values.Add(PXConstant.NO); - } - handler(PXKeywords.DESCRIPTIONDEFAULT, noLanguage, subkey, values); - - values.Clear(); - - // string nowString = System.DateTime.UtcNow.ToString("yyyyMMdd hh:mm"); bug 193 wrong time - // string nowString = System.DateTime.Now.ToString(); - // string nowString = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm"); - // ørebro vedtak(beslut). - //ørebro 27.11.2012 Nytt formatvedtak + private static readonly ILog log = LogManager.GetLogger(typeof(ParseMetaIndependentOfMaintable)); + + internal ParseMetaIndependentOfMaintable() { } + + /// "ANSI" + /// "2000" hei + /// System.DateTime.UtcNow + /// + /// + /// If there exists a Optional_PXCodepage entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "iso-8859-1" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If there exists a Optional_PXAxisVersion entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "2000" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// If there exists a Optional_PXCharset entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise "ANSI" + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// If there exists a Optional_PXDescriptionDefault entry in the keywords-section of the dbconfig then the corresponding MetaAdm-row is used otherwise false + /// + /// + ///
+ ///
+ ///
+ /// + /// + /// + /// System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") + /// + /// + /// + internal void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, PXMetaAdmValues metaAdm) + { + string noLanguage = null; + string subkey = null; + StringCollection values = new StringCollection(); + + values.Add(metaAdm.PXCharset); + handler(PXKeywords.CHARSET, noLanguage, subkey, values); + + + values.Clear(); + values.Add(metaAdm.PXAxisVersion); + handler(PXKeywords.AXIS_VERSION, noLanguage, subkey, values); + + values.Clear(); + values.Add(metaAdm.PXCodepage); + handler(PXKeywords.CODEPAGE, noLanguage, subkey, values); + + values.Clear(); + if (metaAdm.PXDescriptionDefault) + { + values.Add(PXConstant.YES); + } + else + { + values.Add(PXConstant.NO); + } + handler(PXKeywords.DESCRIPTIONDEFAULT, noLanguage, subkey, values); + + values.Clear(); + + // string nowString = System.DateTime.UtcNow.ToString("yyyyMMdd hh:mm"); bug 193 wrong time + // string nowString = System.DateTime.Now.ToString(); + // string nowString = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm"); + // ørebro vedtak(beslut). + //ørebro 27.11.2012 Nytt formatvedtak //string nowString = System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz"); - string nowString = System.DateTime.Now.ToString("yyyyMMdd HH:mm"); + string nowString = System.DateTime.Now.ToString("yyyyMMdd HH:mm"); + + values.Add(nowString); - values.Add(nowString); - - handler(PXKeywords.CREATION_DATE, noLanguage, subkey, values); - } + handler(PXKeywords.CREATION_DATE, noLanguage, subkey, values); + } } diff --git a/PCAxis.Sql/Parser_24/PxSqlParserForCodelists_24.cs b/PCAxis.Sql/Parser_24/PxSqlParserForCodelists_24.cs index 3b618c8..1dd783f 100644 --- a/PCAxis.Sql/Parser_24/PxSqlParserForCodelists_24.cs +++ b/PCAxis.Sql/Parser_24/PxSqlParserForCodelists_24.cs @@ -14,14 +14,14 @@ public class PXSqlParserForCodelists_24 : PCAxis.PlugIn.Sql.PXSqlParserForCodeli { private static readonly ILog log = LogManager.GetLogger(typeof(PXSqlParserForCodelists_24)); - + //private List _variables; private List _variables; - + private PXSqlMeta_24 mPXSqlMeta; private string variableOfApplyValueSet; - + #region Constructors @@ -30,41 +30,42 @@ public class PXSqlParserForCodelists_24 : PCAxis.PlugIn.Sql.PXSqlParserForCodeli ///
/// PXSqlMeta holding variables /// Name of the vaiable - public PXSqlParserForCodelists_24(PXSqlMeta_24 inPXSqlMeta, String variableCode) { - mPXSqlMeta = inPXSqlMeta; - _variables = new List(); - _variables.Add(inPXSqlMeta.VariablesClassification[variableCode]); - this.variableOfApplyValueSet = variableCode; + public PXSqlParserForCodelists_24(PXSqlMeta_24 inPXSqlMeta, String variableCode) + { + mPXSqlMeta = inPXSqlMeta; + _variables = new List(); + _variables.Add(inPXSqlMeta.VariablesClassification[variableCode]); + this.variableOfApplyValueSet = variableCode; } #endregion - + /// /// Sends the data /// /// /// - public override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) - { - foreach (PXSqlVariableClassification variable in _variables) - { - - variable.ParseForApplyValueSet(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); - mPXSqlMeta.TheNotes.ParseNotesApplyValueset(handler, this.variableOfApplyValueSet); - } - + public override void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) + { + foreach (PXSqlVariableClassification variable in _variables) + { + variable.ParseForApplyValueSet(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); + mPXSqlMeta.TheNotes.ParseNotesApplyValueset(handler, this.variableOfApplyValueSet); + } + + + + } - } - /// - /// IDisposable implemenatation + /// IDisposable implemenatation /// - override public void Dispose() - { + override public void Dispose() + { mPXSqlMeta = null; } diff --git a/PCAxis.Sql/Parser_24/PxSqlParser_24.cs b/PCAxis.Sql/Parser_24/PxSqlParser_24.cs index 52be49a..7cc6656 100644 --- a/PCAxis.Sql/Parser_24/PxSqlParser_24.cs +++ b/PCAxis.Sql/Parser_24/PxSqlParser_24.cs @@ -1,11 +1,12 @@ using System; +using System.Collections.Generic; using System.Collections.Specialized; -using PCAxis.Paxiom; using System.Linq; -using System.Collections.Generic; using log4net; +using PCAxis.Paxiom; + namespace PCAxis.Sql.Parser_24 { public class PXSqlParser_24 : PCAxis.PlugIn.Sql.PXSqlParser @@ -19,10 +20,11 @@ public class PXSqlParser_24 : PCAxis.PlugIn.Sql.PXSqlParser internal PXSqlNpm symbols; #region Constructor - // public PXSqlParser_24() { } + // public PXSqlParser_24() { } - public PXSqlParser_24(PXSqlMeta_24 inPXSqlMeta) { + public PXSqlParser_24(PXSqlMeta_24 inPXSqlMeta) + { mPXSqlMeta = inPXSqlMeta; if (mPXSqlMeta.inPresentationModus) @@ -83,18 +85,21 @@ public PXSqlParser_24(PXSqlMeta_24 inPXSqlMeta) { /// /// /// - override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) { + override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string preferredLanguage) + { string keyword; - + string noLanguage = null; string subkey = null; StringCollection values; - if (mHasParsedMeta) { + if (mHasParsedMeta) + { return; } - if (mPXSqlMeta.HasLanguage) { + if (mPXSqlMeta.HasLanguage) + { // Language keyword = PXKeywords.LANGUAGE; values = new StringCollection(); @@ -104,7 +109,8 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, // Languages keyword = PXKeywords.LANGUAGES; values = new StringCollection(); - foreach (string lang in mPXSqlMeta.LanguageCodes) { + foreach (string lang in mPXSqlMeta.LanguageCodes) + { values.Add(lang); } handler(keyword, noLanguage, subkey, values); @@ -121,7 +127,8 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, - foreach (PXSqlVariable var in mPXSqlMeta.Variables.Values) { + foreach (PXSqlVariable var in mPXSqlMeta.Variables.Values) + { var.ParseMeta(handler, mPXSqlMeta.LanguageCodes, preferredLanguage); } @@ -133,13 +140,13 @@ override public void ParseMeta(PCAxis.Paxiom.IPXModelParser.MetaHandler handler, mPXSqlMeta.TheNotes.ParseAllNotes(handler); - - + + #endregion Footnotes #region NPMish stuff - if (mPXSqlMeta.inPresentationModus ) + if (mPXSqlMeta.inPresentationModus) { this.symbols.ParseMeta(handler, mPXSqlMeta); } @@ -152,7 +159,7 @@ override public void SetCurrentValueSets(PXMeta pxMeta) // Due to that this method will exit first time it "hits" a default value. Det default SubTableVariable might have a default grouping. var defaultValueSetBySubTableVar = new Dictionary(); - + //This will set the default SubTableVariable if set foreach (var var in this.mPXSqlMeta.VariablesClassification) { @@ -171,16 +178,16 @@ override public void SetCurrentValueSets(PXMeta pxMeta) { defaultValueSetBySubTableVar.Add(var.Value, variable.CurrentValueSet.ID); } - + break; } } - } + } } //This will set the default grouping if set and not default SubTableVariable is set foreach (var var in this.mPXSqlMeta.VariablesClassification) - { + { var varName = var.Key; if (var.Value != null && var.Value.GroupingInfos != null) @@ -190,7 +197,7 @@ override public void SetCurrentValueSets(PXMeta pxMeta) if (groupingInfo.IsDefault) { //if the grouping belongs to a SubTableVariable and another SubTableVariable is default, the grouping cannot be set as deault(ApplyGrouping) - if (defaultValueSetBySubTableVar.ContainsKey(var.Value)) + if (defaultValueSetBySubTableVar.ContainsKey(var.Value)) { var valueSetId = defaultValueSetBySubTableVar[var.Value]; if (!groupingInfo.ValueSetIds.Contains(valueSetId)) continue; @@ -201,11 +208,11 @@ override public void SetCurrentValueSets(PXMeta pxMeta) } } } - } - + } + } - - + + #endregion @@ -213,12 +220,14 @@ override public void SetCurrentValueSets(PXMeta pxMeta) /// /// IDisposable implemenatation /// - override public void Dispose() { - if (mPXSqlMeta != null) { + override public void Dispose() + { + if (mPXSqlMeta != null) + { mPXSqlMeta.Dispose(); } } - + } } diff --git a/PCAxis.Sql/Parser_24/PxSqlValues.cs b/PCAxis.Sql/Parser_24/PxSqlValues.cs index 45efa06..0fbcfe9 100644 --- a/PCAxis.Sql/Parser_24/PxSqlValues.cs +++ b/PCAxis.Sql/Parser_24/PxSqlValues.cs @@ -1,16 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Text; -using log4net; +using System.Collections.Generic; + +using log4net; namespace PCAxis.Sql.Parser_24 { - public class PxSqlValues:Dictionary + public class PxSqlValues : Dictionary { #region contants - private static readonly ILog log = LogManager.GetLogger(typeof(PxSqlValues)); - + private static readonly ILog log = LogManager.GetLogger(typeof(PxSqlValues)); + #endregion internal List GetValuesForSelectedValueset(string selectedValueset) { @@ -24,7 +23,7 @@ internal List GetValuesForSelectedValueset(string selectedValueset) } return valuesetsValues; } - + internal List GetValuesSortedByVSValue(List values) { List sortedValueList = new List(); @@ -38,7 +37,7 @@ internal List GetValuesSortedByVSValue(List values) } internal List GetValuesSortedByValue(List values) { - + List sortedValueList = new List(); foreach (PXSqlValue value in values) { @@ -86,7 +85,7 @@ internal List GetValuesSortedDefault(List values) return sortedValueList; } - + public PXSqlValue GetValueByContentsCode(string contentsCode) { foreach (PXSqlValue val in this.Values) diff --git a/PCAxis.Sql/Parser_24/SqlCollection.cs b/PCAxis.Sql/Parser_24/SqlCollection.cs index 366290b..4920f52 100644 --- a/PCAxis.Sql/Parser_24/SqlCollection.cs +++ b/PCAxis.Sql/Parser_24/SqlCollection.cs @@ -1,18 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Text; using System.Collections.Specialized; namespace PCAxis.Sql.Parser_24 { - // brukes ikke lenger da generisk dictionary benyttes istedet - class SqlCollection: NameObjectCollectionBase where T:ISqlItem + // brukes ikke lenger da generisk dictionary benyttes istedet + class SqlCollection : NameObjectCollectionBase where T : ISqlItem { #region add public void Add(T collItem) { - base.BaseAdd(collItem.Name,collItem); + base.BaseAdd(collItem.Name, collItem); } #endregion #region remove @@ -22,7 +18,7 @@ public void Remove(T collItem) } #endregion #region locate - public T Item (string Name) + public T Item(string Name) { return (T)base.BaseGet(Name/*.ToUpper()*/); diff --git a/PCAxis.Sql/Parser_24/Texts.cs b/PCAxis.Sql/Parser_24/Texts.cs index 0466833..98f3b4c 100644 --- a/PCAxis.Sql/Parser_24/Texts.cs +++ b/PCAxis.Sql/Parser_24/Texts.cs @@ -1,13 +1,11 @@ -using System; using System.Collections.Generic; -using System.Text; namespace PCAxis.Sql.Parser_24 { // This class should read from a configuration file. class Texts { - private Dictionary mPaxiomAnd; + private Dictionary mPaxiomAnd; public Dictionary PaxiomAnd { get { return mPaxiomAnd; } @@ -28,16 +26,16 @@ public Dictionary PaxiomType } public Texts() { - mPaxiomAnd = new Dictionary(); + mPaxiomAnd = new Dictionary(); mPaxiomBy = new Dictionary(); mPaxiomType = new Dictionary(); - mPaxiomAnd["en"] = "and"; - mPaxiomBy["en"] = "by"; - mPaxiomType["en"] = "type"; - mPaxiomAnd["no"] = "og"; - mPaxiomBy["no"] = "etter"; - mPaxiomType["no"] = "type"; + mPaxiomAnd["en"] = "and"; + mPaxiomBy["en"] = "by"; + mPaxiomType["en"] = "type"; + mPaxiomAnd["no"] = "og"; + mPaxiomBy["no"] = "etter"; + mPaxiomType["no"] = "type"; } } diff --git a/PCAxis.Sql/PxsQuery/FlatFileReaderHelper.cs b/PCAxis.Sql/PxsQuery/FlatFileReaderHelper.cs index 1b5b689..a1cb0e2 100644 --- a/PCAxis.Sql/PxsQuery/FlatFileReaderHelper.cs +++ b/PCAxis.Sql/PxsQuery/FlatFileReaderHelper.cs @@ -1,14 +1,15 @@ using System; using System.Collections.Generic; -using System.Text; -namespace PCAxis.Sql.Pxs { +namespace PCAxis.Sql.Pxs +{ /// /// This class is used be the FlatFileReader-method to store some temp-values. /// - class FlatFileReaderHelper{ - + class FlatFileReaderHelper + { + internal int no_vars = -1; internal int no_vars_before_heading = -1; internal int no_vars_before_time = -1; @@ -23,7 +24,7 @@ class FlatFileReaderHelper{ internal PQVariable[] tmpVariable; internal List[] variableValues; - + //The [] determin which variable ( VAR0, VAR1 ...) // the dictionary use the molecule code as key for list of atom codes internal Dictionary>[] groupsValuesByValueCode; @@ -41,6 +42,6 @@ class FlatFileReaderHelper{ internal FlatFileReaderHelper() { } - + } } diff --git a/PCAxis.Sql/PxsQuery/InfoFromPxSqlMeta2PxsQuery.cs b/PCAxis.Sql/PxsQuery/InfoFromPxSqlMeta2PxsQuery.cs index 75813ac..2a5bd26 100644 --- a/PCAxis.Sql/PxsQuery/InfoFromPxSqlMeta2PxsQuery.cs +++ b/PCAxis.Sql/PxsQuery/InfoFromPxSqlMeta2PxsQuery.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; namespace PCAxis.Sql.Pxs { @@ -20,7 +17,7 @@ public class InfoFromPxSqlMeta2PxsQuery /// Empty constructor ///
public InfoFromPxSqlMeta2PxsQuery() - { + { } diff --git a/PCAxis.Sql/PxsQuery/PxsQuery_FlatFile_partial.cs b/PCAxis.Sql/PxsQuery/PxsQuery_FlatFile_partial.cs index 3622dea..ca1d1be 100644 --- a/PCAxis.Sql/PxsQuery/PxsQuery_FlatFile_partial.cs +++ b/PCAxis.Sql/PxsQuery/PxsQuery_FlatFile_partial.cs @@ -1,19 +1,17 @@ using System; using System.Collections.Generic; -using System.Text; -using System.Xml.Serialization; -using System.Xml; -using System.IO; -using log4net; -namespace PCAxis.Sql.Pxs { +namespace PCAxis.Sql.Pxs +{ - public partial class PxsQuery { + public partial class PxsQuery + { - private void ReadFlatFile(String[] fileLines, string resultLanguage) { + private void ReadFlatFile(String[] fileLines, string resultLanguage) + { FlatFileReaderHelper helper = new FlatFileReaderHelper();//Stores tmp data char[] splitter = new char[1]; splitter[0] = '='; @@ -28,25 +26,33 @@ private void ReadFlatFile(String[] fileLines, string resultLanguage) { log.Debug("fileLines count:" + fileLines.Length); int processedLines = 0; - foreach (String aLine in fileLines) { - if (String.IsNullOrEmpty(aLine)) { + foreach (String aLine in fileLines) + { + if (String.IsNullOrEmpty(aLine)) + { continue; } processedLines++; String line = aLine.Trim(); log.Debug("line='" + line + "'"); String[] lineParts = line.Split(splitter, 2); - if (line.StartsWith("[")) { + if (line.StartsWith("[")) + { String ucLine = line.Trim().Replace("[", "").Replace("]", "").ToUpper(); - if (ucLine.Equals("QUERY") || ucLine.Equals("CONTENTS") || ucLine.Equals("TIME")) { + if (ucLine.Equals("QUERY") || ucLine.Equals("CONTENTS") || ucLine.Equals("TIME")) + { segmentFlag = ucLine; - } else if (ucLine.Equals("FILES")) { + } + else if (ucLine.Equals("FILES")) + { this.Information.Files = new InformationTypeFiles(); segmentFlag = ucLine; - } else if (ucLine.Equals("OPTIONS")) { + } + else if (ucLine.Equals("OPTIONS")) + { this.Information.BatchOptions = new InformationTypeBatchOptions(); //this.Information.BatchOptions.ContinuePxq = " ";//denne er kanskje ikke i bruk @@ -56,7 +62,9 @@ private void ReadFlatFile(String[] fileLines, string resultLanguage) { this.Information.BatchOptions.Metabase = " "; segmentFlag = ucLine; - } else if (ucLine.StartsWith("VAR")) { + } + else if (ucLine.StartsWith("VAR")) + { String shouldBeInt = ucLine.Substring(3); helper.var_counter = int.Parse(shouldBeInt); helper.tmpVariable[helper.var_counter] = new PQVariable(); @@ -66,31 +74,51 @@ private void ReadFlatFile(String[] fileLines, string resultLanguage) { helper.groupTextByValueSortOrder[helper.var_counter] = new Dictionary(); segmentFlag = "VAR"; - } else { + } + else + { throw new Exception("Unknown thing in square brackets:" + line);//in production-release:should be just a warning } - } else if (lineParts.Length == 2) { - if (segmentFlag.Equals("QUERY")) { + } + else if (lineParts.Length == 2) + { + if (segmentFlag.Equals("QUERY")) + { fromQuerySeg(lineParts[0], lineParts[1], helper); - } else if (segmentFlag.Equals("CONTENTS")) { + } + else if (segmentFlag.Equals("CONTENTS")) + { fromContentSeg(lineParts[0], lineParts[1], helper); - } else if (segmentFlag.Equals("VAR")) { + } + else if (segmentFlag.Equals("VAR")) + { fromVarSeg(lineParts[0], lineParts[1], helper); - } else if (segmentFlag.Equals("TIME")) { + } + else if (segmentFlag.Equals("TIME")) + { fromTimeSeg(lineParts[0], lineParts[1], helper); - } else if (segmentFlag.Equals("FILES")) { + } + else if (segmentFlag.Equals("FILES")) + { fromFilesSeg(lineParts[0], lineParts[1]); - } else if (segmentFlag.Equals("OPTIONS")) { + } + else if (segmentFlag.Equals("OPTIONS")) + { fromOptionsSeg(lineParts[0], lineParts[1]); - } else { + } + else + { throw new Exception("Unknown segmentFlag:" + segmentFlag + " line:" + line);//in production-release:should be just a warning } - } else { + } + else + { throw new Exception("Hmmm: not a segment and not key=value: " + line);//in production-release:should be just a warning } } - if (processedLines < 5) { + if (processedLines < 5) + { throw new ApplicationException("Too few lines to be a pxs"); } @@ -98,35 +126,61 @@ private void ReadFlatFile(String[] fileLines, string resultLanguage) { } - private void fromQuerySeg(String key, String value, FlatFileReaderHelper helper) { + private void fromQuerySeg(String key, String value, FlatFileReaderHelper helper) + { string ucKey = key.ToUpper(); - if (ucKey.Equals("TIMEOPT")) { + if (ucKey.Equals("TIMEOPT")) + { this.Query.Time.TimeOption = (TimeTypeTimeOption)int.Parse(value); - } else if (ucKey.Equals("USERID")) { + } + else if (ucKey.Equals("USERID")) + { this.Information.CreatedBy.userId = value; - } else if (ucKey.Equals("USERNAME")) { + } + else if (ucKey.Equals("USERNAME")) + { this.Information.CreatedBy.UserName = value; - } else if (ucKey.Equals("METAVERSION")) { + } + else if (ucKey.Equals("METAVERSION")) + { this.Information.MetaVersion = value; log.Warn("assumes METAVERSION means the same as PxsVersion"); - } else if (ucKey.Equals("SUBJECT")) { + } + else if (ucKey.Equals("SUBJECT")) + { // denne finnes ikke noe subject fixMenuSel("OBS_OBS_fra_subject", value, helper); - } else if (ucKey.Equals("MENUSEL1")) { + } + else if (ucKey.Equals("MENUSEL1")) + { fixMenuSel("1", value, helper); - } else if (ucKey.Equals("MENUSEL2")) { + } + else if (ucKey.Equals("MENUSEL2")) + { fixMenuSel("2", value, helper); - } else if (ucKey.Equals("MENUSEL3")) { + } + else if (ucKey.Equals("MENUSEL3")) + { fixMenuSel("3", value, helper); - } else if (ucKey.Equals("MENUSEL4")) { + } + else if (ucKey.Equals("MENUSEL4")) + { fixMenuSel("4", value, helper); - } else if (ucKey.Equals("MENUSEL5")) { + } + else if (ucKey.Equals("MENUSEL5")) + { fixMenuSel("5", value, helper); - } else if (ucKey.Equals("MENUSEL6")) { + } + else if (ucKey.Equals("MENUSEL6")) + { fixMenuSel("6", value, helper); - } else if (ucKey.Equals("TABLE")) { + } + else if (ucKey.Equals("TABLE")) + { this.Query.TableSource = value; - } else if (ucKey.Equals("VARANT")) { //number of variables (not including time) + } + else if (ucKey.Equals("VARANT")) + { //number of variables (not including time) helper.no_vars = int.Parse(value); helper.tmpVariable = new PQVariable[helper.no_vars]; @@ -134,29 +188,45 @@ private void fromQuerySeg(String key, String value, FlatFileReaderHelper helper) helper.groupsValuesByValueCode = new Dictionary>[helper.no_vars]; helper.groupTextByValueSortOrder = new Dictionary[helper.no_vars]; - } else if (ucKey.Equals("SUBTAB")) { + } + else if (ucKey.Equals("SUBTAB")) + { this.Query.SubTable = value; - } else if (ucKey.Equals("LANG")) { + } + else if (ucKey.Equals("LANG")) + { helper.langInFile = value; - } else if (ucKey.Equals("HEADING")) {//how many variables before heading (those in stub) + } + else if (ucKey.Equals("HEADING")) + {//how many variables before heading (those in stub) helper.no_vars_before_heading = int.Parse(value); - } else if (ucKey.Equals("TIMEORDER")) {//how many variables before the time variable (example time first in heading) + } + else if (ucKey.Equals("TIMEORDER")) + {//how many variables before the time variable (example time first in heading) helper.no_vars_before_time = int.Parse(value); - } else if (ucKey.Equals("CONTENTS")) { + } + else if (ucKey.Equals("CONTENTS")) + { log.Warn("Keyword CONTENTS will be ignored. So you can no longer override the short title from the DB."); //data.Query.Contents.ContText = value; - } else if (ucKey.Equals("PRODUCT")) { + } + else if (ucKey.Equals("PRODUCT")) + { log.Info("Keyword PRODUCT found and will be ignored."); - } else { + } + else + { throw new Exception("Unknown key in query:" + key);//in production-release:should be just a warning } } - private void fromContentSeg(String key, String value, FlatFileReaderHelper helper) { + private void fromContentSeg(String key, String value, FlatFileReaderHelper helper) + { string ucKey = key.ToUpper(); - if (!ucKey.StartsWith("CONT")) { + if (!ucKey.StartsWith("CONT")) + { throw new Exception("Unknown key in content-segment:" + key);//in production-release:should be just a warning } String shouldBeInt = key.Substring(4);//Cont1=... @@ -166,16 +236,25 @@ private void fromContentSeg(String key, String value, FlatFileReaderHelper helpe } - private void fromVarSeg(String key, String value, FlatFileReaderHelper helper) { + private void fromVarSeg(String key, String value, FlatFileReaderHelper helper) + { string ucKey = key.ToUpper(); - if (ucKey.Equals("KOD")) { + if (ucKey.Equals("KOD")) + { helper.tmpVariable[helper.var_counter].code = value; - } else if (ucKey.Equals("PRESTEXT")) { + } + else if (ucKey.Equals("PRESTEXT")) + { helper.tmpVariable[helper.var_counter].PresTextOption = value; - } else if (ucKey.Equals("ELIM")) { + } + else if (ucKey.Equals("ELIM")) + { log.Info("Warning: keyword Elim will be ignored. Read: " + key + " value:" + value); - } else if (ucKey.Equals("AGGREG")) { - switch (value.ToUpper()) { + } + else if (ucKey.Equals("AGGREG")) + { + switch (value.ToUpper()) + { case "G": helper.tmpVariable[helper.var_counter].Aggregation = PQVariableAggregation.G; break; @@ -189,97 +268,149 @@ private void fromVarSeg(String key, String value, FlatFileReaderHelper helper) { helper.tmpVariable[helper.var_counter].Aggregation = PQVariableAggregation.N; break; } - } else if (ucKey.Equals("GROUPING")) { + } + else if (ucKey.Equals("GROUPING")) + { helper.tmpVariable[helper.var_counter].StructureId = value; helper.tmpVariable[helper.var_counter].Aggregation = PQVariableAggregation.G; - } else if (ucKey.Equals("GENERAL")) { - if ((value.ToUpper().StartsWith("Y")) && (helper.tmpVariable[helper.var_counter].StructureId == null)) { + } + else if (ucKey.Equals("GENERAL")) + { + if ((value.ToUpper().StartsWith("Y")) && (helper.tmpVariable[helper.var_counter].StructureId == null)) + { helper.tmpVariable[helper.var_counter].StructureId = "UNKNOWNSTRUCTUREID"; } - } else if (ucKey.StartsWith("VALUE")) { - if (ucKey.EndsWith("TEXT")) { + } + else if (ucKey.StartsWith("VALUE")) + { + if (ucKey.EndsWith("TEXT")) + { //valueNNtext (belongs to valueNN) String NN = ucKey.Replace("VALUE", "").Replace("TEXT", ""); helper.groupTextByValueSortOrder[helper.var_counter][int.Parse(NN)] = value; - } else { + } + else + { //VALUEnn ValueTypeWithGroup tmp = new ValueTypeWithGroup(value, int.Parse(ucKey.Substring(5))); helper.variableValues[helper.var_counter].Add(tmp); } - } else if (ucKey.Equals("GEOAREA")) { + } + else if (ucKey.Equals("GEOAREA")) + { log.Info("GEOAREA will hereafter be retrieved from DB. Is no longer part of query."); - } else if (ucKey.StartsWith("GRVALUE")) { + } + else if (ucKey.StartsWith("GRVALUE")) + { int grvalue_number = int.Parse(ucKey.Substring(7)); String[] valueSplit = value.Split(','); String codeOfAtom = valueSplit[0].Replace("'", ""); String codeOfMolecule = valueSplit[1].Replace("'", ""); - if (!helper.groupsValuesByValueCode[helper.var_counter].ContainsKey(codeOfMolecule)) { + if (!helper.groupsValuesByValueCode[helper.var_counter].ContainsKey(codeOfMolecule)) + { helper.groupsValuesByValueCode[helper.var_counter][codeOfMolecule] = new List(); } GroupValueType tmp = new GroupValueType(); tmp.code = codeOfAtom; helper.groupsValuesByValueCode[helper.var_counter][codeOfMolecule].Add(tmp); - } else { + } + else + { throw new Exception("Unknown keyword in var-segment:" + key + " (value=" + value + ")");//in production-release:should be just a warning } } - private void fromTimeSeg(String key, String value, FlatFileReaderHelper helper) { + private void fromTimeSeg(String key, String value, FlatFileReaderHelper helper) + { string ucKey = key.ToUpper(); - if (ucKey.Equals("KOD")) { + if (ucKey.Equals("KOD")) + { this.Query.Time.code = value; - } else if (ucKey.Equals("VALUES")) { // when Moving time interval + } + else if (ucKey.Equals("VALUES")) + { // when Moving time interval this.Query.Time.Item = int.Parse(value); - } else if (ucKey.StartsWith("VALUE")) { // 0 or 3 - if ((int)this.Query.Time.TimeOption == 3) { + } + else if (ucKey.StartsWith("VALUE")) + { // 0 or 3 + if ((int)this.Query.Time.TimeOption == 3) + { this.Query.Time.Item = value; - } else { + } + else + { BasicValueType tmp = new BasicValueType(value, int.Parse(ucKey.Substring(5))); helper.timeValues.Add(tmp); } - } else if (ucKey.Equals("TIMEVAL")) { + } + else if (ucKey.Equals("TIMEVAL")) + { this.Query.Time.TimeVal = value; - } else { + } + else + { throw new Exception("Unknown keyword in time-segment:" + key + " (value=" + value + ")");//in production-release:should be just a warning } } - private void fromFilesSeg(String key, String value) { + private void fromFilesSeg(String key, String value) + { string ucKey = key.ToUpper(); - if (ucKey.Equals("PXSFILE")) { + if (ucKey.Equals("PXSFILE")) + { this.Information.Files.Pxsfile = value; - } else if (ucKey.Equals("OUTFILE")) { + } + else if (ucKey.Equals("OUTFILE")) + { this.Information.Files.Outfile = value; - } else if (ucKey.Equals("LOGFILE")) { + } + else if (ucKey.Equals("LOGFILE")) + { this.Information.Files.Logfile = value; - } else if (ucKey.Equals("TEXTFILE")) { + } + else if (ucKey.Equals("TEXTFILE")) + { this.Information.Files.Textfile = value; - } else if (ucKey.Equals("SQLFILE")) { + } + else if (ucKey.Equals("SQLFILE")) + { this.Information.Files.Sqlfile = value; - } else { + } + else + { throw new Exception("Unknown keyword in files-segment:" + key + " (value=" + value + ")");//in production-release:should be just a warning } } - private void fromOptionsSeg(String key, String value) { + private void fromOptionsSeg(String key, String value) + { string ucKey = key.ToUpper(); - if (ucKey.Equals("SQLTEST")) { + if (ucKey.Equals("SQLTEST")) + { this.Information.BatchOptions.Sqltest = value; - } else if (ucKey.Equals("PXDATABASE")) { + } + else if (ucKey.Equals("PXDATABASE")) + { this.Information.BatchOptions.PxDatabase = value; - } else if (ucKey.Equals("REPLACE")) { + } + else if (ucKey.Equals("REPLACE")) + { this.Information.BatchOptions.Replace = value; - } else if (ucKey.Equals("METABASE")) { + } + else if (ucKey.Equals("METABASE")) + { this.Information.BatchOptions.Metabase = value; - } else { + } + else + { throw new Exception("Unknown keyword in options-segment:" + key + " (value=" + value + ")");//in production-release:should be just a warning } } @@ -289,24 +420,29 @@ private void fromOptionsSeg(String key, String value) { // it converts lists to arrays and adds them to the object // (The lists are used when parsing since arrays cannot grow dynamically) //recodes data.Query.Time.TimeOption "1" to "2" - private void postParse(FlatFileReaderHelper helper, string resultLanguage) { + private void postParse(FlatFileReaderHelper helper, string resultLanguage) + { bool[] isElim = new bool[helper.no_vars]; int elimCount = 0; // Traverses the variables one by one - for (int n = 0; n < helper.no_vars; n++) { + for (int n = 0; n < helper.no_vars; n++) + { isElim[n] = helper.variableValues[n].Count < 1; // Common to all elimination: No values! - if (isElim[n]) { + if (isElim[n]) + { elimCount++; } log.Debug("isElim=" + isElim[n] + " code" + helper.tmpVariable[n].code); //adds any group values // For each value vt belonging to the current variable n do .... - foreach (ValueTypeWithGroup vt in helper.variableValues[n]) { + foreach (ValueTypeWithGroup vt in helper.variableValues[n]) + { // Checks if the current value code vt.code has a list of group codes associated with it - if (helper.groupsValuesByValueCode[n].ContainsKey(vt.code)) { + if (helper.groupsValuesByValueCode[n].ContainsKey(vt.code)) + { // If so, then create a temporary GroupValueType tmp to hold the list of group codes List tmp = helper.groupsValuesByValueCode[n][vt.code]; @@ -315,15 +451,19 @@ private void postParse(FlatFileReaderHelper helper, string resultLanguage) { vt.Group = new ValueTypeWithGroupGroup(); vt.Group.GroupValue = tmp.ToArray(); // Checks (on the sort order) if there is a ValueText (Group text) attached to any of the values - if (helper.groupTextByValueSortOrder[n].ContainsKey(vt.sortOrder)) { + if (helper.groupTextByValueSortOrder[n].ContainsKey(vt.sortOrder)) + { // text er bare for grupper som kommer fra filer, hva med språk? StringLangType[] tmpSLT = new StringLangType[1]; tmpSLT[0] = new StringLangType(); tmpSLT[0].Value = helper.groupTextByValueSortOrder[n][vt.sortOrder]; - if (helper.langInFile == null) { + if (helper.langInFile == null) + { tmpSLT[0].lang = resultLanguage; log.Warn("Found text but no language. Using " + resultLanguage); - } else { + } + else + { tmpSLT[0].lang = helper.langInFile; } vt.Group.GroupText = tmpSLT; @@ -336,11 +476,14 @@ private void postParse(FlatFileReaderHelper helper, string resultLanguage) { helper.tmpVariable[n].Values.Items = helper.variableValues[n].ToArray(); } - if ((int)this.Query.Time.TimeOption == 0) { + if ((int)this.Query.Time.TimeOption == 0) + { TimeTypeTimeValues tttv = new TimeTypeTimeValues(); tttv.TimeValue = helper.timeValues.ToArray(); this.Query.Time.Item = tttv; - } else if ((int)this.Query.Time.TimeOption == 1) { + } + else if ((int)this.Query.Time.TimeOption == 1) + { this.Query.Time.TimeOption = (TimeTypeTimeOption)2; int noOfValues = 1; this.Query.Time.Item = noOfValues; @@ -348,7 +491,8 @@ private void postParse(FlatFileReaderHelper helper, string resultLanguage) { this.Query.Contents.Content = helper.contentValues.ToArray(); - if (helper.menuSelList.Count > 0) { + if (helper.menuSelList.Count > 0) + { this.Information.Menu = helper.menuSelList.ToArray(); } @@ -357,10 +501,13 @@ private void postParse(FlatFileReaderHelper helper, string resultLanguage) { myLanguageType[] tmpMyLang = new myLanguageType[1]; tmpMyLang[0] = new myLanguageType(); - if (helper.langInFile == null) { + if (helper.langInFile == null) + { tmpMyLang[0].Value = resultLanguage; log.Warn(" no language. Using " + resultLanguage); - } else { + } + else + { tmpMyLang[0].Value = helper.langInFile; } @@ -387,8 +534,10 @@ private void postParse(FlatFileReaderHelper helper, string resultLanguage) { // Traverses the variables found in the pxs file #region for loop - for (int n = 1; n <= helper.no_vars; n++) { - if (isElim[n - 1]) { + for (int n = 1; n <= helper.no_vars; n++) + { + if (isElim[n - 1]) + { continue; // If the variable is eliminated, then skip it } this.Query.Variables[outVarCounter] = helper.tmpVariable[n - 1]; @@ -398,20 +547,27 @@ private void postParse(FlatFileReaderHelper helper, string resultLanguage) { string code = helper.tmpVariable[n - 1].code; // helper.no_vars_before_heading show - if (n <= helper.no_vars_before_heading) { + if (n <= helper.no_vars_before_heading) + { // stub_counter++; stubList.Add(new AxisType(code, stub_counter++)); - } else { + } + else + { // head_counter++; headList.Add(new AxisType(code, head_counter++)); } - if (n == helper.no_vars_before_time) { //Time + if (n == helper.no_vars_before_time) + { //Time string timeCode = this.Query.Time.code; - if (n < helper.no_vars_before_heading) { + if (n < helper.no_vars_before_heading) + { stubList.Add(new AxisType(timeCode, stub_counter++)); - } else { + } + else + { headList.Add(new AxisType(timeCode, head_counter++)); } } @@ -426,10 +582,12 @@ private void postParse(FlatFileReaderHelper helper, string resultLanguage) { this.Presentation = new PresentationType(); - if (stubList.Count > 0) { + if (stubList.Count > 0) + { this.Presentation.Stub = stubList.ToArray(); } - if (headList.Count > 0) { + if (headList.Count > 0) + { this.Presentation.Heading = headList.ToArray(); } @@ -438,7 +596,8 @@ private void postParse(FlatFileReaderHelper helper, string resultLanguage) { } - private void fixMenuSel(String level, String value, FlatFileReaderHelper helper) { + private void fixMenuSel(String level, String value, FlatFileReaderHelper helper) + { MenuSelType tmp = new MenuSelType(); tmp.level = level; tmp.Value = value; diff --git a/PCAxis.Sql/PxsQuery/PxsQuery_Paxiom_partial.cs b/PCAxis.Sql/PxsQuery/PxsQuery_Paxiom_partial.cs index 00393e2..afa86fe 100644 --- a/PCAxis.Sql/PxsQuery/PxsQuery_Paxiom_partial.cs +++ b/PCAxis.Sql/PxsQuery/PxsQuery_Paxiom_partial.cs @@ -1,21 +1,19 @@ using System; using System.Collections.Generic; -using System.Text; -using System.Xml.Serialization; -using System.Xml; -using System.IO; -using log4net; -using PCAxis.Paxiom; using System.Collections.Specialized; + +using PCAxis.Paxiom; using PCAxis.PlugIn.Sql; -namespace PCAxis.Sql.Pxs { +namespace PCAxis.Sql.Pxs +{ + - - public partial class PxsQuery { + public partial class PxsQuery + { + - /// /// For creation after "build for selection GUI" /// @@ -23,11 +21,12 @@ public partial class PxsQuery { /// /// /// - public PxsQuery(PCAxis.Paxiom.PXMeta pax,StringCollection langs, PCAxis.Paxiom.Selection[] selections, InfoFromPxSqlMeta2PxsQuery pxsqlMeta) { + public PxsQuery(PCAxis.Paxiom.PXMeta pax, StringCollection langs, PCAxis.Paxiom.Selection[] selections, InfoFromPxSqlMeta2PxsQuery pxsqlMeta) + { init1(); - + #region this.Information //this.Information.CreatedDate = DateTime.Now; //skal bruke pax.Meta.CreationDate men hva er formatet til denne stringen? @@ -37,7 +36,8 @@ public PxsQuery(PCAxis.Paxiom.PXMeta pax,StringCollection langs, PCAxis.Paxiom.S #region this.Query List theLangs = new List(); - foreach (string aLang in langs) { + foreach (string aLang in langs) + { theLangs.Add(aLang); } @@ -46,18 +46,21 @@ public PxsQuery(PCAxis.Paxiom.PXMeta pax,StringCollection langs, PCAxis.Paxiom.S //this.Query.TableSource = pax.TableID; // eller Matrix this.Query.TableSource = pax.MainTable;// changed. reqtest bug 325/339 - - - + + + List tmpPxsVars = new List(); - foreach (Variable var in pax.Variables) { + foreach (Variable var in pax.Variables) + { Selection correspondingSelection = null; - foreach (Selection sel in selections) { - if (sel.VariableCode.Equals(var.Code)) { + foreach (Selection sel in selections) + { + if (sel.VariableCode.Equals(var.Code)) + { correspondingSelection = sel; } } @@ -65,12 +68,14 @@ public PxsQuery(PCAxis.Paxiom.PXMeta pax,StringCollection langs, PCAxis.Paxiom.S - if (var.IsContentVariable || var.Code.Equals("CONTENTSCODE") || var.IsTime || var.Code.Equals("TID") || var.Code.Equals("Tid")) { + if (var.IsContentVariable || var.Code.Equals("CONTENTSCODE") || var.IsTime || var.Code.Equals("TID") || var.Code.Equals("Tid")) + { List tmpList = new List(); - + int sortOrder = 1; - - foreach (string valCode in correspondingSelection.ValueCodes) { + + foreach (string valCode in correspondingSelection.ValueCodes) + { if (var.IsContentVariable || var.Code.Equals("CONTENTSCODE")) // new piv { string contents = var.Values.GetByCode(valCode).ContentInfo.RefrenceID; @@ -82,13 +87,16 @@ public PxsQuery(PCAxis.Paxiom.PXMeta pax,StringCollection langs, PCAxis.Paxiom.S } } - if (var.IsContentVariable || var.Code.Equals("CONTENTSCODE")) { + if (var.IsContentVariable || var.Code.Equals("CONTENTSCODE")) + { this.Query.Contents.code = var.Code; // - + // this.Query.Contents.Content = tmpList.ToArray(); - } else { + } + else + { //pax vet bare nok til å lage timeoption 0 :-< #region this.Query.Time this.Query.Time.code = var.Code; @@ -101,11 +109,13 @@ public PxsQuery(PCAxis.Paxiom.PXMeta pax,StringCollection langs, PCAxis.Paxiom.S this.Query.Time.TimeVal = var.TimeValue;//?? #endregion this.Query.Time } - } else { //classification + } + else + { //classification #region preparing for this.Query.Variables PQVariable tmpPxsVar = new PQVariable(); tmpPxsVar.code = var.Code; - + //på tynn is her: tmpPxsVar.Aggregation = PQVariableAggregation.N; @@ -115,23 +125,23 @@ public PxsQuery(PCAxis.Paxiom.PXMeta pax,StringCollection langs, PCAxis.Paxiom.S string currentGrouping = pxsqlMeta.GetCurrentGroupingId(var.Code); - + // // string currentGrouping = var.CurrentGrouping; will get trouble for pxs4selection // with a grouping, since it is not an "applied grouping", but more of a "backgroud grouping" - + if (!String.IsNullOrEmpty(currentGrouping)) { tmpPxsVar.Aggregation = PQVariableAggregation.G; tmpPxsVar.StructureId = currentGrouping; log.Debug(currentGrouping); - //} else if ( (! String.IsNullOrEmpty(selectedValueset)) && - // selectedValueset != PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS) { - // tmpPxsVar.StructureId = pxsqlMeta.Variables[var.Code].SelectedValueset; - // tmpPxsVar.Aggregation = PQVariableAggregation.V; - // // denne skulle vel bort? - + //} else if ( (! String.IsNullOrEmpty(selectedValueset)) && + // selectedValueset != PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS) { + // tmpPxsVar.StructureId = pxsqlMeta.Variables[var.Code].SelectedValueset; + // tmpPxsVar.Aggregation = PQVariableAggregation.V; + // // denne skulle vel bort? + } //skip variables which does not have codes in Selection object if (correspondingSelection == null || correspondingSelection.ValueCodes.Count == 0) @@ -148,7 +158,8 @@ public PxsQuery(PCAxis.Paxiom.PXMeta pax,StringCollection langs, PCAxis.Paxiom.S tmpPxsVar.Values = new PQVariableValues(); tmpPxsVar.Values.Items = new ValueTypeWithGroup[correspondingSelection.ValueCodes.Count]; - for (int n = 0; n < tmpPxsVar.Values.Items.Length; n++) { + for (int n = 0; n < tmpPxsVar.Values.Items.Length; n++) + { tmpPxsVar.Values.Items[n] = new ValueTypeWithGroup(correspondingSelection.ValueCodes[n], n + 1); } @@ -164,16 +175,20 @@ public PxsQuery(PCAxis.Paxiom.PXMeta pax,StringCollection langs, PCAxis.Paxiom.S #region this.Presentation this.Presentation = new PresentationType(); - if (pax.Stub.Count > 0) { + if (pax.Stub.Count > 0) + { this.Presentation.Stub = new AxisType[pax.Stub.Count]; - for (int n = 0; n < pax.Stub.Count; n++) { + for (int n = 0; n < pax.Stub.Count; n++) + { this.Presentation.Stub[n] = new AxisType(pax.Stub[n].Code, n); } } - if (pax.Heading.Count > 0) { + if (pax.Heading.Count > 0) + { this.Presentation.Heading = new AxisType[pax.Heading.Count]; - for (int n = 0; n < pax.Heading.Count; n++) { + for (int n = 0; n < pax.Heading.Count; n++) + { this.Presentation.Heading[n] = new AxisType(pax.Heading[n].Code, n); } } @@ -205,7 +220,7 @@ public void SetSelectedValuesetsAndNullSubtable(Dictionary mValu } if (!found) { - log.Info("variableId=" + variableId+ " cant be found in the pxs, so it is hopefully eliminated!"); + log.Info("variableId=" + variableId + " cant be found in the pxs, so it is hopefully eliminated!"); } } diff --git a/PCAxis.Sql/PxsQuery/PxsQuery_partial.cs b/PCAxis.Sql/PxsQuery/PxsQuery_partial.cs index fb99755..2732d4b 100644 --- a/PCAxis.Sql/PxsQuery/PxsQuery_partial.cs +++ b/PCAxis.Sql/PxsQuery/PxsQuery_partial.cs @@ -1,44 +1,52 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; +using System.IO; using System.Text; -using System.Xml.Serialization; using System.Xml; -using System.IO; +using System.Xml.Serialization; + using log4net; -using System.Collections.Specialized; -namespace PCAxis.Sql.Pxs { +namespace PCAxis.Sql.Pxs +{ - public partial class PxsQuery : System.ICloneable { + public partial class PxsQuery : System.ICloneable + { private static readonly ILog log = LogManager.GetLogger(typeof(PxsQuery)); public PxsQuery() { } - + /// /// Creates PxsQuery from an array of fileLines. /// /// The lines /// If no language is found in the lines, this is used - public PxsQuery(String[] fileLines, string resultLanguage) { - this.ReadFlatFile(fileLines,resultLanguage); + public PxsQuery(String[] fileLines, string resultLanguage) + { + this.ReadFlatFile(fileLines, resultLanguage); } - + /// /// Creates PxsQuery from a file. If the pxsPath ends with pxs or pxsb the file /// is assumed a pxs-flatfile. Otherwise it is assumed to be a xml-file. /// /// Path of file to be read /// When used for old pxs:If no language is found in the lines, this is used - public PxsQuery(string pxsPath, string resultLanguage) { + public PxsQuery(string pxsPath, string resultLanguage) + { - if (pxsPath.EndsWith(".pxs") || pxsPath.EndsWith(".pxsb")) { + if (pxsPath.EndsWith(".pxs") || pxsPath.EndsWith(".pxsb")) + { log.Debug("Flat File"); String[] fileLines = File.ReadAllLines(pxsPath, Encoding.Default); - this.ReadFlatFile(fileLines,resultLanguage); - } else { + this.ReadFlatFile(fileLines, resultLanguage); + } + else + { //string pxsPath = @"PxsTest.xml"; XmlTextReader pxsReader = new XmlTextReader(pxsPath); //FileStream pxsReader = new FileStream(pxsPath,FileMode.Open); @@ -73,7 +81,8 @@ public static PxsQuery GetPxsQueryFromXML(string pxsPath) { - private void init1() { + private void init1() + { this.Information = new InformationType(); this.Information.MetaVersion = "2.0"; @@ -91,33 +100,40 @@ private void init1() { /// Sets an indication that texts should be extracted in all languages of /// the datasource at the time of extraction. ///
- public void setLangToAll(){ + public void setLangToAll() + { allType[] tmpLang = new allType[1]; - tmpLang[0] = new allType(); - this.Query.Languages.Items = tmpLang; + tmpLang[0] = new allType(); + this.Query.Languages.Items = tmpLang; } /// /// Sets the timeOption to "Everything you got" /// - public void setTimeOptionToAll() { + public void setTimeOptionToAll() + { this.Query.Time.TimeOption = (TimeTypeTimeOption)4; this.Query.Time.Item = null; } - - + + /// /// Sets an indication that texts should be extracted in the languages of langs. /// /// List of languagecodes. If empty setLangToAll() is called. - public void setLangs(List langs){ - if (langs.Count == 0) { + public void setLangs(List langs) + { + if (langs.Count == 0) + { setLangToAll(); - } else { + } + else + { myLanguageType[] tmpMyLangs = new myLanguageType[langs.Count]; - for (int n = 0; n < langs.Count; n++) { + for (int n = 0; n < langs.Count; n++) + { tmpMyLangs[n] = new myLanguageType(); tmpMyLangs[n].Value = langs[n]; } @@ -127,55 +143,70 @@ public void setLangs(List langs){ } - public void fixPresentation(string[] allHeadCodes, string[] allStubCodes ) { + public void fixPresentation(string[] allHeadCodes, string[] allStubCodes) + { this.Presentation = new PresentationType(); StringCollection allCodesInQuery = new StringCollection(); - allCodesInQuery.Add(this.Query.Time.code); - - + allCodesInQuery.Add(this.Query.Time.code); + + //if (this.Query.Contents.Content.Length > 1) { allCodesInQuery.Add(this.Query.Contents.code); //} - foreach (PQVariable var in this.Query.Variables) { + foreach (PQVariable var in this.Query.Variables) + { log.Debug("'" + var.code + "'"); allCodesInQuery.Add(var.code); } - - if (allHeadCodes.Length > 0) { + + if (allHeadCodes.Length > 0) + { this.Presentation.Heading = new AxisType[allHeadCodes.Length]; - for (int n = 0; n < allHeadCodes.Length; n++) { - if (!allCodesInQuery.Contains(allHeadCodes[n])) { + for (int n = 0; n < allHeadCodes.Length; n++) + { + if (!allCodesInQuery.Contains(allHeadCodes[n])) + { String allCodesInQueryStr = ""; - foreach (string code in allCodesInQuery) { - allCodesInQueryStr += ",'" + code+"'"; + foreach (string code in allCodesInQuery) + { + allCodesInQueryStr += ",'" + code + "'"; } allCodesInQueryStr = allCodesInQueryStr.Substring(1); - throw new System.ApplicationException("Error: No code in query matches code for heading presentation '" + allHeadCodes[n] + "'. The following are valid:"+allCodesInQueryStr); - } else { + throw new System.ApplicationException("Error: No code in query matches code for heading presentation '" + allHeadCodes[n] + "'. The following are valid:" + allCodesInQueryStr); + } + else + { allCodesInQuery.Remove(allHeadCodes[n]); } this.Presentation.Heading[n] = new AxisType(allHeadCodes[n], n); } } - if (allStubCodes.Length > 0) { + if (allStubCodes.Length > 0) + { this.Presentation.Stub = new AxisType[allStubCodes.Length]; - for (int n = 0; n < allStubCodes.Length; n++) { - if (allCodesInQuery.IndexOf(allStubCodes[n]) < 0) { + for (int n = 0; n < allStubCodes.Length; n++) + { + if (allCodesInQuery.IndexOf(allStubCodes[n]) < 0) + { throw new System.ApplicationException("Error: No code in query matches code for stub presentation '" + allStubCodes[n] + "'"); - } else { + } + else + { allCodesInQuery.Remove(allStubCodes[n]); } this.Presentation.Stub[n] = new AxisType(allStubCodes[n], n); } } //what to do with leftovers? - foreach (string leftoverCode in allCodesInQuery) { + foreach (string leftoverCode in allCodesInQuery) + { log.Info("Code: '" + leftoverCode + "' is not in stub nor heading"); } } - public void WriteToFile(string outfile) { + public void WriteToFile(string outfile) + { System.Xml.Serialization.XmlSerializer mySer = new System.Xml.Serialization.XmlSerializer(typeof(PCAxis.Sql.Pxs.PxsQuery)); StreamWriter myWriter = new StreamWriter(outfile); mySer.Serialize(myWriter, this); @@ -199,29 +230,35 @@ public object Clone() } - public partial class BasicValueType { + public partial class BasicValueType + { public BasicValueType() { } - public BasicValueType(string valueCode, int sortOrder) { + public BasicValueType(string valueCode, int sortOrder) + { this.code = valueCode; this.sortOrder = sortOrder; } } - public partial class ValueTypeWithGroup { + public partial class ValueTypeWithGroup + { public ValueTypeWithGroup() { } - public ValueTypeWithGroup(string valueCode, int sortOrder) { + public ValueTypeWithGroup(string valueCode, int sortOrder) + { this.code = valueCode; this.sortOrder = sortOrder; } } - public partial class AxisType { + public partial class AxisType + { public AxisType() { } - public AxisType(string code, int index) { + public AxisType(string code, int index) + { this.code = code; this.index = index; } @@ -251,9 +288,9 @@ public StringCollection GetCodesNoWildcards() } return myOut; } - + } - + } diff --git a/PCAxis.Sql/QueryLib_21/HandmadeRows/FootNoteRows.cs b/PCAxis.Sql/QueryLib_21/HandmadeRows/FootNoteRows.cs index a7745ac..9d04c5b 100644 --- a/PCAxis.Sql/QueryLib_21/HandmadeRows/FootNoteRows.cs +++ b/PCAxis.Sql/QueryLib_21/HandmadeRows/FootNoteRows.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; using System.Data; -using PCAxis.Sql.DbClient; //For executing SQLs. + using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; //using PCAxis.Sql.QueryLib; -using log4net; namespace PCAxis.Sql.QueryLib_21 diff --git a/PCAxis.Sql/QueryLib_21/HandmadeRows/MainTableVariableRow.cs b/PCAxis.Sql/QueryLib_21/HandmadeRows/MainTableVariableRow.cs index a926446..2890d26 100644 --- a/PCAxis.Sql/QueryLib_21/HandmadeRows/MainTableVariableRow.cs +++ b/PCAxis.Sql/QueryLib_21/HandmadeRows/MainTableVariableRow.cs @@ -1,22 +1,24 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Data; + using PCAxis.Sql.DbConfig; -namespace PCAxis.Sql.QueryLib_21 { +namespace PCAxis.Sql.QueryLib_21 +{ /// /// Holds the attributes for reduced version SubTableVariable. /// - public class MainTableVariableRow { + public class MainTableVariableRow + { + + public static string sqlString(SqlDbConfig_21 DB, string aMainTable) + { - public static string sqlString(SqlDbConfig_21 DB, string aMainTable) { - string currentMethod = "MainTableVariableRow.sqlString"; SqlDbConfig_21.TblSubTableVariable stv = DB.SubTableVariable; - return "SELECT DISTINCT " + stv.VariableCol.ForSelect() + ", " + + return "SELECT DISTINCT " + stv.VariableCol.ForSelect() + ", " + stv.VariableTypeCol.ForSelect() + "," + stv.StoreColumnNoCol.ForSelect() + " /*** SQLID: " + currentMethod + "_01 ***/ " + @@ -29,12 +31,14 @@ public static string sqlString(SqlDbConfig_21 DB, string aMainTable) { } private String mVariable; - public String Variable { + public String Variable + { get { return mVariable; } } private String mVariableType; - public String VariableType { + public String VariableType + { get { return mVariableType; } } @@ -43,7 +47,8 @@ public String StoreColumnNo { get { return mStoreColumnNo; } } - public MainTableVariableRow(DataRow myRow, SqlDbConfig_21 dbconf, string metaModel) { + public MainTableVariableRow(DataRow myRow, SqlDbConfig_21 dbconf, string metaModel) + { this.mVariable = myRow[dbconf.SubTableVariable.VariableCol.Label()].ToString(); this.mVariableType = myRow[dbconf.SubTableVariable.VariableTypeCol.Label()].ToString(); this.mStoreColumnNo = myRow[dbconf.SubTableVariable.StoreColumnNoCol.Label()].ToString(); diff --git a/PCAxis.Sql/QueryLib_21/IMetaVersionComparator.cs b/PCAxis.Sql/QueryLib_21/IMetaVersionComparator.cs index 4713099..e0dae5a 100644 --- a/PCAxis.Sql/QueryLib_21/IMetaVersionComparator.cs +++ b/PCAxis.Sql/QueryLib_21/IMetaVersionComparator.cs @@ -1,6 +1,7 @@ -using System; -namespace PCAxis.Sql.QueryLib_21 { - public interface IMetaVersionComparator { +namespace PCAxis.Sql.QueryLib_21 +{ + public interface IMetaVersionComparator + { /// /// To determin if a feature( table/ column) should exists. /// diff --git a/PCAxis.Sql/QueryLib_21/MetaQuery.cs b/PCAxis.Sql/QueryLib_21/MetaQuery.cs index 40c0930..f8decac 100644 --- a/PCAxis.Sql/QueryLib_21/MetaQuery.cs +++ b/PCAxis.Sql/QueryLib_21/MetaQuery.cs @@ -1,21 +1,15 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; - using System.Data; //For DataSet-objects. -using System.Reflection; //For MethodBase.GetCurrentMethod(). - using System.Globalization;// for CultureInfo +using System.Reflection; //For MethodBase.GetCurrentMethod(). +using log4net; using PCAxis.Sql.DbClient; //For executing SQLs. using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; - - -using log4net; using PCAxis.Sql.Exceptions; -using System.Linq; namespace PCAxis.Sql.QueryLib_21 @@ -25,15 +19,15 @@ namespace PCAxis.Sql.QueryLib_21 ///
public partial class MetaQuery : IMetaVersionComparator { - private static readonly ILog log = LogManager.GetLogger(typeof(MetaQuery)); + private static readonly ILog log = LogManager.GetLogger(typeof(MetaQuery)); #if DEBUG - private static readonly log4net.ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(),"LogTime"); + private static readonly log4net.ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(), "LogTime"); #endif - - + + #region Properties and member variables - - + + private readonly PxSqlCommand mSqlCommand; private StringCollection mLanguageCodes; @@ -72,7 +66,7 @@ public string Md #endregion - + #region Constructors public MetaQuery(SqlDbConfig_21 config, InfoForDbConnection selectedDbInfo) { @@ -116,15 +110,15 @@ public string GetDataTablesPrefix(string aProductId) } - - + + /// Gets the languages for which the maintable exists in the database. /// /// The maintable /// All the languages in the database(from dbconfig-xmlfila) /// the languages for which the maintable exists in the database. - + public StringCollection GetLanguagesForMainTable(string mainTableId, StringCollection dbLanguages) { StringCollection maintableLanguages = new StringCollection(); @@ -201,7 +195,7 @@ public List GetValueSetRows2(string MainTable, string Variable) string sqlString = "SELECT DISTINCT " + DB.ValueSet.ValueSetCol.ForSelect() + ", "; - + if (metaVersionGE("2.1")) { sqlString += DB.ValueSet.PresTextCol.ForSelect() + ", "; @@ -322,7 +316,7 @@ public DataSet GetValueWildCardBySubTable(string mainTable, string variable, str public ValueRowDictionary GetValueRowDictionary(string mainTable, StringCollection subTables, string variable, StringCollection someValueCodes, string valueExtraExists) { - + //SqlDbConfig dbconf = DB; // piv added DISTINCT @@ -335,7 +329,7 @@ public ValueRowDictionary GetValueRowDictionary(string mainTable, StringCollecti //TODO: Creating tempTable should be kept for reuse in the datapart string myVariableNumber = "007"; string tempTabId = mSqlCommand.MakeTempTableJustValues(variable, myVariableNumber, DB.Database.Connection.useTemporaryTables, someValueCodes); - + string subTablesString = this.prepareForInClause(subTables); @@ -428,11 +422,11 @@ public ValueRowDictionary GetValueRowDictionary(string mainTable, StringCollecti + ", " + DB.VSValue.ValueCode + " AS " + DB.Value.ValueCode + ", " + DB.VSValue.SortCode + " AS SortCodeVsValue" + " FROM " + DB.MetaOwner + DB.VSValue.TableName - + ") bz ON (bx." + DB.Value.ValuePool + " = bz." + DB.Value.ValuePool + " AND bx." + DB.Value.ValueCode + " = bz." + DB.Value.ValueCode + ")"; + + ") bz ON (bx." + DB.Value.ValuePool + " = bz." + DB.Value.ValuePool + " AND bx." + DB.Value.ValueCode + " = bz." + DB.Value.ValueCode + ")"; sqlString += " JOIN " + DB.MetaOwner + DB.SubTableVariable.TableName + " " + DB.SubTableVariable.Alias + " ON (bz." + DB.VSValue.ValueSet + " = " + DB.SubTableVariable.Alias + "." + DB.SubTableVariable.ValueSet + ")"; sqlString += " JOIN " + tempTabId - + " ON bx." + DB.Value.ValueCode + "="+tempTabId+".Group" + myVariableNumber+" "; + + " ON bx." + DB.Value.ValueCode + "=" + tempTabId + ".Group" + myVariableNumber + " "; #region where section sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(mainTable); @@ -445,7 +439,7 @@ public ValueRowDictionary GetValueRowDictionary(string mainTable, StringCollecti sqlString += " AND " + DB.SubTableVariable.VariableCol.Is(variable); - + #endregion where section @@ -1261,14 +1255,14 @@ public List GetVSGroupRowsSorted(string aValuePool, StringCollection sqlString += " ORDER BY " + DB.VSGroup.SortCodeCol.Id() + ", " + DB.VSGroup.GroupCodeCol.Id() + ", " + DB.Value.SortCodeCol.Id(); - + } else { sqlString += " ORDER BY " + DB.VSGroupLang2.SortCodeCol.Id(sortOrderLanguage) + ", " + DB.VSGroup.GroupCodeCol.Id() + ", " + - DB.ValueLang2.SortCodeCol.Id(sortOrderLanguage); + DB.ValueLang2.SortCodeCol.Id(sortOrderLanguage); } diff --git a/PCAxis.Sql/QueryLib_21/MetaQuery_for_PxsSqlData.cs b/PCAxis.Sql/QueryLib_21/MetaQuery_for_PxsSqlData.cs index 33147f2..e3b26ca 100644 --- a/PCAxis.Sql/QueryLib_21/MetaQuery_for_PxsSqlData.cs +++ b/PCAxis.Sql/QueryLib_21/MetaQuery_for_PxsSqlData.cs @@ -1,14 +1,10 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Text; -using System.Xml.XPath; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; - using System.Collections.Specialized; +using System.Data; using System.Reflection; + +using PCAxis.Sql.Exceptions; using PCAxis.Sql.Parser_21; @@ -25,7 +21,8 @@ public partial class MetaQuery : IDisposable //flytt til hoved - public void Dispose() { + public void Dispose() + { this.DropTempTables(); mSqlCommand.Dispose(); } @@ -33,19 +30,24 @@ public void Dispose() { #region wildcards in groupvalues - public StringCollection GetValueWildCardByGrouping(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) { + public StringCollection GetValueWildCardByGrouping(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) + { // Resolve wildcards here StringCollection myOut = new StringCollection(); DataSet ds; - if (String.Compare(DB.MetaModel, "2.1", false, System.Globalization.CultureInfo.InvariantCulture) > 0) { + if (String.Compare(DB.MetaModel, "2.1", false, System.Globalization.CultureInfo.InvariantCulture) > 0) + { // Datamodel > 2.1, new table structure ds = this.GetValueWildCardByGrouping22(mainTable, variable, subTable, grouping, groupCode, wildCard); - } else { + } + else + { // Datamodel 2.1 or older, the old table structure. Use of Grouping is only valid if a SubTable is selected ds = this.GetValueWildCardByGrouping21(mainTable, variable, subTable, grouping, groupCode, wildCard); } DataRowCollection mValueInfo = ds.Tables[0].Rows; - foreach (DataRow row in mValueInfo) { + foreach (DataRow row in mValueInfo) + { myOut.Add(row[DB.VSGroup.ValueCode].ToString()); } return myOut; @@ -54,7 +56,8 @@ public StringCollection GetValueWildCardByGrouping(string mainTable, string vari - private DataSet GetValueWildCardByGrouping21(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) { + private DataSet GetValueWildCardByGrouping21(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) + { // To ensure that the correct grouping is used mainTable and variable has to be included // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -76,11 +79,11 @@ private DataSet GetValueWildCardByGrouping21(string mainTable, string variable, "/*** SQLID: " + currentMethod + "_01 ***/ " + "FROM " + DB.VSGroup.GetNameAndAlias() + " JOIN " + DB.SubTableVariable.GetNameAndAlias() + - " ON " + DB.VSGroup.ValueSetCol.Is( DB.SubTableVariable.ValueSetCol) + - " WHERE " + DB.SubTableVariable.MainTableCol.Is(mainTable) + + " ON " + DB.VSGroup.ValueSetCol.Is(DB.SubTableVariable.ValueSetCol) + + " WHERE " + DB.SubTableVariable.MainTableCol.Is(mainTable) + " AND " + DB.SubTableVariable.VariableCol.Is(variable) + " AND " + DB.SubTableVariable.SubTableCol.Is(subTable) + - " AND " + DB.VSGroup.GroupingCol.Is(grouping)+ + " AND " + DB.VSGroup.GroupingCol.Is(grouping) + " AND " + DB.VSGroup.GroupCodeCol.Is(groupCode) + " AND " + DB.VSGroup.ValueCodeCol.Like(wildCard); @@ -90,7 +93,8 @@ private DataSet GetValueWildCardByGrouping21(string mainTable, string variable, - private DataSet GetValueWildCardByGrouping22(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) { + private DataSet GetValueWildCardByGrouping22(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) + { // To ensure that the correct grouping is used mainTable and variable has to be included // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -162,7 +166,7 @@ public string MakeTempTable(string VariableName, string VariableNumber, IList values, int numberInBulk) { - + string currentMethod = MethodBase.GetCurrentMethod().Name; StringCollection sqlStrings = new StringCollection(); - + int ValuesCounter = 0; - + foreach (PXSqlValue value in values) { @@ -344,24 +354,36 @@ private void InsertIntoTempTablesBulk(string tempTabellId, IList gro /// Hmm, perhaps auxiliary tables would have been a better word. /// Temporary Table in Oracle is a permanent table with temorary rows ///
- public void DropTempTables() { - - if (!DB.UseTemporaryTables) { - foreach (string tableName in dropTheseTables) { - try { + public void DropTempTables() + { + + if (!DB.UseTemporaryTables) + { + foreach (string tableName in dropTheseTables) + { + try + { mSqlCommand.ExecuteNonQuery("DROP TABLE " + tableName); - } catch (Exception e) { + } + catch (Exception e) + { log.Error("DROP TABLE failed:", e); //don't want to stop because of this... } } - } else if (mSqlCommand.getProgramMustTruncAndDropTempTable()) { - foreach (string tableName in dropTheseTables) { - try { + } + else if (mSqlCommand.getProgramMustTruncAndDropTempTable()) + { + foreach (string tableName in dropTheseTables) + { + try + { mSqlCommand.ExecuteNonQuery("TRUNCATE TABLE " + tableName); mSqlCommand.ExecuteNonQuery("DROP TABLE " + tableName); - } catch (Exception e) { + } + catch (Exception e) + { log.Error("TRUNC or DROP TABLE failed:", e); //don't want to stop because of this... } @@ -371,7 +393,8 @@ public void DropTempTables() { } - public DataRowCollection ExecuteSelect(string sqlString) { + public DataRowCollection ExecuteSelect(string sqlString) + { DataSet ds = mSqlCommand.ExecuteSelect(sqlString); return ds.Tables[0].Rows; } diff --git a/PCAxis.Sql/QueryLib_21/MetaQuery_partial.cs b/PCAxis.Sql/QueryLib_21/MetaQuery_partial.cs index 1129c59..6dbaf3d 100644 --- a/PCAxis.Sql/QueryLib_21/MetaQuery_partial.cs +++ b/PCAxis.Sql/QueryLib_21/MetaQuery_partial.cs @@ -1,15 +1,11 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; using System.Data; using System.Reflection; using PCAxis.Sql.Parser_21; -using System.Collections.Specialized; - namespace PCAxis.Sql.QueryLib_21 { /// @@ -21,12 +17,14 @@ public partial class MetaQuery #region all timevalues - public PxSqlValues GetAllTimeValuesList(string mainTable, string sortOrder) { + public PxSqlValues GetAllTimeValuesList(string mainTable, string sortOrder) + { DataSet ds = this.GetAllTimeValues(mainTable, sortOrder); return GetTimeValues(mainTable, ds, true); } - public DataSet GetAllTimeValues(string mainTable, string sortOrder) { + public DataSet GetAllTimeValues(string mainTable, string sortOrder) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -46,17 +44,20 @@ public DataSet GetAllTimeValues(string mainTable, string sortOrder) { #region fixed list of timevalues //For mPxsFile.Query.Time.TimeOption == 0 - public PxSqlValues GetTimeValueList(string mainTable, Dictionary mySelectedValues) { + public PxSqlValues GetTimeValueList(string mainTable, Dictionary mySelectedValues) + { DataSet ds = this.GetTimeValues(mainTable, mySelectedValues.Keys); PxSqlValues myOut = GetTimeValues(mainTable, ds, false); - - foreach (KeyValuePair time in mySelectedValues) { + + foreach (KeyValuePair time in mySelectedValues) + { // Check to se if the value exist. If it was specified in the pxs, but is not present in the // database it will not exist. Maybe this check should be replaced by an exception handling // due to preformance. - if (myOut.ContainsKey(time.Key)) { + if (myOut.ContainsKey(time.Key)) + { myOut[time.Key].SortCodePxs = time.Value; } } @@ -65,7 +66,8 @@ public PxSqlValues GetTimeValueList(string mainTable, Dictionary m return myOut; } - private DataSet GetTimeValues(string mainTable, ICollection valuesFromPxs) { + private DataSet GetTimeValues(string mainTable, ICollection valuesFromPxs) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -90,7 +92,7 @@ private DataSet GetTimeValues(string mainTable, ICollection valuesFromPx "/*** SQLID: " + currentMethod + "_01 ***/ " + " FROM " + DB.ContentsTime.GetNameAndAlias() + " WHERE " + DB.ContentsTime.MainTableCol.Is(mainTable) + - " AND " + DB.ContentsTime.TimePeriodCol.In(valuesFromPxs); + " AND " + DB.ContentsTime.TimePeriodCol.In(valuesFromPxs); // Execute the SQL and return the result (records) as a System.Data.DataSet-object. return mSqlCommand.ExecuteSelect(sqlString); @@ -98,12 +100,14 @@ private DataSet GetTimeValues(string mainTable, ICollection valuesFromPx #endregion fixed list of timevalues #region the last timevalue ( N=1 below) - public PxSqlValues GetTimeValueList(string mainTable) { + public PxSqlValues GetTimeValueList(string mainTable) + { DataSet ds = this.GetTimeValues(mainTable); return GetTimeValues(mainTable, ds, true); } - - private DataSet GetTimeValues(string mainTable) { + + private DataSet GetTimeValues(string mainTable) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -131,13 +135,15 @@ private DataSet GetTimeValues(string mainTable) { #endregion the last timevalue #region last N timevalues - public PxSqlValues GetTimeValueList(string mainTable, int NoOfTimeValues) { - DataSet ds = this.GetTimeValues(mainTable,NoOfTimeValues); - return GetTimeValues(mainTable, ds, true); + public PxSqlValues GetTimeValueList(string mainTable, int NoOfTimeValues) + { + DataSet ds = this.GetTimeValues(mainTable, NoOfTimeValues); + return GetTimeValues(mainTable, ds, true); } - private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { + private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -185,12 +191,14 @@ private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { #region from start timevalue - public PxSqlValues GetTimeValueList(string mainTable, string StartTimeValue) { - DataSet ds = this.GetTimeValues(mainTable,StartTimeValue); + public PxSqlValues GetTimeValueList(string mainTable, string StartTimeValue) + { + DataSet ds = this.GetTimeValues(mainTable, StartTimeValue); return GetTimeValues(mainTable, ds, true); } - private DataSet GetTimeValues(string mainTable, string StartTimeValue) { + private DataSet GetTimeValues(string mainTable, string StartTimeValue) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -230,24 +238,28 @@ private DataSet GetTimeValues(string mainTable, string StartTimeValue) { /// The Dataset /// Sets SortCodePxs to a counter. True for all ((int)mPxsFile.Query.Time.TimeOption != 0). /// - private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode) { + private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode) + { PxSqlValues myOut = new PxSqlValues(); DataRowCollection rows = ds.Tables[0].Rows; //Todo; fix exception - if (rows.Count <= 0) { + if (rows.Count <= 0) + { throw new ApplicationException("tabellen " + mainTable + " inneholder ikke data. (ingen tider)"); } int timeSortOrder = 0; string timeCode = ""; - foreach (DataRow row in rows) { + foreach (DataRow row in rows) + { timeCode = row[this.DB.ContentsTime.TimePeriod].ToString(); PXSqlValue mValue = new PXSqlValue(timeCode, LanguageCodes); - if (setSortCode) { + if (setSortCode) + { mValue.SortCodePxs = timeSortOrder; timeSortOrder++; } @@ -260,9 +272,9 @@ private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode #endregion Time stuff - - + + } - + } diff --git a/PCAxis.Sql/QueryLib_21/fra_master2MetaQuery.cs b/PCAxis.Sql/QueryLib_21/fra_master2MetaQuery.cs index 42c5353..3377d1a 100644 --- a/PCAxis.Sql/QueryLib_21/fra_master2MetaQuery.cs +++ b/PCAxis.Sql/QueryLib_21/fra_master2MetaQuery.cs @@ -1,22 +1,20 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //using PCAxis.Sql.QueryLib; //This code is generated. Not anymore! -namespace PCAxis.Sql.QueryLib_21 { +namespace PCAxis.Sql.QueryLib_21 +{ - public partial class MetaQuery { + public partial class MetaQuery + { #region for Contents - public Dictionary GetContentsRows(string aMainTable) { + public Dictionary GetContentsRows(string aMainTable) + { Dictionary myOut = new Dictionary(); SqlDbConfig dbconf = DB; string sqlString = GetContents_SQLString_NoWhere(); @@ -28,21 +26,25 @@ public Dictionary GetContentsRows(string aMainTable) { DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + if (myRows.Count < 1) + { + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } - foreach (DataRow sqlRow in myRows) { - ContentsRow outRow = new ContentsRow(sqlRow, DB, mLanguageCodes, (IMetaVersionComparator) this); + foreach (DataRow sqlRow in myRows) + { + ContentsRow outRow = new ContentsRow(sqlRow, DB, mLanguageCodes, (IMetaVersionComparator)this); myOut.Add(outRow.Contents, outRow); } return myOut; } - private String GetContents_SQLString_NoWhere() { + private String GetContents_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; - if( metaVersionGE("2.1")) { + if (metaVersionGE("2.1")) + { sqlString += DB.Contents.PresMissingLineCol.ForSelect() + " , "; } @@ -78,8 +80,10 @@ private String GetContents_SQLString_NoWhere() { DB.Contents.StoreColumnNoCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.ContentsLang2.PresTextCol.ForSelectWithFallback(langCode, DB.Contents.PresTextCol); sqlString += ", " + DB.ContentsLang2.PresTextSCol.ForSelectWithFallback(langCode, DB.Contents.PresTextSCol); sqlString += ", " + DB.ContentsLang2.UnitCol.ForSelectWithFallback(langCode, DB.Contents.UnitCol); @@ -91,9 +95,11 @@ private String GetContents_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetContentsRows_01 ***" + "/ "; sqlString += " FROM " + DB.Contents.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ContentsLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.ContentsLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Contents.MainTableCol.Is(DB.ContentsLang2.MainTableCol, langCode) + " AND " + DB.Contents.ContentsCol.Is(DB.ContentsLang2.ContentsCol, langCode); } @@ -106,23 +112,26 @@ private String GetContents_SQLString_NoWhere() { #region for DataStorage //returns the single "row" found when all PKs are spesified - public DataStorageRow GetDataStorageRow(string aProductId) { + public DataStorageRow GetDataStorageRow(string aProductId) + { //SqlDbConfig dbconf = DB; string sqlString = GetDataStorage_SQLString_NoWhere(); - sqlString += " WHERE " + DB.DataStorage.ProductIdCol.Is(aProductId) ; + sqlString += " WHERE " + DB.DataStorage.ProductIdCol.Is(aProductId); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ProductId = " + aProductId); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " ProductId = " + aProductId); } - DataStorageRow myOut = new DataStorageRow(myRows[0], DB, (IMetaVersionComparator) this); + DataStorageRow myOut = new DataStorageRow(myRows[0], DB, (IMetaVersionComparator)this); return myOut; } - private String GetDataStorage_SQLString_NoWhere() { + private String GetDataStorage_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -141,24 +150,27 @@ private String GetDataStorage_SQLString_NoWhere() { #region for Grouping //returns the single "row" found when all PKs are spesified - public GroupingRow GetGroupingRow(string aValuePool, string aGrouping) { + public GroupingRow GetGroupingRow(string aValuePool, string aGrouping) + { //SqlDbConfig dbconf = DB; string sqlString = GetGrouping_SQLString_NoWhere(); - sqlString += " WHERE " + DB.Grouping.GroupingCol.Is(aGrouping) + - " AND " +DB.Grouping.ValuePoolCol.Is(aValuePool) ; + sqlString += " WHERE " + DB.Grouping.GroupingCol.Is(aGrouping) + + " AND " + DB.Grouping.ValuePoolCol.Is(aValuePool); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValuePool = " + aValuePool + " Grouping = " + aGrouping); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " ValuePool = " + aValuePool + " Grouping = " + aGrouping); } - GroupingRow myOut = new GroupingRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + GroupingRow myOut = new GroupingRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } - private String GetGrouping_SQLString_NoWhere() { + private String GetGrouping_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -174,8 +186,10 @@ private String GetGrouping_SQLString_NoWhere() { DB.Grouping.SortCodeCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.GroupingLang2.PresTextCol.ForSelectWithFallback(langCode, DB.Grouping.PresTextCol); sqlString += ", " + DB.GroupingLang2.SortCodeCol.ForSelectWithFallback(langCode, DB.Grouping.SortCodeCol); } @@ -184,9 +198,11 @@ private String GetGrouping_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetGroupingRow_01 ***" + "/ "; sqlString += " FROM " + DB.Grouping.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.GroupingLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.GroupingLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Grouping.GroupingCol.Is(DB.GroupingLang2.GroupingCol, langCode) + " AND " + DB.Grouping.ValuePoolCol.Is(DB.GroupingLang2.ValuePoolCol, langCode); } @@ -199,27 +215,31 @@ private String GetGrouping_SQLString_NoWhere() { #region for MainTable //returns the single "row" found when all PKs are spesified - public MainTableRow GetMainTableRow(string aMainTable) { + public MainTableRow GetMainTableRow(string aMainTable) + { //SqlDbConfig dbconf = DB; string sqlString = GetMainTable_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MainTable.MainTableCol.Is(aMainTable) ; + sqlString += " WHERE " + DB.MainTable.MainTableCol.Is(aMainTable); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable); } - MainTableRow myOut = new MainTableRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + MainTableRow myOut = new MainTableRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } - private String GetMainTable_SQLString_NoWhere() { + private String GetMainTable_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; - if( metaVersionLE("2.0")) { + if (metaVersionLE("2.0")) + { sqlString += DB.MainTable.StatusEngCol.ForSelect() + " , "; } @@ -237,14 +257,16 @@ private String GetMainTable_SQLString_NoWhere() { DB.MainTable.TimeScaleCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.MainTableLang2.PresTextCol.ForSelectWithFallback(langCode, DB.MainTable.PresTextCol); sqlString += ", " + DB.MainTableLang2.PresTextSCol.ForSelectWithFallback(langCode, DB.MainTable.PresTextSCol); sqlString += ", " + DB.MainTableLang2.ContentsVariableCol.ForSelectWithFallback(langCode, DB.MainTable.ContentsVariableCol); if (metaVersionGE("2.1")) { - sqlString += " , " + DB.MainTableLang2.StatusCol.ForSelect(langCode); + sqlString += " , " + DB.MainTableLang2.StatusCol.ForSelect(langCode); } } } @@ -252,9 +274,11 @@ private String GetMainTable_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetMainTableRow_01 ***" + "/ "; sqlString += " FROM " + DB.MainTable.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.MainTableLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.MainTableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.MainTable.MainTableCol.Is(DB.MainTableLang2.MainTableCol, langCode); } } @@ -265,7 +289,8 @@ private String GetMainTable_SQLString_NoWhere() { #endregion for MainTable #region for MainTablePerson - public Dictionary GetMainTablePersonRows(string aMainTable, string aRolePerson) { + public Dictionary GetMainTablePersonRows(string aMainTable, string aRolePerson) + { Dictionary myOut = new Dictionary(); SqlDbConfig dbconf = DB; @@ -274,25 +299,28 @@ public Dictionary GetMainTablePersonRows(string aMai // WHERE MTP.MainTable = '' // AND MTP.RolePerson = '' // - sqlString += " WHERE " + DB.MainTablePerson.MainTableCol.Is(aMainTable) + - " AND " +DB.MainTablePerson.RolePersonCol.Is(aRolePerson); + sqlString += " WHERE " + DB.MainTablePerson.MainTableCol.Is(aMainTable) + + " AND " + DB.MainTablePerson.RolePersonCol.Is(aRolePerson); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; //Only Role Head and Updated must exist - if (myRows.Count < 1 && (aRolePerson.Equals(DB.Codes.RoleHead, StringComparison.InvariantCultureIgnoreCase) || aRolePerson.Equals(DB.Codes.RoleUpdate, StringComparison.InvariantCultureIgnoreCase))) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " RolePerson = " + aRolePerson); + if (myRows.Count < 1 && (aRolePerson.Equals(DB.Codes.RoleHead, StringComparison.InvariantCultureIgnoreCase) || aRolePerson.Equals(DB.Codes.RoleUpdate, StringComparison.InvariantCultureIgnoreCase))) + { + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " RolePerson = " + aRolePerson); } - foreach (DataRow sqlRow in myRows) { - MainTablePersonRow outRow = new MainTablePersonRow(sqlRow, DB, (IMetaVersionComparator) this); + foreach (DataRow sqlRow in myRows) + { + MainTablePersonRow outRow = new MainTablePersonRow(sqlRow, DB, (IMetaVersionComparator)this); myOut.Add(outRow.PersonCode, outRow); } return myOut; } - private String GetMainTablePerson_SQLString_NoWhere() { + private String GetMainTablePerson_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -312,24 +340,27 @@ private String GetMainTablePerson_SQLString_NoWhere() { #region for MenuSelection /* For SubjectArea*/ //returns the single "row" found when all PKs are spesified - public MenuSelectionRow GetMenuSelectionRow(string aMenu, string aSelection) { + public MenuSelectionRow GetMenuSelectionRow(string aMenu, string aSelection) + { //SqlDbConfig dbconf = DB; string sqlString = GetMenuSelection_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MenuSelection.MenuCol.Is(aMenu) + - " AND " +DB.MenuSelection.SelectionCol.Is(aSelection) ; + sqlString += " WHERE " + DB.MenuSelection.MenuCol.Is(aMenu) + + " AND " + DB.MenuSelection.SelectionCol.Is(aSelection); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Menu = " + aMenu + " Selection = " + aSelection); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " Menu = " + aMenu + " Selection = " + aSelection); } - MenuSelectionRow myOut = new MenuSelectionRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + MenuSelectionRow myOut = new MenuSelectionRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } - private String GetMenuSelection_SQLString_NoWhere() { + private String GetMenuSelection_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -346,8 +377,10 @@ private String GetMenuSelection_SQLString_NoWhere() { DB.MenuSelection.InternalIdCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.MenuSelectionLang2.PresTextCol.ForSelectWithFallback(langCode, DB.MenuSelection.PresTextCol); sqlString += ", " + DB.MenuSelectionLang2.PresTextSCol.ForSelectWithFallback(langCode, DB.MenuSelection.PresTextSCol); sqlString += ", " + DB.MenuSelectionLang2.DescriptionCol.ForSelectWithFallback(langCode, DB.MenuSelection.DescriptionCol); @@ -359,9 +392,11 @@ private String GetMenuSelection_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetMenuSelectionRow_01 ***" + "/ "; sqlString += " FROM " + DB.MenuSelection.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.MenuSelectionLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.MenuSelectionLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.MenuSelection.MenuCol.Is(DB.MenuSelectionLang2.MenuCol, langCode) + " AND " + DB.MenuSelection.SelectionCol.Is(DB.MenuSelectionLang2.SelectionCol, langCode); } @@ -374,42 +409,48 @@ private String GetMenuSelection_SQLString_NoWhere() { #region for MetaAdm //returns the single "row" found when all PKs are spesified - public MetaAdmRow GetMetaAdmRow(string aProperty) { + public MetaAdmRow GetMetaAdmRow(string aProperty) + { //SqlDbConfig dbconf = DB; string sqlString = GetMetaAdm_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MetaAdm.PropertyCol.IsUppered(aProperty) ; + sqlString += " WHERE " + DB.MetaAdm.PropertyCol.IsUppered(aProperty); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Property = " + aProperty); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " Property = " + aProperty); } - MetaAdmRow myOut = new MetaAdmRow(myRows[0], DB, (IMetaVersionComparator) this); + MetaAdmRow myOut = new MetaAdmRow(myRows[0], DB, (IMetaVersionComparator)this); return myOut; } //returns the all "rows" found in database - public Dictionary GetMetaAdmAllRows() { + public Dictionary GetMetaAdmAllRows() + { string sqlString = GetMetaAdm_SQLString_NoWhere(); Dictionary myOut = new Dictionary(); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1) { + if (myRows.Count < 1) + { throw new PCAxis.Sql.Exceptions.DbException(44, "MetaAdm", "METAADM"); } - foreach (DataRow sqlRow in myRows) { - MetaAdmRow outRow = new MetaAdmRow(sqlRow, DB, (IMetaVersionComparator) this ); + foreach (DataRow sqlRow in myRows) + { + MetaAdmRow outRow = new MetaAdmRow(sqlRow, DB, (IMetaVersionComparator)this); myOut.Add(outRow.Property, outRow); } return myOut; } - private String GetMetaAdm_SQLString_NoWhere() { + private String GetMetaAdm_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -427,23 +468,26 @@ private String GetMetaAdm_SQLString_NoWhere() { #region for MetabaseInfo //returns the single "row" found when all PKs are spesified - public MetabaseInfoRow GetMetabaseInfoRow(string aModel) { + public MetabaseInfoRow GetMetabaseInfoRow(string aModel) + { //SqlDbConfig dbconf = DB; string sqlString = GetMetabaseInfo_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MetabaseInfo.ModelCol.IsUppered(aModel) ; + sqlString += " WHERE " + DB.MetabaseInfo.ModelCol.IsUppered(aModel); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Model = " + aModel); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " Model = " + aModel); } - MetabaseInfoRow myOut = new MetabaseInfoRow(myRows[0], DB, (IMetaVersionComparator) this); + MetabaseInfoRow myOut = new MetabaseInfoRow(myRows[0], DB, (IMetaVersionComparator)this); return myOut; } - private String GetMetabaseInfo_SQLString_NoWhere() { + private String GetMetabaseInfo_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -462,26 +506,30 @@ private String GetMetabaseInfo_SQLString_NoWhere() { #region for Organization //returns the single "row" found when all PKs are spesified - public OrganizationRow GetOrganizationRow(string aOrganizationCode) { + public OrganizationRow GetOrganizationRow(string aOrganizationCode) + { //SqlDbConfig dbconf = DB; string sqlString = GetOrganization_SQLString_NoWhere(); - sqlString += " WHERE " + DB.Organization.OrganizationCodeCol.Is(aOrganizationCode) ; + sqlString += " WHERE " + DB.Organization.OrganizationCodeCol.Is(aOrganizationCode); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," OrganizationCode = " + aOrganizationCode); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " OrganizationCode = " + aOrganizationCode); } - OrganizationRow myOut = new OrganizationRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + OrganizationRow myOut = new OrganizationRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } - private String GetOrganization_SQLString_NoWhere() { + private String GetOrganization_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; - if( metaVersionGE("2.1")) { + if (metaVersionGE("2.1")) + { sqlString += DB.Organization.WebAddressCol.ForSelect() + " , "; } @@ -494,8 +542,10 @@ private String GetOrganization_SQLString_NoWhere() { DB.Organization.InternalIdCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.OrganizationLang2.OrganizationNameCol.ForSelectWithFallback(langCode, DB.Organization.OrganizationNameCol); sqlString += ", " + DB.OrganizationLang2.DepartmentCol.ForSelectWithFallback(langCode, DB.Organization.DepartmentCol); sqlString += ", " + DB.OrganizationLang2.UnitCol.ForSelectWithFallback(langCode, DB.Organization.UnitCol); @@ -505,9 +555,11 @@ private String GetOrganization_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetOrganizationRow_01 ***" + "/ "; sqlString += " FROM " + DB.Organization.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.OrganizationLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.OrganizationLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Organization.OrganizationCodeCol.Is(DB.OrganizationLang2.OrganizationCodeCol, langCode); } } @@ -519,23 +571,26 @@ private String GetOrganization_SQLString_NoWhere() { #region for Person //returns the single "row" found when all PKs are spesified - public PersonRow GetPersonRow(string aPersonCode) { + public PersonRow GetPersonRow(string aPersonCode) + { //SqlDbConfig dbconf = DB; string sqlString = GetPerson_SQLString_NoWhere(); - sqlString += " WHERE " + DB.Person.PersonCodeCol.Is(aPersonCode) ; + sqlString += " WHERE " + DB.Person.PersonCodeCol.Is(aPersonCode); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," PersonCode = " + aPersonCode); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " PersonCode = " + aPersonCode); } - PersonRow myOut = new PersonRow(myRows[0], DB, (IMetaVersionComparator) this); + PersonRow myOut = new PersonRow(myRows[0], DB, (IMetaVersionComparator)this); return myOut; } - private String GetPerson_SQLString_NoWhere() { + private String GetPerson_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -559,48 +614,56 @@ private String GetPerson_SQLString_NoWhere() { #region for SpecialCharacter //returns the single "row" found when all PKs are spesified - public SpecialCharacterRow GetSpecialCharacterRow(string aCharacterType) { + public SpecialCharacterRow GetSpecialCharacterRow(string aCharacterType) + { //SqlDbConfig dbconf = DB; string sqlString = GetSpecialCharacter_SQLString_NoWhere(); - sqlString += " WHERE " + DB.SpecialCharacter.CharacterTypeCol.Is(aCharacterType) ; + sqlString += " WHERE " + DB.SpecialCharacter.CharacterTypeCol.Is(aCharacterType); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," CharacterType = " + aCharacterType); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " CharacterType = " + aCharacterType); } - SpecialCharacterRow myOut = new SpecialCharacterRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + SpecialCharacterRow myOut = new SpecialCharacterRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } //returns the all "rows" found in database - public Dictionary GetSpecialCharacterAllRows() { + public Dictionary GetSpecialCharacterAllRows() + { string sqlString = GetSpecialCharacter_SQLString_NoWhere(); Dictionary myOut = new Dictionary(); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1) { + if (myRows.Count < 1) + { throw new PCAxis.Sql.Exceptions.DbException(44, "SpecialCharacter", "SPECIALTECKEN"); } - foreach (DataRow sqlRow in myRows) { - SpecialCharacterRow outRow = new SpecialCharacterRow(sqlRow, DB, mLanguageCodes, (IMetaVersionComparator) this ); + foreach (DataRow sqlRow in myRows) + { + SpecialCharacterRow outRow = new SpecialCharacterRow(sqlRow, DB, mLanguageCodes, (IMetaVersionComparator)this); myOut.Add(outRow.CharacterType, outRow); } return myOut; } - private String GetSpecialCharacter_SQLString_NoWhere() { + private String GetSpecialCharacter_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; - if( metaVersionGE("2.1")) { + if (metaVersionGE("2.1")) + { sqlString += DB.SpecialCharacter.DataCellPresCol.ForSelect() + " , "; } - if( metaVersionGE("2.1")) { + if (metaVersionGE("2.1")) + { sqlString += DB.SpecialCharacter.DataCellFilledCol.ForSelect() + " , "; } @@ -612,8 +675,10 @@ private String GetSpecialCharacter_SQLString_NoWhere() { DB.SpecialCharacter.PresTextCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.SpecialCharacterLang2.PresCharacterCol.ForSelectWithFallback(langCode, DB.SpecialCharacter.PresCharacterCol); sqlString += ", " + DB.SpecialCharacterLang2.PresTextCol.ForSelectWithFallback(langCode, DB.SpecialCharacter.PresTextCol); } @@ -622,9 +687,11 @@ private String GetSpecialCharacter_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetSpecialCharacterAllRows_01 ***" + "/ "; sqlString += " FROM " + DB.SpecialCharacter.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.SpecialCharacterLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.SpecialCharacterLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.SpecialCharacter.CharacterTypeCol.Is(DB.SpecialCharacterLang2.CharacterTypeCol, langCode); } } @@ -635,7 +702,8 @@ private String GetSpecialCharacter_SQLString_NoWhere() { #endregion for SpecialCharacter #region for SubTable - public Dictionary GetSubTableRows(string aMainTable) { + public Dictionary GetSubTableRows(string aMainTable) + { Dictionary myOut = new Dictionary(); SqlDbConfig dbconf = DB; string sqlString = GetSubTable_SQLString_NoWhere(); @@ -647,18 +715,21 @@ public Dictionary GetSubTableRows(string aMainTable) { DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + if (myRows.Count < 1) + { + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } - foreach (DataRow sqlRow in myRows) { - SubTableRow outRow = new SubTableRow(sqlRow, DB, mLanguageCodes, (IMetaVersionComparator) this); + foreach (DataRow sqlRow in myRows) + { + SubTableRow outRow = new SubTableRow(sqlRow, DB, mLanguageCodes, (IMetaVersionComparator)this); myOut.Add(outRow.SubTable, outRow); } return myOut; } - private String GetSubTable_SQLString_NoWhere() { + private String GetSubTable_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -670,8 +741,10 @@ private String GetSubTable_SQLString_NoWhere() { DB.SubTable.CleanTableCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.SubTableLang2.PresTextCol.ForSelectWithFallback(langCode, DB.SubTable.PresTextCol); } } @@ -679,9 +752,11 @@ private String GetSubTable_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetSubTableRows_01 ***" + "/ "; sqlString += " FROM " + DB.SubTable.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.SubTableLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.SubTableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.SubTable.MainTableCol.Is(DB.SubTableLang2.MainTableCol, langCode) + " AND " + DB.SubTable.SubTableCol.Is(DB.SubTableLang2.SubTableCol, langCode); } @@ -694,24 +769,27 @@ private String GetSubTable_SQLString_NoWhere() { #region for SubTableVariable //returns the single "row" found when all PKs are spesified - public SubTableVariableRow GetSubTableVariableRow(string aMainTable, string aSubTable, string aVariable) { + public SubTableVariableRow GetSubTableVariableRow(string aMainTable, string aSubTable, string aVariable) + { //SqlDbConfig dbconf = DB; string sqlString = GetSubTableVariable_SQLString_NoWhere(); - sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(aMainTable) + - " AND " +DB.SubTableVariable.SubTableCol.Is(aSubTable) + - " AND " +DB.SubTableVariable.VariableCol.Is(aVariable) ; + sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(aMainTable) + + " AND " + DB.SubTableVariable.SubTableCol.Is(aSubTable) + + " AND " + DB.SubTableVariable.VariableCol.Is(aVariable); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable + " SubTable = " + aSubTable + " Variable = " + aVariable); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable + " SubTable = " + aSubTable + " Variable = " + aVariable); } - SubTableVariableRow myOut = new SubTableVariableRow(myRows[0], DB, (IMetaVersionComparator) this); + SubTableVariableRow myOut = new SubTableVariableRow(myRows[0], DB, (IMetaVersionComparator)this); return myOut; } - public Dictionary GetSubTableVariableRowskeyVariable(string aMainTable, string aSubTable) { + public Dictionary GetSubTableVariableRowskeyVariable(string aMainTable, string aSubTable) + { Dictionary myOut = new Dictionary(); SqlDbConfig dbconf = DB; string sqlString = GetSubTableVariable_SQLString_NoWhere(); @@ -719,24 +797,27 @@ public Dictionary GetSubTableVariableRowskeyVariabl // WHERE STV.MainTable = '' // AND STV.SubTable = '' // - sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(aMainTable) + - " AND " +DB.SubTableVariable.SubTableCol.Is(aSubTable); + sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(aMainTable) + + " AND " + DB.SubTableVariable.SubTableCol.Is(aSubTable); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " SubTable = " + aSubTable); + if (myRows.Count < 1) + { + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " SubTable = " + aSubTable); } - foreach (DataRow sqlRow in myRows) { - SubTableVariableRow outRow = new SubTableVariableRow(sqlRow, DB, (IMetaVersionComparator) this); + foreach (DataRow sqlRow in myRows) + { + SubTableVariableRow outRow = new SubTableVariableRow(sqlRow, DB, (IMetaVersionComparator)this); myOut.Add(outRow.Variable, outRow); } return myOut; } - private String GetSubTableVariable_SQLString_NoWhere() { + private String GetSubTableVariable_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -759,7 +840,8 @@ private String GetSubTableVariable_SQLString_NoWhere() { #region for TextCatalog /*This table is not suitable for generated extractions such as Get...*/ - private String GetTextCatalog_SQLString_NoWhere() { + private String GetTextCatalog_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -771,8 +853,10 @@ private String GetTextCatalog_SQLString_NoWhere() { DB.TextCatalog.DescriptionCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.TextCatalogLang2.TextTypeCol.ForSelectWithFallback(langCode, DB.TextCatalog.TextTypeCol); sqlString += ", " + DB.TextCatalogLang2.PresTextCol.ForSelectWithFallback(langCode, DB.TextCatalog.PresTextCol); sqlString += ", " + DB.TextCatalogLang2.DescriptionCol.ForSelectWithFallback(langCode, DB.TextCatalog.DescriptionCol); @@ -782,9 +866,11 @@ private String GetTextCatalog_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetSubTableVariableRowskeyVariable_01 ***" + "/ "; sqlString += " FROM " + DB.TextCatalog.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.TextCatalogLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.TextCatalogLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.TextCatalog.TextCatalogNoCol.Is(DB.TextCatalogLang2.TextCatalogNoCol, langCode); } } @@ -796,23 +882,26 @@ private String GetTextCatalog_SQLString_NoWhere() { #region for TimeScale //returns the single "row" found when all PKs are spesified - public TimeScaleRow GetTimeScaleRow(string aTimeScale) { + public TimeScaleRow GetTimeScaleRow(string aTimeScale) + { //SqlDbConfig dbconf = DB; string sqlString = GetTimeScale_SQLString_NoWhere(); - sqlString += " WHERE " + DB.TimeScale.TimeScaleCol.Is(aTimeScale) ; + sqlString += " WHERE " + DB.TimeScale.TimeScaleCol.Is(aTimeScale); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," TimeScale = " + aTimeScale); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " TimeScale = " + aTimeScale); } - TimeScaleRow myOut = new TimeScaleRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + TimeScaleRow myOut = new TimeScaleRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } - private String GetTimeScale_SQLString_NoWhere() { + private String GetTimeScale_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; sqlString += @@ -825,8 +914,10 @@ private String GetTimeScale_SQLString_NoWhere() { DB.TimeScale.StoreFormatCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.TimeScaleLang2.PresTextCol.ForSelectWithFallback(langCode, DB.TimeScale.PresTextCol); } } @@ -834,9 +925,11 @@ private String GetTimeScale_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetTimeScaleRow_01 ***" + "/ "; sqlString += " FROM " + DB.TimeScale.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.TimeScaleLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.TimeScaleLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.TimeScale.TimeScaleCol.Is(DB.TimeScaleLang2.TimeScaleCol, langCode); } } @@ -848,23 +941,26 @@ private String GetTimeScale_SQLString_NoWhere() { #region for ValuePool //returns the single "row" found when all PKs are spesified - public ValuePoolRow GetValuePoolRow(string aValuePool) { + public ValuePoolRow GetValuePoolRow(string aValuePool) + { //SqlDbConfig dbconf = DB; string sqlString = GetValuePool_SQLString_NoWhere(); - sqlString += " WHERE " + DB.ValuePool.ValuePoolCol.Is(aValuePool) ; + sqlString += " WHERE " + DB.ValuePool.ValuePoolCol.Is(aValuePool); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValuePool = " + aValuePool); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " ValuePool = " + aValuePool); } - ValuePoolRow myOut = new ValuePoolRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + ValuePoolRow myOut = new ValuePoolRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } - private String GetValuePool_SQLString_NoWhere() { + private String GetValuePool_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -878,8 +974,10 @@ private String GetValuePool_SQLString_NoWhere() { DB.ValuePool.KDBIdCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.ValuePoolLang2.PresTextCol.ForSelectWithFallback(langCode, DB.ValuePool.PresTextCol); if (this.metaVersionGE("2.2")) { @@ -895,9 +993,11 @@ private String GetValuePool_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetValuePoolRow_01 ***" + "/ "; sqlString += " FROM " + DB.ValuePool.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValuePoolLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.ValuePoolLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValuePool.ValuePoolCol.Is(DB.ValuePoolLang2.ValuePoolCol, langCode); } } @@ -909,26 +1009,30 @@ private String GetValuePool_SQLString_NoWhere() { #region for ValueSet //returns the single "row" found when all PKs are spesified - public ValueSetRow GetValueSetRow(string aValueSet) { + public ValueSetRow GetValueSetRow(string aValueSet) + { //SqlDbConfig dbconf = DB; string sqlString = GetValueSet_SQLString_NoWhere(); - sqlString += " WHERE " + DB.ValueSet.ValueSetCol.Is(aValueSet) ; + sqlString += " WHERE " + DB.ValueSet.ValueSetCol.Is(aValueSet); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValueSet = " + aValueSet); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " ValueSet = " + aValueSet); } - ValueSetRow myOut = new ValueSetRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + ValueSetRow myOut = new ValueSetRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } - private String GetValueSet_SQLString_NoWhere() { + private String GetValueSet_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; - if( metaVersionGE("2.1")) { + if (metaVersionGE("2.1")) + { sqlString += DB.ValueSet.PresTextCol.ForSelect() + " , "; } @@ -945,9 +1049,12 @@ private String GetValueSet_SQLString_NoWhere() { DB.ValueSet.FootnoteCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - if( metaVersionGE("2.1")){ + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + if (metaVersionGE("2.1")) + { sqlString += ", " + DB.ValueSetLang2.PresTextCol.ForSelectWithFallback(langCode, DB.ValueSet.PresTextCol); } sqlString += ", " + DB.ValueSetLang2.DescriptionCol.ForSelectWithFallback(langCode, DB.ValueSet.DescriptionCol); @@ -957,9 +1064,11 @@ private String GetValueSet_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetValueSetRow_01 ***" + "/ "; sqlString += " FROM " + DB.ValueSet.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValueSetLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.ValueSetLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValueSet.ValueSetCol.Is(DB.ValueSetLang2.ValueSetCol, langCode); } } @@ -971,23 +1080,26 @@ private String GetValueSet_SQLString_NoWhere() { #region for Variable //returns the single "row" found when all PKs are spesified - public VariableRow GetVariableRow(string aVariable) { + public VariableRow GetVariableRow(string aVariable) + { //SqlDbConfig dbconf = DB; string sqlString = GetVariable_SQLString_NoWhere(); - sqlString += " WHERE " + DB.Variable.VariableCol.Is(aVariable) ; + sqlString += " WHERE " + DB.Variable.VariableCol.Is(aVariable); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Variable = " + aVariable); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " Variable = " + aVariable); } - VariableRow myOut = new VariableRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + VariableRow myOut = new VariableRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } - private String GetVariable_SQLString_NoWhere() { + private String GetVariable_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -999,8 +1111,10 @@ private String GetVariable_SQLString_NoWhere() { DB.Variable.FootnoteCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.VariableLang2.PresTextCol.ForSelectWithFallback(langCode, DB.Variable.PresTextCol); } } @@ -1008,9 +1122,11 @@ private String GetVariable_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetVariableRow_01 ***" + "/ "; sqlString += " FROM " + DB.Variable.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.VariableLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.VariableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Variable.VariableCol.Is(DB.VariableLang2.VariableCol, langCode); } } @@ -1022,27 +1138,30 @@ private String GetVariable_SQLString_NoWhere() { #region for VSGroup //returns the single "row" found when all PKs are spesified - public VSGroupRow GetVSGroupRow(string aValueSet, string aGrouping, string aGroupCode, string aValueCode, string aValuePool) { + public VSGroupRow GetVSGroupRow(string aValueSet, string aGrouping, string aGroupCode, string aValueCode, string aValuePool) + { //SqlDbConfig dbconf = DB; string sqlString = GetVSGroup_SQLString_NoWhere(); - sqlString += " WHERE " + DB.VSGroup.ValueSetCol.Is(aValueSet) + - " AND " +DB.VSGroup.GroupingCol.Is(aGrouping) + - " AND " +DB.VSGroup.GroupCodeCol.Is(aGroupCode) + - " AND " +DB.VSGroup.ValueCodeCol.Is(aValueCode) + - " AND " +DB.VSGroup.ValuePoolCol.Is(aValuePool) ; + sqlString += " WHERE " + DB.VSGroup.ValueSetCol.Is(aValueSet) + + " AND " + DB.VSGroup.GroupingCol.Is(aGrouping) + + " AND " + DB.VSGroup.GroupCodeCol.Is(aGroupCode) + + " AND " + DB.VSGroup.ValueCodeCol.Is(aValueCode) + + " AND " + DB.VSGroup.ValuePoolCol.Is(aValuePool); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValueSet = " + aValueSet + " Grouping = " + aGrouping + " GroupCode = " + aGroupCode + " ValueCode = " + aValueCode + " ValuePool = " + aValuePool); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " ValueSet = " + aValueSet + " Grouping = " + aGrouping + " GroupCode = " + aGroupCode + " ValueCode = " + aValueCode + " ValuePool = " + aValuePool); } - VSGroupRow myOut = new VSGroupRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + VSGroupRow myOut = new VSGroupRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } - private String GetVSGroup_SQLString_NoWhere() { + private String GetVSGroup_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -1056,8 +1175,10 @@ private String GetVSGroup_SQLString_NoWhere() { DB.VSGroup.SortCodeCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.VSGroupLang2.SortCodeCol.ForSelectWithFallback(langCode, DB.VSGroup.SortCodeCol); } } @@ -1065,9 +1186,11 @@ private String GetVSGroup_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetVSGroupRow_01 ***" + "/ "; sqlString += " FROM " + DB.VSGroup.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.VSGroupLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.VSGroupLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.VSGroup.ValueSetCol.Is(DB.VSGroupLang2.ValueSetCol, langCode) + " AND " + DB.VSGroup.GroupingCol.Is(DB.VSGroupLang2.GroupingCol, langCode) + " AND " + DB.VSGroup.GroupCodeCol.Is(DB.VSGroupLang2.GroupCodeCol, langCode) + @@ -1083,25 +1206,28 @@ private String GetVSGroup_SQLString_NoWhere() { #region for VSValue //returns the single "row" found when all PKs are spesified - public VSValueRow GetVSValueRow(string aValueSet, string aValuePool, string aValueCode) { + public VSValueRow GetVSValueRow(string aValueSet, string aValuePool, string aValueCode) + { //SqlDbConfig dbconf = DB; string sqlString = GetVSValue_SQLString_NoWhere(); - sqlString += " WHERE " + DB.VSValue.ValueSetCol.Is(aValueSet) + - " AND " +DB.VSValue.ValuePoolCol.Is(aValuePool) + - " AND " +DB.VSValue.ValueCodeCol.Is(aValueCode) ; + sqlString += " WHERE " + DB.VSValue.ValueSetCol.Is(aValueSet) + + " AND " + DB.VSValue.ValuePoolCol.Is(aValuePool) + + " AND " + DB.VSValue.ValueCodeCol.Is(aValueCode); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValueSet = " + aValueSet + " ValuePool = " + aValuePool + " ValueCode = " + aValueCode); + if (myRows.Count != 1) + { + throw new PCAxis.Sql.Exceptions.DbException(36, " ValueSet = " + aValueSet + " ValuePool = " + aValuePool + " ValueCode = " + aValueCode); } - VSValueRow myOut = new VSValueRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator) this); + VSValueRow myOut = new VSValueRow(myRows[0], DB, mLanguageCodes, (IMetaVersionComparator)this); return myOut; } - private String GetVSValue_SQLString_NoWhere() { + private String GetVSValue_SQLString_NoWhere() + { //SqlDbConfig dbconf = DB; string sqlString = "SELECT "; @@ -1113,8 +1239,10 @@ private String GetVSValue_SQLString_NoWhere() { DB.VSValue.SortCodeCol.ForSelect(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { sqlString += ", " + DB.VSValueLang2.SortCodeCol.ForSelectWithFallback(langCode, DB.VSValue.SortCodeCol); } } @@ -1122,9 +1250,11 @@ private String GetVSValue_SQLString_NoWhere() { sqlString += " /" + "*** SQLID: GetVSValueRow_01 ***" + "/ "; sqlString += " FROM " + DB.VSValue.GetNameAndAlias(); - foreach (String langCode in mLanguageCodes) { - if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.VSValueLang2.GetNameAndAlias(langCode); + foreach (String langCode in mLanguageCodes) + { + if (DB.isSecondaryLanguage(langCode)) + { + sqlString += " LEFT JOIN " + DB.VSValueLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.VSValue.ValueSetCol.Is(DB.VSValueLang2.ValueSetCol, langCode) + " AND " + DB.VSValue.ValuePoolCol.Is(DB.VSValueLang2.ValuePoolCol, langCode) + " AND " + DB.VSValue.ValueCodeCol.Is(DB.VSValueLang2.ValueCodeCol, langCode); diff --git a/PCAxis.Sql/QueryLib_21/fra_master2Rows.cs b/PCAxis.Sql/QueryLib_21/fra_master2Rows.cs index 842133c..d84bdfd 100644 --- a/PCAxis.Sql/QueryLib_21/fra_master2Rows.cs +++ b/PCAxis.Sql/QueryLib_21/fra_master2Rows.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_21/value_fra_master2Rows.cs b/PCAxis.Sql/QueryLib_21/value_fra_master2Rows.cs index fc9619a..dd214f7 100644 --- a/PCAxis.Sql/QueryLib_21/value_fra_master2Rows.cs +++ b/PCAxis.Sql/QueryLib_21/value_fra_master2Rows.cs @@ -1,41 +1,43 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; //This code is generated by master2Rows.xslt. Nope! -namespace PCAxis.Sql.QueryLib_21 { +namespace PCAxis.Sql.QueryLib_21 +{ #region class Value /// /// Holds a list of ValueRows. /// - public class ValueRowDictionary { + public class ValueRowDictionary + { // One entry in the Dictionary for each ValueCode private Dictionary mValueRows = new Dictionary(); - public Dictionary ValueRows { + public Dictionary ValueRows + { get { return mValueRows; } set { mValueRows = value; } } - public ValueRowDictionary(DataTable mTable, SqlDbConfig_21 dbconf, string metaModel) { + public ValueRowDictionary(DataTable mTable, SqlDbConfig_21 dbconf, string metaModel) + { string theValueCode; string theLanguage; int sortOrder = 0; - foreach (DataRow mRow in mTable.Rows) { + foreach (DataRow mRow in mTable.Rows) + { theValueCode = mRow[dbconf.VSValue.ValueCode].ToString(); if (!mValueRows.ContainsKey(theValueCode)) { sortOrder += 1; // this will be the sortorder for mainlanguage. Since each language could have its own sortorder this well be set in the Valuetext and coukd be used by the calling program. mValueRows.Add(theValueCode, new ValueRow2(mRow, dbconf, metaModel, sortOrder)); } //denne bør fel flyttes et par hakk ned - theLanguage = mRow["Language"].ToString(); + theLanguage = mRow["Language"].ToString(); if (!mValueRows[theValueCode].texts.ContainsKey(theLanguage)) { mValueRows[theValueCode].texts.Add(theLanguage, new ValueText2(mRow, dbconf, metaModel)); @@ -48,27 +50,31 @@ public ValueRowDictionary(DataTable mTable, SqlDbConfig_21 dbconf, string metaMo /// /// Holds the attributes for Value. The language dependent parts are stored in the texts dictionary which is indexed by language code. /// - public class ValueRow { + public class ValueRow + { private String mValuePool; - public String ValuePool { + public String ValuePool + { get { return mValuePool; } } private String mValueCode; - public String ValueCode { + public String ValueCode + { get { return mValueCode; } } - - + + public Dictionary texts = new Dictionary(); - public ValueRow(DataRow mRow, SqlDbConfig_21 dbconf, IMetaVersionComparator metaModel,StringCollection languageCodes,int sortOrder) + public ValueRow(DataRow mRow, SqlDbConfig_21 dbconf, IMetaVersionComparator metaModel, StringCollection languageCodes, int sortOrder) { this.mValuePool = mRow[dbconf.Value.ValuePoolCol.Label()].ToString(); - this.mValueCode = mRow[dbconf.Value.ValueCodeCol.Label()].ToString(); - foreach (string languageCode in languageCodes) { + this.mValueCode = mRow[dbconf.Value.ValueCodeCol.Label()].ToString(); + foreach (string languageCode in languageCodes) + { texts.Add(languageCode, new ValueText(mRow, dbconf, languageCode, metaModel)); } } @@ -97,7 +103,7 @@ public String SortCode get { return mSortCode; } } - internal ValueText(DataRow mRow, SqlDbConfig_21 dbconf, String languageCode, IMetaVersionComparator metaModel) + internal ValueText(DataRow mRow, SqlDbConfig_21 dbconf, String languageCode, IMetaVersionComparator metaModel) { { if (dbconf.isSecondaryLanguage(languageCode)) @@ -106,7 +112,8 @@ internal ValueText(DataRow mRow, SqlDbConfig_21 dbconf, String languageCode, IM this.mValueTextL = mRow[dbconf.ValueLang2.ValueTextLCol.Label(languageCode)].ToString(); this.mSortCode = mRow[dbconf.ValueLang2.SortCodeCol.Label(languageCode)].ToString(); - } else + } + else { this.mValueTextS = mRow[dbconf.Value.ValueTextSCol.Label()].ToString(); this.mValueTextL = mRow[dbconf.Value.ValueTextLCol.Label()].ToString(); @@ -117,9 +124,11 @@ internal ValueText(DataRow mRow, SqlDbConfig_21 dbconf, String languageCode, IM } - public class ValueRow2 { + public class ValueRow2 + { private String mValuePool; - public String ValuePool { + public String ValuePool + { get { return mValuePool; } } private String mValueSet; @@ -128,20 +137,24 @@ public String ValueSet get { return mValueSet; } } private String mValueCode; - public String ValueCode { + public String ValueCode + { get { return mValueCode; } } private String mSortOrder; - public String SortOrder { - get { return mSortOrder; } + public String SortOrder + { + get { return mSortOrder; } } private String mFootnote; - public String Footnote { + public String Footnote + { get { return mFootnote; } } public Dictionary texts = new Dictionary(); - public ValueRow2(DataRow mRow, SqlDbConfig_21 dbconf, string metaModel,int sortOrder) { + public ValueRow2(DataRow mRow, SqlDbConfig_21 dbconf, string metaModel, int sortOrder) + { this.mValuePool = mRow[dbconf.VSValue.ValuePool].ToString(); // VAL_Vardeforrad this.mValueSet = mRow[dbconf.VSValue.ValueSet].ToString(); // VAL_Vardemangd this.mValueCode = mRow[dbconf.VSValue.ValueCode].ToString(); @@ -154,7 +167,8 @@ public ValueRow2(DataRow mRow, SqlDbConfig_21 dbconf, string metaModel,int sortO /// /// Holds the language dependent attributes for Value for one language /// - public class ValueText2 { + public class ValueText2 + { private String mSortCodeValue; public String SortCodeValue { @@ -166,15 +180,18 @@ public String SortCodeVsValue get { return mSortCodeVsValue; } } private String mValueTextS; - public String ValueTextS { + public String ValueTextS + { get { return mValueTextS; } } private String mValueTextL; - public String ValueTextL { + public String ValueTextL + { get { return mValueTextL; } } - internal ValueText2(DataRow mRow, SqlDbConfig_21 dbconf, string metaModel) { + internal ValueText2(DataRow mRow, SqlDbConfig_21 dbconf, string metaModel) + { this.mSortCodeValue = mRow["SortCodeValue"].ToString(); this.mSortCodeVsValue = mRow["SortCodeVsValue"].ToString(); this.mValueTextS = mRow[dbconf.Value.ValueTextS].ToString(); diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Contents.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Contents.cs index 8854906..d9a536e 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Contents.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Contents.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -29,9 +24,9 @@ public Dictionary GetContentsRows(string aMainTable, bool e DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) @@ -95,7 +90,7 @@ private String GetContents_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ContentsLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ContentsLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Contents.MainTableCol.Is(DB.ContentsLang2.MainTableCol, langCode) + " AND " + DB.Contents.ContentsCol.Is(DB.ContentsLang2.ContentsCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs index cfdf4b8..80a52c7 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public DataStorageRow GetDataStorageRow(string aProductId) { //SqlDbConfig dbconf = DB; string sqlString = GetDataStorage_SQLString_NoWhere(); - sqlString += " WHERE " + DB.DataStorage.ProductIdCol.Is(aProductId) ; + sqlString += " WHERE " + DB.DataStorage.ProductIdCol.Is(aProductId); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ProductId = " + aProductId); + throw new PCAxis.Sql.Exceptions.DbException(36, " ProductId = " + aProductId); } - DataStorageRow myOut = new DataStorageRow(myRows[0], DB); + DataStorageRow myOut = new DataStorageRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Footnote.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Footnote.cs index 3d555a6..069df57 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Footnote.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Footnote.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public FootnoteRow GetFootnoteRow(string aFootnoteNo) { //SqlDbConfig dbconf = DB; string sqlString = GetFootnote_SQLString_NoWhere(); - sqlString += " WHERE " + DB.Footnote.FootnoteNoCol.Is(aFootnoteNo) ; + sqlString += " WHERE " + DB.Footnote.FootnoteNoCol.Is(aFootnoteNo); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," FootnoteNo = " + aFootnoteNo); + throw new PCAxis.Sql.Exceptions.DbException(36, " FootnoteNo = " + aFootnoteNo); } - FootnoteRow myOut = new FootnoteRow(myRows[0], DB, mLanguageCodes); + FootnoteRow myOut = new FootnoteRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -64,7 +56,7 @@ private String GetFootnote_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.FootnoteLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.FootnoteLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Footnote.FootnoteNoCol.Is(DB.FootnoteLang2.FootnoteNoCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs index db5de6c..5e642e2 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs @@ -1,13 +1,9 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -29,7 +25,7 @@ public Dictionary GetFootnoteGroupingRows(StringCol DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { throw new PCAxis.Sql.Exceptions.DbException(35, " query, see log. "); } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Grouping.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Grouping.cs index c98be16..23a8729 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Grouping.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Grouping.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public GroupingRow GetGroupingRow(string aGrouping) { //SqlDbConfig dbconf = DB; string sqlString = GetGrouping_SQLString_NoWhere(); - sqlString += " WHERE " + DB.Grouping.GroupingCol.Is(aGrouping) ; + sqlString += " WHERE " + DB.Grouping.GroupingCol.Is(aGrouping); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Grouping = " + aGrouping); + throw new PCAxis.Sql.Exceptions.DbException(36, " Grouping = " + aGrouping); } - GroupingRow myOut = new GroupingRow(myRows[0], DB, mLanguageCodes); + GroupingRow myOut = new GroupingRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -68,7 +60,7 @@ private String GetGrouping_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.GroupingLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.GroupingLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Grouping.GroupingCol.Is(DB.GroupingLang2.GroupingCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs index 9cd1734..89cec85 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -29,9 +24,9 @@ public Dictionary GetGroupingLevelRows_KeyIsLevel(stri DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); } foreach (DataRow sqlRow in myRows) @@ -71,7 +66,7 @@ private String GetGroupingLevel_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.GroupingLevelLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.GroupingLevelLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.GroupingLevel.GroupingCol.Is(DB.GroupingLevelLang2.GroupingCol, langCode) + " AND " + DB.GroupingLevel.LevelCol.Is(DB.GroupingLevelLang2.LevelCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTable.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTable.cs index 03924e2..b397afa 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTable.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTable.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public MainTableRow GetMainTableRow(string aMainTable) { //SqlDbConfig dbconf = DB; string sqlString = GetMainTable_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MainTable.MainTableCol.Is(aMainTable) ; + sqlString += " WHERE " + DB.MainTable.MainTableCol.Is(aMainTable); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable); } - MainTableRow myOut = new MainTableRow(myRows[0], DB, mLanguageCodes); + MainTableRow myOut = new MainTableRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -72,7 +64,7 @@ private String GetMainTable_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.MainTableLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.MainTableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.MainTable.MainTableCol.Is(DB.MainTableLang2.MainTableCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs index ee41833..8affb47 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -25,15 +20,15 @@ public Dictionary GetMainTablePersonRows(string aMai // WHERE MTP.MainTable = '' // AND MTP.RolePerson = '' // - sqlString += " WHERE " + DB.MainTablePerson.MainTableCol.Is(aMainTable) + - " AND " +DB.MainTablePerson.RolePersonCol.Is(aRolePerson); + sqlString += " WHERE " + DB.MainTablePerson.MainTableCol.Is(aMainTable) + + " AND " + DB.MainTablePerson.RolePersonCol.Is(aRolePerson); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " RolePerson = " + aRolePerson); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " RolePerson = " + aRolePerson); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs index 6e29e95..0aa2eed 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,18 +16,18 @@ public MainTableVariableHierarchyRow GetMainTableVariableHierarchyRow(string aMa { //SqlDbConfig dbconf = DB; string sqlString = GetMainTableVariableHierarchy_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(aMainTable) + - " AND " +DB.MainTableVariableHierarchy.VariableCol.Is(aVariable) + - " AND " +DB.MainTableVariableHierarchy.GroupingCol.Is(aGrouping) ; + sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(aMainTable) + + " AND " + DB.MainTableVariableHierarchy.VariableCol.Is(aVariable) + + " AND " + DB.MainTableVariableHierarchy.GroupingCol.Is(aGrouping); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable + " Variable = " + aVariable + " Grouping = " + aGrouping); + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable + " Variable = " + aVariable + " Grouping = " + aGrouping); } - MainTableVariableHierarchyRow myOut = new MainTableVariableHierarchyRow(myRows[0], DB); + MainTableVariableHierarchyRow myOut = new MainTableVariableHierarchyRow(myRows[0], DB); return myOut; } @@ -45,15 +40,15 @@ public Dictionary GetMainTableVariableHie // WHERE MTP.MainTable = '' // AND MTP.Variable = '' // - sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(aMainTable) + - " AND " +DB.MainTableVariableHierarchy.VariableCol.Is(aVariable); + sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(aMainTable) + + " AND " + DB.MainTableVariableHierarchy.VariableCol.Is(aVariable); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " Variable = " + aVariable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " Variable = " + aVariable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs index bc06f08..18c9269 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -22,17 +14,17 @@ public MenuSelectionRow GetMenuSelectionRow(string aMenu, string aSelection) { //SqlDbConfig dbconf = DB; string sqlString = GetMenuSelection_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MenuSelection.MenuCol.Is(aMenu) + - " AND " +DB.MenuSelection.SelectionCol.Is(aSelection) ; + sqlString += " WHERE " + DB.MenuSelection.MenuCol.Is(aMenu) + + " AND " + DB.MenuSelection.SelectionCol.Is(aSelection); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Menu = " + aMenu + " Selection = " + aSelection); + throw new PCAxis.Sql.Exceptions.DbException(36, " Menu = " + aMenu + " Selection = " + aSelection); } - MenuSelectionRow myOut = new MenuSelectionRow(myRows[0], DB, mLanguageCodes); + MenuSelectionRow myOut = new MenuSelectionRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -74,7 +66,7 @@ private String GetMenuSelection_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.MenuSelectionLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.MenuSelectionLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.MenuSelection.MenuCol.Is(DB.MenuSelectionLang2.MenuCol, langCode) + " AND " + DB.MenuSelection.SelectionCol.Is(DB.MenuSelectionLang2.SelectionCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs index c6fdadc..dbff107 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs @@ -1,13 +1,6 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; +using System.Data; //This code is generated. @@ -21,16 +14,16 @@ public MetaAdmRow GetMetaAdmRow(string aProperty) { //SqlDbConfig dbconf = DB; string sqlString = GetMetaAdm_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MetaAdm.PropertyCol.IsUppered(aProperty) ; + sqlString += " WHERE " + DB.MetaAdm.PropertyCol.IsUppered(aProperty); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Property = " + aProperty); + throw new PCAxis.Sql.Exceptions.DbException(36, " Property = " + aProperty); } - MetaAdmRow myOut = new MetaAdmRow(myRows[0], DB); + MetaAdmRow myOut = new MetaAdmRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs index afd3f12..fa479b3 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public MetabaseInfoRow GetMetabaseInfoRow(string aModel) { //SqlDbConfig dbconf = DB; string sqlString = GetMetabaseInfo_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MetabaseInfo.ModelCol.IsUppered(aModel) ; + sqlString += " WHERE " + DB.MetabaseInfo.ModelCol.IsUppered(aModel); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Model = " + aModel); + throw new PCAxis.Sql.Exceptions.DbException(36, " Model = " + aModel); } - MetabaseInfoRow myOut = new MetabaseInfoRow(myRows[0], DB); + MetabaseInfoRow myOut = new MetabaseInfoRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Organization.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Organization.cs index 70cd23a..2f39692 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Organization.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Organization.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public OrganizationRow GetOrganizationRow(string aOrganizationCode) { //SqlDbConfig dbconf = DB; string sqlString = GetOrganization_SQLString_NoWhere(); - sqlString += " WHERE " + DB.Organization.OrganizationCodeCol.Is(aOrganizationCode) ; + sqlString += " WHERE " + DB.Organization.OrganizationCodeCol.Is(aOrganizationCode); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," OrganizationCode = " + aOrganizationCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " OrganizationCode = " + aOrganizationCode); } - OrganizationRow myOut = new OrganizationRow(myRows[0], DB, mLanguageCodes); + OrganizationRow myOut = new OrganizationRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -67,7 +59,7 @@ private String GetOrganization_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.OrganizationLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.OrganizationLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Organization.OrganizationCodeCol.Is(DB.OrganizationLang2.OrganizationCodeCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Person.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Person.cs index 4895bb6..a0f5e10 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Person.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Person.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public PersonRow GetPersonRow(string aPersonCode) { //SqlDbConfig dbconf = DB; string sqlString = GetPerson_SQLString_NoWhere(); - sqlString += " WHERE " + DB.Person.PersonCodeCol.Is(aPersonCode) ; + sqlString += " WHERE " + DB.Person.PersonCodeCol.Is(aPersonCode); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," PersonCode = " + aPersonCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " PersonCode = " + aPersonCode); } - PersonRow myOut = new PersonRow(myRows[0], DB); + PersonRow myOut = new PersonRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs index 172920e..4307e2c 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs @@ -1,13 +1,6 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; +using System.Data; //This code is generated. @@ -21,16 +14,16 @@ public SpecialCharacterRow GetSpecialCharacterRow(string aCharacterType) { //SqlDbConfig dbconf = DB; string sqlString = GetSpecialCharacter_SQLString_NoWhere(); - sqlString += " WHERE " + DB.SpecialCharacter.CharacterTypeCol.Is(aCharacterType) ; + sqlString += " WHERE " + DB.SpecialCharacter.CharacterTypeCol.Is(aCharacterType); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," CharacterType = " + aCharacterType); + throw new PCAxis.Sql.Exceptions.DbException(36, " CharacterType = " + aCharacterType); } - SpecialCharacterRow myOut = new SpecialCharacterRow(myRows[0], DB, mLanguageCodes); + SpecialCharacterRow myOut = new SpecialCharacterRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -88,7 +81,7 @@ private String GetSpecialCharacter_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.SpecialCharacterLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.SpecialCharacterLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.SpecialCharacter.CharacterTypeCol.Is(DB.SpecialCharacterLang2.CharacterTypeCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SubTable.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SubTable.cs index 7940ac4..7ceea2b 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SubTable.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SubTable.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -29,9 +24,9 @@ public Dictionary GetSubTableRows(string aMainTable, bool e DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) @@ -70,7 +65,7 @@ private String GetSubTable_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.SubTableLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.SubTableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.SubTable.MainTableCol.Is(DB.SubTableLang2.MainTableCol, langCode) + " AND " + DB.SubTable.SubTableCol.Is(DB.SubTableLang2.SubTableCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs index 62fa36b..de14230 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,18 +16,18 @@ public SubTableVariableRow GetSubTableVariableRow(string aMainTable, string aSub { //SqlDbConfig dbconf = DB; string sqlString = GetSubTableVariable_SQLString_NoWhere(); - sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(aMainTable) + - " AND " +DB.SubTableVariable.SubTableCol.Is(aSubTable) + - " AND " +DB.SubTableVariable.VariableCol.Is(aVariable) ; + sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(aMainTable) + + " AND " + DB.SubTableVariable.SubTableCol.Is(aSubTable) + + " AND " + DB.SubTableVariable.VariableCol.Is(aVariable); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable + " SubTable = " + aSubTable + " Variable = " + aVariable); + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable + " SubTable = " + aSubTable + " Variable = " + aVariable); } - SubTableVariableRow myOut = new SubTableVariableRow(myRows[0], DB); + SubTableVariableRow myOut = new SubTableVariableRow(myRows[0], DB); return myOut; } @@ -45,15 +40,15 @@ public Dictionary GetSubTableVariableRowskeyVariabl // WHERE STV.MainTable = '' // AND STV.SubTable = '' // - sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(aMainTable) + - " AND " +DB.SubTableVariable.SubTableCol.Is(aSubTable); + sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(aMainTable) + + " AND " + DB.SubTableVariable.SubTableCol.Is(aSubTable); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " SubTable = " + aSubTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " SubTable = " + aSubTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs index c01e758..789ecfb 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs @@ -1,13 +1,4 @@ using System; -using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -48,7 +39,7 @@ private String GetTextCatalog_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.TextCatalogLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.TextCatalogLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.TextCatalog.TextCatalogNoCol.Is(DB.TextCatalogLang2.TextCatalogNoCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs index e14b07c..a18372d 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public TimeScaleRow GetTimeScaleRow(string aTimeScale) { //SqlDbConfig dbconf = DB; string sqlString = GetTimeScale_SQLString_NoWhere(); - sqlString += " WHERE " + DB.TimeScale.TimeScaleCol.Is(aTimeScale) ; + sqlString += " WHERE " + DB.TimeScale.TimeScaleCol.Is(aTimeScale); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," TimeScale = " + aTimeScale); + throw new PCAxis.Sql.Exceptions.DbException(36, " TimeScale = " + aTimeScale); } - TimeScaleRow myOut = new TimeScaleRow(myRows[0], DB, mLanguageCodes); + TimeScaleRow myOut = new TimeScaleRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -66,7 +58,7 @@ private String GetTimeScale_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.TimeScaleLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.TimeScaleLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.TimeScale.TimeScaleCol.Is(DB.TimeScaleLang2.TimeScaleCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_VSValue.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_VSValue.cs index b034ed4..00b19b4 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_VSValue.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_VSValue.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,18 +13,18 @@ public VSValueRow GetVSValueRow(string aValueSet, string aValuePool, string aVal { //SqlDbConfig dbconf = DB; string sqlString = GetVSValue_SQLString_NoWhere(); - sqlString += " WHERE " + DB.VSValue.ValueSetCol.Is(aValueSet) + - " AND " +DB.VSValue.ValuePoolCol.Is(aValuePool) + - " AND " +DB.VSValue.ValueCodeCol.Is(aValueCode) ; + sqlString += " WHERE " + DB.VSValue.ValueSetCol.Is(aValueSet) + + " AND " + DB.VSValue.ValuePoolCol.Is(aValuePool) + + " AND " + DB.VSValue.ValueCodeCol.Is(aValueCode); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValueSet = " + aValueSet + " ValuePool = " + aValuePool + " ValueCode = " + aValueCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " ValueSet = " + aValueSet + " ValuePool = " + aValuePool + " ValueCode = " + aValueCode); } - VSValueRow myOut = new VSValueRow(myRows[0], DB, mLanguageCodes); + VSValueRow myOut = new VSValueRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -65,7 +57,7 @@ private String GetVSValue_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.VSValueLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.VSValueLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.VSValue.ValueSetCol.Is(DB.VSValueLang2.ValueSetCol, langCode) + " AND " + DB.VSValue.ValuePoolCol.Is(DB.VSValueLang2.ValuePoolCol, langCode) + " AND " + DB.VSValue.ValueCodeCol.Is(DB.VSValueLang2.ValueCodeCol, langCode); diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs index 6a8a080..8173dcd 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -25,15 +20,15 @@ public Dictionary GetValueGroupRowskeyValueCode(string aG // WHERE VPL.Grouping = '' // AND VPL.GroupCode = '' // - sqlString += " WHERE " + DB.ValueGroup.GroupingCol.Is(aGrouping) + - " AND " +DB.ValueGroup.GroupCodeCol.Is(aGroupCode); + sqlString += " WHERE " + DB.ValueGroup.GroupingCol.Is(aGrouping) + + " AND " + DB.ValueGroup.GroupCodeCol.Is(aGroupCode); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping + " GroupCode = " + aGroupCode); + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping + " GroupCode = " + aGroupCode); } foreach (DataRow sqlRow in myRows) @@ -76,7 +71,7 @@ private String GetValueGroup_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValueGroupLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValueGroupLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValueGroup.GroupingCol.Is(DB.ValueGroupLang2.GroupingCol, langCode) + " AND " + DB.ValueGroup.GroupCodeCol.Is(DB.ValueGroupLang2.GroupCodeCol, langCode) + " AND " + DB.ValueGroup.ValueCodeCol.Is(DB.ValueGroupLang2.ValueCodeCol, langCode); diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs index 2a6e997..875e2fe 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public ValuePoolRow GetValuePoolRow(string aValuePool) { //SqlDbConfig dbconf = DB; string sqlString = GetValuePool_SQLString_NoWhere(); - sqlString += " WHERE " + DB.ValuePool.ValuePoolCol.Is(aValuePool) ; + sqlString += " WHERE " + DB.ValuePool.ValuePoolCol.Is(aValuePool); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValuePool = " + aValuePool); + throw new PCAxis.Sql.Exceptions.DbException(36, " ValuePool = " + aValuePool); } - ValuePoolRow myOut = new ValuePoolRow(myRows[0], DB, mLanguageCodes); + ValuePoolRow myOut = new ValuePoolRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -67,7 +59,7 @@ private String GetValuePool_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValuePoolLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValuePoolLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValuePool.ValuePoolCol.Is(DB.ValuePoolLang2.ValuePoolCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs index 05ef58d..823e4f2 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public ValueSetRow GetValueSetRow(string aValueSet) { //SqlDbConfig dbconf = DB; string sqlString = GetValueSet_SQLString_NoWhere(); - sqlString += " WHERE " + DB.ValueSet.ValueSetCol.Is(aValueSet) ; + sqlString += " WHERE " + DB.ValueSet.ValueSetCol.Is(aValueSet); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValueSet = " + aValueSet); + throw new PCAxis.Sql.Exceptions.DbException(36, " ValueSet = " + aValueSet); } - ValueSetRow myOut = new ValueSetRow(myRows[0], DB, mLanguageCodes); + ValueSetRow myOut = new ValueSetRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -70,7 +62,7 @@ private String GetValueSet_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValueSetLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValueSetLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValueSet.ValueSetCol.Is(DB.ValueSetLang2.ValueSetCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs index b2975e5..d8d65bc 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -29,9 +24,9 @@ public Dictionary GetValueSetGroupingRowskeyGroupin DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " ValueSet = " + aValueSet); + throw new PCAxis.Sql.Exceptions.DbException(35, " ValueSet = " + aValueSet); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Variable.cs b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Variable.cs index 2190604..d86c238 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Variable.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedMetaQueryParts/MetaQuery_Variable.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,16 +13,16 @@ public VariableRow GetVariableRow(string aVariable) { //SqlDbConfig dbconf = DB; string sqlString = GetVariable_SQLString_NoWhere(); - sqlString += " WHERE " + DB.Variable.VariableCol.Is(aVariable) ; + sqlString += " WHERE " + DB.Variable.VariableCol.Is(aVariable); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Variable = " + aVariable); + throw new PCAxis.Sql.Exceptions.DbException(36, " Variable = " + aVariable); } - VariableRow myOut = new VariableRow(myRows[0], DB, mLanguageCodes); + VariableRow myOut = new VariableRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -63,7 +55,7 @@ private String GetVariable_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.VariableLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.VariableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Variable.VariableCol.Is(DB.VariableLang2.VariableCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/ContentsRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/ContentsRow.cs index 4b54b07..844d598 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/ContentsRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/ContentsRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/DataStorageRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/DataStorageRow.cs index 0b9795a..d262f45 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/DataStorageRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/DataStorageRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/FootnoteGroupingRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/FootnoteGroupingRow.cs index d7ae9e4..9c6771c 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/FootnoteGroupingRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/FootnoteGroupingRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/FootnoteRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/FootnoteRow.cs index 6869bb8..80980ea 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/FootnoteRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/FootnoteRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/GroupingLevelRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/GroupingLevelRow.cs index 8223270..e7ee62f 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/GroupingLevelRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/GroupingLevelRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/GroupingRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/GroupingRow.cs index 8f5afb5..e05e2fa 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/GroupingRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/GroupingRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTablePersonRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTablePersonRow.cs index e9b2a9a..245a625 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTablePersonRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTablePersonRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTableRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTableRow.cs index 63779c5..a12c8a1 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTableRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTableRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTableVariableHierarchyRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTableVariableHierarchyRow.cs index 384d1d0..20abff7 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTableVariableHierarchyRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/MainTableVariableHierarchyRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/MenuSelectionRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/MenuSelectionRow.cs index 9665ba8..f6a4bd9 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/MenuSelectionRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/MenuSelectionRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/MetaAdmRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/MetaAdmRow.cs index db04443..ed6d9cc 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/MetaAdmRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/MetaAdmRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/MetabaseInfoRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/MetabaseInfoRow.cs index ce0e15e..135dc2a 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/MetabaseInfoRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/MetabaseInfoRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/OrganizationRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/OrganizationRow.cs index 702cf3f..fdc1872 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/OrganizationRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/OrganizationRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/PersonRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/PersonRow.cs index d342a25..e5ecec8 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/PersonRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/PersonRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/SpecialCharacterRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/SpecialCharacterRow.cs index 89468f4..d4f6ae3 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/SpecialCharacterRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/SpecialCharacterRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/SubTableRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/SubTableRow.cs index 4a62611..6060693 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/SubTableRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/SubTableRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/SubTableVariableRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/SubTableVariableRow.cs index 502d08a..6b6a153 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/SubTableVariableRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/SubTableVariableRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/TextCatalogRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/TextCatalogRow.cs index b3e5362..294c9f5 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/TextCatalogRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/TextCatalogRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/TimeScaleRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/TimeScaleRow.cs index 9dda308..7a9af05 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/TimeScaleRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/TimeScaleRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/VSValueRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/VSValueRow.cs index 207f2d8..5e3cdbb 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/VSValueRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/VSValueRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueGroupRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueGroupRow.cs index ab0bda3..561e8c8 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueGroupRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueGroupRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/ValuePoolRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/ValuePoolRow.cs index cd967fc..3d99b34 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/ValuePoolRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/ValuePoolRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueSetGroupingRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueSetGroupingRow.cs index 0dbeec8..cf70185 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueSetGroupingRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueSetGroupingRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueSetRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueSetRow.cs index 6540de4..fafe663 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueSetRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/ValueSetRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/GeneratedRows/VariableRow.cs b/PCAxis.Sql/QueryLib_22/GeneratedRows/VariableRow.cs index f8f1298..1b5af02 100644 --- a/PCAxis.Sql/QueryLib_22/GeneratedRows/VariableRow.cs +++ b/PCAxis.Sql/QueryLib_22/GeneratedRows/VariableRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_22/HandmadeRows/FootNoteRows.cs b/PCAxis.Sql/QueryLib_22/HandmadeRows/FootNoteRows.cs index a52437a..fb3f6e0 100644 --- a/PCAxis.Sql/QueryLib_22/HandmadeRows/FootNoteRows.cs +++ b/PCAxis.Sql/QueryLib_22/HandmadeRows/FootNoteRows.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; using System.Data; -using PCAxis.Sql.DbClient; //For executing SQLs. + using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; //using PCAxis.Sql.QueryLib; -using log4net; namespace PCAxis.Sql.QueryLib_22 @@ -27,7 +25,7 @@ public enum PXSqlNoteType } public class RelevantFootNotesRow { - + private string mFootNoteNo; public string FootNoteNo { @@ -87,7 +85,7 @@ public string ShowFootNote public Dictionary texts = new Dictionary(); public RelevantFootNotesRow(DataRow myRow, SqlDbConfig_22 dbconf, StringCollection languageCodes) { - + this.mFootNoteNo = myRow["FootNoteNo"].ToString(); //this.mFootNoteType = myRow["FootNoteType"].ToString(); this.mFootNoteType = (PXSqlNoteType)Enum.Parse(typeof(PXSqlNoteType), myRow["FootNoteType"].ToString()); @@ -117,7 +115,7 @@ public RelevantFootNotesRow(string variable, FootnoteRow fr, SqlDbConfig_22 dbco this.mValueCode = "*"; this.mTimePeriod = "*"; this.mSubTable = "*"; - this.mMandOpt = fr.MandOpt; + this.mMandOpt = fr.MandOpt; this.mShowFootNote = fr.ShowFootnote; foreach (string languageCode in languageCodes) { diff --git a/PCAxis.Sql/QueryLib_22/HandmadeRows/MainTableVariableRow.cs b/PCAxis.Sql/QueryLib_22/HandmadeRows/MainTableVariableRow.cs index e8a9343..7130386 100644 --- a/PCAxis.Sql/QueryLib_22/HandmadeRows/MainTableVariableRow.cs +++ b/PCAxis.Sql/QueryLib_22/HandmadeRows/MainTableVariableRow.cs @@ -1,22 +1,24 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Data; + using PCAxis.Sql.DbConfig; -namespace PCAxis.Sql.QueryLib_22 { +namespace PCAxis.Sql.QueryLib_22 +{ /// /// Holds the attributes for reduced version SubTableVariable. /// - public class MainTableVariableRow { + public class MainTableVariableRow + { + + public static string sqlString(SqlDbConfig_22 DB, string aMainTable) + { - public static string sqlString(SqlDbConfig_22 DB, string aMainTable) { - string currentMethod = "MainTableVariableRow.sqlString"; SqlDbConfig_22.TblSubTableVariable stv = DB.SubTableVariable; - return "SELECT DISTINCT " + stv.VariableCol.ForSelect() + ", " + + return "SELECT DISTINCT " + stv.VariableCol.ForSelect() + ", " + stv.VariableTypeCol.ForSelect() + "," + stv.StoreColumnNoCol.ForSelect() + " /*** SQLID: " + currentMethod + "_01 ***/ " + @@ -29,12 +31,14 @@ public static string sqlString(SqlDbConfig_22 DB, string aMainTable) { } private String mVariable; - public String Variable { + public String Variable + { get { return mVariable; } } private String mVariableType; - public String VariableType { + public String VariableType + { get { return mVariableType; } } @@ -43,7 +47,8 @@ public String StoreColumnNo { get { return mStoreColumnNo; } } - public MainTableVariableRow(DataRow myRow, SqlDbConfig_22 dbconf) { + public MainTableVariableRow(DataRow myRow, SqlDbConfig_22 dbconf) + { this.mVariable = myRow[dbconf.SubTableVariable.VariableCol.Label()].ToString(); this.mVariableType = myRow[dbconf.SubTableVariable.VariableTypeCol.Label()].ToString(); this.mStoreColumnNo = myRow[dbconf.SubTableVariable.StoreColumnNoCol.Label()].ToString(); diff --git a/PCAxis.Sql/QueryLib_22/MetaQuery.cs b/PCAxis.Sql/QueryLib_22/MetaQuery.cs index 308f0ec..0dcaf1e 100644 --- a/PCAxis.Sql/QueryLib_22/MetaQuery.cs +++ b/PCAxis.Sql/QueryLib_22/MetaQuery.cs @@ -1,19 +1,13 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; - using System.Data; //For DataSet-objects. using System.Reflection; //For MethodBase.GetCurrentMethod(). -using System.Globalization;// for CultureInfo - +using log4net; using PCAxis.Sql.DbClient; //For executing SQLs. using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; - - -using log4net; using PCAxis.Sql.Exceptions; @@ -113,36 +107,36 @@ public string GetDataTablesPrefix(string aProductId) } - - + + /// Gets the languages for which the maintable exists in the database. /// /// The maintable /// All the languages in the database(from dbconfig-xmlfila) /// the languages for which the maintable exists in the database. - + public StringCollection GetLanguagesForMainTable(string mainTableId, StringCollection dbLanguages) { StringCollection maintableLanguages = new StringCollection(); maintableLanguages.Add(DB.MainLanguage.code); string sqlString; - foreach (String dbLang in dbLanguages) + foreach (String dbLang in dbLanguages) + { + if (DB.isSecondaryLanguage(dbLang)) { - if (DB.isSecondaryLanguage(dbLang)) + sqlString = "select " + DB.MainTableLang2.StatusCol.ForSelect(dbLang) + " from " + DB.MainTableLang2.GetNameAndAlias(dbLang); + sqlString += " where " + DB.MainTableLang2.MainTableCol.Id(dbLang) + "='" + mainTableId + "'"; + DataSet ds = mSqlCommand.ExecuteSelect(sqlString); + DataRowCollection myRows = ds.Tables[0].Rows; + if (myRows.Count == 1 && myRows[0][DB.MainTableLang2.StatusCol.Label(dbLang)].ToString() == DB.Codes.StatusEng) { - sqlString = "select " + DB.MainTableLang2.StatusCol.ForSelect(dbLang) + " from " + DB.MainTableLang2.GetNameAndAlias(dbLang); - sqlString += " where " + DB.MainTableLang2.MainTableCol.Id(dbLang) + "='" + mainTableId + "'"; - DataSet ds = mSqlCommand.ExecuteSelect(sqlString); - DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count == 1 && myRows[0][DB.MainTableLang2.StatusCol.Label(dbLang)].ToString() == DB.Codes.StatusEng) - { - maintableLanguages.Add(dbLang); - } + maintableLanguages.Add(dbLang); } } - + } + return maintableLanguages; } @@ -179,7 +173,7 @@ public List GetValueSetRows2(string MainTable, string Variable) DB.ValueSet.ValueSetCol.ForSelect() + ", "; sqlString += DB.ValueSet.PresTextCol.ForSelect() + ", "; - + sqlString += DB.ValueSet.DescriptionCol.ForSelect() + ", " + DB.ValueSet.EliminationCol.ForSelect() + ", " + DB.ValueSet.ValuePoolCol.ForSelect() + ", " + @@ -192,8 +186,8 @@ public List GetValueSetRows2(string MainTable, string Variable) { if (DB.isSecondaryLanguage(langCode)) { - - sqlString += ", " + DB.ValueSetLang2.PresTextCol.ForSelectWithFallback(langCode, DB.ValueSet.PresTextCol) + " "; + + sqlString += ", " + DB.ValueSetLang2.PresTextCol.ForSelectWithFallback(langCode, DB.ValueSet.PresTextCol) + " "; sqlString += ", " + DB.ValueSetLang2.DescriptionCol.ForSelectWithFallback(langCode, DB.ValueSet.DescriptionCol) + " "; } @@ -420,7 +414,7 @@ public ValueRowDictionary GetValueRowDictionary(string mainTable, StringCollecti if (valueExtraExists == DB.Codes.ValueTextExistsX) { - + sqlString += " JOIN " + DB.ValueExtraLang2.GetNameAndAlias(langCode) + " ON (" + DB.ValueExtraLang2.ValuePoolCol.Id(langCode) + " = " + DB.ValueLang2.ValuePoolCol.Id(langCode) + " AND " + DB.ValueExtraLang2.ValueCodeCol.Id(langCode) + " = " + DB.ValueLang2.ValueCodeCol.Id(langCode) + ")"; @@ -851,7 +845,7 @@ public int GetNumberOfValuesInValueSetById(string ValueSet) } - + /// /// Logs a line if Database and configfile disagrees on CNMM version /// @@ -869,10 +863,10 @@ private void CompareCNMMVersionSources() versionFromConfig + " in config file. They must be equal"; log.Warn(message); } - + } - + //flyttet over fra fra_master2MetaQuery. Denne tabellen er ond @@ -1070,16 +1064,16 @@ public List GetRelevantFoonotes(string mainTable) "(select fi." + DB.FootnoteSubTable.MainTableCol.PureColumnName() + " as MainTable, " + DB.FootnoteSubTable.FootnoteNoCol.PureColumnName() + " as FootNote, '8' as FootNoteType, '*' as Contents, '*' as Variable, '*' as ValuePool, '*' as ValueCode," + "'*' as TimePeriod, " + "fi." + DB.FootnoteSubTable.SubTableCol.PureColumnName() + " as SubTable " + "from " + Md + DB.FootnoteSubTable.TableName + " fi) "; - - sqlString += "union " + - "(select distinct fi." + DB.FootnoteMaintValue.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteMaintValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '9' as FootNoteType, '*' as Contents, dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + ", fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + " as ValuePool , fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + " as ValueCode," + - "'*' as TimePeriod, '*' as SubTable " + - "from " + Md + DB.FootnoteMaintValue.TableName + " fi, " + Md + DB.SubTableVariable.TableName + " dvt," + Md + DB.VSValue.TableName + " vmv " + - "where dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + "= fi." + DB.FootnoteMaintValue.VariableCol.PureColumnName() + - " and vmv." + DB.VSValue.ValueSetCol.PureColumnName() + " = dvt." + DB.SubTableVariable.ValueSetCol.PureColumnName() + - " and vmv." + DB.VSValue.ValuePoolCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + - " and vmv." + DB.VSValue.ValueCodeCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + ")"; - + + sqlString += "union " + + "(select distinct fi." + DB.FootnoteMaintValue.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteMaintValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '9' as FootNoteType, '*' as Contents, dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + ", fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + " as ValuePool , fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + " as ValueCode," + + "'*' as TimePeriod, '*' as SubTable " + + "from " + Md + DB.FootnoteMaintValue.TableName + " fi, " + Md + DB.SubTableVariable.TableName + " dvt," + Md + DB.VSValue.TableName + " vmv " + + "where dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + "= fi." + DB.FootnoteMaintValue.VariableCol.PureColumnName() + + " and vmv." + DB.VSValue.ValueSetCol.PureColumnName() + " = dvt." + DB.SubTableVariable.ValueSetCol.PureColumnName() + + " and vmv." + DB.VSValue.ValuePoolCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + + " and vmv." + DB.VSValue.ValueCodeCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + ")"; + sqlString += ") bx," + DB.Footnote.GetNameAndAlias(); foreach (String langCode in mLanguageCodes) @@ -1251,7 +1245,7 @@ public List GetRelevantFoonotes(string mainTable) // return myOut; //} - + //public List GetVSGroupRow(string aValuePool, StringCollection aValueSets, string aGrouping, string aGroupCode) //{ diff --git a/PCAxis.Sql/QueryLib_22/MetaQuery_ValueGroupMaxValueLevel.cs b/PCAxis.Sql/QueryLib_22/MetaQuery_ValueGroupMaxValueLevel.cs index b9b49bb..16a4f0c 100644 --- a/PCAxis.Sql/QueryLib_22/MetaQuery_ValueGroupMaxValueLevel.cs +++ b/PCAxis.Sql/QueryLib_22/MetaQuery_ValueGroupMaxValueLevel.cs @@ -1,17 +1,11 @@ -using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; -namespace PCAxis.Sql.QueryLib_22 { +namespace PCAxis.Sql.QueryLib_22 +{ public partial class MetaQuery { @@ -23,13 +17,14 @@ public string GetValueGroupMaxValueLevel(string aGrouping, bool emptyRowSetIsOK) string sqlString = "SELECT "; sqlString += "MAX(" + - DB.ValueGroup.GroupLevelCol.Id() +") "; + DB.ValueGroup.GroupLevelCol.Id() + ") "; sqlString += " FROM " + DB.ValueGroup.GetNameAndAlias(); sqlString += " WHERE " + DB.ValueGroup.GroupingCol.Is(aGrouping); DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); + if (myRows.Count < 1 && !emptyRowSetIsOK) + { + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); } myOut = myRows[0][0].ToString(); return myOut; diff --git a/PCAxis.Sql/QueryLib_22/MetaQuery_ValueGroupSorted.cs b/PCAxis.Sql/QueryLib_22/MetaQuery_ValueGroupSorted.cs index 5f27084..effe630 100644 --- a/PCAxis.Sql/QueryLib_22/MetaQuery_ValueGroupSorted.cs +++ b/PCAxis.Sql/QueryLib_22/MetaQuery_ValueGroupSorted.cs @@ -1,22 +1,18 @@ -using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. -namespace PCAxis.Sql.QueryLib_22 { +namespace PCAxis.Sql.QueryLib_22 +{ - public partial class MetaQuery { + public partial class MetaQuery + { #region for ValueGroup - public List GetValueGroupRowsSorted(string aGrouping,string aLevel, bool emptyRowSetIsOK, string aSortOrderLanguage) + public List GetValueGroupRowsSorted(string aGrouping, string aLevel, bool emptyRowSetIsOK, string aSortOrderLanguage) { string sortOrderLanguage = aSortOrderLanguage; if (!this.mLanguageCodes.Contains(aSortOrderLanguage)) @@ -51,18 +47,20 @@ public List GetValueGroupRowsSorted(string aGrouping,string aLeve DataSet ds = mSqlCommand.ExecuteSelect(sqlString); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); + if (myRows.Count < 1 && !emptyRowSetIsOK) + { + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); } - foreach (DataRow sqlRow in myRows) { + foreach (DataRow sqlRow in myRows) + { ValueGroupRow outRow = new ValueGroupRow(sqlRow, DB, mLanguageCodes); myOut.Add(outRow); } return myOut; } - + #endregion for ValueGroup diff --git a/PCAxis.Sql/QueryLib_22/MetaQuery_for_PxsSqlData.cs b/PCAxis.Sql/QueryLib_22/MetaQuery_for_PxsSqlData.cs index 6243881..6bfc764 100644 --- a/PCAxis.Sql/QueryLib_22/MetaQuery_for_PxsSqlData.cs +++ b/PCAxis.Sql/QueryLib_22/MetaQuery_for_PxsSqlData.cs @@ -1,14 +1,10 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Text; -using System.Xml.XPath; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; - using System.Collections.Specialized; +using System.Data; using System.Reflection; + +using PCAxis.Sql.Exceptions; using PCAxis.Sql.Parser_22; @@ -25,7 +21,8 @@ public partial class MetaQuery : IDisposable //flytt til hoved - public void Dispose() { + public void Dispose() + { this.DropTempTables(); mSqlCommand.Dispose(); } @@ -33,22 +30,27 @@ public void Dispose() { #region wildcards in groupvalues - public StringCollection GetValueWildCardByGrouping(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) { + public StringCollection GetValueWildCardByGrouping(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) + { // Resolve wildcards here StringCollection myOut = new StringCollection(); DataSet ds = null; - if (String.Compare(DB.MetaModel, "2.1", false, System.Globalization.CultureInfo.InvariantCulture) > 0) { + if (String.Compare(DB.MetaModel, "2.1", false, System.Globalization.CultureInfo.InvariantCulture) > 0) + { // Datamodel > 2.1, new table structure ds = this.GetValueWildCardByGrouping22(mainTable, variable, subTable, grouping, groupCode, wildCard); - } else { + } + else + { // Datamodel 2.1 or older, the old table structure. Use of Grouping is only valid if a SubTable is selected //ds = this.GetValueWildCardByGrouping21(mainTable, variable, subTable, grouping, groupCode, wildCard); } DataRowCollection mValueInfo = ds.Tables[0].Rows; - foreach (DataRow row in mValueInfo) { + foreach (DataRow row in mValueInfo) + { throw new NotImplementedException(); //TODO; tok bort myOut.Add(row[DB.VSGroup.ValueCode].ToString()); - // myOut.Add(row[DB.VSGroup.ValueCode].ToString()); + // myOut.Add(row[DB.VSGroup.ValueCode].ToString()); } return myOut; } @@ -92,7 +94,8 @@ public StringCollection GetValueWildCardByGrouping(string mainTable, string vari - private DataSet GetValueWildCardByGrouping22(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) { + private DataSet GetValueWildCardByGrouping22(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) + { // To ensure that the correct grouping is used mainTable and variable has to be included // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -164,7 +167,7 @@ public string MakeTempTable(string VariableName, string VariableNumber, IList values, int numberInBulk) { - + string currentMethod = MethodBase.GetCurrentMethod().Name; StringCollection sqlStrings = new StringCollection(); - + int ValuesCounter = 0; - + foreach (PXSqlValue value in values) { @@ -346,24 +355,36 @@ private void InsertIntoTempTablesBulk(string tempTabellId, IList gro /// Hmm, perhaps auxiliary tables would have been a better word. /// Temporary Table in Oracle is a permanent table with temorary rows /// - public void DropTempTables() { - - if (!DB.UseTemporaryTables) { - foreach (string tableName in dropTheseTables) { - try { + public void DropTempTables() + { + + if (!DB.UseTemporaryTables) + { + foreach (string tableName in dropTheseTables) + { + try + { mSqlCommand.ExecuteNonQuery("DROP TABLE " + tableName); - } catch (Exception e) { + } + catch (Exception e) + { log.Error("DROP TABLE failed:", e); //don't want to stop because of this... } } - } else if (mSqlCommand.getProgramMustTruncAndDropTempTable()) { - foreach (string tableName in dropTheseTables) { - try { + } + else if (mSqlCommand.getProgramMustTruncAndDropTempTable()) + { + foreach (string tableName in dropTheseTables) + { + try + { mSqlCommand.ExecuteNonQuery("TRUNCATE TABLE " + tableName); mSqlCommand.ExecuteNonQuery("DROP TABLE " + tableName); - } catch (Exception e) { + } + catch (Exception e) + { log.Error("TRUNC or DROP TABLE failed:", e); //don't want to stop because of this... } @@ -373,7 +394,8 @@ public void DropTempTables() { } - public DataRowCollection ExecuteSelect(string sqlString) { + public DataRowCollection ExecuteSelect(string sqlString) + { DataSet ds = mSqlCommand.ExecuteSelect(sqlString); return ds.Tables[0].Rows; } diff --git a/PCAxis.Sql/QueryLib_22/MetaQuery_partial.cs b/PCAxis.Sql/QueryLib_22/MetaQuery_partial.cs index 5230f50..bb07116 100644 --- a/PCAxis.Sql/QueryLib_22/MetaQuery_partial.cs +++ b/PCAxis.Sql/QueryLib_22/MetaQuery_partial.cs @@ -1,15 +1,11 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; using System.Data; using System.Reflection; using PCAxis.Sql.Parser_22; -using System.Collections.Specialized; - namespace PCAxis.Sql.QueryLib_22 { /// @@ -21,12 +17,14 @@ public partial class MetaQuery #region all timevalues - public PxSqlValues GetAllTimeValuesList(string mainTable, string sortOrder) { + public PxSqlValues GetAllTimeValuesList(string mainTable, string sortOrder) + { DataSet ds = this.GetAllTimeValues(mainTable, sortOrder); return GetTimeValues(mainTable, ds, true); } - public DataSet GetAllTimeValues(string mainTable, string sortOrder) { + public DataSet GetAllTimeValues(string mainTable, string sortOrder) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -46,17 +44,20 @@ public DataSet GetAllTimeValues(string mainTable, string sortOrder) { #region fixed list of timevalues //For mPxsFile.Query.Time.TimeOption == 0 - public PxSqlValues GetTimeValueList(string mainTable, Dictionary mySelectedValues) { + public PxSqlValues GetTimeValueList(string mainTable, Dictionary mySelectedValues) + { DataSet ds = this.GetTimeValues(mainTable, mySelectedValues.Keys); PxSqlValues myOut = GetTimeValues(mainTable, ds, false); - - foreach (KeyValuePair time in mySelectedValues) { + + foreach (KeyValuePair time in mySelectedValues) + { // Check to se if the value exist. If it was specified in the pxs, but is not present in the // database it will not exist. Maybe this check should be replaced by an exception handling // due to preformance. - if (myOut.ContainsKey(time.Key)) { + if (myOut.ContainsKey(time.Key)) + { myOut[time.Key].SortCodePxs = time.Value; } } @@ -65,7 +66,8 @@ public PxSqlValues GetTimeValueList(string mainTable, Dictionary m return myOut; } - private DataSet GetTimeValues(string mainTable, ICollection valuesFromPxs) { + private DataSet GetTimeValues(string mainTable, ICollection valuesFromPxs) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -90,7 +92,7 @@ private DataSet GetTimeValues(string mainTable, ICollection valuesFromPx "/*** SQLID: " + currentMethod + "_01 ***/ " + " FROM " + DB.ContentsTime.GetNameAndAlias() + " WHERE " + DB.ContentsTime.MainTableCol.Is(mainTable) + - " AND " + DB.ContentsTime.TimePeriodCol.In(valuesFromPxs); + " AND " + DB.ContentsTime.TimePeriodCol.In(valuesFromPxs); // Execute the SQL and return the result (records) as a System.Data.DataSet-object. return mSqlCommand.ExecuteSelect(sqlString); @@ -98,12 +100,14 @@ private DataSet GetTimeValues(string mainTable, ICollection valuesFromPx #endregion fixed list of timevalues #region the last timevalue ( N=1 below) - public PxSqlValues GetTimeValueList(string mainTable) { + public PxSqlValues GetTimeValueList(string mainTable) + { DataSet ds = this.GetTimeValues(mainTable); return GetTimeValues(mainTable, ds, true); } - - private DataSet GetTimeValues(string mainTable) { + + private DataSet GetTimeValues(string mainTable) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -131,13 +135,15 @@ private DataSet GetTimeValues(string mainTable) { #endregion the last timevalue #region last N timevalues - public PxSqlValues GetTimeValueList(string mainTable, int NoOfTimeValues) { - DataSet ds = this.GetTimeValues(mainTable,NoOfTimeValues); - return GetTimeValues(mainTable, ds, true); + public PxSqlValues GetTimeValueList(string mainTable, int NoOfTimeValues) + { + DataSet ds = this.GetTimeValues(mainTable, NoOfTimeValues); + return GetTimeValues(mainTable, ds, true); } - private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { + private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -185,12 +191,14 @@ private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { #region from start timevalue - public PxSqlValues GetTimeValueList(string mainTable, string StartTimeValue) { - DataSet ds = this.GetTimeValues(mainTable,StartTimeValue); + public PxSqlValues GetTimeValueList(string mainTable, string StartTimeValue) + { + DataSet ds = this.GetTimeValues(mainTable, StartTimeValue); return GetTimeValues(mainTable, ds, true); } - private DataSet GetTimeValues(string mainTable, string StartTimeValue) { + private DataSet GetTimeValues(string mainTable, string StartTimeValue) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -230,24 +238,28 @@ private DataSet GetTimeValues(string mainTable, string StartTimeValue) { /// The Dataset /// Sets SortCodePxs to a counter. True for all ((int)mPxsFile.Query.Time.TimeOption != 0). /// - private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode) { + private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode) + { PxSqlValues myOut = new PxSqlValues(); DataRowCollection rows = ds.Tables[0].Rows; //Todo; fix exception - if (rows.Count <= 0) { + if (rows.Count <= 0) + { throw new ApplicationException("tabellen " + mainTable + " inneholder ikke data. (ingen tider)"); } int timeSortOrder = 0; string timeCode = ""; - foreach (DataRow row in rows) { + foreach (DataRow row in rows) + { timeCode = row[this.DB.ContentsTime.TimePeriodCol.PureColumnName()].ToString(); PXSqlValue mValue = new PXSqlValue(timeCode, LanguageCodes); - if (setSortCode) { + if (setSortCode) + { mValue.SortCodePxs = timeSortOrder; timeSortOrder++; } @@ -260,9 +272,9 @@ private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode #endregion Time stuff - - + + } - + } diff --git a/PCAxis.Sql/QueryLib_22/value_fra_master2Rows.cs b/PCAxis.Sql/QueryLib_22/value_fra_master2Rows.cs index 63dbc0c..3da4dc1 100644 --- a/PCAxis.Sql/QueryLib_22/value_fra_master2Rows.cs +++ b/PCAxis.Sql/QueryLib_22/value_fra_master2Rows.cs @@ -1,41 +1,43 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; //This code is generated by master2Rows.xslt. Nope! -namespace PCAxis.Sql.QueryLib_22 { +namespace PCAxis.Sql.QueryLib_22 +{ #region class Value /// /// Holds a list of ValueRows. /// - public class ValueRowDictionary { + public class ValueRowDictionary + { // One entry in the Dictionary for each ValueCode private Dictionary mValueRows = new Dictionary(); - public Dictionary ValueRows { + public Dictionary ValueRows + { get { return mValueRows; } set { mValueRows = value; } } - public ValueRowDictionary(DataTable mTable, SqlDbConfig_22 dbconf) { + public ValueRowDictionary(DataTable mTable, SqlDbConfig_22 dbconf) + { string theValueCode; string theLanguage; int sortOrder = 0; - foreach (DataRow mRow in mTable.Rows) { + foreach (DataRow mRow in mTable.Rows) + { theValueCode = mRow[dbconf.VSValue.ValueCodeCol.PureColumnName()].ToString(); if (!mValueRows.ContainsKey(theValueCode)) { sortOrder += 1; // this will be the sortorder for mainlanguage. Since each language could have its own sortorder this well be set in the Valuetext and coukd be used by the calling program. mValueRows.Add(theValueCode, new ValueRow2(mRow, dbconf, sortOrder)); } //denne bør fel flyttes et par hakk ned - theLanguage = mRow["Language"].ToString(); + theLanguage = mRow["Language"].ToString(); if (!mValueRows[theValueCode].texts.ContainsKey(theLanguage)) { mValueRows[theValueCode].texts.Add(theLanguage, new ValueText2(mRow, dbconf)); @@ -48,27 +50,31 @@ public ValueRowDictionary(DataTable mTable, SqlDbConfig_22 dbconf) { /// /// Holds the attributes for Value. The language dependent parts are stored in the texts dictionary which is indexed by language code. /// - public class ValueRow { + public class ValueRow + { private String mValuePool; - public String ValuePool { + public String ValuePool + { get { return mValuePool; } } private String mValueCode; - public String ValueCode { + public String ValueCode + { get { return mValueCode; } } - - + + public Dictionary texts = new Dictionary(); - public ValueRow(DataRow mRow, SqlDbConfig_22 dbconf,StringCollection languageCodes,int sortOrder) + public ValueRow(DataRow mRow, SqlDbConfig_22 dbconf, StringCollection languageCodes, int sortOrder) { this.mValuePool = mRow[dbconf.Value.ValuePoolCol.Label()].ToString(); - this.mValueCode = mRow[dbconf.Value.ValueCodeCol.Label()].ToString(); - foreach (string languageCode in languageCodes) { + this.mValueCode = mRow[dbconf.Value.ValueCodeCol.Label()].ToString(); + foreach (string languageCode in languageCodes) + { texts.Add(languageCode, new ValueText(mRow, dbconf, languageCode)); } } @@ -97,7 +103,7 @@ public String SortCode get { return mSortCode; } } - internal ValueText(DataRow mRow, SqlDbConfig_22 dbconf, String languageCode) + internal ValueText(DataRow mRow, SqlDbConfig_22 dbconf, String languageCode) { { if (dbconf.isSecondaryLanguage(languageCode)) @@ -106,7 +112,8 @@ internal ValueText(DataRow mRow, SqlDbConfig_22 dbconf, String languageCode) this.mValueTextL = mRow[dbconf.ValueLang2.ValueTextLCol.Label(languageCode)].ToString(); this.mSortCode = mRow[dbconf.ValueLang2.SortCodeCol.Label(languageCode)].ToString(); - } else + } + else { this.mValueTextS = mRow[dbconf.Value.ValueTextSCol.Label()].ToString(); this.mValueTextL = mRow[dbconf.Value.ValueTextLCol.Label()].ToString(); @@ -117,9 +124,11 @@ internal ValueText(DataRow mRow, SqlDbConfig_22 dbconf, String languageCode) } - public class ValueRow2 { + public class ValueRow2 + { private String mValuePool; - public String ValuePool { + public String ValuePool + { get { return mValuePool; } } private String mValueSet; @@ -128,20 +137,24 @@ public String ValueSet get { return mValueSet; } } private String mValueCode; - public String ValueCode { + public String ValueCode + { get { return mValueCode; } } private String mSortOrder; - public String SortOrder { - get { return mSortOrder; } + public String SortOrder + { + get { return mSortOrder; } } private String mFootnote; - public String Footnote { + public String Footnote + { get { return mFootnote; } } public Dictionary texts = new Dictionary(); - public ValueRow2(DataRow mRow, SqlDbConfig_22 dbconf, int sortOrder) { + public ValueRow2(DataRow mRow, SqlDbConfig_22 dbconf, int sortOrder) + { this.mValuePool = mRow[dbconf.VSValue.ValuePoolCol.PureColumnName()].ToString(); // VAL_Vardeforrad this.mValueSet = mRow[dbconf.VSValue.ValueSetCol.PureColumnName()].ToString(); // VAL_Vardemangd this.mValueCode = mRow[dbconf.VSValue.ValueCodeCol.PureColumnName()].ToString(); @@ -154,7 +167,8 @@ public ValueRow2(DataRow mRow, SqlDbConfig_22 dbconf, int sortOrder) { /// /// Holds the language dependent attributes for Value for one language /// - public class ValueText2 { + public class ValueText2 + { private String mSortCodeValue; public String SortCodeValue { @@ -166,15 +180,18 @@ public String SortCodeVsValue get { return mSortCodeVsValue; } } private String mValueTextS; - public String ValueTextS { + public String ValueTextS + { get { return mValueTextS; } } private String mValueTextL; - public String ValueTextL { + public String ValueTextL + { get { return mValueTextL; } } - internal ValueText2(DataRow mRow, SqlDbConfig_22 dbconf) { + internal ValueText2(DataRow mRow, SqlDbConfig_22 dbconf) + { this.mSortCodeValue = mRow["SortCodeValue"].ToString(); this.mSortCodeVsValue = mRow["SortCodeVsValue"].ToString(); this.mValueTextS = mRow[dbconf.Value.ValueTextSCol.PureColumnName()].ToString(); diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Attribute.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Attribute.cs index c7296b1..50d8001 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Attribute.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Attribute.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetAttributeRows(string aMainTable, bool DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) @@ -80,7 +75,7 @@ private String GetAttribute_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.AttributeLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.AttributeLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Attribute.MainTableCol.Is(DB.AttributeLang2.MainTableCol, langCode) + " AND " + DB.Attribute.AttributeCol.Is(DB.AttributeLang2.AttributeCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Contents.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Contents.cs index 57bcf4c..039202c 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Contents.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Contents.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetContentsRows(string aMainTable, bool e DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) @@ -101,7 +96,7 @@ private String GetContents_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ContentsLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ContentsLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Contents.MainTableCol.Is(DB.ContentsLang2.MainTableCol, langCode) + " AND " + DB.Contents.ContentsCol.Is(DB.ContentsLang2.ContentsCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs index 831a798..5e2fbc1 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public DataStorageRow GetDataStorageRow(string aProductCode) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ProductCode = " + aProductCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " ProductCode = " + aProductCode); } - DataStorageRow myOut = new DataStorageRow(myRows[0], DB); + DataStorageRow myOut = new DataStorageRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Footnote.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Footnote.cs index d57fd9e..e99419f 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Footnote.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Footnote.cs @@ -1,13 +1,9 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +27,10 @@ public FootnoteRow GetFootnoteRow(string aFootnoteNo) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," FootnoteNo = " + aFootnoteNo); + throw new PCAxis.Sql.Exceptions.DbException(36, " FootnoteNo = " + aFootnoteNo); } - FootnoteRow myOut = new FootnoteRow(myRows[0], DB, mLanguageCodes); + FootnoteRow myOut = new FootnoteRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -52,7 +48,7 @@ public Dictionary GetFootnoteRows(StringCollection aFootnot System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[aFootnoteNo.Count]; for (int counter = 1; counter <= aFootnoteNo.Count; counter++) { - parameters[counter - 1] = mSqlCommand.GetStringParameter("aFootnoteNo" + counter, aFootnoteNo[counter - 1]); + parameters[counter - 1] = mSqlCommand.GetStringParameter("aFootnoteNo" + counter, aFootnoteNo[counter - 1]); } @@ -60,7 +56,7 @@ public Dictionary GetFootnoteRows(StringCollection aFootnot DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { throw new PCAxis.Sql.Exceptions.DbException(35, " query, see log. "); } @@ -103,7 +99,7 @@ private String GetFootnote_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.FootnoteLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.FootnoteLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Footnote.FootnoteNoCol.Is(DB.FootnoteLang2.FootnoteNoCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteContTime.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteContTime.cs index 9f1ea09..85534f1 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteContTime.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteContTime.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary> GetFootnoteContTimeRows(str DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteContValue.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteContValue.cs index b2eb172..8495baa 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteContValue.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteContValue.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary> GetFootnoteContValueRows(s DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs index 18a5cc8..2924d24 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs @@ -1,13 +1,9 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -30,7 +26,7 @@ public Dictionary GetFootnoteGroupingRows(StringCol System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[aGrouping.Count]; for (int counter = 1; counter <= aGrouping.Count; counter++) { - parameters[counter - 1] = mSqlCommand.GetStringParameter("aGrouping" + counter, aGrouping[counter - 1]); + parameters[counter - 1] = mSqlCommand.GetStringParameter("aGrouping" + counter, aGrouping[counter - 1]); } @@ -38,7 +34,7 @@ public Dictionary GetFootnoteGroupingRows(StringCol DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { throw new PCAxis.Sql.Exceptions.DbException(35, " query, see log. "); } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteMaintTime.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteMaintTime.cs index b783873..2217b64 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteMaintTime.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteMaintTime.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetFootnoteMaintTimeRows(string DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteValueSetValue.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteValueSetValue.cs index 9b93a3b..af8199f 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteValueSetValue.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_FootnoteValueSetValue.cs @@ -1,13 +1,9 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -30,7 +26,7 @@ public Dictionary GetFootnoteValueSetValueRows System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[aValueSet.Count]; for (int counter = 1; counter <= aValueSet.Count; counter++) { - parameters[counter - 1] = mSqlCommand.GetStringParameter("aValueSet" + counter, aValueSet[counter - 1]); + parameters[counter - 1] = mSqlCommand.GetStringParameter("aValueSet" + counter, aValueSet[counter - 1]); } @@ -38,7 +34,7 @@ public Dictionary GetFootnoteValueSetValueRows DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { throw new PCAxis.Sql.Exceptions.DbException(35, " query, see log. "); } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Grouping.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Grouping.cs index f9db452..78dc782 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Grouping.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Grouping.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public GroupingRow GetGroupingRow(string aGrouping) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Grouping = " + aGrouping); + throw new PCAxis.Sql.Exceptions.DbException(36, " Grouping = " + aGrouping); } - GroupingRow myOut = new GroupingRow(myRows[0], DB, mLanguageCodes); + GroupingRow myOut = new GroupingRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -72,7 +64,7 @@ private String GetGrouping_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.GroupingLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.GroupingLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Grouping.GroupingCol.Is(DB.GroupingLang2.GroupingCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs index 94b4ed5..a8e5626 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetGroupingLevelRows_KeyIsLevel(stri DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); } foreach (DataRow sqlRow in myRows) @@ -75,7 +70,7 @@ private String GetGroupingLevel_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.GroupingLevelLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.GroupingLevelLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.GroupingLevel.GroupingCol.Is(DB.GroupingLevelLang2.GroupingCol, langCode) + " AND " + DB.GroupingLevel.LevelNoCol.Is(DB.GroupingLevelLang2.LevelNoCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTable.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTable.cs index c79964e..ab2d07d 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTable.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTable.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public MainTableRow GetMainTableRow(string aMainTable) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable); } - MainTableRow myOut = new MainTableRow(myRows[0], DB, mLanguageCodes); + MainTableRow myOut = new MainTableRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -78,7 +70,7 @@ private String GetMainTable_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.MainTableLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.MainTableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.MainTable.MainTableCol.Is(DB.MainTableLang2.MainTableCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs index 86507f0..7afbeba 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -25,8 +20,8 @@ public Dictionary GetMainTablePersonRows(string aMai // WHERE MTP.MainTable = <"MainTable as parameter reference for your db vendor"> // AND MTP.RolePerson = <"RolePerson as parameter reference for your db vendor"> // - sqlString += " WHERE " + DB.MainTablePerson.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + - " AND " +DB.MainTablePerson.RolePersonCol.Is(mSqlCommand.GetParameterRef("aRolePerson")); + sqlString += " WHERE " + DB.MainTablePerson.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + + " AND " + DB.MainTablePerson.RolePersonCol.Is(mSqlCommand.GetParameterRef("aRolePerson")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -37,9 +32,9 @@ public Dictionary GetMainTablePersonRows(string aMai DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " RolePerson = " + aRolePerson); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " RolePerson = " + aRolePerson); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs index 6d79ee0..30972fa 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,9 +16,9 @@ public MainTableVariableHierarchyRow GetMainTableVariableHierarchyRow(string aMa { //SqlDbConfig dbconf = DB; string sqlString = GetMainTableVariableHierarchy_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + - " AND " +DB.MainTableVariableHierarchy.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")) + - " AND " +DB.MainTableVariableHierarchy.GroupingCol.Is(mSqlCommand.GetParameterRef("aGrouping")); + sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + + " AND " + DB.MainTableVariableHierarchy.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")) + + " AND " + DB.MainTableVariableHierarchy.GroupingCol.Is(mSqlCommand.GetParameterRef("aGrouping")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[3]; @@ -35,10 +30,10 @@ public MainTableVariableHierarchyRow GetMainTableVariableHierarchyRow(string aMa DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable + " Variable = " + aVariable + " Grouping = " + aGrouping); + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable + " Variable = " + aVariable + " Grouping = " + aGrouping); } - MainTableVariableHierarchyRow myOut = new MainTableVariableHierarchyRow(myRows[0], DB); + MainTableVariableHierarchyRow myOut = new MainTableVariableHierarchyRow(myRows[0], DB); return myOut; } @@ -51,8 +46,8 @@ public Dictionary GetMainTableVariableHie // WHERE MTP.MainTable = <"MainTable as parameter reference for your db vendor"> // AND MTP.Variable = <"Variable as parameter reference for your db vendor"> // - sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + - " AND " +DB.MainTableVariableHierarchy.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")); + sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + + " AND " + DB.MainTableVariableHierarchy.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -63,9 +58,9 @@ public Dictionary GetMainTableVariableHie DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " Variable = " + aVariable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " Variable = " + aVariable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs index 3b57234..61e5ac7 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -22,8 +14,8 @@ public MenuSelectionRow GetMenuSelectionRow(string aMenu, string aSelection) { //SqlDbConfig dbconf = DB; string sqlString = GetMenuSelection_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MenuSelection.MenuCol.Is(mSqlCommand.GetParameterRef("aMenu")) + - " AND " +DB.MenuSelection.SelectionCol.Is(mSqlCommand.GetParameterRef("aSelection")); + sqlString += " WHERE " + DB.MenuSelection.MenuCol.Is(mSqlCommand.GetParameterRef("aMenu")) + + " AND " + DB.MenuSelection.SelectionCol.Is(mSqlCommand.GetParameterRef("aSelection")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -34,10 +26,10 @@ public MenuSelectionRow GetMenuSelectionRow(string aMenu, string aSelection) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Menu = " + aMenu + " Selection = " + aSelection); + throw new PCAxis.Sql.Exceptions.DbException(36, " Menu = " + aMenu + " Selection = " + aSelection); } - MenuSelectionRow myOut = new MenuSelectionRow(myRows[0], DB, mLanguageCodes); + MenuSelectionRow myOut = new MenuSelectionRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -79,7 +71,7 @@ private String GetMenuSelection_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.MenuSelectionLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.MenuSelectionLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.MenuSelection.MenuCol.Is(DB.MenuSelectionLang2.MenuCol, langCode) + " AND " + DB.MenuSelection.SelectionCol.Is(DB.MenuSelectionLang2.SelectionCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs index 23f5401..e14eb6c 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs @@ -1,13 +1,6 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; +using System.Data; //This code is generated. @@ -31,10 +24,10 @@ public MetaAdmRow GetMetaAdmRow(string aProperty) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Property = " + aProperty); + throw new PCAxis.Sql.Exceptions.DbException(36, " Property = " + aProperty); } - MetaAdmRow myOut = new MetaAdmRow(myRows[0], DB); + MetaAdmRow myOut = new MetaAdmRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs index baafb06..333c405 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public MetabaseInfoRow GetMetabaseInfoRow(string aModel) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Model = " + aModel); + throw new PCAxis.Sql.Exceptions.DbException(36, " Model = " + aModel); } - MetabaseInfoRow myOut = new MetabaseInfoRow(myRows[0], DB); + MetabaseInfoRow myOut = new MetabaseInfoRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Organization.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Organization.cs index 215870c..ee46b1b 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Organization.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Organization.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public OrganizationRow GetOrganizationRow(string aOrganizationCode) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," OrganizationCode = " + aOrganizationCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " OrganizationCode = " + aOrganizationCode); } - OrganizationRow myOut = new OrganizationRow(myRows[0], DB, mLanguageCodes); + OrganizationRow myOut = new OrganizationRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -72,7 +64,7 @@ private String GetOrganization_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.OrganizationLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.OrganizationLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Organization.OrganizationCodeCol.Is(DB.OrganizationLang2.OrganizationCodeCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Person.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Person.cs index b7229a0..ad219c3 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Person.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Person.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public PersonRow GetPersonRow(string aPersonCode) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," PersonCode = " + aPersonCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " PersonCode = " + aPersonCode); } - PersonRow myOut = new PersonRow(myRows[0], DB); + PersonRow myOut = new PersonRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SecondaryLanguage.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SecondaryLanguage.cs index 7340e5f..a54cbb9 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SecondaryLanguage.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SecondaryLanguage.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetSecondaryLanguageRowsbyLangua DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs index e190bf3..9f375b0 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs @@ -1,13 +1,6 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; +using System.Data; //This code is generated. @@ -31,10 +24,10 @@ public SpecialCharacterRow GetSpecialCharacterRow(string aCharacterType) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," CharacterType = " + aCharacterType); + throw new PCAxis.Sql.Exceptions.DbException(36, " CharacterType = " + aCharacterType); } - SpecialCharacterRow myOut = new SpecialCharacterRow(myRows[0], DB, mLanguageCodes); + SpecialCharacterRow myOut = new SpecialCharacterRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -92,7 +85,7 @@ private String GetSpecialCharacter_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.SpecialCharacterLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.SpecialCharacterLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.SpecialCharacter.CharacterTypeCol.Is(DB.SpecialCharacterLang2.CharacterTypeCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SubTable.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SubTable.cs index e8b0e43..399ce36 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SubTable.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SubTable.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetSubTableRows(string aMainTable, bool e DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) @@ -75,7 +70,7 @@ private String GetSubTable_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.SubTableLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.SubTableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.SubTable.MainTableCol.Is(DB.SubTableLang2.MainTableCol, langCode) + " AND " + DB.SubTable.SubTableCol.Is(DB.SubTableLang2.SubTableCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs index bb85c96..f14fae2 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,9 +16,9 @@ public SubTableVariableRow GetSubTableVariableRow(string aMainTable, string aSub { //SqlDbConfig dbconf = DB; string sqlString = GetSubTableVariable_SQLString_NoWhere(); - sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + - " AND " +DB.SubTableVariable.SubTableCol.Is(mSqlCommand.GetParameterRef("aSubTable")) + - " AND " +DB.SubTableVariable.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")); + sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + + " AND " + DB.SubTableVariable.SubTableCol.Is(mSqlCommand.GetParameterRef("aSubTable")) + + " AND " + DB.SubTableVariable.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[3]; @@ -35,10 +30,10 @@ public SubTableVariableRow GetSubTableVariableRow(string aMainTable, string aSub DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable + " SubTable = " + aSubTable + " Variable = " + aVariable); + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable + " SubTable = " + aSubTable + " Variable = " + aVariable); } - SubTableVariableRow myOut = new SubTableVariableRow(myRows[0], DB); + SubTableVariableRow myOut = new SubTableVariableRow(myRows[0], DB); return myOut; } @@ -51,8 +46,8 @@ public Dictionary GetSubTableVariableRowskeyVariabl // WHERE STV.MainTable = <"MainTable as parameter reference for your db vendor"> // AND STV.SubTable = <"SubTable as parameter reference for your db vendor"> // - sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + - " AND " +DB.SubTableVariable.SubTableCol.Is(mSqlCommand.GetParameterRef("aSubTable")); + sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + + " AND " + DB.SubTableVariable.SubTableCol.Is(mSqlCommand.GetParameterRef("aSubTable")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -63,9 +58,9 @@ public Dictionary GetSubTableVariableRowskeyVariabl DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " SubTable = " + aSubTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " SubTable = " + aSubTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs index f3d0458..50105fb 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs @@ -1,13 +1,4 @@ using System; -using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -48,7 +39,7 @@ private String GetTextCatalog_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.TextCatalogLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.TextCatalogLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.TextCatalog.TextCatalogNoCol.Is(DB.TextCatalogLang2.TextCatalogNoCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs index a2ab26d..bb0e5a8 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public TimeScaleRow GetTimeScaleRow(string aTimeScale) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," TimeScale = " + aTimeScale); + throw new PCAxis.Sql.Exceptions.DbException(36, " TimeScale = " + aTimeScale); } - TimeScaleRow myOut = new TimeScaleRow(myRows[0], DB, mLanguageCodes); + TimeScaleRow myOut = new TimeScaleRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -70,7 +62,7 @@ private String GetTimeScale_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.TimeScaleLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.TimeScaleLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.TimeScale.TimeScaleCol.Is(DB.TimeScaleLang2.TimeScaleCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_VSValue.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_VSValue.cs index a3a6f9e..9795240 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_VSValue.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_VSValue.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,9 +13,9 @@ public VSValueRow GetVSValueRow(string aValueSet, string aValuePool, string aVal { //SqlDbConfig dbconf = DB; string sqlString = GetVSValue_SQLString_NoWhere(); - sqlString += " WHERE " + DB.VSValue.ValueSetCol.Is(mSqlCommand.GetParameterRef("aValueSet")) + - " AND " +DB.VSValue.ValuePoolCol.Is(mSqlCommand.GetParameterRef("aValuePool")) + - " AND " +DB.VSValue.ValueCodeCol.Is(mSqlCommand.GetParameterRef("aValueCode")); + sqlString += " WHERE " + DB.VSValue.ValueSetCol.Is(mSqlCommand.GetParameterRef("aValueSet")) + + " AND " + DB.VSValue.ValuePoolCol.Is(mSqlCommand.GetParameterRef("aValuePool")) + + " AND " + DB.VSValue.ValueCodeCol.Is(mSqlCommand.GetParameterRef("aValueCode")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[3]; @@ -35,10 +27,10 @@ public VSValueRow GetVSValueRow(string aValueSet, string aValuePool, string aVal DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValueSet = " + aValueSet + " ValuePool = " + aValuePool + " ValueCode = " + aValueCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " ValueSet = " + aValueSet + " ValuePool = " + aValuePool + " ValueCode = " + aValueCode); } - VSValueRow myOut = new VSValueRow(myRows[0], DB, mLanguageCodes); + VSValueRow myOut = new VSValueRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -71,7 +63,7 @@ private String GetVSValue_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.VSValueLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.VSValueLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.VSValue.ValueSetCol.Is(DB.VSValueLang2.ValueSetCol, langCode) + " AND " + DB.VSValue.ValuePoolCol.Is(DB.VSValueLang2.ValuePoolCol, langCode) + " AND " + DB.VSValue.ValueCodeCol.Is(DB.VSValueLang2.ValueCodeCol, langCode); diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Value.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Value.cs index dbbc6ec..262f24b 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Value.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Value.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -24,8 +19,8 @@ public Dictionary GetValueRows(string aValuePool, bool emptyRo // // WHERE VAL.ValuePool = <"ValuePool as parameter reference for your db vendor"> // - sqlString += " WHERE " + DB.Value.ValuePoolCol.Is(mSqlCommand.GetParameterRef("aValuePool")) + - " AND " +DB.Value.MetaIdCol.IsNotNULL(); + sqlString += " WHERE " + DB.Value.ValuePoolCol.Is(mSqlCommand.GetParameterRef("aValuePool")) + + " AND " + DB.Value.MetaIdCol.IsNotNULL(); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1]; @@ -35,9 +30,9 @@ public Dictionary GetValueRows(string aValuePool, bool emptyRo DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " ValuePool = " + aValuePool); + throw new PCAxis.Sql.Exceptions.DbException(35, " ValuePool = " + aValuePool); } foreach (DataRow sqlRow in myRows) @@ -83,7 +78,7 @@ private String GetValue_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValueLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValueLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Value.ValuePoolCol.Is(DB.ValueLang2.ValuePoolCol, langCode) + " AND " + DB.Value.ValueCodeCol.Is(DB.ValueLang2.ValueCodeCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs index c41eb07..6949236 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -25,8 +20,8 @@ public Dictionary GetValueGroupRowskeyValueCode(string aG // WHERE VPL.Grouping = <"Grouping as parameter reference for your db vendor"> // AND VPL.GroupCode = <"GroupCode as parameter reference for your db vendor"> // - sqlString += " WHERE " + DB.ValueGroup.GroupingCol.Is(mSqlCommand.GetParameterRef("aGrouping")) + - " AND " +DB.ValueGroup.GroupCodeCol.Is(mSqlCommand.GetParameterRef("aGroupCode")); + sqlString += " WHERE " + DB.ValueGroup.GroupingCol.Is(mSqlCommand.GetParameterRef("aGrouping")) + + " AND " + DB.ValueGroup.GroupCodeCol.Is(mSqlCommand.GetParameterRef("aGroupCode")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -37,9 +32,9 @@ public Dictionary GetValueGroupRowskeyValueCode(string aG DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping + " GroupCode = " + aGroupCode); + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping + " GroupCode = " + aGroupCode); } foreach (DataRow sqlRow in myRows) @@ -81,7 +76,7 @@ private String GetValueGroup_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValueGroupLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValueGroupLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValueGroup.GroupingCol.Is(DB.ValueGroupLang2.GroupingCol, langCode) + " AND " + DB.ValueGroup.GroupCodeCol.Is(DB.ValueGroupLang2.GroupCodeCol, langCode) + " AND " + DB.ValueGroup.ValueCodeCol.Is(DB.ValueGroupLang2.ValueCodeCol, langCode); diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs index 5edd566..90bb1b8 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public ValuePoolRow GetValuePoolRow(string aValuePool) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValuePool = " + aValuePool); + throw new PCAxis.Sql.Exceptions.DbException(36, " ValuePool = " + aValuePool); } - ValuePoolRow myOut = new ValuePoolRow(myRows[0], DB, mLanguageCodes); + ValuePoolRow myOut = new ValuePoolRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -71,7 +63,7 @@ private String GetValuePool_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValuePoolLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValuePoolLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValuePool.ValuePoolCol.Is(DB.ValuePoolLang2.ValuePoolCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs index 828ea2c..a87302f 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public ValueSetRow GetValueSetRow(string aValueSet) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValueSet = " + aValueSet); + throw new PCAxis.Sql.Exceptions.DbException(36, " ValueSet = " + aValueSet); } - ValueSetRow myOut = new ValueSetRow(myRows[0], DB, mLanguageCodes); + ValueSetRow myOut = new ValueSetRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -74,7 +66,7 @@ private String GetValueSet_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValueSetLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValueSetLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValueSet.ValueSetCol.Is(DB.ValueSetLang2.ValueSetCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs index 399eefa..d427c6d 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetValueSetGroupingRowskeyGroupin DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " ValueSet = " + aValueSet); + throw new PCAxis.Sql.Exceptions.DbException(35, " ValueSet = " + aValueSet); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Variable.cs b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Variable.cs index 85d3acc..ea80613 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Variable.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedMetaQueryParts/MetaQuery_Variable.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public VariableRow GetVariableRow(string aVariable) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Variable = " + aVariable); + throw new PCAxis.Sql.Exceptions.DbException(36, " Variable = " + aVariable); } - VariableRow myOut = new VariableRow(myRows[0], DB, mLanguageCodes); + VariableRow myOut = new VariableRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -68,7 +60,7 @@ private String GetVariable_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.VariableLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.VariableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Variable.VariableCol.Is(DB.VariableLang2.VariableCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/AttributeRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/AttributeRow.cs index b440797..a6c8159 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/AttributeRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/AttributeRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/ContentsRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/ContentsRow.cs index cc5fc93..ad9f762 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/ContentsRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/ContentsRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/DataStorageRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/DataStorageRow.cs index 04bc51e..48cd95b 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/DataStorageRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/DataStorageRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteContTimeRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteContTimeRow.cs index 164c0c6..d50c0e0 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteContTimeRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteContTimeRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteContValueRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteContValueRow.cs index 8ad55f6..5f42254 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteContValueRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteContValueRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteGroupingRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteGroupingRow.cs index 400115d..cae0daa 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteGroupingRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteGroupingRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteMaintTimeRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteMaintTimeRow.cs index 11632c3..2a8e138 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteMaintTimeRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteMaintTimeRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteRow.cs index 7f2c398..d2e23ad 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteValueSetValueRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteValueSetValueRow.cs index 8fc7ecf..1c0e0ae 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteValueSetValueRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/FootnoteValueSetValueRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/GroupingLevelRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/GroupingLevelRow.cs index 1a2fab8..40b6aad 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/GroupingLevelRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/GroupingLevelRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/GroupingRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/GroupingRow.cs index e6c56c9..2018b90 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/GroupingRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/GroupingRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTablePersonRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTablePersonRow.cs index 588e1fe..1d9c825 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTablePersonRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTablePersonRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTableRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTableRow.cs index 0497140..e02e60e 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTableRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTableRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTableVariableHierarchyRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTableVariableHierarchyRow.cs index 94828e1..4bf01fc 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTableVariableHierarchyRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/MainTableVariableHierarchyRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/MenuSelectionRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/MenuSelectionRow.cs index 7777670..49084a9 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/MenuSelectionRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/MenuSelectionRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/MetaAdmRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/MetaAdmRow.cs index e61e43a..4c6a4ba 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/MetaAdmRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/MetaAdmRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/MetabaseInfoRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/MetabaseInfoRow.cs index eaf49e8..72446ea 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/MetabaseInfoRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/MetabaseInfoRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/OrganizationRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/OrganizationRow.cs index 932a7a3..1b15046 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/OrganizationRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/OrganizationRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/PersonRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/PersonRow.cs index f718a3d..69630e8 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/PersonRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/PersonRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/SecondaryLanguageRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/SecondaryLanguageRow.cs index 053f49a..9725824 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/SecondaryLanguageRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/SecondaryLanguageRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/SpecialCharacterRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/SpecialCharacterRow.cs index 83de593..f88060a 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/SpecialCharacterRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/SpecialCharacterRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/SubTableRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/SubTableRow.cs index 98eadd0..e5f0aa6 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/SubTableRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/SubTableRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/SubTableVariableRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/SubTableVariableRow.cs index bc70359..6476215 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/SubTableVariableRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/SubTableVariableRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/TextCatalogRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/TextCatalogRow.cs index c6a81a6..aa810f4 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/TextCatalogRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/TextCatalogRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/TimeScaleRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/TimeScaleRow.cs index daba178..dd09d44 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/TimeScaleRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/TimeScaleRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/VSValueRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/VSValueRow.cs index 7e74206..e078a66 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/VSValueRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/VSValueRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueGroupRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueGroupRow.cs index 4768d37..2244863 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueGroupRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueGroupRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/ValuePoolRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/ValuePoolRow.cs index c397616..4516c89 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/ValuePoolRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/ValuePoolRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueRow.cs index 164cb5f..075cad3 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueSetGroupingRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueSetGroupingRow.cs index 5d8c449..4f5a0ad 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueSetGroupingRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueSetGroupingRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueSetRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueSetRow.cs index ec4dbce..7dcc910 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueSetRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/ValueSetRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/GeneratedRows/VariableRow.cs b/PCAxis.Sql/QueryLib_23/GeneratedRows/VariableRow.cs index 5e42895..fd0e3f9 100644 --- a/PCAxis.Sql/QueryLib_23/GeneratedRows/VariableRow.cs +++ b/PCAxis.Sql/QueryLib_23/GeneratedRows/VariableRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_23/HandmadeRows/FootNoteRows.cs b/PCAxis.Sql/QueryLib_23/HandmadeRows/FootNoteRows.cs index 4e9f118..b01d037 100644 --- a/PCAxis.Sql/QueryLib_23/HandmadeRows/FootNoteRows.cs +++ b/PCAxis.Sql/QueryLib_23/HandmadeRows/FootNoteRows.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; using System.Data; -using PCAxis.Sql.DbClient; //For executing SQLs. + using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; //using PCAxis.Sql.QueryLib; -using log4net; namespace PCAxis.Sql.QueryLib_23 @@ -27,7 +25,7 @@ public enum PXSqlNoteType } public class RelevantFootNotesRow { - + private string mFootNoteNo; public string FootNoteNo { @@ -86,7 +84,7 @@ public string ShowFootNote } private string mPresCharacter; - public string PresCharacter + public string PresCharacter { get { return mPresCharacter; } } @@ -94,7 +92,7 @@ public string PresCharacter public Dictionary texts = new Dictionary(); public RelevantFootNotesRow(DataRow myRow, SqlDbConfig_23 dbconf, StringCollection languageCodes) { - + this.mFootNoteNo = myRow["FootNoteNo"].ToString(); //this.mFootNoteType = myRow["FootNoteType"].ToString(); this.mFootNoteType = (PXSqlNoteType)Enum.Parse(typeof(PXSqlNoteType), myRow["FootNoteType"].ToString()); @@ -114,7 +112,7 @@ public RelevantFootNotesRow(DataRow myRow, SqlDbConfig_23 dbconf, StringCollecti } - + } diff --git a/PCAxis.Sql/QueryLib_23/HandmadeRows/GetNumberOfDistinctAttributeColumns.cs b/PCAxis.Sql/QueryLib_23/HandmadeRows/GetNumberOfDistinctAttributeColumns.cs index 8469c40..2392370 100644 --- a/PCAxis.Sql/QueryLib_23/HandmadeRows/GetNumberOfDistinctAttributeColumns.cs +++ b/PCAxis.Sql/QueryLib_23/HandmadeRows/GetNumberOfDistinctAttributeColumns.cs @@ -1,13 +1,6 @@ -using System; -using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. diff --git a/PCAxis.Sql/QueryLib_23/HandmadeRows/MainTableVariableRow.cs b/PCAxis.Sql/QueryLib_23/HandmadeRows/MainTableVariableRow.cs index 902dc33..fd098b6 100644 --- a/PCAxis.Sql/QueryLib_23/HandmadeRows/MainTableVariableRow.cs +++ b/PCAxis.Sql/QueryLib_23/HandmadeRows/MainTableVariableRow.cs @@ -1,18 +1,20 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Data; + using PCAxis.Sql.DbConfig; -namespace PCAxis.Sql.QueryLib_23 { +namespace PCAxis.Sql.QueryLib_23 +{ /// /// Holds the attributes for reduced version SubTableVariable. /// - public class MainTableVariableRow { + public class MainTableVariableRow + { + + public static string sqlString(SqlDbConfig_23 DB) + { - public static string sqlString(SqlDbConfig_23 DB) { - string currentMethod = "MainTableVariableRow.sqlString"; SqlDbConfig_23.TblSubTableVariable stv = DB.SubTableVariable; @@ -31,12 +33,14 @@ public static string sqlString(SqlDbConfig_23 DB) { } private String mVariable; - public String Variable { + public String Variable + { get { return mVariable; } } private String mVariableType; - public String VariableType { + public String VariableType + { get { return mVariableType; } } @@ -45,7 +49,8 @@ public String StoreColumnNo { get { return mStoreColumnNo; } } - public MainTableVariableRow(DataRow myRow, SqlDbConfig_23 dbconf) { + public MainTableVariableRow(DataRow myRow, SqlDbConfig_23 dbconf) + { this.mVariable = myRow[dbconf.SubTableVariable.VariableCol.Label()].ToString(); this.mVariableType = myRow[dbconf.SubTableVariable.VariableTypeCol.Label()].ToString(); this.mStoreColumnNo = myRow[dbconf.SubTableVariable.StoreColumnNoCol.Label()].ToString(); diff --git a/PCAxis.Sql/QueryLib_23/MetaQuery.cs b/PCAxis.Sql/QueryLib_23/MetaQuery.cs index bb2c64f..95a4f1f 100644 --- a/PCAxis.Sql/QueryLib_23/MetaQuery.cs +++ b/PCAxis.Sql/QueryLib_23/MetaQuery.cs @@ -1,19 +1,13 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; - using System.Data; //For DataSet-objects. using System.Reflection; //For MethodBase.GetCurrentMethod(). -using System.Globalization;// for CultureInfo - +using log4net; using PCAxis.Sql.DbClient; //For executing SQLs. using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; - - -using log4net; using PCAxis.Sql.Exceptions; @@ -27,7 +21,7 @@ public partial class MetaQuery { private static readonly ILog log = LogManager.GetLogger(typeof(MetaQuery)); #if DEBUG - private static readonly log4net.ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(),"LogTime"); + private static readonly log4net.ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(), "LogTime"); #endif @@ -101,9 +95,9 @@ public string GetDataTablesPrefix(string aProductId) } - - + + /// Gets the languages for which the maintable exists in the database. /// /// The maintable @@ -113,23 +107,23 @@ public StringCollection GetLanguagesForMainTable(string mainTableId, StringColle { StringCollection maintableLanguages = new StringCollection(); maintableLanguages.Add(DB.MainLanguage.code); - + Dictionary SLs = this.GetSecondaryLanguageRowsbyLanguage(mainTableId, true); - foreach (String dbLang in dbLanguages) + foreach (String dbLang in dbLanguages) + { + if (DB.isSecondaryLanguage(dbLang)) { - if (DB.isSecondaryLanguage(dbLang)) + if (SLs.ContainsKey(dbLang)) { - if (SLs.ContainsKey(dbLang)) + if (SLs[dbLang].CompletelyTranslated.Equals(DB.Codes.Yes)) { - if (SLs[dbLang].CompletelyTranslated.Equals(DB.Codes.Yes)) - { - maintableLanguages.Add(dbLang); - } + maintableLanguages.Add(dbLang); } - } + } - + } + return maintableLanguages; } @@ -143,7 +137,7 @@ public List GetMainTableVariableRows(string aMainTable) System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1]; parameters[0] = DB.SubTableVariable.MainTableCol.GetStringParameter(aMainTable); - + DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; @@ -171,7 +165,7 @@ public List GetValueSetRows2(string MainTable, string Variable) DB.ValueSet.ValueSetCol.ForSelect() + ", "; sqlString += DB.ValueSet.PresTextCol.ForSelect() + ", "; - + sqlString += DB.ValueSet.DescriptionCol.ForSelect() + ", " + DB.ValueSet.EliminationCol.ForSelect() + ", " + DB.ValueSet.ValuePoolCol.ForSelect() + ", " + @@ -184,8 +178,8 @@ public List GetValueSetRows2(string MainTable, string Variable) { if (DB.isSecondaryLanguage(langCode)) { - - sqlString += ", " + DB.ValueSetLang2.PresTextCol.ForSelectWithFallback(langCode, DB.ValueSet.PresTextCol) + " "; + + sqlString += ", " + DB.ValueSetLang2.PresTextCol.ForSelectWithFallback(langCode, DB.ValueSet.PresTextCol) + " "; sqlString += ", " + DB.ValueSetLang2.DescriptionCol.ForSelectWithFallback(langCode, DB.ValueSet.DescriptionCol) + " "; } @@ -297,7 +291,7 @@ public DataSet GetValueWildCardBySubTable(string aMainTable, string aVariable, s parameters[2] = DB.VSValue.ValueCodeCol.GetStringParameter(sqlWildCard); } - + // Execute the SQL and return the result (records) as a System.Data.DataSet-object. return mSqlCommand.ExecuteSelect(sqlString, parameters); } @@ -375,9 +369,9 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle sqlString += " FROM ("; #region language section int LangCounter = 0; - + //TODO; reduserte denne mye, kan man bruke noe generert nå, mon tro - + foreach (String langCode in mLanguageCodes) { if (LangCounter > 0) @@ -391,15 +385,15 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle + ", " + DB.Value.ValuePoolCol.Id() + " AS " + DB.Value.ValuePoolCol.PureColumnName(); - - sqlString += ", " + DB.Value.ValueTextLCol.Id() + " AS " + DB.Value.ValueTextLCol.PureColumnName() - + ", " + DB.Value.ValueTextSCol.Id() + " AS " + DB.Value.ValueTextSCol.PureColumnName(); - + + sqlString += ", " + DB.Value.ValueTextLCol.Id() + " AS " + DB.Value.ValueTextLCol.PureColumnName() + + ", " + DB.Value.ValueTextSCol.Id() + " AS " + DB.Value.ValueTextSCol.PureColumnName(); + sqlString += ", " + DB.Value.SortCodeCol.Id() + " AS SortCodeValue" + " FROM " + DB.MetaOwner + DB.Value.TableName + " " + DB.Value.Alias; - + } else { @@ -407,15 +401,15 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle + ", " + DB.ValueLang2.ValueCodeCol.Id(langCode) + " AS " + DB.Value.ValueCodeCol.PureColumnName() + ", " + DB.ValueLang2.ValuePoolCol.Id(langCode) + " AS " + DB.Value.ValuePoolCol.PureColumnName(); - - sqlString += ", " + DB.ValueLang2.ValueTextLCol.Id(langCode) + " AS " + DB.Value.ValueTextLCol.PureColumnName() - + ", " + DB.ValueLang2.ValueTextSCol.Id(langCode) + " AS " + DB.Value.ValueTextSCol.PureColumnName(); - + + sqlString += ", " + DB.ValueLang2.ValueTextLCol.Id(langCode) + " AS " + DB.Value.ValueTextLCol.PureColumnName() + + ", " + DB.ValueLang2.ValueTextSCol.Id(langCode) + " AS " + DB.Value.ValueTextSCol.PureColumnName(); + sqlString += ", " + DB.ValueLang2.SortCodeCol.Id(langCode) + " AS SortCodeValue" + " FROM " + DB.ValueLang2.GetNameAndAlias(langCode); - + } LangCounter++; } @@ -436,10 +430,10 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle #region where section - + sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(); int numberOfDbParameters = 1; - + if (subTables != null) { sqlString += " AND " + DB.SubTableVariable.SubTableCol.In(subTables); @@ -449,11 +443,11 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle sqlString += " AND " + DB.SubTableVariable.VariableCol.Is(); numberOfDbParameters++; - + #endregion where section sqlString += " ORDER BY Language, SortCodeVsValue, SortCodeValue, bx." + DB.Value.ValueCodeCol.PureColumnName(); - + #region parameters to where section System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[numberOfDbParameters]; @@ -470,13 +464,13 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle parameters[DbParameterIndex] = DB.SubTableVariable.VariableCol.GetStringParameter(variable); DbParameterIndex++; - + #endregion parameters to where section DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataTable myTable = ds.Tables[0]; - + ValueRow2HMDictionary myOut = new ValueRow2HMDictionary(myTable, DB, this); @@ -589,7 +583,7 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle // piv added DISTINCT #endregion example - + int numberOfDbParameters = mLanguageCodes.Count * (2 + subTables.Count); int DbParameterIndex = 0; @@ -620,15 +614,15 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle + ", " + DB.Value.ValueCodeCol.Id() + " AS " + DB.Value.ValueCodeCol.PureColumnName() + ", " + DB.Value.ValuePoolCol.Id() + " AS " + DB.Value.ValuePoolCol.PureColumnName(); - - sqlString += ", " + DB.Value.ValueTextLCol.Id() + " AS " + DB.Value.ValueTextLCol.PureColumnName() - + ", " + DB.Value.ValueTextSCol.Id() + " AS " + DB.Value.ValueTextSCol.PureColumnName(); - + + sqlString += ", " + DB.Value.ValueTextLCol.Id() + " AS " + DB.Value.ValueTextLCol.PureColumnName() + + ", " + DB.Value.ValueTextSCol.Id() + " AS " + DB.Value.ValueTextSCol.PureColumnName(); + sqlString += ", " + DB.Value.SortCodeCol.Id() + " AS SortCodeValue" + " FROM " + DB.Value.GetNameAndAlias(); - + #endregion primary language } else @@ -638,15 +632,15 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle + ", " + DB.ValueLang2.ValueCodeCol.Id(langCode) + " AS " + DB.Value.ValueCodeCol.PureColumnName() + ", " + DB.ValueLang2.ValuePoolCol.Id(langCode) + " AS " + DB.Value.ValuePoolCol.PureColumnName(); - - sqlString += ", " + DB.ValueLang2.ValueTextLCol.Id(langCode) + " AS " + DB.Value.ValueTextLCol.PureColumnName() - + ", " + DB.ValueLang2.ValueTextSCol.Id(langCode) + " AS " + DB.Value.ValueTextSCol.PureColumnName(); - + + sqlString += ", " + DB.ValueLang2.ValueTextLCol.Id(langCode) + " AS " + DB.Value.ValueTextLCol.PureColumnName() + + ", " + DB.ValueLang2.ValueTextSCol.Id(langCode) + " AS " + DB.Value.ValueTextSCol.PureColumnName(); + sqlString += ", " + DB.ValueLang2.SortCodeCol.Id(langCode) + " AS SortCodeValue" + " FROM " + DB.ValueLang2.GetNameAndAlias(langCode); - + #endregion secondary language } @@ -659,7 +653,7 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle + " ON (bx." + DB.Value.ValuePoolCol.PureColumnName() + " = bz." + DB.Value.ValuePoolCol.PureColumnName() + " AND bx." + DB.Value.ValueCodeCol.PureColumnName() + " = bz." + DB.Value.ValueCodeCol.PureColumnName() + ")" + " JOIN " + DB.SubTableVariable.GetNameAndAlias() + " ON (bz." + DB.VSValue.ValueSetCol.PureColumnName() + " = " + DB.SubTableVariable.ValueSetCol.Id() + ")" - + " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable"+langCode)); + + " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable" + langCode)); @@ -669,11 +663,11 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle // If extraction from only one subtable, this paragraph must be included if (subTables.Count > 0) { - string tmpNameBase=""; + string tmpNameBase = ""; sqlString += " AND " + DB.SubTableVariable.SubTableCol.Id() + " IN ("; for (int counter = 0; counter < subTables.Count; counter++) { - tmpNameBase= "aSubTable" + langCode + (counter + 1); + tmpNameBase = "aSubTable" + langCode + (counter + 1); sqlString += mSqlCommand.GetParameterRef(tmpNameBase) + " ,"; parameters[DbParameterIndex] = mSqlCommand.GetStringParameter(tmpNameBase, subTables[counter]); DbParameterIndex++; @@ -695,11 +689,11 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); //DataRowCollection myRows = ds.Tables[0].Rows; DataTable myTable = ds.Tables[0]; - + ValueRow2HMDictionary myOut = new ValueRow2HMDictionary(myTable, DB, this); return myOut; } - + // newnewnew //flyttet hit fra fra_master2MetaQuery @@ -714,9 +708,9 @@ public List GetValueRowsByValuePool(string valuePool, StringCollecti { if (!DB.isSecondaryLanguage(langCode)) { - sqlString += ", " + DB.Value.ValueTextSCol.ForSelect(); - sqlString += ", " + DB.Value.ValueTextLCol.ForSelect(); - sqlString += ", " + DB.Value.SortCodeCol.ForSelect(); + sqlString += ", " + DB.Value.ValueTextSCol.ForSelect(); + sqlString += ", " + DB.Value.ValueTextLCol.ForSelect(); + sqlString += ", " + DB.Value.SortCodeCol.ForSelect(); } else { @@ -725,11 +719,11 @@ public List GetValueRowsByValuePool(string valuePool, StringCollecti joinString += " ON ( " + DB.ValueLang2.ValuePoolCol.Id(langCode) + " = " + DB.Value.ValuePoolCol.Id() + " AND " + DB.ValueLang2.ValueCodeCol.Id(langCode) + " = " + DB.Value.ValueCodeCol.Id() + ")"; - - sqlString += ", " + GetColumnSelectionString(DB.ValueLang2.Alias + DB.GetMetaSuffix(langCode), DB.ValueLang2.ValueTextSCol.PureColumnName()); - sqlString += ", " + GetColumnSelectionString(DB.ValueLang2.Alias + DB.GetMetaSuffix(langCode), DB.ValueLang2.ValueTextLCol.PureColumnName()); - + sqlString += ", " + GetColumnSelectionString(DB.ValueLang2.Alias + DB.GetMetaSuffix(langCode), DB.ValueLang2.ValueTextSCol.PureColumnName()); + sqlString += ", " + GetColumnSelectionString(DB.ValueLang2.Alias + DB.GetMetaSuffix(langCode), DB.ValueLang2.ValueTextLCol.PureColumnName()); + + sqlString += ", " + GetColumnSelectionString(DB.ValueLang2.Alias + DB.GetMetaSuffix(langCode), DB.ValueLang2.SortCodeCol.PureColumnName()); } @@ -749,7 +743,7 @@ public List GetValueRowsByValuePool(string valuePool, StringCollecti System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1 + someValueCodes.Count]; parameters[0] = DB.Value.ValuePoolCol.GetStringParameter(valuePool); - + if (someValueCodes.Count > 0) { Array.Copy(DB.Value.ValueCodeCol.GetStringParameters(someValueCodes), 0, parameters, 1, someValueCodes.Count); @@ -805,7 +799,7 @@ public int GetNumberOfValuesInValueSetById(string aValueSet) return int.Parse((mMetaSet.Tables[0].Rows[0]["COUNT"]).ToString()); } - + /// /// Logs a line if Database and configfile disagrees on CNMM version /// @@ -823,10 +817,10 @@ private void CompareCNMMVersionSources() versionFromConfig + " in config file. They must be equal"; log.Warn(message); } - + } - + //flyttet over fra fra_master2MetaQuery. Denne tabellen er ond @@ -836,7 +830,7 @@ private void CompareCNMMVersionSources() public TextCatalogRow GetTextCatalogRow() { string aTextType = DB.Keywords.ContentVariable; - + string sqlString = GetTextCatalog_SQLString_NoWhere(); sqlString += " WHERE " + DB.TextCatalog.TextTypeCol.IsUppered(); @@ -980,7 +974,7 @@ public List GetRelevantFoonotes(string mainTable) string sqlString = "select bx.MainTable, bx.FootNoteNo, bx.FootNoteType, bx.Contents, bx.Variable, bx.ValuePool, bx.ValueCode," + "bx.TimePeriod, bx.Subtable," + DB.Footnote.MandOptCol.Id() + " as MandOpt," + DB.Footnote.ShowFootnoteCol.Id() + " as ShowFootNotes," + DB.Footnote.PresCharacterCol.Id() + " as PresCharacter," + - DB.Footnote.FootnoteTextCol.ForSelect() ; + DB.Footnote.FootnoteTextCol.ForSelect(); foreach (String langCode in mLanguageCodes) { if (DB.isSecondaryLanguage(langCode)) @@ -996,23 +990,23 @@ public List GetRelevantFoonotes(string mainTable) "(select fi." + DB.FootnoteContVbl.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteContVbl.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '3' as FootNoteType, fi." + DB.FootnoteContVbl.ContentsCol.PureColumnName() + " as Contents, fi." + DB.FootnoteContVbl.VariableCol.PureColumnName() + " as Variable, '*' as ValuePool, '*' as Valuecode, " + "'*' as TimePeriod, '*' as Subtable " + "from " + Md + DB.FootnoteContVbl.TableName + " fi) " + - // "union " + - // "(select fi." + DB.FootnoteContValue.MainTableCol.PureColumnName() + ", fi." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + ", '4' as FootNoteType, fi." + DB.FootnoteContValue.ContentsCol.PureColumnName() + " as Contents, fi." + DB.FootnoteContValue.VariableCol.PureColumnName() + " as Variable, fi." + DB.FootnoteContValue.ValuePoolCol.PureColumnName() + " as ValuePool, fi." + DB.FootnoteContValue.ValueCodeCol.PureColumnName() + " as ValueCode, " + - // "'*' as TimePeriod, '*' as SubTable " + - // "from " + Md + DB.FootnoteContValue.TableName + " fi " + - // "where COALESCE(fi." + DB.FootnoteContValue.CellnoteCol.PureColumnName() + ", 'XX') <> '" + DB.Codes.Yes + "') " + - // "union " + - // "(select fi." + DB.FootnoteContTime.MainTableCol.PureColumnName() + " as MainTable,fi." + DB.FootnoteContTime.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '41' as FootNoteType, fi." + DB.FootnoteContTime.ContentsCol.PureColumnName() + " as Contents, '*' as Variable, '*' as ValuePool, '*' as ValueCode," + - // "fi." + DB.FootnoteContTime.TimePeriodCol.PureColumnName() + " as TimePeriod, '*' as SubTable " + - // "from " + Md + DB.FootnoteContTime.TableName + " fi " + - // "where COALESCE(fi." + DB.FootnoteContTime.CellnoteCol.PureColumnName() + ", 'XX') <> '" + DB.Codes.Yes + "') " + - // "union " + - // "(select fih." + DB.FootnoteContValue.MainTableCol.PureColumnName() + ", fih." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '999' as FootNoteType, fih." + DB.FootnoteContValue.ContentsCol.PureColumnName() + " as Contents, fih." + DB.FootnoteContValue.VariableCol.PureColumnName() + " Variable, fih." + DB.FootnoteContValue.ValuePoolCol.PureColumnName() + " as ValuePool, fih." + DB.FootnoteContValue.ValueCodeCol.PureColumnName() + " as ValueCode, " + - // "fit." + DB.FootnoteContTime.TimePeriodCol.PureColumnName() + " as TimePeriod, '*' as SubTable " + - // "from " + Md + DB.FootnoteContValue.TableName + " fih, " + Md + DB.FootnoteContTime.TableName + " fit " + - // "where fih." + DB.FootnoteContValue.CellnoteCol.PureColumnName() + " = '" + DB.Codes.Yes + "' " + - // "and fit." + DB.FootnoteContTime.CellnoteCol.PureColumnName() + " = '" + DB.Codes.Yes + "' " + - // "and fit." + DB.FootnoteContTime.FootnoteNoCol.PureColumnName() + " = fih." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + ") " + + // "union " + + // "(select fi." + DB.FootnoteContValue.MainTableCol.PureColumnName() + ", fi." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + ", '4' as FootNoteType, fi." + DB.FootnoteContValue.ContentsCol.PureColumnName() + " as Contents, fi." + DB.FootnoteContValue.VariableCol.PureColumnName() + " as Variable, fi." + DB.FootnoteContValue.ValuePoolCol.PureColumnName() + " as ValuePool, fi." + DB.FootnoteContValue.ValueCodeCol.PureColumnName() + " as ValueCode, " + + // "'*' as TimePeriod, '*' as SubTable " + + // "from " + Md + DB.FootnoteContValue.TableName + " fi " + + // "where COALESCE(fi." + DB.FootnoteContValue.CellnoteCol.PureColumnName() + ", 'XX') <> '" + DB.Codes.Yes + "') " + + // "union " + + // "(select fi." + DB.FootnoteContTime.MainTableCol.PureColumnName() + " as MainTable,fi." + DB.FootnoteContTime.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '41' as FootNoteType, fi." + DB.FootnoteContTime.ContentsCol.PureColumnName() + " as Contents, '*' as Variable, '*' as ValuePool, '*' as ValueCode," + + // "fi." + DB.FootnoteContTime.TimePeriodCol.PureColumnName() + " as TimePeriod, '*' as SubTable " + + // "from " + Md + DB.FootnoteContTime.TableName + " fi " + + // "where COALESCE(fi." + DB.FootnoteContTime.CellnoteCol.PureColumnName() + ", 'XX') <> '" + DB.Codes.Yes + "') " + + // "union " + + // "(select fih." + DB.FootnoteContValue.MainTableCol.PureColumnName() + ", fih." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '999' as FootNoteType, fih." + DB.FootnoteContValue.ContentsCol.PureColumnName() + " as Contents, fih." + DB.FootnoteContValue.VariableCol.PureColumnName() + " Variable, fih." + DB.FootnoteContValue.ValuePoolCol.PureColumnName() + " as ValuePool, fih." + DB.FootnoteContValue.ValueCodeCol.PureColumnName() + " as ValueCode, " + + // "fit." + DB.FootnoteContTime.TimePeriodCol.PureColumnName() + " as TimePeriod, '*' as SubTable " + + // "from " + Md + DB.FootnoteContValue.TableName + " fih, " + Md + DB.FootnoteContTime.TableName + " fit " + + // "where fih." + DB.FootnoteContValue.CellnoteCol.PureColumnName() + " = '" + DB.Codes.Yes + "' " + + // "and fit." + DB.FootnoteContTime.CellnoteCol.PureColumnName() + " = '" + DB.Codes.Yes + "' " + + // "and fit." + DB.FootnoteContTime.FootnoteNoCol.PureColumnName() + " = fih." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + ") " + "union " + "(select distinct dvt." + DB.SubTableVariable.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteVariable.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '5' as FootNoteType, '*' as Contents, fi." + DB.FootnoteContVbl.VariableCol.PureColumnName() + " as Variable, '*' as ValuePool, '*' as ValueCode, " + "'*' as TimePeriod, '*' as SubTable " + @@ -1033,16 +1027,16 @@ public List GetRelevantFoonotes(string mainTable) "(select fi." + DB.FootnoteSubTable.MainTableCol.PureColumnName() + " as MainTable, " + DB.FootnoteSubTable.FootnoteNoCol.PureColumnName() + " as FootNote, '8' as FootNoteType, '*' as Contents, '*' as Variable, '*' as ValuePool, '*' as ValueCode," + "'*' as TimePeriod, " + "fi." + DB.FootnoteSubTable.SubTableCol.PureColumnName() + " as SubTable " + "from " + Md + DB.FootnoteSubTable.TableName + " fi) "; - - sqlString += "union " + - "(select distinct fi." + DB.FootnoteMaintValue.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteMaintValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '9' as FootNoteType, '*' as Contents, dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + ", fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + " as ValuePool , fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + " as ValueCode," + - "'*' as TimePeriod, '*' as SubTable " + - "from " + Md + DB.FootnoteMaintValue.TableName + " fi, " + Md + DB.SubTableVariable.TableName + " dvt," + Md + DB.VSValue.TableName + " vmv " + - "where dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + "= fi." + DB.FootnoteMaintValue.VariableCol.PureColumnName() + - " and vmv." + DB.VSValue.ValueSetCol.PureColumnName() + " = dvt." + DB.SubTableVariable.ValueSetCol.PureColumnName() + - " and vmv." + DB.VSValue.ValuePoolCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + - " and vmv." + DB.VSValue.ValueCodeCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + ")"; - + + sqlString += "union " + + "(select distinct fi." + DB.FootnoteMaintValue.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteMaintValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '9' as FootNoteType, '*' as Contents, dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + ", fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + " as ValuePool , fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + " as ValueCode," + + "'*' as TimePeriod, '*' as SubTable " + + "from " + Md + DB.FootnoteMaintValue.TableName + " fi, " + Md + DB.SubTableVariable.TableName + " dvt," + Md + DB.VSValue.TableName + " vmv " + + "where dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + "= fi." + DB.FootnoteMaintValue.VariableCol.PureColumnName() + + " and vmv." + DB.VSValue.ValueSetCol.PureColumnName() + " = dvt." + DB.SubTableVariable.ValueSetCol.PureColumnName() + + " and vmv." + DB.VSValue.ValuePoolCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + + " and vmv." + DB.VSValue.ValueCodeCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + ")"; + sqlString += ") bx," + DB.Footnote.GetNameAndAlias(); foreach (String langCode in mLanguageCodes) @@ -1220,7 +1214,7 @@ public List GetRelevantFoonotes(string mainTable) // return myOut; //} - + //public List GetVSGroupRow(string aValuePool, StringCollection aValueSets, string aGrouping, string aGroupCode) //{ @@ -1251,7 +1245,7 @@ public List GetRelevantFoonotes(string mainTable) #endregion - + } // End class MetaQuery diff --git a/PCAxis.Sql/QueryLib_23/MetaQuery_ValueGroupMaxValueLevel.cs b/PCAxis.Sql/QueryLib_23/MetaQuery_ValueGroupMaxValueLevel.cs index 727bb7e..16c9cee 100644 --- a/PCAxis.Sql/QueryLib_23/MetaQuery_ValueGroupMaxValueLevel.cs +++ b/PCAxis.Sql/QueryLib_23/MetaQuery_ValueGroupMaxValueLevel.cs @@ -1,17 +1,11 @@ -using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; -namespace PCAxis.Sql.QueryLib_23 { +namespace PCAxis.Sql.QueryLib_23 +{ public partial class MetaQuery { @@ -23,7 +17,7 @@ public string GetValueGroupMaxValueLevel(string aGrouping, bool emptyRowSetIsOK) string sqlString = "SELECT "; sqlString += "MAX(" + - DB.ValueGroup.GroupLevelCol.Id() +") "; + DB.ValueGroup.GroupLevelCol.Id() + ") "; sqlString += " FROM " + DB.ValueGroup.GetNameAndAlias(); sqlString += " WHERE " + DB.ValueGroup.GroupingCol.Is(mSqlCommand.GetParameterRef("aGrouping")); @@ -33,8 +27,9 @@ public string GetValueGroupMaxValueLevel(string aGrouping, bool emptyRowSetIsOK) DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); + if (myRows.Count < 1 && !emptyRowSetIsOK) + { + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); } myOut = myRows[0][0].ToString(); return myOut; diff --git a/PCAxis.Sql/QueryLib_23/MetaQuery_ValueGroupSorted.cs b/PCAxis.Sql/QueryLib_23/MetaQuery_ValueGroupSorted.cs index a3aec7e..d7de084 100644 --- a/PCAxis.Sql/QueryLib_23/MetaQuery_ValueGroupSorted.cs +++ b/PCAxis.Sql/QueryLib_23/MetaQuery_ValueGroupSorted.cs @@ -1,21 +1,17 @@ -using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; -namespace PCAxis.Sql.QueryLib_23 { +namespace PCAxis.Sql.QueryLib_23 +{ - public partial class MetaQuery { + public partial class MetaQuery + { #region for ValueGroup - public List GetValueGroupRowsSorted(string aGrouping,string aLevel, bool emptyRowSetIsOK, string aSortOrderLanguage) + public List GetValueGroupRowsSorted(string aGrouping, string aLevel, bool emptyRowSetIsOK, string aSortOrderLanguage) { string sortOrderLanguage = aSortOrderLanguage; if (!this.mLanguageCodes.Contains(aSortOrderLanguage)) @@ -40,8 +36,8 @@ public List GetValueGroupRowsSorted(string aGrouping,string aLeve parameters = new System.Data.Common.DbParameter[2]; parameters[0] = DB.ValueGroup.GroupingCol.GetStringParameter(aGrouping); - parameters[1] = DB.ValueGroup.GroupLevelCol.GetStringParameter(aLevel); - } + parameters[1] = DB.ValueGroup.GroupLevelCol.GetStringParameter(aLevel); + } else { parameters = new System.Data.Common.DbParameter[1]; @@ -55,28 +51,30 @@ public List GetValueGroupRowsSorted(string aGrouping,string aLeve else { sqlString += " ORDER BY " - + DB.ValueGroupLang2.SortCodeCol.Id(sortOrderLanguage) + ", " ; + + DB.ValueGroupLang2.SortCodeCol.Id(sortOrderLanguage) + ", "; } sqlString += DB.ValueGroup.GroupCodeCol.Id() + ", " + DB.ValueGroup.ValueCodeCol.Id(); - + DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); - + DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); + if (myRows.Count < 1 && !emptyRowSetIsOK) + { + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); } - foreach (DataRow sqlRow in myRows) { + foreach (DataRow sqlRow in myRows) + { ValueGroupRow outRow = new ValueGroupRow(sqlRow, DB, mLanguageCodes); myOut.Add(outRow); } return myOut; } - + #endregion for ValueGroup diff --git a/PCAxis.Sql/QueryLib_23/MetaQuery_for_PxsSqlData.cs b/PCAxis.Sql/QueryLib_23/MetaQuery_for_PxsSqlData.cs index 07ab464..b1d021d 100644 --- a/PCAxis.Sql/QueryLib_23/MetaQuery_for_PxsSqlData.cs +++ b/PCAxis.Sql/QueryLib_23/MetaQuery_for_PxsSqlData.cs @@ -1,14 +1,10 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Text; -using System.Xml.XPath; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; - using System.Collections.Specialized; +using System.Data; using System.Reflection; + +using PCAxis.Sql.Exceptions; using PCAxis.Sql.Parser_23; @@ -25,7 +21,8 @@ public partial class MetaQuery : IDisposable //flytt til hoved - public void Dispose() { + public void Dispose() + { this.DropTempTables(); mSqlCommand.Dispose(); } @@ -33,22 +30,27 @@ public void Dispose() { #region wildcards in groupvalues - public StringCollection GetValueWildCardByGrouping(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) { + public StringCollection GetValueWildCardByGrouping(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) + { // Resolve wildcards here StringCollection myOut = new StringCollection(); DataSet ds = null; - if (String.Compare(DB.MetaModel, "2.1", false, System.Globalization.CultureInfo.InvariantCulture) > 0) { + if (String.Compare(DB.MetaModel, "2.1", false, System.Globalization.CultureInfo.InvariantCulture) > 0) + { // Datamodel > 2.1, new table structure ds = this.GetValueWildCardByGrouping22(mainTable, variable, subTable, grouping, groupCode, wildCard); - } else { + } + else + { // Datamodel 2.1 or older, the old table structure. Use of Grouping is only valid if a SubTable is selected //ds = this.GetValueWildCardByGrouping21(mainTable, variable, subTable, grouping, groupCode, wildCard); } DataRowCollection mValueInfo = ds.Tables[0].Rows; - foreach (DataRow row in mValueInfo) { + foreach (DataRow row in mValueInfo) + { throw new NotImplementedException(); //TODO; tok bort myOut.Add(row[DB.VSGroup.ValueCode].ToString()); - // myOut.Add(row[DB.VSGroup.ValueCode].ToString()); + // myOut.Add(row[DB.VSGroup.ValueCode].ToString()); } return myOut; } @@ -92,7 +94,8 @@ public StringCollection GetValueWildCardByGrouping(string mainTable, string vari - private DataSet GetValueWildCardByGrouping22(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) { + private DataSet GetValueWildCardByGrouping22(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) + { // To ensure that the correct grouping is used mainTable and variable has to be included // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -165,10 +168,10 @@ public string MakeTempTable(string VariableName, string VariableNumber, IList @@ -214,24 +217,36 @@ public string MakeTempTable(string VariableName, string VariableNumber, IList - public void DropTempTables() { - - if (!DB.UseTemporaryTables) { - foreach (string tableName in dropTheseTables) { - try { + public void DropTempTables() + { + + if (!DB.UseTemporaryTables) + { + foreach (string tableName in dropTheseTables) + { + try + { mSqlCommand.ExecuteNonQuery("DROP TABLE " + tableName); - } catch (Exception e) { + } + catch (Exception e) + { log.Error("DROP TABLE failed:", e); //don't want to stop because of this... } } - } else if (mSqlCommand.getProgramMustTruncAndDropTempTable()) { - foreach (string tableName in dropTheseTables) { - try { + } + else if (mSqlCommand.getProgramMustTruncAndDropTempTable()) + { + foreach (string tableName in dropTheseTables) + { + try + { mSqlCommand.ExecuteNonQuery("TRUNCATE TABLE " + tableName); mSqlCommand.ExecuteNonQuery("DROP TABLE " + tableName); - } catch (Exception e) { + } + catch (Exception e) + { log.Error("TRUNC or DROP TABLE failed:", e); //don't want to stop because of this... } diff --git a/PCAxis.Sql/QueryLib_23/MetaQuery_partial.cs b/PCAxis.Sql/QueryLib_23/MetaQuery_partial.cs index 22bc43e..ac02114 100644 --- a/PCAxis.Sql/QueryLib_23/MetaQuery_partial.cs +++ b/PCAxis.Sql/QueryLib_23/MetaQuery_partial.cs @@ -1,15 +1,11 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; using System.Data; using System.Reflection; using PCAxis.Sql.Parser_23; -using System.Collections.Specialized; - namespace PCAxis.Sql.QueryLib_23 { /// @@ -21,7 +17,8 @@ public partial class MetaQuery #region all timevalues - public PxSqlValues GetAllTimeValuesList(string mainTable, string sortOrder) { + public PxSqlValues GetAllTimeValuesList(string mainTable, string sortOrder) + { DataSet ds = this.GetAllTimeValues(mainTable, sortOrder); return GetTimeValues(mainTable, ds, true); } @@ -32,8 +29,8 @@ public DataSet GetAllTimeValues(string aMainTable, string aSortOrder) // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; - string sortOrder = "asc"; - if (! aSortOrder.ToUpper().Equals("ASC") ) + string sortOrder = "asc"; + if (!aSortOrder.ToUpper().Equals("ASC")) { sortOrder = "desc"; } @@ -58,17 +55,20 @@ public DataSet GetAllTimeValues(string aMainTable, string aSortOrder) #region fixed list of timevalues //For mPxsFile.Query.Time.TimeOption == 0 - public PxSqlValues GetTimeValueList(string mainTable, Dictionary mySelectedValues) { + public PxSqlValues GetTimeValueList(string mainTable, Dictionary mySelectedValues) + { DataSet ds = this.GetTimeValues(mainTable, mySelectedValues.Keys); PxSqlValues myOut = GetTimeValues(mainTable, ds, false); - - foreach (KeyValuePair time in mySelectedValues) { + + foreach (KeyValuePair time in mySelectedValues) + { // Check to se if the value exist. If it was specified in the pxs, but is not present in the // database it will not exist. Maybe this check should be replaced by an exception handling // due to preformance. - if (myOut.ContainsKey(time.Key)) { + if (myOut.ContainsKey(time.Key)) + { myOut[time.Key].SortCodePxs = time.Value; } } @@ -77,7 +77,8 @@ public PxSqlValues GetTimeValueList(string mainTable, Dictionary m return myOut; } - private DataSet GetTimeValues(string aMainTable, ICollection valuesFromPxs) { + private DataSet GetTimeValues(string aMainTable, ICollection valuesFromPxs) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -106,7 +107,7 @@ private DataSet GetTimeValues(string aMainTable, ICollection valuesFromP // creating the parameters - System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1+valuesFromPxs.Count]; + System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1 + valuesFromPxs.Count]; parameters[0] = mSqlCommand.GetStringParameter("aMainTable", aMainTable); int counter = 0; foreach (string valueFromPxs in valuesFromPxs) @@ -114,15 +115,16 @@ private DataSet GetTimeValues(string aMainTable, ICollection valuesFromP parameters[counter + 1] = mSqlCommand.GetStringParameter("valuesFromPxs" + (counter + 1), valueFromPxs); counter++; } - - + + // Execute the SQL and return the result (records) as a System.Data.DataSet-object. return mSqlCommand.ExecuteSelect(sqlString, parameters); } #endregion fixed list of timevalues #region the last timevalue ( N=1 below) - public PxSqlValues GetTimeValueList(string mainTable) { + public PxSqlValues GetTimeValueList(string mainTable) + { DataSet ds = this.GetTimeValues(mainTable); return GetTimeValues(mainTable, ds, true); } @@ -161,13 +163,15 @@ private DataSet GetTimeValues(string aMainTable) #endregion the last timevalue #region last N timevalues - public PxSqlValues GetTimeValueList(string mainTable, int NoOfTimeValues) { - DataSet ds = this.GetTimeValues(mainTable,NoOfTimeValues); - return GetTimeValues(mainTable, ds, true); + public PxSqlValues GetTimeValueList(string mainTable, int NoOfTimeValues) + { + DataSet ds = this.GetTimeValues(mainTable, NoOfTimeValues); + return GetTimeValues(mainTable, ds, true); } - private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { + private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -195,7 +199,7 @@ private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { string innerSelect = "SELECT DISTINCT " + DB.ContentsTime.MainTableCol.PureColumnName() + ", " + DB.ContentsTime.TimePeriodCol.PureColumnName() + " FROM " + DB.ContentsTime.GetNameAndAlias(); - + string sqlString = "SELECT a." + DB.ContentsTime.TimePeriodCol.PureColumnName() + ", COUNT(*) /*** SQLID: GetTimeValues_03 ***/" + @@ -204,7 +208,7 @@ private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { "(" + innerSelect + " WHERE " + DB.ContentsTime.MainTableCol.Is("mainTable_b") + ") b " + " WHERE a." + DB.ContentsTime.TimePeriodCol.PureColumnName() + " <= b." + DB.ContentsTime.TimePeriodCol.PureColumnName() + " GROUP BY a." + DB.ContentsTime.TimePeriodCol.PureColumnName() + - " HAVING COUNT(*) <= " + NoOfTimeValues.ToString() + + " HAVING COUNT(*) <= " + NoOfTimeValues.ToString() + " ORDER BY COUNT(*) DESC "; System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -221,12 +225,14 @@ private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { #region from start timevalue - public PxSqlValues GetTimeValueList(string mainTable, string StartTimeValue) { - DataSet ds = this.GetTimeValues(mainTable,StartTimeValue); + public PxSqlValues GetTimeValueList(string mainTable, string StartTimeValue) + { + DataSet ds = this.GetTimeValues(mainTable, StartTimeValue); return GetTimeValues(mainTable, ds, true); } - private DataSet GetTimeValues(string aMainTable, string StartTimeValue) { + private DataSet GetTimeValues(string aMainTable, string StartTimeValue) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -256,7 +262,7 @@ private DataSet GetTimeValues(string aMainTable, string StartTimeValue) { - + System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; parameters[0] = DB.ContentsTime.MainTableCol.GetStringParameter(aMainTable); @@ -273,24 +279,28 @@ private DataSet GetTimeValues(string aMainTable, string StartTimeValue) { /// The Dataset /// Sets SortCodePxs to a counter. True for all ((int)mPxsFile.Query.Time.TimeOption != 0). /// - private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode) { + private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode) + { PxSqlValues myOut = new PxSqlValues(); DataRowCollection rows = ds.Tables[0].Rows; //Todo; fix exception - if (rows.Count <= 0) { + if (rows.Count <= 0) + { throw new ApplicationException("tabellen " + mainTable + " inneholder ikke data. (ingen tider)"); } int timeSortOrder = 0; string timeCode = ""; - foreach (DataRow row in rows) { + foreach (DataRow row in rows) + { timeCode = row[this.DB.ContentsTime.TimePeriodCol.PureColumnName()].ToString(); PXSqlValue mValue = new PXSqlValue(timeCode, LanguageCodes); - if (setSortCode) { + if (setSortCode) + { mValue.SortCodePxs = timeSortOrder; timeSortOrder++; } @@ -303,9 +313,9 @@ private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode #endregion Time stuff - - + + } - + } diff --git a/PCAxis.Sql/QueryLib_23/value_fra_master2Rows.cs b/PCAxis.Sql/QueryLib_23/value_fra_master2Rows.cs index 977afe9..70fe0e1 100644 --- a/PCAxis.Sql/QueryLib_23/value_fra_master2Rows.cs +++ b/PCAxis.Sql/QueryLib_23/value_fra_master2Rows.cs @@ -1,26 +1,26 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; //This code is generated by master2Rows.xslt. Nope! -namespace PCAxis.Sql.QueryLib_23 { +namespace PCAxis.Sql.QueryLib_23 +{ #region class Value /// /// Holds a list of ValueRows. /// - public class ValueRow2HMDictionary { + public class ValueRow2HMDictionary + { // One entry in the Dictionary for each ValueCode private Dictionary mValueRows = new Dictionary(); - internal Dictionary ValueRows { + internal Dictionary ValueRows + { get { return mValueRows; } set { mValueRows = value; } } @@ -28,20 +28,21 @@ internal Dictionary ValueRows { public ValueRow2HMDictionary(DataTable mTable, SqlDbConfig_23 dbconf, MetaQuery metaQuery) { - string theValueCode=""; + string theValueCode = ""; string theLanguage; - + int sortOrder = 0; - foreach (DataRow mRow in mTable.Rows) { + foreach (DataRow mRow in mTable.Rows) + { theValueCode = mRow[dbconf.VSValue.ValueCodeCol.PureColumnName()].ToString(); if (!mValueRows.ContainsKey(theValueCode)) { sortOrder += 1; // this will be the sortorder for mainlanguage. Since each language could have its own sortorder this well be set in the Valuetext and coukd be used by the calling program. mValueRows.Add(theValueCode, new ValueRow2HM(mRow, dbconf, sortOrder)); } //denne bør fel flyttes et par hakk ned sto det, men det er vel slik for å kunne motta norsk og engelsk for samme kode - theLanguage = mRow["Language"].ToString(); + theLanguage = mRow["Language"].ToString(); if (!mValueRows[theValueCode].texts.ContainsKey(theLanguage)) { mValueRows[theValueCode].texts.Add(theLanguage, new ValueText2HM(mRow, dbconf)); @@ -54,7 +55,7 @@ public ValueRow2HMDictionary(DataTable mTable, SqlDbConfig_23 dbconf, MetaQuery /// to the primary language table. Expecting very few MetaId on values. /// Attaching them at a later stage should be faster ... but it takes a separate sql-call. /// - + //adding MetaId on Value if there are any (should not happen often) // picking one ValueCode (the last) just to get the valuepool @@ -76,15 +77,18 @@ public ValueRow2HMDictionary(DataTable mTable, SqlDbConfig_23 dbconf, MetaQuery /// /// Holds the attributes for Value. The language dependent parts are stored in the texts dictionary which is indexed by language code. /// - public class ValueRowHM { + public class ValueRowHM + { private String mValuePool; - public String ValuePool { + public String ValuePool + { get { return mValuePool; } } private String mValueCode; - public String ValueCode { + public String ValueCode + { get { return mValueCode; } } @@ -98,12 +102,13 @@ internal string MetaId public Dictionary texts = new Dictionary(); - public ValueRowHM(DataRow mRow, SqlDbConfig_23 dbconf,StringCollection languageCodes,int sortOrder) + public ValueRowHM(DataRow mRow, SqlDbConfig_23 dbconf, StringCollection languageCodes, int sortOrder) { this.mValuePool = mRow[dbconf.Value.ValuePoolCol.Label()].ToString(); this.mValueCode = mRow[dbconf.Value.ValueCodeCol.Label()].ToString(); - this.mMetaId = mRow[dbconf.Value.MetaIdCol.Label()].ToString(); - foreach (string languageCode in languageCodes) { + this.mMetaId = mRow[dbconf.Value.MetaIdCol.Label()].ToString(); + foreach (string languageCode in languageCodes) + { texts.Add(languageCode, new ValueTextHM(mRow, dbconf, languageCode)); } } @@ -132,7 +137,7 @@ public String SortCode get { return mSortCode; } } - internal ValueTextHM(DataRow mRow, SqlDbConfig_23 dbconf, String languageCode) + internal ValueTextHM(DataRow mRow, SqlDbConfig_23 dbconf, String languageCode) { { if (dbconf.isSecondaryLanguage(languageCode)) @@ -141,7 +146,8 @@ internal ValueTextHM(DataRow mRow, SqlDbConfig_23 dbconf, String languageCode) this.mValueTextL = mRow[dbconf.ValueLang2.ValueTextLCol.Label(languageCode)].ToString(); this.mSortCode = mRow[dbconf.ValueLang2.SortCodeCol.Label(languageCode)].ToString(); - } else + } + else { this.mValueTextS = mRow[dbconf.Value.ValueTextSCol.Label()].ToString(); this.mValueTextL = mRow[dbconf.Value.ValueTextLCol.Label()].ToString(); @@ -152,9 +158,11 @@ internal ValueTextHM(DataRow mRow, SqlDbConfig_23 dbconf, String languageCode) } - public class ValueRow2HM { + public class ValueRow2HM + { private String mValuePool; - public String ValuePool { + public String ValuePool + { get { return mValuePool; } } private String mValueSet; @@ -163,15 +171,18 @@ public String ValueSet get { return mValueSet; } } private String mValueCode; - public String ValueCode { + public String ValueCode + { get { return mValueCode; } } private String mSortOrder; - public String SortOrder { - get { return mSortOrder; } + public String SortOrder + { + get { return mSortOrder; } } private String mFootnote; - public String Footnote { + public String Footnote + { get { return mFootnote; } } @@ -182,11 +193,12 @@ internal string MetaId get { return mMetaId; } set { mMetaId = value; } } - + public Dictionary texts = new Dictionary(); - public ValueRow2HM(DataRow mRow, SqlDbConfig_23 dbconf, int sortOrder) { + public ValueRow2HM(DataRow mRow, SqlDbConfig_23 dbconf, int sortOrder) + { this.mValuePool = mRow[dbconf.VSValue.ValuePoolCol.PureColumnName()].ToString(); // VAL_Vardeforrad this.mValueSet = mRow[dbconf.VSValue.ValueSetCol.PureColumnName()].ToString(); // VAL_Vardemangd this.mValueCode = mRow[dbconf.VSValue.ValueCodeCol.PureColumnName()].ToString(); @@ -199,7 +211,8 @@ public ValueRow2HM(DataRow mRow, SqlDbConfig_23 dbconf, int sortOrder) { /// /// Holds the language dependent attributes for Value for one language /// - public class ValueText2HM { + public class ValueText2HM + { private String mSortCodeValue; public String SortCodeValue { @@ -211,15 +224,18 @@ public String SortCodeVsValue get { return mSortCodeVsValue; } } private String mValueTextS; - public String ValueTextS { + public String ValueTextS + { get { return mValueTextS; } } private String mValueTextL; - public String ValueTextL { + public String ValueTextL + { get { return mValueTextL; } } - internal ValueText2HM(DataRow mRow, SqlDbConfig_23 dbconf) { + internal ValueText2HM(DataRow mRow, SqlDbConfig_23 dbconf) + { this.mSortCodeValue = mRow["SortCodeValue"].ToString(); this.mSortCodeVsValue = mRow["SortCodeVsValue"].ToString(); this.mValueTextS = mRow[dbconf.Value.ValueTextSCol.PureColumnName()].ToString(); diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Attribute.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Attribute.cs index b70bad8..ebe1972 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Attribute.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Attribute.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetAttributeRows(string aMainTable, bool DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) @@ -80,7 +75,7 @@ private String GetAttribute_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.AttributeLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.AttributeLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Attribute.MainTableCol.Is(DB.AttributeLang2.MainTableCol, langCode) + " AND " + DB.Attribute.AttributeCol.Is(DB.AttributeLang2.AttributeCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Contents.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Contents.cs index aea742e..c349a61 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Contents.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Contents.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetContentsRows(string aMainTable, bool e DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) @@ -101,7 +96,7 @@ private String GetContents_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ContentsLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ContentsLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Contents.MainTableCol.Is(DB.ContentsLang2.MainTableCol, langCode) + " AND " + DB.Contents.ContentsCol.Is(DB.ContentsLang2.ContentsCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs index 7366a0f..377dadc 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_DataStorage.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public DataStorageRow GetDataStorageRow(string aProductCode) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ProductCode = " + aProductCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " ProductCode = " + aProductCode); } - DataStorageRow myOut = new DataStorageRow(myRows[0], DB); + DataStorageRow myOut = new DataStorageRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Footnote.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Footnote.cs index aa63d77..3898dc5 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Footnote.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Footnote.cs @@ -1,13 +1,9 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +27,10 @@ public FootnoteRow GetFootnoteRow(string aFootnoteNo) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," FootnoteNo = " + aFootnoteNo); + throw new PCAxis.Sql.Exceptions.DbException(36, " FootnoteNo = " + aFootnoteNo); } - FootnoteRow myOut = new FootnoteRow(myRows[0], DB, mLanguageCodes); + FootnoteRow myOut = new FootnoteRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -52,7 +48,7 @@ public Dictionary GetFootnoteRows(StringCollection aFootnot System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[aFootnoteNo.Count]; for (int counter = 1; counter <= aFootnoteNo.Count; counter++) { - parameters[counter - 1] = mSqlCommand.GetStringParameter("aFootnoteNo" + counter, aFootnoteNo[counter - 1]); + parameters[counter - 1] = mSqlCommand.GetStringParameter("aFootnoteNo" + counter, aFootnoteNo[counter - 1]); } @@ -60,7 +56,7 @@ public Dictionary GetFootnoteRows(StringCollection aFootnot DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { throw new PCAxis.Sql.Exceptions.DbException(35, " query, see log. "); } @@ -103,7 +99,7 @@ private String GetFootnote_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.FootnoteLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.FootnoteLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Footnote.FootnoteNoCol.Is(DB.FootnoteLang2.FootnoteNoCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteContTime.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteContTime.cs index e01ebc5..2d3f5e6 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteContTime.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteContTime.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary> GetFootnoteContTimeRows(str DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteContValue.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteContValue.cs index 56955ea..f02471c 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteContValue.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteContValue.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary> GetFootnoteContValueRows(s DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs index 5ee05d3..89715c4 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteGrouping.cs @@ -1,13 +1,9 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -30,7 +26,7 @@ public Dictionary GetFootnoteGroupingRows(StringCol System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[aGrouping.Count]; for (int counter = 1; counter <= aGrouping.Count; counter++) { - parameters[counter - 1] = mSqlCommand.GetStringParameter("aGrouping" + counter, aGrouping[counter - 1]); + parameters[counter - 1] = mSqlCommand.GetStringParameter("aGrouping" + counter, aGrouping[counter - 1]); } @@ -38,7 +34,7 @@ public Dictionary GetFootnoteGroupingRows(StringCol DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { throw new PCAxis.Sql.Exceptions.DbException(35, " query, see log. "); } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteMaintTime.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteMaintTime.cs index c1f5a7c..6710bf5 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteMaintTime.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteMaintTime.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetFootnoteMaintTimeRows(string DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteValueSetValue.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteValueSetValue.cs index c0411b2..d2bb636 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteValueSetValue.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_FootnoteValueSetValue.cs @@ -1,13 +1,9 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -30,7 +26,7 @@ public Dictionary GetFootnoteValueSetValueRows System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[aValueSet.Count]; for (int counter = 1; counter <= aValueSet.Count; counter++) { - parameters[counter - 1] = mSqlCommand.GetStringParameter("aValueSet" + counter, aValueSet[counter - 1]); + parameters[counter - 1] = mSqlCommand.GetStringParameter("aValueSet" + counter, aValueSet[counter - 1]); } @@ -38,7 +34,7 @@ public Dictionary GetFootnoteValueSetValueRows DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { throw new PCAxis.Sql.Exceptions.DbException(35, " query, see log. "); } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Grouping.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Grouping.cs index 81a6f17..4c80cb1 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Grouping.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Grouping.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public GroupingRow GetGroupingRow(string aGrouping) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Grouping = " + aGrouping); + throw new PCAxis.Sql.Exceptions.DbException(36, " Grouping = " + aGrouping); } - GroupingRow myOut = new GroupingRow(myRows[0], DB, mLanguageCodes); + GroupingRow myOut = new GroupingRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -73,7 +65,7 @@ private String GetGrouping_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.GroupingLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.GroupingLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Grouping.GroupingCol.Is(DB.GroupingLang2.GroupingCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs index df56756..c18e14a 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_GroupingLevel.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetGroupingLevelRows_KeyIsLevel(stri DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); } foreach (DataRow sqlRow in myRows) @@ -75,7 +70,7 @@ private String GetGroupingLevel_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.GroupingLevelLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.GroupingLevelLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.GroupingLevel.GroupingCol.Is(DB.GroupingLevelLang2.GroupingCol, langCode) + " AND " + DB.GroupingLevel.LevelNoCol.Is(DB.GroupingLevelLang2.LevelNoCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTable.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTable.cs index c711f3c..0aa4465 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTable.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTable.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public MainTableRow GetMainTableRow(string aMainTable) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable); } - MainTableRow myOut = new MainTableRow(myRows[0], DB, mLanguageCodes); + MainTableRow myOut = new MainTableRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -78,7 +70,7 @@ private String GetMainTable_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.MainTableLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.MainTableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.MainTable.MainTableCol.Is(DB.MainTableLang2.MainTableCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs index 390ad51..45f81fd 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTablePerson.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -25,8 +20,8 @@ public Dictionary GetMainTablePersonRows(string aMai // WHERE MTP.MainTable = <"MainTable as parameter reference for your db vendor"> // AND MTP.RolePerson = <"RolePerson as parameter reference for your db vendor"> // - sqlString += " WHERE " + DB.MainTablePerson.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + - " AND " +DB.MainTablePerson.RolePersonCol.Is(mSqlCommand.GetParameterRef("aRolePerson")); + sqlString += " WHERE " + DB.MainTablePerson.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + + " AND " + DB.MainTablePerson.RolePersonCol.Is(mSqlCommand.GetParameterRef("aRolePerson")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -37,9 +32,9 @@ public Dictionary GetMainTablePersonRows(string aMai DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " RolePerson = " + aRolePerson); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " RolePerson = " + aRolePerson); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs index e877244..00c5b9f 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MainTableVariableHierarchy.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,9 +16,9 @@ public MainTableVariableHierarchyRow GetMainTableVariableHierarchyRow(string aMa { //SqlDbConfig dbconf = DB; string sqlString = GetMainTableVariableHierarchy_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + - " AND " +DB.MainTableVariableHierarchy.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")) + - " AND " +DB.MainTableVariableHierarchy.GroupingCol.Is(mSqlCommand.GetParameterRef("aGrouping")); + sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + + " AND " + DB.MainTableVariableHierarchy.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")) + + " AND " + DB.MainTableVariableHierarchy.GroupingCol.Is(mSqlCommand.GetParameterRef("aGrouping")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[3]; @@ -35,10 +30,10 @@ public MainTableVariableHierarchyRow GetMainTableVariableHierarchyRow(string aMa DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable + " Variable = " + aVariable + " Grouping = " + aGrouping); + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable + " Variable = " + aVariable + " Grouping = " + aGrouping); } - MainTableVariableHierarchyRow myOut = new MainTableVariableHierarchyRow(myRows[0], DB); + MainTableVariableHierarchyRow myOut = new MainTableVariableHierarchyRow(myRows[0], DB); return myOut; } @@ -51,8 +46,8 @@ public Dictionary GetMainTableVariableHie // WHERE MTP.MainTable = <"MainTable as parameter reference for your db vendor"> // AND MTP.Variable = <"Variable as parameter reference for your db vendor"> // - sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + - " AND " +DB.MainTableVariableHierarchy.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")); + sqlString += " WHERE " + DB.MainTableVariableHierarchy.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + + " AND " + DB.MainTableVariableHierarchy.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -63,9 +58,9 @@ public Dictionary GetMainTableVariableHie DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " Variable = " + aVariable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " Variable = " + aVariable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs index f2fc07e..dbed8c6 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MenuSelection.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -22,8 +14,8 @@ public MenuSelectionRow GetMenuSelectionRow(string aMenu, string aSelection) { //SqlDbConfig dbconf = DB; string sqlString = GetMenuSelection_SQLString_NoWhere(); - sqlString += " WHERE " + DB.MenuSelection.MenuCol.Is(mSqlCommand.GetParameterRef("aMenu")) + - " AND " +DB.MenuSelection.SelectionCol.Is(mSqlCommand.GetParameterRef("aSelection")); + sqlString += " WHERE " + DB.MenuSelection.MenuCol.Is(mSqlCommand.GetParameterRef("aMenu")) + + " AND " + DB.MenuSelection.SelectionCol.Is(mSqlCommand.GetParameterRef("aSelection")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -34,10 +26,10 @@ public MenuSelectionRow GetMenuSelectionRow(string aMenu, string aSelection) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Menu = " + aMenu + " Selection = " + aSelection); + throw new PCAxis.Sql.Exceptions.DbException(36, " Menu = " + aMenu + " Selection = " + aSelection); } - MenuSelectionRow myOut = new MenuSelectionRow(myRows[0], DB, mLanguageCodes); + MenuSelectionRow myOut = new MenuSelectionRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -79,7 +71,7 @@ private String GetMenuSelection_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.MenuSelectionLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.MenuSelectionLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.MenuSelection.MenuCol.Is(DB.MenuSelectionLang2.MenuCol, langCode) + " AND " + DB.MenuSelection.SelectionCol.Is(DB.MenuSelectionLang2.SelectionCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs index 5744311..087521f 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MetaAdm.cs @@ -1,13 +1,6 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; +using System.Data; //This code is generated. @@ -31,10 +24,10 @@ public MetaAdmRow GetMetaAdmRow(string aProperty) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Property = " + aProperty); + throw new PCAxis.Sql.Exceptions.DbException(36, " Property = " + aProperty); } - MetaAdmRow myOut = new MetaAdmRow(myRows[0], DB); + MetaAdmRow myOut = new MetaAdmRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs index f1fa4d1..809a12d 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_MetabaseInfo.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public MetabaseInfoRow GetMetabaseInfoRow(string aModel) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Model = " + aModel); + throw new PCAxis.Sql.Exceptions.DbException(36, " Model = " + aModel); } - MetabaseInfoRow myOut = new MetabaseInfoRow(myRows[0], DB); + MetabaseInfoRow myOut = new MetabaseInfoRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Organization.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Organization.cs index 58a6597..6d95980 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Organization.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Organization.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public OrganizationRow GetOrganizationRow(string aOrganizationCode) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," OrganizationCode = " + aOrganizationCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " OrganizationCode = " + aOrganizationCode); } - OrganizationRow myOut = new OrganizationRow(myRows[0], DB, mLanguageCodes); + OrganizationRow myOut = new OrganizationRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -72,7 +64,7 @@ private String GetOrganization_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.OrganizationLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.OrganizationLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Organization.OrganizationCodeCol.Is(DB.OrganizationLang2.OrganizationCodeCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Person.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Person.cs index 5f9726f..c19ec9c 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Person.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Person.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public PersonRow GetPersonRow(string aPersonCode) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," PersonCode = " + aPersonCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " PersonCode = " + aPersonCode); } - PersonRow myOut = new PersonRow(myRows[0], DB); + PersonRow myOut = new PersonRow(myRows[0], DB); return myOut; } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SecondaryLanguage.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SecondaryLanguage.cs index 1240299..7d01351 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SecondaryLanguage.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SecondaryLanguage.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetSecondaryLanguageRowsbyLangua DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs index 5b5e1e2..c7c93f2 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SpecialCharacter.cs @@ -1,13 +1,6 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; +using System.Data; //This code is generated. @@ -31,10 +24,10 @@ public SpecialCharacterRow GetSpecialCharacterRow(string aCharacterType) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," CharacterType = " + aCharacterType); + throw new PCAxis.Sql.Exceptions.DbException(36, " CharacterType = " + aCharacterType); } - SpecialCharacterRow myOut = new SpecialCharacterRow(myRows[0], DB, mLanguageCodes); + SpecialCharacterRow myOut = new SpecialCharacterRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -92,7 +85,7 @@ private String GetSpecialCharacter_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.SpecialCharacterLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.SpecialCharacterLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.SpecialCharacter.CharacterTypeCol.Is(DB.SpecialCharacterLang2.CharacterTypeCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SubTable.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SubTable.cs index c4b8084..4d0363f 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SubTable.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SubTable.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetSubTableRows(string aMainTable, bool e DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable); } foreach (DataRow sqlRow in myRows) @@ -75,7 +70,7 @@ private String GetSubTable_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.SubTableLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.SubTableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.SubTable.MainTableCol.Is(DB.SubTableLang2.MainTableCol, langCode) + " AND " + DB.SubTable.SubTableCol.Is(DB.SubTableLang2.SubTableCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs index aa0b1f4..e0bf557 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_SubTableVariable.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,9 +16,9 @@ public SubTableVariableRow GetSubTableVariableRow(string aMainTable, string aSub { //SqlDbConfig dbconf = DB; string sqlString = GetSubTableVariable_SQLString_NoWhere(); - sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + - " AND " +DB.SubTableVariable.SubTableCol.Is(mSqlCommand.GetParameterRef("aSubTable")) + - " AND " +DB.SubTableVariable.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")); + sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + + " AND " + DB.SubTableVariable.SubTableCol.Is(mSqlCommand.GetParameterRef("aSubTable")) + + " AND " + DB.SubTableVariable.VariableCol.Is(mSqlCommand.GetParameterRef("aVariable")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[3]; @@ -35,10 +30,10 @@ public SubTableVariableRow GetSubTableVariableRow(string aMainTable, string aSub DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," MainTable = " + aMainTable + " SubTable = " + aSubTable + " Variable = " + aVariable); + throw new PCAxis.Sql.Exceptions.DbException(36, " MainTable = " + aMainTable + " SubTable = " + aSubTable + " Variable = " + aVariable); } - SubTableVariableRow myOut = new SubTableVariableRow(myRows[0], DB); + SubTableVariableRow myOut = new SubTableVariableRow(myRows[0], DB); return myOut; } @@ -51,8 +46,8 @@ public Dictionary GetSubTableVariableRowskeyVariabl // WHERE STV.MainTable = <"MainTable as parameter reference for your db vendor"> // AND STV.SubTable = <"SubTable as parameter reference for your db vendor"> // - sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + - " AND " +DB.SubTableVariable.SubTableCol.Is(mSqlCommand.GetParameterRef("aSubTable")); + sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable")) + + " AND " + DB.SubTableVariable.SubTableCol.Is(mSqlCommand.GetParameterRef("aSubTable")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -63,9 +58,9 @@ public Dictionary GetSubTableVariableRowskeyVariabl DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " SubTable = " + aSubTable); + throw new PCAxis.Sql.Exceptions.DbException(35, " MainTable = " + aMainTable + " SubTable = " + aSubTable); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs index a3e02bf..9dfda80 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_TextCatalog.cs @@ -1,13 +1,4 @@ using System; -using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -48,7 +39,7 @@ private String GetTextCatalog_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.TextCatalogLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.TextCatalogLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.TextCatalog.TextCatalogNoCol.Is(DB.TextCatalogLang2.TextCatalogNoCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs index 63ae4a5..ea13237 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_TimeScale.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public TimeScaleRow GetTimeScaleRow(string aTimeScale) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," TimeScale = " + aTimeScale); + throw new PCAxis.Sql.Exceptions.DbException(36, " TimeScale = " + aTimeScale); } - TimeScaleRow myOut = new TimeScaleRow(myRows[0], DB, mLanguageCodes); + TimeScaleRow myOut = new TimeScaleRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -70,7 +62,7 @@ private String GetTimeScale_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.TimeScaleLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.TimeScaleLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.TimeScale.TimeScaleCol.Is(DB.TimeScaleLang2.TimeScaleCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_VSValue.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_VSValue.cs index 9acb616..b08aa86 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_VSValue.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_VSValue.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -21,9 +13,9 @@ public VSValueRow GetVSValueRow(string aValueSet, string aValuePool, string aVal { //SqlDbConfig dbconf = DB; string sqlString = GetVSValue_SQLString_NoWhere(); - sqlString += " WHERE " + DB.VSValue.ValueSetCol.Is(mSqlCommand.GetParameterRef("aValueSet")) + - " AND " +DB.VSValue.ValuePoolCol.Is(mSqlCommand.GetParameterRef("aValuePool")) + - " AND " +DB.VSValue.ValueCodeCol.Is(mSqlCommand.GetParameterRef("aValueCode")); + sqlString += " WHERE " + DB.VSValue.ValueSetCol.Is(mSqlCommand.GetParameterRef("aValueSet")) + + " AND " + DB.VSValue.ValuePoolCol.Is(mSqlCommand.GetParameterRef("aValuePool")) + + " AND " + DB.VSValue.ValueCodeCol.Is(mSqlCommand.GetParameterRef("aValueCode")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[3]; @@ -35,10 +27,10 @@ public VSValueRow GetVSValueRow(string aValueSet, string aValuePool, string aVal DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValueSet = " + aValueSet + " ValuePool = " + aValuePool + " ValueCode = " + aValueCode); + throw new PCAxis.Sql.Exceptions.DbException(36, " ValueSet = " + aValueSet + " ValuePool = " + aValuePool + " ValueCode = " + aValueCode); } - VSValueRow myOut = new VSValueRow(myRows[0], DB, mLanguageCodes); + VSValueRow myOut = new VSValueRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -71,7 +63,7 @@ private String GetVSValue_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.VSValueLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.VSValueLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.VSValue.ValueSetCol.Is(DB.VSValueLang2.ValueSetCol, langCode) + " AND " + DB.VSValue.ValuePoolCol.Is(DB.VSValueLang2.ValuePoolCol, langCode) + " AND " + DB.VSValue.ValueCodeCol.Is(DB.VSValueLang2.ValueCodeCol, langCode); diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Value.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Value.cs index 412b91b..5e1598e 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Value.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Value.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -24,8 +19,8 @@ public Dictionary GetValueRows(string aValuePool, bool emptyRo // // WHERE VAL.ValuePool = <"ValuePool as parameter reference for your db vendor"> // - sqlString += " WHERE " + DB.Value.ValuePoolCol.Is(mSqlCommand.GetParameterRef("aValuePool")) + - " AND " +DB.Value.MetaIdCol.IsNotNULL(); + sqlString += " WHERE " + DB.Value.ValuePoolCol.Is(mSqlCommand.GetParameterRef("aValuePool")) + + " AND " + DB.Value.MetaIdCol.IsNotNULL(); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1]; @@ -35,9 +30,9 @@ public Dictionary GetValueRows(string aValuePool, bool emptyRo DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " ValuePool = " + aValuePool); + throw new PCAxis.Sql.Exceptions.DbException(35, " ValuePool = " + aValuePool); } foreach (DataRow sqlRow in myRows) @@ -83,7 +78,7 @@ private String GetValue_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValueLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValueLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Value.ValuePoolCol.Is(DB.ValueLang2.ValuePoolCol, langCode) + " AND " + DB.Value.ValueCodeCol.Is(DB.ValueLang2.ValueCodeCol, langCode); } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs index bb1a964..df1ee44 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueGroup.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -25,8 +20,8 @@ public Dictionary GetValueGroupRowskeyValueCode(string aG // WHERE VPL.Grouping = <"Grouping as parameter reference for your db vendor"> // AND VPL.GroupCode = <"GroupCode as parameter reference for your db vendor"> // - sqlString += " WHERE " + DB.ValueGroup.GroupingCol.Is(mSqlCommand.GetParameterRef("aGrouping")) + - " AND " +DB.ValueGroup.GroupCodeCol.Is(mSqlCommand.GetParameterRef("aGroupCode")); + sqlString += " WHERE " + DB.ValueGroup.GroupingCol.Is(mSqlCommand.GetParameterRef("aGrouping")) + + " AND " + DB.ValueGroup.GroupCodeCol.Is(mSqlCommand.GetParameterRef("aGroupCode")); // creating the parameters System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -37,9 +32,9 @@ public Dictionary GetValueGroupRowskeyValueCode(string aG DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping + " GroupCode = " + aGroupCode); + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping + " GroupCode = " + aGroupCode); } foreach (DataRow sqlRow in myRows) @@ -81,7 +76,7 @@ private String GetValueGroup_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValueGroupLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValueGroupLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValueGroup.GroupingCol.Is(DB.ValueGroupLang2.GroupingCol, langCode) + " AND " + DB.ValueGroup.GroupCodeCol.Is(DB.ValueGroupLang2.GroupCodeCol, langCode) + " AND " + DB.ValueGroup.ValueCodeCol.Is(DB.ValueGroupLang2.ValueCodeCol, langCode); diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs index b9f90b5..c3d80b0 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValuePool.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public ValuePoolRow GetValuePoolRow(string aValuePool) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValuePool = " + aValuePool); + throw new PCAxis.Sql.Exceptions.DbException(36, " ValuePool = " + aValuePool); } - ValuePoolRow myOut = new ValuePoolRow(myRows[0], DB, mLanguageCodes); + ValuePoolRow myOut = new ValuePoolRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -71,7 +63,7 @@ private String GetValuePool_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValuePoolLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValuePoolLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValuePool.ValuePoolCol.Is(DB.ValuePoolLang2.ValuePoolCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs index 4b3a1dc..ccf0040 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueSet.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public ValueSetRow GetValueSetRow(string aValueSet) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," ValueSet = " + aValueSet); + throw new PCAxis.Sql.Exceptions.DbException(36, " ValueSet = " + aValueSet); } - ValueSetRow myOut = new ValueSetRow(myRows[0], DB, mLanguageCodes); + ValueSetRow myOut = new ValueSetRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -75,7 +67,7 @@ private String GetValueSet_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.ValueSetLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.ValueSetLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.ValueSet.ValueSetCol.Is(DB.ValueSetLang2.ValueSetCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs index f4d9326..e781f06 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_ValueSetGrouping.cs @@ -1,13 +1,8 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -34,9 +29,9 @@ public Dictionary GetValueSetGroupingRowskeyGroupin DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) + if (myRows.Count < 1 && !emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " ValueSet = " + aValueSet); + throw new PCAxis.Sql.Exceptions.DbException(35, " ValueSet = " + aValueSet); } foreach (DataRow sqlRow in myRows) diff --git a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Variable.cs b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Variable.cs index cb8cea2..79b5dc9 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Variable.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedMetaQueryParts/MetaQuery_Variable.cs @@ -1,13 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. @@ -31,10 +23,10 @@ public VariableRow GetVariableRow(string aVariable) DataRowCollection myRows = ds.Tables[0].Rows; if (myRows.Count != 1) { - throw new PCAxis.Sql.Exceptions.DbException(36," Variable = " + aVariable); + throw new PCAxis.Sql.Exceptions.DbException(36, " Variable = " + aVariable); } - VariableRow myOut = new VariableRow(myRows[0], DB, mLanguageCodes); + VariableRow myOut = new VariableRow(myRows[0], DB, mLanguageCodes); return myOut; } @@ -68,7 +60,7 @@ private String GetVariable_SQLString_NoWhere() { if (DB.isSecondaryLanguage(langCode)) { - sqlString += " LEFT JOIN " + DB.VariableLang2.GetNameAndAlias(langCode); + sqlString += " LEFT JOIN " + DB.VariableLang2.GetNameAndAlias(langCode); sqlString += " ON " + DB.Variable.VariableCol.Is(DB.VariableLang2.VariableCol, langCode); } } diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/AttributeRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/AttributeRow.cs index e46fa3e..759d98d 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/AttributeRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/AttributeRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/ContentsRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/ContentsRow.cs index d58e302..c228737 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/ContentsRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/ContentsRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/DataStorageRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/DataStorageRow.cs index 047a559..f726f09 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/DataStorageRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/DataStorageRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteContTimeRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteContTimeRow.cs index 5649623..c903a68 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteContTimeRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteContTimeRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteContValueRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteContValueRow.cs index 5584fa7..9a6f245 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteContValueRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteContValueRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteGroupingRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteGroupingRow.cs index 1698e28..8e2c472 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteGroupingRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteGroupingRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteMaintTimeRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteMaintTimeRow.cs index 574110c..d2649e4 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteMaintTimeRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteMaintTimeRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteRow.cs index dcc5c22..ac378ea 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteValueSetValueRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteValueSetValueRow.cs index 2af6948..5442aa7 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteValueSetValueRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/FootnoteValueSetValueRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/GroupingLevelRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/GroupingLevelRow.cs index 3c67b15..64ea32a 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/GroupingLevelRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/GroupingLevelRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/GroupingRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/GroupingRow.cs index 854a40f..d702edd 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/GroupingRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/GroupingRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTablePersonRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTablePersonRow.cs index 5cc1a58..e44d4e9 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTablePersonRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTablePersonRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTableRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTableRow.cs index dfa7080..ba795d1 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTableRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTableRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTableVariableHierarchyRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTableVariableHierarchyRow.cs index f9b7629..601f45e 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTableVariableHierarchyRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/MainTableVariableHierarchyRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/MenuSelectionRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/MenuSelectionRow.cs index 3183923..ddaef59 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/MenuSelectionRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/MenuSelectionRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/MetaAdmRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/MetaAdmRow.cs index 4d595f6..6e06337 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/MetaAdmRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/MetaAdmRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/MetabaseInfoRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/MetabaseInfoRow.cs index bb3939f..cbbaa21 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/MetabaseInfoRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/MetabaseInfoRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/OrganizationRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/OrganizationRow.cs index f928f34..88658fc 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/OrganizationRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/OrganizationRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/PersonRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/PersonRow.cs index a9ff579..92deb34 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/PersonRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/PersonRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/SecondaryLanguageRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/SecondaryLanguageRow.cs index 37c02ee..c3bf738 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/SecondaryLanguageRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/SecondaryLanguageRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/SpecialCharacterRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/SpecialCharacterRow.cs index fba3a8e..139ba28 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/SpecialCharacterRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/SpecialCharacterRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/SubTableRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/SubTableRow.cs index efdfa75..64099fa 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/SubTableRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/SubTableRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/SubTableVariableRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/SubTableVariableRow.cs index 596dba8..75fd266 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/SubTableVariableRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/SubTableVariableRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/TextCatalogRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/TextCatalogRow.cs index 22ef2a3..282d248 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/TextCatalogRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/TextCatalogRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/TimeScaleRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/TimeScaleRow.cs index 4d2e392..aa37f92 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/TimeScaleRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/TimeScaleRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/VSValueRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/VSValueRow.cs index 5fe2f8e..b7e94b2 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/VSValueRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/VSValueRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueGroupRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueGroupRow.cs index 9a80969..e8608e5 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueGroupRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueGroupRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/ValuePoolRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/ValuePoolRow.cs index 26d723e..b5b96b8 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/ValuePoolRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/ValuePoolRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueRow.cs index 003c209..60991c6 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueSetGroupingRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueSetGroupingRow.cs index 093b520..05e2a02 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueSetGroupingRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueSetGroupingRow.cs @@ -1,10 +1,5 @@ using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueSetRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueSetRow.cs index 21a8cc5..71c6db5 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueSetRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/ValueSetRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/GeneratedRows/VariableRow.cs b/PCAxis.Sql/QueryLib_24/GeneratedRows/VariableRow.cs index 8485676..947671c 100644 --- a/PCAxis.Sql/QueryLib_24/GeneratedRows/VariableRow.cs +++ b/PCAxis.Sql/QueryLib_24/GeneratedRows/VariableRow.cs @@ -1,10 +1,7 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; diff --git a/PCAxis.Sql/QueryLib_24/HandmadeRows/FootNoteRows.cs b/PCAxis.Sql/QueryLib_24/HandmadeRows/FootNoteRows.cs index c50709a..62a15a1 100644 --- a/PCAxis.Sql/QueryLib_24/HandmadeRows/FootNoteRows.cs +++ b/PCAxis.Sql/QueryLib_24/HandmadeRows/FootNoteRows.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; using System.Data; -using PCAxis.Sql.DbClient; //For executing SQLs. + using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; //using PCAxis.Sql.QueryLib; -using log4net; namespace PCAxis.Sql.QueryLib_24 @@ -27,7 +25,7 @@ public enum PXSqlNoteType } public class RelevantFootNotesRow { - + private string mFootNoteNo; public string FootNoteNo { @@ -86,7 +84,7 @@ public string ShowFootNote } private string mPresCharacter; - public string PresCharacter + public string PresCharacter { get { return mPresCharacter; } } @@ -94,7 +92,7 @@ public string PresCharacter public Dictionary texts = new Dictionary(); public RelevantFootNotesRow(DataRow myRow, SqlDbConfig_24 dbconf, StringCollection languageCodes) { - + this.mFootNoteNo = myRow["FootNoteNo"].ToString(); //this.mFootNoteType = myRow["FootNoteType"].ToString(); this.mFootNoteType = (PXSqlNoteType)Enum.Parse(typeof(PXSqlNoteType), myRow["FootNoteType"].ToString()); @@ -114,7 +112,7 @@ public RelevantFootNotesRow(DataRow myRow, SqlDbConfig_24 dbconf, StringCollecti } - + } diff --git a/PCAxis.Sql/QueryLib_24/HandmadeRows/GetNumberOfDistinctAttributeColumns.cs b/PCAxis.Sql/QueryLib_24/HandmadeRows/GetNumberOfDistinctAttributeColumns.cs index 9f8bc2b..4f114bf 100644 --- a/PCAxis.Sql/QueryLib_24/HandmadeRows/GetNumberOfDistinctAttributeColumns.cs +++ b/PCAxis.Sql/QueryLib_24/HandmadeRows/GetNumberOfDistinctAttributeColumns.cs @@ -1,13 +1,6 @@ -using System; -using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; //This code is generated. diff --git a/PCAxis.Sql/QueryLib_24/HandmadeRows/MainTableVariableRow.cs b/PCAxis.Sql/QueryLib_24/HandmadeRows/MainTableVariableRow.cs index 68210df..4c377e5 100644 --- a/PCAxis.Sql/QueryLib_24/HandmadeRows/MainTableVariableRow.cs +++ b/PCAxis.Sql/QueryLib_24/HandmadeRows/MainTableVariableRow.cs @@ -1,18 +1,20 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Data; + using PCAxis.Sql.DbConfig; -namespace PCAxis.Sql.QueryLib_24 { +namespace PCAxis.Sql.QueryLib_24 +{ /// /// Holds the attributes for reduced version SubTableVariable. /// - public class MainTableVariableRow { + public class MainTableVariableRow + { + + public static string sqlString(SqlDbConfig_24 DB) + { - public static string sqlString(SqlDbConfig_24 DB) { - string currentMethod = "MainTableVariableRow.sqlString"; SqlDbConfig_24.TblSubTableVariable stv = DB.SubTableVariable; @@ -31,12 +33,14 @@ public static string sqlString(SqlDbConfig_24 DB) { } private String mVariable; - public String Variable { + public String Variable + { get { return mVariable; } } private String mVariableType; - public String VariableType { + public String VariableType + { get { return mVariableType; } } @@ -45,7 +49,8 @@ public String StoreColumnNo { get { return mStoreColumnNo; } } - public MainTableVariableRow(DataRow myRow, SqlDbConfig_24 dbconf) { + public MainTableVariableRow(DataRow myRow, SqlDbConfig_24 dbconf) + { this.mVariable = myRow[dbconf.SubTableVariable.VariableCol.Label()].ToString(); this.mVariableType = myRow[dbconf.SubTableVariable.VariableTypeCol.Label()].ToString(); this.mStoreColumnNo = myRow[dbconf.SubTableVariable.StoreColumnNoCol.Label()].ToString(); diff --git a/PCAxis.Sql/QueryLib_24/MetaQuery.cs b/PCAxis.Sql/QueryLib_24/MetaQuery.cs index b8759f9..badb754 100644 --- a/PCAxis.Sql/QueryLib_24/MetaQuery.cs +++ b/PCAxis.Sql/QueryLib_24/MetaQuery.cs @@ -1,19 +1,14 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Linq; using System.Data; //For DataSet-objects. +using System.Linq; using System.Reflection; //For MethodBase.GetCurrentMethod(). -using System.Globalization;// for CultureInfo - +using log4net; using PCAxis.Sql.DbClient; //For executing SQLs. using PCAxis.Sql.DbConfig; // ReadSqlDbConfig; - - -using log4net; using PCAxis.Sql.Exceptions; @@ -27,7 +22,7 @@ public partial class MetaQuery { private static readonly ILog log = LogManager.GetLogger(typeof(MetaQuery)); #if DEBUG - private static readonly log4net.ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(),"LogTime"); + private static readonly log4net.ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(), "LogTime"); #endif @@ -82,7 +77,7 @@ public MetaQuery(SqlDbConfig_24 config, InfoForDbConnection selectedDbInfo, bool CompareCNMMVersionSources(); } - + public PxSqlCommand GetPxSqlCommand() { if (_useTempTables) @@ -109,9 +104,9 @@ public string GetDataTablesPrefix(string aProductId) } - - + + /// Gets the languages for which the maintable exists in the database. /// /// The maintable @@ -121,23 +116,23 @@ public StringCollection GetLanguagesForMainTable(string mainTableId, StringColle { StringCollection maintableLanguages = new StringCollection(); maintableLanguages.Add(DB.MainLanguage.code); - + Dictionary SLs = this.GetSecondaryLanguageRowsbyLanguage(mainTableId, true); - foreach (String dbLang in dbLanguages) + foreach (String dbLang in dbLanguages) + { + if (DB.isSecondaryLanguage(dbLang)) { - if (DB.isSecondaryLanguage(dbLang)) + if (SLs.ContainsKey(dbLang)) { - if (SLs.ContainsKey(dbLang)) + if (SLs[dbLang].CompletelyTranslated.Equals(DB.Codes.Yes)) { - if (SLs[dbLang].CompletelyTranslated.Equals(DB.Codes.Yes)) - { - maintableLanguages.Add(dbLang); - } + maintableLanguages.Add(dbLang); } - } + } - + } + return maintableLanguages; } @@ -151,7 +146,7 @@ public List GetMainTableVariableRows(string aMainTable) System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1]; parameters[0] = DB.SubTableVariable.MainTableCol.GetStringParameter(aMainTable); - + DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; @@ -167,8 +162,8 @@ public List GetMainTableVariableRows(string aMainTable) return myOut; } - - + + public DataSet GetValueWildCardBySubTable(string aMainTable, string aVariable, string aSubtable, string aWildCard) { @@ -230,7 +225,7 @@ public DataSet GetValueWildCardBySubTable(string aMainTable, string aVariable, s parameters[2] = DB.VSValue.ValueCodeCol.GetStringParameter(sqlWildCard); } - + // Execute the SQL and return the result (records) as a System.Data.DataSet-object. return mSqlCommand.ExecuteSelect(sqlString, parameters); } @@ -308,9 +303,9 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle sqlString += " FROM ("; #region language section int LangCounter = 0; - + //TODO; reduserte denne mye, kan man bruke noe generert nå, mon tro - + foreach (String langCode in mLanguageCodes) { if (LangCounter > 0) @@ -324,15 +319,15 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle + ", " + DB.Value.ValuePoolCol.Id() + " AS " + DB.Value.ValuePoolCol.PureColumnName(); - - sqlString += ", " + DB.Value.ValueTextLCol.Id() + " AS " + DB.Value.ValueTextLCol.PureColumnName() - + ", " + DB.Value.ValueTextSCol.Id() + " AS " + DB.Value.ValueTextSCol.PureColumnName(); - + + sqlString += ", " + DB.Value.ValueTextLCol.Id() + " AS " + DB.Value.ValueTextLCol.PureColumnName() + + ", " + DB.Value.ValueTextSCol.Id() + " AS " + DB.Value.ValueTextSCol.PureColumnName(); + sqlString += ", " + DB.Value.SortCodeCol.Id() + " AS SortCodeValue" + " FROM " + DB.MetaOwner + DB.Value.TableName + " " + DB.Value.Alias; - + } else { @@ -340,15 +335,15 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle + ", " + DB.ValueLang2.ValueCodeCol.Id(langCode) + " AS " + DB.Value.ValueCodeCol.PureColumnName() + ", " + DB.ValueLang2.ValuePoolCol.Id(langCode) + " AS " + DB.Value.ValuePoolCol.PureColumnName(); - - sqlString += ", " + DB.ValueLang2.ValueTextLCol.Id(langCode) + " AS " + DB.Value.ValueTextLCol.PureColumnName() - + ", " + DB.ValueLang2.ValueTextSCol.Id(langCode) + " AS " + DB.Value.ValueTextSCol.PureColumnName(); - + + sqlString += ", " + DB.ValueLang2.ValueTextLCol.Id(langCode) + " AS " + DB.Value.ValueTextLCol.PureColumnName() + + ", " + DB.ValueLang2.ValueTextSCol.Id(langCode) + " AS " + DB.Value.ValueTextSCol.PureColumnName(); + sqlString += ", " + DB.ValueLang2.SortCodeCol.Id(langCode) + " AS SortCodeValue" + " FROM " + DB.ValueLang2.GetNameAndAlias(langCode); - + } LangCounter++; } @@ -369,10 +364,10 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle #region where section - + sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is(); int numberOfDbParameters = 1; - + if (subTables != null) { sqlString += " AND " + DB.SubTableVariable.SubTableCol.In(subTables); @@ -382,11 +377,11 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle sqlString += " AND " + DB.SubTableVariable.VariableCol.Is(); numberOfDbParameters++; - + #endregion where section sqlString += " ORDER BY Language, SortCodeVsValue, SortCodeValue, bx." + DB.Value.ValueCodeCol.PureColumnName(); - + #region parameters to where section System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[numberOfDbParameters]; @@ -403,13 +398,13 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle parameters[DbParameterIndex] = DB.SubTableVariable.VariableCol.GetStringParameter(variable); DbParameterIndex++; - + #endregion parameters to where section DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataTable myTable = ds.Tables[0]; - + ValueRow2HMDictionary myOut = new ValueRow2HMDictionary(myTable, DB, this); @@ -522,7 +517,7 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle // piv added DISTINCT #endregion example - + int numberOfDbParameters = mLanguageCodes.Count * (2 + subTables.Count); int DbParameterIndex = 0; @@ -553,15 +548,15 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle + ", " + DB.Value.ValueCodeCol.Id() + " AS " + DB.Value.ValueCodeCol.PureColumnName() + ", " + DB.Value.ValuePoolCol.Id() + " AS " + DB.Value.ValuePoolCol.PureColumnName(); - - sqlString += ", " + DB.Value.ValueTextLCol.Id() + " AS " + DB.Value.ValueTextLCol.PureColumnName() - + ", " + DB.Value.ValueTextSCol.Id() + " AS " + DB.Value.ValueTextSCol.PureColumnName(); - + + sqlString += ", " + DB.Value.ValueTextLCol.Id() + " AS " + DB.Value.ValueTextLCol.PureColumnName() + + ", " + DB.Value.ValueTextSCol.Id() + " AS " + DB.Value.ValueTextSCol.PureColumnName(); + sqlString += ", " + DB.Value.SortCodeCol.Id() + " AS SortCodeValue" + " FROM " + DB.Value.GetNameAndAlias(); - + #endregion primary language } else @@ -571,15 +566,15 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle + ", " + DB.ValueLang2.ValueCodeCol.Id(langCode) + " AS " + DB.Value.ValueCodeCol.PureColumnName() + ", " + DB.ValueLang2.ValuePoolCol.Id(langCode) + " AS " + DB.Value.ValuePoolCol.PureColumnName(); - - sqlString += ", " + DB.ValueLang2.ValueTextLCol.Id(langCode) + " AS " + DB.Value.ValueTextLCol.PureColumnName() - + ", " + DB.ValueLang2.ValueTextSCol.Id(langCode) + " AS " + DB.Value.ValueTextSCol.PureColumnName(); - + + sqlString += ", " + DB.ValueLang2.ValueTextLCol.Id(langCode) + " AS " + DB.Value.ValueTextLCol.PureColumnName() + + ", " + DB.ValueLang2.ValueTextSCol.Id(langCode) + " AS " + DB.Value.ValueTextSCol.PureColumnName(); + sqlString += ", " + DB.ValueLang2.SortCodeCol.Id(langCode) + " AS SortCodeValue" + " FROM " + DB.ValueLang2.GetNameAndAlias(langCode); - + #endregion secondary language } @@ -592,7 +587,7 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle + " ON (bx." + DB.Value.ValuePoolCol.PureColumnName() + " = bz." + DB.Value.ValuePoolCol.PureColumnName() + " AND bx." + DB.Value.ValueCodeCol.PureColumnName() + " = bz." + DB.Value.ValueCodeCol.PureColumnName() + ")" + " JOIN " + DB.SubTableVariable.GetNameAndAlias() + " ON (bz." + DB.VSValue.ValueSetCol.PureColumnName() + " = " + DB.SubTableVariable.ValueSetCol.Id() + ")" - + " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable"+langCode)); + + " WHERE " + DB.SubTableVariable.MainTableCol.Is(mSqlCommand.GetParameterRef("aMainTable" + langCode)); @@ -602,11 +597,11 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle // If extraction from only one subtable, this paragraph must be included if (subTables.Count > 0) { - string tmpNameBase=""; + string tmpNameBase = ""; sqlString += " AND " + DB.SubTableVariable.SubTableCol.Id() + " IN ("; for (int counter = 0; counter < subTables.Count; counter++) { - tmpNameBase= "aSubTable" + langCode + (counter + 1); + tmpNameBase = "aSubTable" + langCode + (counter + 1); sqlString += mSqlCommand.GetParameterRef(tmpNameBase) + " ,"; parameters[DbParameterIndex] = mSqlCommand.GetStringParameter(tmpNameBase, subTables[counter]); DbParameterIndex++; @@ -628,11 +623,11 @@ public ValueRow2HMDictionary GetValueRowDictionary(string mainTable, StringColle DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); //DataRowCollection myRows = ds.Tables[0].Rows; DataTable myTable = ds.Tables[0]; - + ValueRow2HMDictionary myOut = new ValueRow2HMDictionary(myTable, DB, this); return myOut; } - + // newnewnew //flyttet hit fra fra_master2MetaQuery @@ -647,9 +642,9 @@ public List GetValueRowsByValuePool(string valuePool, StringCollecti { if (!DB.isSecondaryLanguage(langCode)) { - sqlString += ", " + DB.Value.ValueTextSCol.ForSelect(); - sqlString += ", " + DB.Value.ValueTextLCol.ForSelect(); - sqlString += ", " + DB.Value.SortCodeCol.ForSelect(); + sqlString += ", " + DB.Value.ValueTextSCol.ForSelect(); + sqlString += ", " + DB.Value.ValueTextLCol.ForSelect(); + sqlString += ", " + DB.Value.SortCodeCol.ForSelect(); } else { @@ -658,11 +653,11 @@ public List GetValueRowsByValuePool(string valuePool, StringCollecti joinString += " ON ( " + DB.ValueLang2.ValuePoolCol.Id(langCode) + " = " + DB.Value.ValuePoolCol.Id() + " AND " + DB.ValueLang2.ValueCodeCol.Id(langCode) + " = " + DB.Value.ValueCodeCol.Id() + ")"; - - sqlString += ", " + GetColumnSelectionString(DB.ValueLang2.Alias + DB.GetMetaSuffix(langCode), DB.ValueLang2.ValueTextSCol.PureColumnName()); - sqlString += ", " + GetColumnSelectionString(DB.ValueLang2.Alias + DB.GetMetaSuffix(langCode), DB.ValueLang2.ValueTextLCol.PureColumnName()); - + sqlString += ", " + GetColumnSelectionString(DB.ValueLang2.Alias + DB.GetMetaSuffix(langCode), DB.ValueLang2.ValueTextSCol.PureColumnName()); + sqlString += ", " + GetColumnSelectionString(DB.ValueLang2.Alias + DB.GetMetaSuffix(langCode), DB.ValueLang2.ValueTextLCol.PureColumnName()); + + sqlString += ", " + GetColumnSelectionString(DB.ValueLang2.Alias + DB.GetMetaSuffix(langCode), DB.ValueLang2.SortCodeCol.PureColumnName()); } @@ -682,7 +677,7 @@ public List GetValueRowsByValuePool(string valuePool, StringCollecti System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1 + someValueCodes.Count]; parameters[0] = DB.Value.ValuePoolCol.GetStringParameter(valuePool); - + if (someValueCodes.Count > 0) { Array.Copy(DB.Value.ValueCodeCol.GetStringParameters(someValueCodes), 0, parameters, 1, someValueCodes.Count); @@ -738,7 +733,7 @@ public int GetNumberOfValuesInValueSetById(string aValueSet) return int.Parse((mMetaSet.Tables[0].Rows[0]["COUNT"]).ToString()); } - + /// /// Logs a line if Database and configfile disagrees on CNMM version /// @@ -756,10 +751,10 @@ private void CompareCNMMVersionSources() versionFromConfig + " in config file. They must be equal"; log.Warn(message); } - + } - + //flyttet over fra fra_master2MetaQuery. Denne tabellen er ond @@ -769,7 +764,7 @@ private void CompareCNMMVersionSources() public TextCatalogRow GetTextCatalogRow() { string aTextType = DB.Keywords.ContentVariable; - + string sqlString = GetTextCatalog_SQLString_NoWhere(); sqlString += " WHERE " + DB.TextCatalog.TextTypeCol.IsUppered(); @@ -917,7 +912,7 @@ public List GetRelevantFoonotes(string mainTable) string sqlString = "select bx.MainTable, bx.FootNoteNo, bx.FootNoteType, bx.Contents, bx.Variable, bx.ValuePool, bx.ValueCode," + "bx.TimePeriod, bx.Subtable," + DB.Footnote.MandOptCol.Id() + " as MandOpt," + DB.Footnote.ShowFootnoteCol.Id() + " as ShowFootNotes," + DB.Footnote.PresCharacterCol.Id() + " as PresCharacter," + - DB.Footnote.FootnoteTextCol.ForSelect() ; + DB.Footnote.FootnoteTextCol.ForSelect(); foreach (String langCode in mLanguageCodes) { if (DB.isSecondaryLanguage(langCode)) @@ -933,23 +928,23 @@ public List GetRelevantFoonotes(string mainTable) "(select fi." + DB.FootnoteContVbl.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteContVbl.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '3' as FootNoteType, fi." + DB.FootnoteContVbl.ContentsCol.PureColumnName() + " as Contents, fi." + DB.FootnoteContVbl.VariableCol.PureColumnName() + " as Variable, '*' as ValuePool, '*' as Valuecode, " + "'*' as TimePeriod, '*' as Subtable " + "from " + Md + DB.FootnoteContVbl.TableName + " fi) " + - // "union " + - // "(select fi." + DB.FootnoteContValue.MainTableCol.PureColumnName() + ", fi." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + ", '4' as FootNoteType, fi." + DB.FootnoteContValue.ContentsCol.PureColumnName() + " as Contents, fi." + DB.FootnoteContValue.VariableCol.PureColumnName() + " as Variable, fi." + DB.FootnoteContValue.ValuePoolCol.PureColumnName() + " as ValuePool, fi." + DB.FootnoteContValue.ValueCodeCol.PureColumnName() + " as ValueCode, " + - // "'*' as TimePeriod, '*' as SubTable " + - // "from " + Md + DB.FootnoteContValue.TableName + " fi " + - // "where COALESCE(fi." + DB.FootnoteContValue.CellnoteCol.PureColumnName() + ", 'XX') <> '" + DB.Codes.Yes + "') " + - // "union " + - // "(select fi." + DB.FootnoteContTime.MainTableCol.PureColumnName() + " as MainTable,fi." + DB.FootnoteContTime.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '41' as FootNoteType, fi." + DB.FootnoteContTime.ContentsCol.PureColumnName() + " as Contents, '*' as Variable, '*' as ValuePool, '*' as ValueCode," + - // "fi." + DB.FootnoteContTime.TimePeriodCol.PureColumnName() + " as TimePeriod, '*' as SubTable " + - // "from " + Md + DB.FootnoteContTime.TableName + " fi " + - // "where COALESCE(fi." + DB.FootnoteContTime.CellnoteCol.PureColumnName() + ", 'XX') <> '" + DB.Codes.Yes + "') " + - // "union " + - // "(select fih." + DB.FootnoteContValue.MainTableCol.PureColumnName() + ", fih." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '999' as FootNoteType, fih." + DB.FootnoteContValue.ContentsCol.PureColumnName() + " as Contents, fih." + DB.FootnoteContValue.VariableCol.PureColumnName() + " Variable, fih." + DB.FootnoteContValue.ValuePoolCol.PureColumnName() + " as ValuePool, fih." + DB.FootnoteContValue.ValueCodeCol.PureColumnName() + " as ValueCode, " + - // "fit." + DB.FootnoteContTime.TimePeriodCol.PureColumnName() + " as TimePeriod, '*' as SubTable " + - // "from " + Md + DB.FootnoteContValue.TableName + " fih, " + Md + DB.FootnoteContTime.TableName + " fit " + - // "where fih." + DB.FootnoteContValue.CellnoteCol.PureColumnName() + " = '" + DB.Codes.Yes + "' " + - // "and fit." + DB.FootnoteContTime.CellnoteCol.PureColumnName() + " = '" + DB.Codes.Yes + "' " + - // "and fit." + DB.FootnoteContTime.FootnoteNoCol.PureColumnName() + " = fih." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + ") " + + // "union " + + // "(select fi." + DB.FootnoteContValue.MainTableCol.PureColumnName() + ", fi." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + ", '4' as FootNoteType, fi." + DB.FootnoteContValue.ContentsCol.PureColumnName() + " as Contents, fi." + DB.FootnoteContValue.VariableCol.PureColumnName() + " as Variable, fi." + DB.FootnoteContValue.ValuePoolCol.PureColumnName() + " as ValuePool, fi." + DB.FootnoteContValue.ValueCodeCol.PureColumnName() + " as ValueCode, " + + // "'*' as TimePeriod, '*' as SubTable " + + // "from " + Md + DB.FootnoteContValue.TableName + " fi " + + // "where COALESCE(fi." + DB.FootnoteContValue.CellnoteCol.PureColumnName() + ", 'XX') <> '" + DB.Codes.Yes + "') " + + // "union " + + // "(select fi." + DB.FootnoteContTime.MainTableCol.PureColumnName() + " as MainTable,fi." + DB.FootnoteContTime.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '41' as FootNoteType, fi." + DB.FootnoteContTime.ContentsCol.PureColumnName() + " as Contents, '*' as Variable, '*' as ValuePool, '*' as ValueCode," + + // "fi." + DB.FootnoteContTime.TimePeriodCol.PureColumnName() + " as TimePeriod, '*' as SubTable " + + // "from " + Md + DB.FootnoteContTime.TableName + " fi " + + // "where COALESCE(fi." + DB.FootnoteContTime.CellnoteCol.PureColumnName() + ", 'XX') <> '" + DB.Codes.Yes + "') " + + // "union " + + // "(select fih." + DB.FootnoteContValue.MainTableCol.PureColumnName() + ", fih." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '999' as FootNoteType, fih." + DB.FootnoteContValue.ContentsCol.PureColumnName() + " as Contents, fih." + DB.FootnoteContValue.VariableCol.PureColumnName() + " Variable, fih." + DB.FootnoteContValue.ValuePoolCol.PureColumnName() + " as ValuePool, fih." + DB.FootnoteContValue.ValueCodeCol.PureColumnName() + " as ValueCode, " + + // "fit." + DB.FootnoteContTime.TimePeriodCol.PureColumnName() + " as TimePeriod, '*' as SubTable " + + // "from " + Md + DB.FootnoteContValue.TableName + " fih, " + Md + DB.FootnoteContTime.TableName + " fit " + + // "where fih." + DB.FootnoteContValue.CellnoteCol.PureColumnName() + " = '" + DB.Codes.Yes + "' " + + // "and fit." + DB.FootnoteContTime.CellnoteCol.PureColumnName() + " = '" + DB.Codes.Yes + "' " + + // "and fit." + DB.FootnoteContTime.FootnoteNoCol.PureColumnName() + " = fih." + DB.FootnoteContValue.FootnoteNoCol.PureColumnName() + ") " + "union " + "(select distinct dvt." + DB.SubTableVariable.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteVariable.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '5' as FootNoteType, '*' as Contents, fi." + DB.FootnoteContVbl.VariableCol.PureColumnName() + " as Variable, '*' as ValuePool, '*' as ValueCode, " + "'*' as TimePeriod, '*' as SubTable " + @@ -963,14 +958,14 @@ public List GetRelevantFoonotes(string mainTable) " and vmv." + DB.VSValue.ValuePoolCol.PureColumnName() + " = fi." + DB.FootnoteValue.ValuePoolCol.PureColumnName() + " and vmv." + DB.VSValue.ValueCodeCol.PureColumnName() + " = fi." + DB.FootnoteValue.ValueCodeCol.PureColumnName() + ") " + "union " + - "(select distinct "+ oraninja1+" dvt." + DB.SubTableVariable.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '6' as FootNoteType, '*' as Contents, dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + " as Variable, fi." + DB.FootnoteValue.ValuePoolCol.PureColumnName() + " as ValuePool, fi." + DB.FootnoteValue.ValueCodeCol.PureColumnName() + " as ValueCode, " + + "(select distinct " + oraninja1 + " dvt." + DB.SubTableVariable.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '6' as FootNoteType, '*' as Contents, dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + " as Variable, fi." + DB.FootnoteValue.ValuePoolCol.PureColumnName() + " as ValuePool, fi." + DB.FootnoteValue.ValueCodeCol.PureColumnName() + " as ValueCode, " + "'*' as TimePeriod, '*' as SubTable " + "from " + Md + DB.FootnoteValue.TableName + " fi, " + Md + DB.SubTableVariable.TableName + " dvt, " + Md + DB.ValueSetGrouping.TableName + " vmg, " + Md + DB.Grouping.TableName + " g, " + Md + DB.ValueGroup.TableName + " vg " + "where dvt. " + DB.ValueSet.ValueSetCol.PureColumnName() + " = vmg." + DB.ValueSetGrouping.ValueSetCol.PureColumnName() + " and vmg." + DB.ValueSetGrouping.GroupingCol.PureColumnName() + " = g." + DB.Grouping.GroupingCol.PureColumnName() + " and g." + DB.Grouping.GroupingCol.PureColumnName() + " = vg." + DB.ValueSetGrouping.GroupingCol.PureColumnName() + - " and g." + DB.Grouping.ValuePoolCol.PureColumnName() + " = vg." + DB.ValueGroup.ValuePoolCol.PureColumnName() + - " and vg." + DB.ValueGroup.ValuePoolCol.PureColumnName() + " = fi." + DB.FootnoteValue.ValuePoolCol.PureColumnName() + + " and g." + DB.Grouping.ValuePoolCol.PureColumnName() + " = vg." + DB.ValueGroup.ValuePoolCol.PureColumnName() + + " and vg." + DB.ValueGroup.ValuePoolCol.PureColumnName() + " = fi." + DB.FootnoteValue.ValuePoolCol.PureColumnName() + " and vg." + DB.ValueGroup.GroupCodeCol.PureColumnName() + " = fi." + DB.FootnoteValue.ValueCodeCol.PureColumnName() + oraninja2 + ") " + "union " + "(select fi." + DB.FootnoteMainTable.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteMainTable.FootnoteNoCol.PureColumnName() + " as FootNoteNo , '7' as FootNoteType, '*' as Contents, '*' as Variable, '*' as ValuePool, '*' as ValueCode," + @@ -980,16 +975,16 @@ public List GetRelevantFoonotes(string mainTable) "(select fi." + DB.FootnoteSubTable.MainTableCol.PureColumnName() + " as MainTable, " + DB.FootnoteSubTable.FootnoteNoCol.PureColumnName() + " as FootNote, '8' as FootNoteType, '*' as Contents, '*' as Variable, '*' as ValuePool, '*' as ValueCode," + "'*' as TimePeriod, " + "fi." + DB.FootnoteSubTable.SubTableCol.PureColumnName() + " as SubTable " + "from " + Md + DB.FootnoteSubTable.TableName + " fi) "; - - sqlString += "union " + - "(select distinct fi." + DB.FootnoteMaintValue.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteMaintValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '9' as FootNoteType, '*' as Contents, dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + ", fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + " as ValuePool , fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + " as ValueCode," + - "'*' as TimePeriod, '*' as SubTable " + - "from " + Md + DB.FootnoteMaintValue.TableName + " fi, " + Md + DB.SubTableVariable.TableName + " dvt," + Md + DB.VSValue.TableName + " vmv " + - "where dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + "= fi." + DB.FootnoteMaintValue.VariableCol.PureColumnName() + - " and vmv." + DB.VSValue.ValueSetCol.PureColumnName() + " = dvt." + DB.SubTableVariable.ValueSetCol.PureColumnName() + - " and vmv." + DB.VSValue.ValuePoolCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + - " and vmv." + DB.VSValue.ValueCodeCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + ")"; - + + sqlString += "union " + + "(select distinct fi." + DB.FootnoteMaintValue.MainTableCol.PureColumnName() + " as MainTable, fi." + DB.FootnoteMaintValue.FootnoteNoCol.PureColumnName() + " as FootNoteNo, '9' as FootNoteType, '*' as Contents, dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + ", fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + " as ValuePool , fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + " as ValueCode," + + "'*' as TimePeriod, '*' as SubTable " + + "from " + Md + DB.FootnoteMaintValue.TableName + " fi, " + Md + DB.SubTableVariable.TableName + " dvt," + Md + DB.VSValue.TableName + " vmv " + + "where dvt." + DB.SubTableVariable.VariableCol.PureColumnName() + "= fi." + DB.FootnoteMaintValue.VariableCol.PureColumnName() + + " and vmv." + DB.VSValue.ValueSetCol.PureColumnName() + " = dvt." + DB.SubTableVariable.ValueSetCol.PureColumnName() + + " and vmv." + DB.VSValue.ValuePoolCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValuePoolCol.PureColumnName() + + " and vmv." + DB.VSValue.ValueCodeCol.PureColumnName() + " = fi." + DB.FootnoteMaintValue.ValueCodeCol.PureColumnName() + ")"; + sqlString += ") bx," + DB.Footnote.GetNameAndAlias(); foreach (String langCode in mLanguageCodes) @@ -1202,7 +1197,7 @@ public List GetRelevantFoonotes(string mainTable) private IEnumerable> CreateGroupCodeBuckets(IEnumerable groupCodes) { if (groupCodes == null) return null; - + var result = new List>(); var groupCodeArray = groupCodes.ToArray(); List bucket = new List(); @@ -1226,7 +1221,7 @@ private IEnumerable> CreateGroupCodeBuckets(IEnumerable GetGroupingRowsSorted(StringCollection aGroupings, bool } bool sortOnPrimaryLanguage = !this.mDbConfig.isSecondaryLanguage(sortOrderLanguage); List myOut = new List(); - if(aGroupings.Count == 0) + if (aGroupings.Count == 0) { return myOut; } @@ -34,7 +34,7 @@ public List GetGroupingRowsSorted(StringCollection aGroupings, bool SqlDbConfig dbconf = DB; - + string sqlString = GetGrouping_SQLString_NoWhere(); @@ -54,7 +54,7 @@ public List GetGroupingRowsSorted(StringCollection aGroupings, bool } else { - sqlString += " ORDER BY " + DB.GroupingLang2.SortCodeCol.Id(sortOrderLanguage) + ", "+ + sqlString += " ORDER BY " + DB.GroupingLang2.SortCodeCol.Id(sortOrderLanguage) + ", " + DB.GroupingLang2.PresTextCol.Id(sortOrderLanguage) + ", "; } sqlString += DB.Grouping.GroupingCol.Id(); diff --git a/PCAxis.Sql/QueryLib_24/MetaQuery_SubTableVariable.cs b/PCAxis.Sql/QueryLib_24/MetaQuery_SubTableVariable.cs index 4926fa4..58e285d 100644 --- a/PCAxis.Sql/QueryLib_24/MetaQuery_SubTableVariable.cs +++ b/PCAxis.Sql/QueryLib_24/MetaQuery_SubTableVariable.cs @@ -1,9 +1,6 @@ +using System.Collections.Generic; using System.Data; using System.Text; -using System.Collections.Generic; -using System.Collections.Specialized; - -using PCAxis.Sql.DbConfig; namespace PCAxis.Sql.QueryLib_24 { @@ -55,10 +52,10 @@ public List GetValuesetIdsFromSubTableVariableOrderedBySortcode(string m { string sqlString = "SELECT DISTINCT " + DB.SubTableVariable.ValueSetCol.ForSelect() + ", " + - DB.SubTableVariable.SortCodeCol.ForSelect() ; + DB.SubTableVariable.SortCodeCol.ForSelect(); sqlString += " /" + "*** SQLID: SubTableVariable_02 ***" + "/"; - sqlString += " FROM " + DB.SubTableVariable.GetNameAndAlias() ; + sqlString += " FROM " + DB.SubTableVariable.GetNameAndAlias(); sqlString += " WHERE " + DB.SubTableVariable.MainTableCol.Is() + " AND " + DB.SubTableVariable.VariableCol.Is(); @@ -79,7 +76,7 @@ public List GetValuesetIdsFromSubTableVariableOrderedBySortcode(string m string valuesetId = myRow[DB.SubTableVariable.ValueSetCol.Label()].ToString(); if (myOut.Contains(valuesetId)) { - throw new PCAxis.Sql.Exceptions.DbException(49, maintable, variable,valuesetId); + throw new PCAxis.Sql.Exceptions.DbException(49, maintable, variable, valuesetId); } myOut.Add(valuesetId); } diff --git a/PCAxis.Sql/QueryLib_24/MetaQuery_ValueGroupMaxValueLevel.cs b/PCAxis.Sql/QueryLib_24/MetaQuery_ValueGroupMaxValueLevel.cs index fbf9652..14be78d 100644 --- a/PCAxis.Sql/QueryLib_24/MetaQuery_ValueGroupMaxValueLevel.cs +++ b/PCAxis.Sql/QueryLib_24/MetaQuery_ValueGroupMaxValueLevel.cs @@ -1,17 +1,11 @@ -using System; using System.Data; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; -namespace PCAxis.Sql.QueryLib_24 { +namespace PCAxis.Sql.QueryLib_24 +{ public partial class MetaQuery { @@ -23,7 +17,7 @@ public string GetValueGroupMaxValueLevel(string aGrouping, bool emptyRowSetIsOK) string sqlString = "SELECT "; sqlString += "MAX(" + - DB.ValueGroup.GroupLevelCol.Id() +") "; + DB.ValueGroup.GroupLevelCol.Id() + ") "; sqlString += " FROM " + DB.ValueGroup.GetNameAndAlias(); sqlString += " WHERE " + DB.ValueGroup.GroupingCol.Is(mSqlCommand.GetParameterRef("aGrouping")); @@ -33,8 +27,9 @@ public string GetValueGroupMaxValueLevel(string aGrouping, bool emptyRowSetIsOK) DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); + if (myRows.Count < 1 && !emptyRowSetIsOK) + { + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); } myOut = myRows[0][0].ToString(); return myOut; diff --git a/PCAxis.Sql/QueryLib_24/MetaQuery_ValueGroupSorted.cs b/PCAxis.Sql/QueryLib_24/MetaQuery_ValueGroupSorted.cs index 34291c0..9c114d2 100644 --- a/PCAxis.Sql/QueryLib_24/MetaQuery_ValueGroupSorted.cs +++ b/PCAxis.Sql/QueryLib_24/MetaQuery_ValueGroupSorted.cs @@ -1,21 +1,17 @@ -using System; -using System.Data; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; -namespace PCAxis.Sql.QueryLib_24 { +namespace PCAxis.Sql.QueryLib_24 +{ - public partial class MetaQuery { + public partial class MetaQuery + { #region for ValueGroup - public List GetValueGroupRowsSorted(string aGrouping,string aLevel, bool emptyRowSetIsOK, string aSortOrderLanguage) + public List GetValueGroupRowsSorted(string aGrouping, string aLevel, bool emptyRowSetIsOK, string aSortOrderLanguage) { string sortOrderLanguage = aSortOrderLanguage; if (!this.mLanguageCodes.Contains(aSortOrderLanguage)) @@ -40,8 +36,8 @@ public List GetValueGroupRowsSorted(string aGrouping,string aLeve parameters = new System.Data.Common.DbParameter[2]; parameters[0] = DB.ValueGroup.GroupingCol.GetStringParameter(aGrouping); - parameters[1] = DB.ValueGroup.GroupLevelCol.GetStringParameter(aLevel); - } + parameters[1] = DB.ValueGroup.GroupLevelCol.GetStringParameter(aLevel); + } else { parameters = new System.Data.Common.DbParameter[1]; @@ -55,28 +51,30 @@ public List GetValueGroupRowsSorted(string aGrouping,string aLeve else { sqlString += " ORDER BY " - + DB.ValueGroupLang2.SortCodeCol.Id(sortOrderLanguage) + ", " ; + + DB.ValueGroupLang2.SortCodeCol.Id(sortOrderLanguage) + ", "; } sqlString += DB.ValueGroup.GroupCodeCol.Id() + ", " + DB.ValueGroup.ValueCodeCol.Id(); - + DataSet ds = mSqlCommand.ExecuteSelect(sqlString, parameters); - + DataRowCollection myRows = ds.Tables[0].Rows; - if (myRows.Count < 1 && ! emptyRowSetIsOK) { - throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); + if (myRows.Count < 1 && !emptyRowSetIsOK) + { + throw new PCAxis.Sql.Exceptions.DbException(35, " Grouping = " + aGrouping); } - foreach (DataRow sqlRow in myRows) { + foreach (DataRow sqlRow in myRows) + { ValueGroupRow outRow = new ValueGroupRow(sqlRow, DB, mLanguageCodes); myOut.Add(outRow); } return myOut; } - + #endregion for ValueGroup diff --git a/PCAxis.Sql/QueryLib_24/MetaQuery_for_PxsSqlData.cs b/PCAxis.Sql/QueryLib_24/MetaQuery_for_PxsSqlData.cs index e38805b..828a1f9 100644 --- a/PCAxis.Sql/QueryLib_24/MetaQuery_for_PxsSqlData.cs +++ b/PCAxis.Sql/QueryLib_24/MetaQuery_for_PxsSqlData.cs @@ -1,14 +1,10 @@ using System; -using System.Data; using System.Collections.Generic; -using System.Text; -using System.Xml.XPath; - -using PCAxis.Sql.DbConfig; -using PCAxis.Sql.Exceptions; - using System.Collections.Specialized; +using System.Data; using System.Reflection; + +using PCAxis.Sql.Exceptions; using PCAxis.Sql.Parser_24; @@ -25,7 +21,8 @@ public partial class MetaQuery : IDisposable //flytt til hoved - public void Dispose() { + public void Dispose() + { this.DropTempTables(); mSqlCommand.Dispose(); } @@ -33,22 +30,27 @@ public void Dispose() { #region wildcards in groupvalues - public StringCollection GetValueWildCardByGrouping(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) { + public StringCollection GetValueWildCardByGrouping(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) + { // Resolve wildcards here StringCollection myOut = new StringCollection(); DataSet ds = null; - if (String.Compare(DB.MetaModel, "2.1", false, System.Globalization.CultureInfo.InvariantCulture) > 0) { + if (String.Compare(DB.MetaModel, "2.1", false, System.Globalization.CultureInfo.InvariantCulture) > 0) + { // Datamodel > 2.1, new table structure ds = this.GetValueWildCardByGrouping22(mainTable, variable, subTable, grouping, groupCode, wildCard); - } else { + } + else + { // Datamodel 2.1 or older, the old table structure. Use of Grouping is only valid if a SubTable is selected //ds = this.GetValueWildCardByGrouping21(mainTable, variable, subTable, grouping, groupCode, wildCard); } DataRowCollection mValueInfo = ds.Tables[0].Rows; - foreach (DataRow row in mValueInfo) { + foreach (DataRow row in mValueInfo) + { throw new NotImplementedException(); //TODO; tok bort myOut.Add(row[DB.VSGroup.ValueCode].ToString()); - // myOut.Add(row[DB.VSGroup.ValueCode].ToString()); + // myOut.Add(row[DB.VSGroup.ValueCode].ToString()); } return myOut; } @@ -92,7 +94,8 @@ public StringCollection GetValueWildCardByGrouping(string mainTable, string vari - private DataSet GetValueWildCardByGrouping22(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) { + private DataSet GetValueWildCardByGrouping22(string mainTable, string variable, string subTable, string grouping, string groupCode, string wildCard) + { // To ensure that the correct grouping is used mainTable and variable has to be included // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -165,10 +168,10 @@ public string MakeTempTable(string VariableName, string VariableNumber, IList @@ -214,24 +217,36 @@ public string MakeTempTable(string VariableName, string VariableNumber, IList - public void DropTempTables() { - - if (!DB.UseTemporaryTables) { - foreach (string tableName in dropTheseTables) { - try { + public void DropTempTables() + { + + if (!DB.UseTemporaryTables) + { + foreach (string tableName in dropTheseTables) + { + try + { mSqlCommand.ExecuteNonQuery("DROP TABLE " + tableName); - } catch (Exception e) { + } + catch (Exception e) + { log.Error("DROP TABLE failed:", e); //don't want to stop because of this... } } - } else if (mSqlCommand.getProgramMustTruncAndDropTempTable()) { - foreach (string tableName in dropTheseTables) { - try { + } + else if (mSqlCommand.getProgramMustTruncAndDropTempTable()) + { + foreach (string tableName in dropTheseTables) + { + try + { mSqlCommand.ExecuteNonQuery("TRUNCATE TABLE " + tableName); mSqlCommand.ExecuteNonQuery("DROP TABLE " + tableName); - } catch (Exception e) { + } + catch (Exception e) + { log.Error("TRUNC or DROP TABLE failed:", e); //don't want to stop because of this... } diff --git a/PCAxis.Sql/QueryLib_24/MetaQuery_partial.cs b/PCAxis.Sql/QueryLib_24/MetaQuery_partial.cs index 9fd9833..4b2f338 100644 --- a/PCAxis.Sql/QueryLib_24/MetaQuery_partial.cs +++ b/PCAxis.Sql/QueryLib_24/MetaQuery_partial.cs @@ -1,15 +1,13 @@ using System; using System.Collections.Generic; -using System.Text; -using PCAxis.Sql.DbConfig; -using System.Linq; +using System.Collections.Specialized; using System.Data; +using System.Linq; using System.Reflection; +using PCAxis.Sql.DbConfig; using PCAxis.Sql.Parser_24; -using System.Collections.Specialized; - namespace PCAxis.Sql.QueryLib_24 { /// @@ -21,7 +19,8 @@ public partial class MetaQuery #region all timevalues - public PxSqlValues GetAllTimeValuesList(string mainTable, string sortOrder) { + public PxSqlValues GetAllTimeValuesList(string mainTable, string sortOrder) + { DataSet ds = this.GetAllTimeValues(mainTable, sortOrder); return GetTimeValues(mainTable, ds, true); } @@ -32,8 +31,8 @@ public DataSet GetAllTimeValues(string aMainTable, string aSortOrder) // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; - string sortOrder = "asc"; - if (! aSortOrder.ToUpper().Equals("ASC") ) + string sortOrder = "asc"; + if (!aSortOrder.ToUpper().Equals("ASC")) { sortOrder = "desc"; } @@ -58,17 +57,20 @@ public DataSet GetAllTimeValues(string aMainTable, string aSortOrder) #region fixed list of timevalues //For mPxsFile.Query.Time.TimeOption == 0 - public PxSqlValues GetTimeValueList(string mainTable, Dictionary mySelectedValues) { + public PxSqlValues GetTimeValueList(string mainTable, Dictionary mySelectedValues) + { DataSet ds = this.GetTimeValues(mainTable, mySelectedValues.Keys); PxSqlValues myOut = GetTimeValues(mainTable, ds, false); - - foreach (KeyValuePair time in mySelectedValues) { + + foreach (KeyValuePair time in mySelectedValues) + { // Check to se if the value exist. If it was specified in the pxs, but is not present in the // database it will not exist. Maybe this check should be replaced by an exception handling // due to preformance. - if (myOut.ContainsKey(time.Key)) { + if (myOut.ContainsKey(time.Key)) + { myOut[time.Key].SortCodePxs = time.Value; } } @@ -77,7 +79,8 @@ public PxSqlValues GetTimeValueList(string mainTable, Dictionary m return myOut; } - private DataSet GetTimeValues(string aMainTable, ICollection valuesFromPxs) { + private DataSet GetTimeValues(string aMainTable, ICollection valuesFromPxs) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -118,7 +121,7 @@ private DataSet GetTimeValues(string aMainTable, ICollection valuesFromP } // creating the parameters - System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1+valuesFromPxs.Count]; + System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1 + valuesFromPxs.Count]; parameters[0] = mSqlCommand.GetStringParameter("aMainTable", aMainTable); int counter = 0; foreach (string valueFromPxs in valuesFromPxs) @@ -126,15 +129,16 @@ private DataSet GetTimeValues(string aMainTable, ICollection valuesFromP parameters[counter + 1] = mSqlCommand.GetStringParameter("valuesFromPxs" + (counter + 1), valueFromPxs); counter++; } - - + + // Execute the SQL and return the result (records) as a System.Data.DataSet-object. return mSqlCommand.ExecuteSelect(sqlString, parameters); } #endregion fixed list of timevalues #region the last timevalue ( N=1 below) - public PxSqlValues GetTimeValueList(string mainTable) { + public PxSqlValues GetTimeValueList(string mainTable) + { DataSet ds = this.GetTimeValues(mainTable); return GetTimeValues(mainTable, ds, true); } @@ -173,13 +177,15 @@ private DataSet GetTimeValues(string aMainTable) #endregion the last timevalue #region last N timevalues - public PxSqlValues GetTimeValueList(string mainTable, int NoOfTimeValues) { - DataSet ds = this.GetTimeValues(mainTable,NoOfTimeValues); - return GetTimeValues(mainTable, ds, true); + public PxSqlValues GetTimeValueList(string mainTable, int NoOfTimeValues) + { + DataSet ds = this.GetTimeValues(mainTable, NoOfTimeValues); + return GetTimeValues(mainTable, ds, true); } - private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { + private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -207,7 +213,7 @@ private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { string innerSelect = "SELECT DISTINCT " + DB.ContentsTime.MainTableCol.PureColumnName() + ", " + DB.ContentsTime.TimePeriodCol.PureColumnName() + " FROM " + DB.ContentsTime.GetNameAndAlias(); - + string sqlString = "SELECT a." + DB.ContentsTime.TimePeriodCol.PureColumnName() + ", COUNT(*) /*** SQLID: GetTimeValues_03 ***/" + @@ -216,7 +222,7 @@ private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { "(" + innerSelect + " WHERE " + DB.ContentsTime.MainTableCol.Is("mainTable_b") + ") b " + " WHERE a." + DB.ContentsTime.TimePeriodCol.PureColumnName() + " <= b." + DB.ContentsTime.TimePeriodCol.PureColumnName() + " GROUP BY a." + DB.ContentsTime.TimePeriodCol.PureColumnName() + - " HAVING COUNT(*) <= " + NoOfTimeValues.ToString() + + " HAVING COUNT(*) <= " + NoOfTimeValues.ToString() + " ORDER BY COUNT(*) DESC "; System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; @@ -233,12 +239,14 @@ private DataSet GetTimeValues(string mainTable, int NoOfTimeValues) { #region from start timevalue - public PxSqlValues GetTimeValueList(string mainTable, string StartTimeValue) { - DataSet ds = this.GetTimeValues(mainTable,StartTimeValue); + public PxSqlValues GetTimeValueList(string mainTable, string StartTimeValue) + { + DataSet ds = this.GetTimeValues(mainTable, StartTimeValue); return GetTimeValues(mainTable, ds, true); } - private DataSet GetTimeValues(string aMainTable, string StartTimeValue) { + private DataSet GetTimeValues(string aMainTable, string StartTimeValue) + { // Get the name of the current method. string currentMethod = MethodBase.GetCurrentMethod().Name; @@ -268,7 +276,7 @@ private DataSet GetTimeValues(string aMainTable, string StartTimeValue) { - + System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[2]; parameters[0] = DB.ContentsTime.MainTableCol.GetStringParameter(aMainTable); @@ -285,24 +293,28 @@ private DataSet GetTimeValues(string aMainTable, string StartTimeValue) { /// The Dataset /// Sets SortCodePxs to a counter. True for all ((int)mPxsFile.Query.Time.TimeOption != 0). /// - private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode) { + private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode) + { PxSqlValues myOut = new PxSqlValues(); DataRowCollection rows = ds.Tables[0].Rows; //Todo; fix exception - if (rows.Count <= 0) { + if (rows.Count <= 0) + { throw new ApplicationException("tabellen " + mainTable + " inneholder ikke data. (ingen tider)"); } int timeSortOrder = 0; string timeCode = ""; - foreach (DataRow row in rows) { + foreach (DataRow row in rows) + { timeCode = row[this.DB.ContentsTime.TimePeriodCol.PureColumnName()].ToString(); PXSqlValue mValue = new PXSqlValue(timeCode, LanguageCodes); - if (setSortCode) { + if (setSortCode) + { mValue.SortCodePxs = timeSortOrder; timeSortOrder++; } @@ -315,9 +327,9 @@ private PxSqlValues GetTimeValues(string mainTable, DataSet ds, bool setSortCode #endregion Time stuff - - + + } - + } diff --git a/PCAxis.Sql/QueryLib_24/value_fra_master2Rows.cs b/PCAxis.Sql/QueryLib_24/value_fra_master2Rows.cs index 1ac9e60..fdea3a4 100644 --- a/PCAxis.Sql/QueryLib_24/value_fra_master2Rows.cs +++ b/PCAxis.Sql/QueryLib_24/value_fra_master2Rows.cs @@ -1,26 +1,26 @@ using System; -using System.Data; using System.Collections.Generic; using System.Collections.Specialized; -using System.Text; -using System.Xml.XPath; -using System.Globalization; +using System.Data; using PCAxis.Sql.DbConfig; //This code is generated by master2Rows.xslt. Nope! -namespace PCAxis.Sql.QueryLib_24 { +namespace PCAxis.Sql.QueryLib_24 +{ #region class Value /// /// Holds a list of ValueRows. /// - public class ValueRow2HMDictionary { + public class ValueRow2HMDictionary + { // One entry in the Dictionary for each ValueCode private Dictionary mValueRows = new Dictionary(); - internal Dictionary ValueRows { + internal Dictionary ValueRows + { get { return mValueRows; } set { mValueRows = value; } } @@ -28,20 +28,21 @@ internal Dictionary ValueRows { public ValueRow2HMDictionary(DataTable mTable, SqlDbConfig_24 dbconf, MetaQuery metaQuery) { - string theValueCode=""; + string theValueCode = ""; string theLanguage; - + int sortOrder = 0; - foreach (DataRow mRow in mTable.Rows) { + foreach (DataRow mRow in mTable.Rows) + { theValueCode = mRow[dbconf.VSValue.ValueCodeCol.PureColumnName()].ToString(); if (!mValueRows.ContainsKey(theValueCode)) { sortOrder += 1; // this will be the sortorder for mainlanguage. Since each language could have its own sortorder this well be set in the Valuetext and coukd be used by the calling program. mValueRows.Add(theValueCode, new ValueRow2HM(mRow, dbconf, sortOrder)); } //denne bør fel flyttes et par hakk ned sto det, men det er vel slik for å kunne motta norsk og engelsk for samme kode - theLanguage = mRow["Language"].ToString(); + theLanguage = mRow["Language"].ToString(); if (!mValueRows[theValueCode].texts.ContainsKey(theLanguage)) { mValueRows[theValueCode].texts.Add(theLanguage, new ValueText2HM(mRow, dbconf)); @@ -54,7 +55,7 @@ public ValueRow2HMDictionary(DataTable mTable, SqlDbConfig_24 dbconf, MetaQuery /// to the primary language table. Expecting very few MetaId on values. /// Attaching them at a later stage should be faster ... but it takes a separate sql-call. /// - + //adding MetaId on Value if there are any (should not happen often) // picking one ValueCode (the last) just to get the valuepool @@ -76,15 +77,18 @@ public ValueRow2HMDictionary(DataTable mTable, SqlDbConfig_24 dbconf, MetaQuery /// /// Holds the attributes for Value. The language dependent parts are stored in the texts dictionary which is indexed by language code. /// - public class ValueRowHM { + public class ValueRowHM + { private String mValuePool; - public String ValuePool { + public String ValuePool + { get { return mValuePool; } } private String mValueCode; - public String ValueCode { + public String ValueCode + { get { return mValueCode; } } @@ -98,12 +102,13 @@ internal string MetaId public Dictionary texts = new Dictionary(); - public ValueRowHM(DataRow mRow, SqlDbConfig_24 dbconf,StringCollection languageCodes,int sortOrder) + public ValueRowHM(DataRow mRow, SqlDbConfig_24 dbconf, StringCollection languageCodes, int sortOrder) { this.mValuePool = mRow[dbconf.Value.ValuePoolCol.Label()].ToString(); this.mValueCode = mRow[dbconf.Value.ValueCodeCol.Label()].ToString(); - this.mMetaId = mRow[dbconf.Value.MetaIdCol.Label()].ToString(); - foreach (string languageCode in languageCodes) { + this.mMetaId = mRow[dbconf.Value.MetaIdCol.Label()].ToString(); + foreach (string languageCode in languageCodes) + { texts.Add(languageCode, new ValueTextHM(mRow, dbconf, languageCode)); } } @@ -132,7 +137,7 @@ public String SortCode get { return mSortCode; } } - internal ValueTextHM(DataRow mRow, SqlDbConfig_24 dbconf, String languageCode) + internal ValueTextHM(DataRow mRow, SqlDbConfig_24 dbconf, String languageCode) { { if (dbconf.isSecondaryLanguage(languageCode)) @@ -141,7 +146,8 @@ internal ValueTextHM(DataRow mRow, SqlDbConfig_24 dbconf, String languageCode) this.mValueTextL = mRow[dbconf.ValueLang2.ValueTextLCol.Label(languageCode)].ToString(); this.mSortCode = mRow[dbconf.ValueLang2.SortCodeCol.Label(languageCode)].ToString(); - } else + } + else { this.mValueTextS = mRow[dbconf.Value.ValueTextSCol.Label()].ToString(); this.mValueTextL = mRow[dbconf.Value.ValueTextLCol.Label()].ToString(); @@ -152,9 +158,11 @@ internal ValueTextHM(DataRow mRow, SqlDbConfig_24 dbconf, String languageCode) } - public class ValueRow2HM { + public class ValueRow2HM + { private String mValuePool; - public String ValuePool { + public String ValuePool + { get { return mValuePool; } } private String mValueSet; @@ -163,15 +171,18 @@ public String ValueSet get { return mValueSet; } } private String mValueCode; - public String ValueCode { + public String ValueCode + { get { return mValueCode; } } private String mSortOrder; - public String SortOrder { - get { return mSortOrder; } + public String SortOrder + { + get { return mSortOrder; } } private String mFootnote; - public String Footnote { + public String Footnote + { get { return mFootnote; } } @@ -182,11 +193,12 @@ internal string MetaId get { return mMetaId; } set { mMetaId = value; } } - + public Dictionary texts = new Dictionary(); - public ValueRow2HM(DataRow mRow, SqlDbConfig_24 dbconf, int sortOrder) { + public ValueRow2HM(DataRow mRow, SqlDbConfig_24 dbconf, int sortOrder) + { this.mValuePool = mRow[dbconf.VSValue.ValuePoolCol.PureColumnName()].ToString(); // VAL_Vardeforrad this.mValueSet = mRow[dbconf.VSValue.ValueSetCol.PureColumnName()].ToString(); // VAL_Vardemangd this.mValueCode = mRow[dbconf.VSValue.ValueCodeCol.PureColumnName()].ToString(); @@ -199,7 +211,8 @@ public ValueRow2HM(DataRow mRow, SqlDbConfig_24 dbconf, int sortOrder) { /// /// Holds the language dependent attributes for Value for one language /// - public class ValueText2HM { + public class ValueText2HM + { private String mSortCodeValue; public String SortCodeValue { @@ -211,15 +224,18 @@ public String SortCodeVsValue get { return mSortCodeVsValue; } } private String mValueTextS; - public String ValueTextS { + public String ValueTextS + { get { return mValueTextS; } } private String mValueTextL; - public String ValueTextL { + public String ValueTextL + { get { return mValueTextL; } } - internal ValueText2HM(DataRow mRow, SqlDbConfig_24 dbconf) { + internal ValueText2HM(DataRow mRow, SqlDbConfig_24 dbconf) + { this.mSortCodeValue = mRow["SortCodeValue"].ToString(); this.mSortCodeVsValue = mRow["SortCodeVsValue"].ToString(); this.mValueTextS = mRow[dbconf.Value.ValueTextSCol.PureColumnName()].ToString(); diff --git a/PCAxis.Sql/SqlClient/MyDbVendor.cs b/PCAxis.Sql/SqlClient/MyDbVendor.cs index 9c65ed6..83c7366 100644 --- a/PCAxis.Sql/SqlClient/MyDbVendor.cs +++ b/PCAxis.Sql/SqlClient/MyDbVendor.cs @@ -2,30 +2,32 @@ namespace PCAxis.Sql.DbClient { using System; + using System.Collections.Generic; using System.Collections.Specialized; using System.Data; using System.Data.Common; using System.Text; + using log4net; - using System.Collections.Generic; /// /// The purpose of this class is to hide the diffence of the classnames the database vendors. /// The handeling of differences in SQL is left to PxSQLCommand. /// - internal abstract class MyDbVendor : IDisposable { + internal abstract class MyDbVendor : IDisposable + { #region Properties and Member variables private static readonly ILog log = LogManager.GetLogger(typeof(MyDbVendor)); - + protected readonly DbConnection dbconn; - internal string mXtraDotForDatatables=""; - internal string PrefixIndicatingTempTable = ""; - internal string KeywordAfterCreateIndicatingTempTable = ""; + internal string mXtraDotForDatatables = ""; + internal string PrefixIndicatingTempTable = ""; + internal string KeywordAfterCreateIndicatingTempTable = ""; //Only oracle? - internal string TempTableCreateCommandEndClause = ""; - internal Boolean ProgramMustTrunCAndDropTempTable = false; + internal string TempTableCreateCommandEndClause = ""; + internal Boolean ProgramMustTrunCAndDropTempTable = false; //In rare cases 1? in 12000? a distinct in the footnote sql caused an 40 second increase in executing time, but/and the rowset was empty, //which must mean that the distinct somehow changed how the query was executed. @@ -34,19 +36,20 @@ internal abstract class MyDbVendor : IDisposable { internal string OracleNinja1 = ""; internal string OracleNinja2 = ""; - + #endregion Properties and Member variables - internal MyDbVendor(DbConnection aDbconn) { + internal MyDbVendor(DbConnection aDbconn) + { this.dbconn = aDbconn; } internal abstract DbConnectionStringBuilder GetDbConnectionStringBuilder(string connectionString); - internal abstract DbCommand GetDbCommand(string commandString) ; + internal abstract DbCommand GetDbCommand(string commandString); internal abstract DbDataAdapter GetDbDataAdapter(string selectString); @@ -57,7 +60,7 @@ internal MyDbVendor(DbConnection aDbconn) { /// /// The reference to a parameter, e.g. @maintable,:maintable or just ? depending on your db /// - internal abstract string GetParameterRef(string propertyName) ; + internal abstract string GetParameterRef(string propertyName); internal virtual string ConcatString(params string[] myStrings) @@ -85,8 +88,9 @@ internal virtual string ConcatString(params string[] myStrings) /// /// Disposes the connection /// - public void Dispose() { - + public void Dispose() + { + if (dbconn.State == ConnectionState.Open) { dbconn.Close(); @@ -101,8 +105,10 @@ public void Dispose() { /// /// Opens the connection if it is not already open /// - internal void ensureConnectionOpen() { - if (this.dbconn.State != ConnectionState.Open) { + internal void ensureConnectionOpen() + { + if (this.dbconn.State != ConnectionState.Open) + { this.dbconn.Open(); log.Debug("(Re)opening database connection."); } @@ -112,10 +118,12 @@ internal void ensureConnectionOpen() { /// /// The commandstrings to join /// - internal virtual string joinCommandStrings(StringCollection commandStrings) { + internal virtual string joinCommandStrings(StringCollection commandStrings) + { StringBuilder sb = new StringBuilder(commandStrings.Count * 50); // or ? - - foreach (string commandString in commandStrings) { + + foreach (string commandString in commandStrings) + { sb.Append(commandString + ";"); } @@ -123,7 +131,7 @@ internal virtual string joinCommandStrings(StringCollection commandStrings) { } - + /// @@ -136,11 +144,11 @@ internal virtual string joinCommandStrings(StringCollection commandStrings) { /// parentCodeCounter internal virtual void BulkInsertIntoTemp(string tableName, IEnumerable columnNames, string sqlString, DbParameter[] parameters, string[] valueCodesArray1, string[] valueCodesArray2, int[] parentCodeCounter) { - + DbCommand pxDbCommand = this.GetDbCommand(sqlString); pxDbCommand.Parameters.AddRange(parameters); - for (int n = 0; n < valueCodesArray1.Length ; n++) + for (int n = 0; n < valueCodesArray1.Length; n++) { parameters[0].Value = valueCodesArray1[n]; parameters[1].Value = valueCodesArray2[n]; diff --git a/PCAxis.Sql/SqlClient/MyDbVendorIsOracle.cs b/PCAxis.Sql/SqlClient/MyDbVendorIsOracle.cs index 3b60a7d..4e6295e 100644 --- a/PCAxis.Sql/SqlClient/MyDbVendorIsOracle.cs +++ b/PCAxis.Sql/SqlClient/MyDbVendorIsOracle.cs @@ -1,29 +1,27 @@ -using System; using System.Collections.Generic; +using System.Collections.Specialized; +using System.Data.Common; using System.Text; +using log4net; -using System.Data; // For DataSet-objects. using Oracle.ManagedDataAccess.Client;// For Oracle-connections. -using System.Collections.Specialized; - -using System.Data.Common; -using log4net; - - -namespace PCAxis.Sql.DbClient { +namespace PCAxis.Sql.DbClient +{ /// /// The Oracle version of MyDbVendor. /// - internal class MyDbVendorIsOracle:MyDbVendor { - + internal class MyDbVendorIsOracle : MyDbVendor + { + private static readonly ILog log = LogManager.GetLogger(typeof(MyDbVendorIsOracle)); - + internal MyDbVendorIsOracle(string connectionString) - :base( new OracleConnection(connectionString)) { + : base(new OracleConnection(connectionString)) + { KeywordAfterCreateIndicatingTempTable = "GLOBAL TEMPORARY"; TempTableCreateCommandEndClause = "ON COMMIT PRESERVE ROWS"; @@ -40,16 +38,18 @@ internal override DbConnectionStringBuilder GetDbConnectionStringBuilder(string return new OracleConnectionStringBuilder(connectionString); } - internal override DbCommand GetDbCommand(string commandString) { + internal override DbCommand GetDbCommand(string commandString) + { - return new OracleCommand(commandString, (OracleConnection)this.dbconn) {BindByName = true }; + return new OracleCommand(commandString, (OracleConnection)this.dbconn) { BindByName = true }; } - internal override DbDataAdapter GetDbDataAdapter(string selectString) { + internal override DbDataAdapter GetDbDataAdapter(string selectString) + { var aaa = new OracleDataAdapter(selectString, (OracleConnection)this.dbconn); - - return new OracleDataAdapter(selectString, (OracleConnection)this.dbconn); + + return new OracleDataAdapter(selectString, (OracleConnection)this.dbconn); } @@ -61,16 +61,18 @@ internal override DbParameter GetEmptyDbParameter() internal override string GetParameterRef(string propertyName) { - return ":"+propertyName; + return ":" + propertyName; } - internal override string joinCommandStrings(StringCollection commandStrings) { + internal override string joinCommandStrings(StringCollection commandStrings) + { StringBuilder sb = new StringBuilder(commandStrings.Count * 50); // or ? sb.Append("BEGIN "); - foreach (string commandString in commandStrings) { + foreach (string commandString in commandStrings) + { sb.Append(commandString + ";"); } - sb.Append(" END;"); + sb.Append(" END;"); return sb.ToString(); } diff --git a/PCAxis.Sql/SqlClient/MyDbVendorIsSql.cs b/PCAxis.Sql/SqlClient/MyDbVendorIsSql.cs index cf61dc2..564076d 100644 --- a/PCAxis.Sql/SqlClient/MyDbVendorIsSql.cs +++ b/PCAxis.Sql/SqlClient/MyDbVendorIsSql.cs @@ -1,31 +1,30 @@ using System; using System.Collections.Generic; -using System.Text; -using System.Linq; - - using System.Data; // For DataSet-objects. - -using System.Collections.Specialized; - using System.Data.Common; +using System.Linq; + using log4net; + using Microsoft.Data.SqlClient; -namespace PCAxis.Sql.DbClient { +namespace PCAxis.Sql.DbClient +{ /// The (MS)Sql version of MyDbVendor. /// - internal class MyDbVendorIsSql : MyDbVendor { + internal class MyDbVendorIsSql : MyDbVendor + { private static readonly ILog log = LogManager.GetLogger(typeof(MyDbVendorIsSql)); private static int? CommandTimeout { get; set; } internal MyDbVendorIsSql(string connectionString) - : base(new SqlConnection(connectionString)) { - mXtraDotForDatatables = "."; - PrefixIndicatingTempTable = "#"; - KeywordAfterCreateIndicatingTempTable = ""; + : base(new SqlConnection(connectionString)) + { + mXtraDotForDatatables = "."; + PrefixIndicatingTempTable = "#"; + KeywordAfterCreateIndicatingTempTable = ""; } static MyDbVendorIsSql() @@ -48,7 +47,8 @@ internal override DbConnectionStringBuilder GetDbConnectionStringBuilder(string return new SqlConnectionStringBuilder(connectionString); } - internal override DbCommand GetDbCommand(string commandString ) { + internal override DbCommand GetDbCommand(string commandString) + { var cmd = new SqlCommand(commandString, (SqlConnection)this.dbconn); if (CommandTimeout.HasValue) cmd.CommandTimeout = CommandTimeout.Value; @@ -56,7 +56,8 @@ internal override DbCommand GetDbCommand(string commandString ) { return cmd; } - internal override DbDataAdapter GetDbDataAdapter(string selectString) { + internal override DbDataAdapter GetDbDataAdapter(string selectString) + { var cmd = new SqlCommand(selectString, (SqlConnection)this.dbconn); if (CommandTimeout.HasValue) cmd.CommandTimeout = CommandTimeout.Value; @@ -80,7 +81,7 @@ internal override string ConcatString(params string[] myStrings) string ConcatedString = ""; for (int i = 0; i < myStrings.Length; i++) { - ConcatedString += "ISNULL("+ myStrings[i] + ",'')" + "+"; + ConcatedString += "ISNULL(" + myStrings[i] + ",'')" + "+"; } return ConcatedString.TrimEnd('+'); } @@ -124,7 +125,7 @@ internal override void BulkInsertIntoTemp(string tableName, IEnumerable // write the data in the "dataTable" //bulkCopy.WriteToServer(dataTable); - bulkCopy.WriteToServer(new BulkValueReader(valueCodesArray1,valueCodesArray2, parentCodeCounter, columnNames)); + bulkCopy.WriteToServer(new BulkValueReader(valueCodesArray1, valueCodesArray2, parentCodeCounter, columnNames)); } internal class BulkValueReader : IDataReader @@ -156,7 +157,8 @@ public object this[int i] public object this[string name] { - get { + get + { return this[_columnNames.IndexOf(name)]; } } diff --git a/PCAxis.Sql/SqlClient/PxSqlCommand.cs b/PCAxis.Sql/SqlClient/PxSqlCommand.cs index 6aa8d54..5a0c857 100644 --- a/PCAxis.Sql/SqlClient/PxSqlCommand.cs +++ b/PCAxis.Sql/SqlClient/PxSqlCommand.cs @@ -1,18 +1,16 @@ using System; using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Linq; - -using System.Data; // For DataSet-objects. using System.Collections.Specialized; - +using System.Data; // For DataSet-objects. using System.Data.Common; +using System.Linq; + using log4net; using PCAxis.Sql.Exceptions; -namespace PCAxis.Sql.DbClient { +namespace PCAxis.Sql.DbClient +{ /// 13:10 /// This class represents a "common sql gateway" for all sql databases @@ -40,7 +38,7 @@ public class PxSqlCommandForTempTables : IDisposable, PCAxis.Sql.PxSqlCommand private static readonly ILog log = LogManager.GetLogger(typeof(PxSqlCommand)); #if DEBUG - private static readonly log4net.ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(),"LogTime"); + private static readonly log4net.ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(), "LogTime"); #endif private readonly string connectionString; @@ -56,13 +54,16 @@ public class PxSqlCommandForTempTables : IDisposable, PCAxis.Sql.PxSqlCommand /// /// Constructor with connection-parameters. /// - public PxSqlCommandForTempTables(string dbType, string dataProvider, string connectionString) { + public PxSqlCommandForTempTables(string dbType, string dataProvider, string connectionString) + { this.connectionString = connectionString; // dataProvider = "OleDb","Oracle","Sql","Odbc","SqlCe" - if ( String.IsNullOrEmpty(connectionString)) { + if (String.IsNullOrEmpty(connectionString)) + { throw new PxsException(37); } - if (String.IsNullOrEmpty(dataProvider)){ + if (String.IsNullOrEmpty(dataProvider)) + { throw new PxsException(38); } @@ -70,9 +71,12 @@ public PxSqlCommandForTempTables(string dbType, string dataProvider, string conn //log.Debug("PxSqlCommand started with type: " + dbType + ", dataProvider:" + dataProvider + " and string:" + connectionString); String lDataProvider = dataProvider.ToUpper(); - if (lDataProvider.Equals("ORACLE")) { + if (lDataProvider.Equals("ORACLE")) + { myDbVendor = new MyDbVendorIsOracle(connectionString); - } else if (lDataProvider.Equals("SQL")) { + } + else if (lDataProvider.Equals("SQL")) + { myDbVendor = new MyDbVendorIsSql(connectionString); } /* @@ -82,7 +86,8 @@ public PxSqlCommandForTempTables(string dbType, string dataProvider, string conn myDbVendor = new MyDbVendorIsOdbc(connectionString); } */ - else { + else + { // lDataProvider.Equals("SQLCE") could not find namespace throw new PxsException(39, "\"OleDb\",\"Oracle\",\"Sql\", \"Odbc\"", dataProvider); @@ -108,33 +113,36 @@ public DbConnectionStringBuilder connectionStringBuilder() /// /// The SQL query (select). /// A "System.Data DataSet" with the data result from the query. - public DataSet ExecuteSelect(string selectString) { + public DataSet ExecuteSelect(string selectString) + { // Check SQL param - if (String.IsNullOrEmpty(selectString)) { + if (String.IsNullOrEmpty(selectString)) + { throw new BugException("Error PxSqlClient.PxSqlCommand.ExecuteSelect: Parameter \"selectString\" is empty/null!"); } log.Debug(selectString); - if(selectString.Contains(";")) + if (selectString.Contains(";")) { throw new BugException("Error PxSqlClient.PxSqlCommand.ExecuteSelect: Parameter \"selectString\" contains semicolon"); } - #if DEBUG - System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); - stopWatch.Start(); - #endif +#if DEBUG + System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); + stopWatch.Start(); +#endif DataSet pxDataSet = new DataSet(); - using (DbDataAdapter pxDataAdapter = myDbVendor.GetDbDataAdapter(selectString)) { + using (DbDataAdapter pxDataAdapter = myDbVendor.GetDbDataAdapter(selectString)) + { pxDataAdapter.Fill(pxDataSet); //TODO: Check for pxDataAdapter.FillError??? } - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " in ms = {0} for sql = {1}", stopWatch.ElapsedMilliseconds, selectString); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " in ms = {0} for sql = {1}", stopWatch.ElapsedMilliseconds, selectString); +#endif return pxDataSet; } @@ -153,10 +161,10 @@ public DataSet ExecuteSelect(string selectString, DbParameter[] parameters) throw new BugException("Error PxSqlClient.PxSqlCommand.ExecuteSelect: Parameter \"selectString\" is empty/null!"); } log.Debug(selectString); - #if DEBUG - System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); - stopWatch.Start(); - #endif +#if DEBUG + System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); + stopWatch.Start(); +#endif DataSet pxDataSet = new DataSet(); try @@ -183,46 +191,48 @@ public DataSet ExecuteSelect(string selectString, DbParameter[] parameters) } throw; } - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " in ms = {0} for sql = {1}", stopWatch.ElapsedMilliseconds, selectString); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " in ms = {0} for sql = {1}", stopWatch.ElapsedMilliseconds, selectString); +#endif return pxDataSet; } - /// - /// Returns a DbParameter with type= string and parameterName and parameterValue as given. - /// - public DbParameter GetStringParameter(string parameterName, string parameterValue) - { - DbParameter myOut = myDbVendor.GetEmptyDbParameter(); - myOut.DbType = DbType.String; - myOut.ParameterName = parameterName; - myOut.Value = parameterValue; - return myOut; - } - - /// - /// The reference to a parameter, e.g. @maintable,:maintable or just ? depending on your db - /// - /// The "base" e.g. maintable - /// @maintable,:maintable or just ? depending on your db - public string GetParameterRef(string propertyName) - { - return myDbVendor.GetParameterRef(propertyName); - } + /// + /// Returns a DbParameter with type= string and parameterName and parameterValue as given. + /// + public DbParameter GetStringParameter(string parameterName, string parameterValue) + { + DbParameter myOut = myDbVendor.GetEmptyDbParameter(); + myOut.DbType = DbType.String; + myOut.ParameterName = parameterName; + myOut.Value = parameterValue; + return myOut; + } + + /// + /// The reference to a parameter, e.g. @maintable,:maintable or just ? depending on your db + /// + /// The "base" e.g. maintable + /// @maintable,:maintable or just ? depending on your db + public string GetParameterRef(string propertyName) + { + return myDbVendor.GetParameterRef(propertyName); + } /// /// Execute a "non query" command (insert, update, delete, create, drop, ...). Explicit connection. /// /// The SQL command. /// For UPDATE, INSERT and DELETE statements. The return value is the number of rows affected by the command. For CREATE TABLE and DROP TABLE statements, the return value is 0. For all other types of statements, the return value is -1. - public int ExecuteNonQuery(string commandString) { + public int ExecuteNonQuery(string commandString) + { int numOfRowsAffected = -1; // Default value. // Check SQL - if (String.IsNullOrEmpty(commandString)) { + if (String.IsNullOrEmpty(commandString)) + { throw new BugException("PxSqlClient.PxSqlCommand.ExecuteNonQuery: Parameter \"commandString\" is empty/null!"); } log.Debug(commandString); @@ -231,22 +241,23 @@ public int ExecuteNonQuery(string commandString) { { throw new BugException("PxSqlClient.PxSqlCommand.ExecuteNonQuery: Parameter \"commandString\" contains semicolon"); } - #if DEBUG - System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); - stopWatch.Start(); - #endif +#if DEBUG + System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); + stopWatch.Start(); +#endif DbCommand pxDbCommand = myDbVendor.GetDbCommand(commandString); - if (pxDbCommand.Connection.State != ConnectionState.Open) { + if (pxDbCommand.Connection.State != ConnectionState.Open) + { pxDbCommand.Connection.Open(); } numOfRowsAffected = pxDbCommand.ExecuteNonQuery(); - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0} for sql={1}", stopWatch.ElapsedMilliseconds, commandString); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0} for sql={1}", stopWatch.ElapsedMilliseconds, commandString); +#endif return numOfRowsAffected; } @@ -260,7 +271,8 @@ public int ExecuteNonQuery(string commandString) { /// /// The length of the rest of the tablename /// - public string getUniqueNumber(int lengthOfOtherChars) { + public string getUniqueNumber(int lengthOfOtherChars) + { int dbMaxLength = 30;// int outLength = dbMaxLength - lengthOfOtherChars - 15; @@ -283,16 +295,18 @@ public string getUniqueNumber(int lengthOfOtherChars) { /// /// /// - public int InsertBulk(StringCollection commandStrings, int numberInBulk) { + public int InsertBulk(StringCollection commandStrings, int numberInBulk) + { - if (commandStrings == null || commandStrings.Count == 0) { + if (commandStrings == null || commandStrings.Count == 0) + { throw new BugException("Error PxSqlClient.PxSqlCommand.InsertBulk: Parameter \"commandStrings\" is empty/null!"); } - #if DEBUG +#if DEBUG System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); logTime.DebugFormat(" Start " + System.Reflection.MethodBase.GetCurrentMethod().Name + " commandStrings.Count ={0}", commandStrings.Count); - #endif +#endif StringCollection sqlStrings = new StringCollection(); int numOfRowsAffected = 0; // jfi: denne var -1 @@ -304,16 +318,18 @@ public int InsertBulk(StringCollection commandStrings, int numberInBulk) { - foreach (string value in commandStrings) { + foreach (string value in commandStrings) + { if (value.Contains(";")) { - log.Error("Bad command: "+value); + log.Error("Bad command: " + value); throw new BugException("Error PxSqlClient.PxSqlCommand.InsertBulk: command contains semicolon"); } sqlStrings.Add(value); ValuesCounter += 1; Math.DivRem(ValuesCounter, numberInBulk, out rem); - if ((rem == 0) || ValuesCounter == commandStrings.Count) { + if ((rem == 0) || ValuesCounter == commandStrings.Count) + { numOfRowsAffected += this.InsertBulk(sqlStrings); sqlStrings.Clear(); } @@ -331,20 +347,21 @@ public int InsertBulk(StringCollection commandStrings, int numberInBulk) { } */ - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(" " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0}", stopWatch.ElapsedMilliseconds); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(" " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0}", stopWatch.ElapsedMilliseconds); +#endif return numOfRowsAffected; } - private int InsertBulk(StringCollection commandStrings) { - #if DEBUG - System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); - stopWatch.Start(); - #endif + private int InsertBulk(StringCollection commandStrings) + { +#if DEBUG + System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); + stopWatch.Start(); +#endif string command = myDbVendor.joinCommandStrings(commandStrings); log.Debug(command); @@ -353,10 +370,10 @@ private int InsertBulk(StringCollection commandStrings) { // Return number of rows affected. int myOut = pxDbCommand.ExecuteNonQuery(); - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(" Completed inner " + System.Reflection.MethodBase.GetCurrentMethod().Name + " in ms = {0} for commandStrings.Count ={1}", stopWatch.ElapsedMilliseconds, commandStrings.Count); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(" Completed inner " + System.Reflection.MethodBase.GetCurrentMethod().Name + " in ms = {0} for commandStrings.Count ={1}", stopWatch.ElapsedMilliseconds, commandStrings.Count); +#endif return myOut; } @@ -368,7 +385,8 @@ private int InsertBulk(StringCollection commandStrings) { /// Returns "." for the datatables prefix for mssql otherwise "" /// /// - public string getExtraDotForDatatables() { + public string getExtraDotForDatatables() + { return myDbVendor.mXtraDotForDatatables; } @@ -377,7 +395,8 @@ public string getExtraDotForDatatables() { /// Prefix for the tablename. Some vendors use this to indicate that a table is temporary. /// /// "" or prefix - public string getPrefixIndicatingTempTable() { + public string getPrefixIndicatingTempTable() + { return myDbVendor.PrefixIndicatingTempTable; } @@ -385,7 +404,8 @@ public string getPrefixIndicatingTempTable() { /// Extra keyword for temp tables. Some vendors use this to indicate that a table is temporary. ///
/// spaces or Keyword - public string getKeywordAfterCreateIndicatingTempTable() { + public string getKeywordAfterCreateIndicatingTempTable() + { return " " + myDbVendor.KeywordAfterCreateIndicatingTempTable + " "; } @@ -393,7 +413,8 @@ public string getKeywordAfterCreateIndicatingTempTable() { /// Extra clause for temp tables. Some vendors use this when a table is temporary. ///
/// spaces or Keyword - public string getTempTableCreateCommandEndClause() { + public string getTempTableCreateCommandEndClause() + { return " " + myDbVendor.TempTableCreateCommandEndClause; } @@ -424,7 +445,8 @@ public string getOracleNinja2() /// Should clean up be done by this application ///
/// true false - public Boolean getProgramMustTruncAndDropTempTable() { + public Boolean getProgramMustTruncAndDropTempTable() + { return myDbVendor.ProgramMustTrunCAndDropTempTable; } @@ -447,10 +469,10 @@ public string getConcatString(params string[] myStrings) ///
public string MakeTempTableJustValues(string VariableName, string VariableNumber, bool UseTemporaryTables, StringCollection valueCodes) { - #if DEBUG +#if DEBUG System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); - #endif +#endif bool makeGroupFactorCol = false; string tempTableId = this.GetTempTableId(VariableNumber, UseTemporaryTables); @@ -468,7 +490,7 @@ public string MakeTempTableJustValues(string VariableName, string VariableNumber DbParameter[] parameters = new DbParameter[3]; parameters[0] = this.GetStringParameter("aValueCode1", "WillBeOverwritten"); - parameters[1] = this.GetStringParameter("aValueCode2","WillBeOverwritten"); + parameters[1] = this.GetStringParameter("aValueCode2", "WillBeOverwritten"); parameters[2] = this.myDbVendor.GetEmptyDbParameter(); parameters[2].DbType = DbType.Int32; parameters[2].ParameterName = "aValueCounter"; @@ -555,7 +577,7 @@ public string MakeTempTable(string VariableName, string VariableNumber, bool mak "(SELECT COUNT(*) FROM " + tempTableId + " a2 " + "WHERE a2.group" + VariableNumber + " = " + tempTableId + ".group" + VariableNumber + ")"; - int numberOfRowsAffected = this.ExecuteNonQuery(sqlString2); + int numberOfRowsAffected = this.ExecuteNonQuery(sqlString2); } return tempTableId; @@ -566,7 +588,8 @@ public string MakeTempTable(string VariableName, string VariableNumber, bool mak /// It har 3 or 4 columns. The first contains incomming codes, the second output codes and the third is an output code counter used in the extraction-sql group by. /// The fourth is used to determin if there are missing rows in the datatable, when the extraction uses sum and the default value for a missing row is a npm of type 3. ///
- private void createTempTable(string tempTableId, string VariableName, string VariableNumber, bool makeGroupFactorCol, bool UseTemporaryTables){ + private void createTempTable(string tempTableId, string VariableName, string VariableNumber, bool makeGroupFactorCol, bool UseTemporaryTables) + { log.Debug("tempTabellId:" + tempTableId + " tempTableId len:" + tempTableId.Length); string sqlString = "CREATE /*** SQLID: createTempTable_01 ***/"; @@ -610,7 +633,8 @@ private string GetTempTableId(string VariableNumber, bool UseTemporaryTables) #region IDisposable Members - public void Dispose() { + public void Dispose() + { myDbVendor.Dispose(); } diff --git a/PCAxis.Sql/SqlClientCleanup/MyDbVendor.cs b/PCAxis.Sql/SqlClientCleanup/MyDbVendor.cs index a6acf4c..6340fa1 100644 --- a/PCAxis.Sql/SqlClientCleanup/MyDbVendor.cs +++ b/PCAxis.Sql/SqlClientCleanup/MyDbVendor.cs @@ -1,30 +1,32 @@ namespace PCAxis.Sql.SqlClientCleanup { -using System; -using System.Collections.Specialized; -using System.Data; -using System.Data.Common; -using System.Text; -using log4net; + using System; + using System.Collections.Specialized; + using System.Data; + using System.Data.Common; + using System.Text; + + using log4net; /// /// The purpose of this class is to hide the diffence of the classnames the database vendors. /// The handeling of differences in SQL is left to PxSQLCommand. /// - internal abstract class MyDbVendor : IDisposable { + internal abstract class MyDbVendor : IDisposable + { #region Properties and Member variables private static readonly ILog log = LogManager.GetLogger(typeof(MyDbVendor)); - + protected readonly DbConnection dbconn; - internal string mXtraDotForDatatables=""; - internal string PrefixIndicatingTempTable = ""; - internal string KeywordAfterCreateIndicatingTempTable = ""; + internal string mXtraDotForDatatables = ""; + internal string PrefixIndicatingTempTable = ""; + internal string KeywordAfterCreateIndicatingTempTable = ""; //Only oracle? - internal string TempTableCreateCommandEndClause = ""; - internal Boolean ProgramMustTrunCAndDropTempTable = false; + internal string TempTableCreateCommandEndClause = ""; + internal Boolean ProgramMustTrunCAndDropTempTable = false; //In rare cases 1? in 12000? a distinct in the footnote sql caused an 40 second increase in executing time, but/and the rowset was empty, //which must mean that the distinct somehow changed how the query was executed. @@ -39,13 +41,14 @@ internal abstract class MyDbVendor : IDisposable { #endregion Properties and Member variables - internal MyDbVendor(DbConnection aDbconn, string connectionString) { + internal MyDbVendor(DbConnection aDbconn, string connectionString) + { this.dbconn = aDbconn; ConnectionString = connectionString; } internal abstract DbConnectionStringBuilder GetDbConnectionStringBuilder(string connectionString); - internal abstract DbCommand GetDbCommand(string commandString) ; + internal abstract DbCommand GetDbCommand(string commandString); internal abstract DbDataAdapter GetDbDataAdapter(string selectString); @@ -56,7 +59,7 @@ internal MyDbVendor(DbConnection aDbconn, string connectionString) { /// /// The reference to a parameter, e.g. @maintable,:maintable or just ? depending on your db /// - internal abstract string GetParameterRef(string propertyName) ; + internal abstract string GetParameterRef(string propertyName); internal virtual string ConcatString(params string[] myStrings) @@ -84,8 +87,9 @@ internal virtual string ConcatString(params string[] myStrings) /// /// Disposes the connection /// - public void Dispose() { - + public void Dispose() + { + if (dbconn.State == ConnectionState.Open) { dbconn.Close(); @@ -111,10 +115,12 @@ public void Dispose() { ///
/// The commandstrings to join /// - internal virtual string joinCommandStrings(StringCollection commandStrings) { + internal virtual string joinCommandStrings(StringCollection commandStrings) + { StringBuilder sb = new StringBuilder(commandStrings.Count * 50); // or ? - - foreach (string commandString in commandStrings) { + + foreach (string commandString in commandStrings) + { sb.Append(commandString + ";"); } diff --git a/PCAxis.Sql/SqlClientCleanup/MyDbVendorIsOracle.cs b/PCAxis.Sql/SqlClientCleanup/MyDbVendorIsOracle.cs index 9d73afa..431cb0c 100644 --- a/PCAxis.Sql/SqlClientCleanup/MyDbVendorIsOracle.cs +++ b/PCAxis.Sql/SqlClientCleanup/MyDbVendorIsOracle.cs @@ -1,31 +1,27 @@ -using System; -using System.Collections.Generic; +using System.Collections.Specialized; +using System.Data.Common; using System.Text; +using log4net; -using System.Data; // For DataSet-objects. using Oracle.ManagedDataAccess.Client;// For Oracle-connections. -using System.Collections.Specialized; - -using System.Data.Common; -using log4net; - - namespace PCAxis.Sql.SqlClientCleanup { /// /// The Oracle version of MyDbVendor. /// - internal class MyDbVendorIsOracle:MyDbVendor { - + internal class MyDbVendorIsOracle : MyDbVendor + { + private static readonly ILog log = LogManager.GetLogger(typeof(MyDbVendorIsOracle)); - + internal MyDbVendorIsOracle(string connectionString) - :base( new OracleConnection(connectionString), connectionString) { - + : base(new OracleConnection(connectionString), connectionString) + { + KeywordAfterCreateIndicatingTempTable = "GLOBAL TEMPORARY"; TempTableCreateCommandEndClause = "ON COMMIT PRESERVE ROWS"; @@ -46,16 +42,18 @@ internal override DbConnectionStringBuilder GetDbConnectionStringBuilder(string return new OracleConnectionStringBuilder(connectionString); } - internal override DbCommand GetDbCommand(string commandString) { + internal override DbCommand GetDbCommand(string commandString) + { - return new OracleCommand(commandString, (OracleConnection)this.dbconn) {BindByName = true }; + return new OracleCommand(commandString, (OracleConnection)this.dbconn) { BindByName = true }; } - internal override DbDataAdapter GetDbDataAdapter(string selectString) { + internal override DbDataAdapter GetDbDataAdapter(string selectString) + { return new OracleDataAdapter(selectString, ConnectionString); //var aaa = new OracleDataAdapter(selectString, (OracleConnection)this.dbconn); - + // return new OracleDataAdapter(selectString, (OracleConnection)this.dbconn); @@ -69,16 +67,18 @@ internal override DbParameter GetEmptyDbParameter() internal override string GetParameterRef(string propertyName) { - return ":"+propertyName; + return ":" + propertyName; } - internal override string joinCommandStrings(StringCollection commandStrings) { + internal override string joinCommandStrings(StringCollection commandStrings) + { StringBuilder sb = new StringBuilder(commandStrings.Count * 50); // or ? sb.Append("BEGIN "); - foreach (string commandString in commandStrings) { + foreach (string commandString in commandStrings) + { sb.Append(commandString + ";"); } - sb.Append(" END;"); + sb.Append(" END;"); return sb.ToString(); } diff --git a/PCAxis.Sql/SqlClientCleanup/MyDbVendorIsSql.cs b/PCAxis.Sql/SqlClientCleanup/MyDbVendorIsSql.cs index a69e15d..4d413b0 100644 --- a/PCAxis.Sql/SqlClientCleanup/MyDbVendorIsSql.cs +++ b/PCAxis.Sql/SqlClientCleanup/MyDbVendorIsSql.cs @@ -1,14 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; - - -using System.Data; // For DataSet-objects. - -using System.Collections.Specialized; - using System.Data.Common; + using log4net; + using Microsoft.Data.SqlClient; namespace PCAxis.Sql.SqlClientCleanup @@ -16,16 +9,18 @@ namespace PCAxis.Sql.SqlClientCleanup /// The (MS)Sql version of MyDbVendor. /// - internal class MyDbVendorIsSql : MyDbVendor { + internal class MyDbVendorIsSql : MyDbVendor + { private static readonly ILog log = LogManager.GetLogger(typeof(MyDbVendorIsSql)); private static int? CommandTimeout { get; set; } internal MyDbVendorIsSql(string connectionString) - : base(new SqlConnection(connectionString), connectionString) { - mXtraDotForDatatables = "."; - PrefixIndicatingTempTable = "#"; - KeywordAfterCreateIndicatingTempTable = ""; + : base(new SqlConnection(connectionString), connectionString) + { + mXtraDotForDatatables = "."; + PrefixIndicatingTempTable = "#"; + KeywordAfterCreateIndicatingTempTable = ""; } internal override DbConnection CreateDbConnection() @@ -53,7 +48,8 @@ internal override DbConnectionStringBuilder GetDbConnectionStringBuilder(string return new SqlConnectionStringBuilder(connectionString); } - internal override DbCommand GetDbCommand(string commandString ) { + internal override DbCommand GetDbCommand(string commandString) + { var cmd = new SqlCommand(commandString, (SqlConnection)this.dbconn); if (CommandTimeout.HasValue) cmd.CommandTimeout = CommandTimeout.Value; @@ -61,7 +57,8 @@ internal override DbCommand GetDbCommand(string commandString ) { return cmd; } - internal override DbDataAdapter GetDbDataAdapter(string selectString) { + internal override DbDataAdapter GetDbDataAdapter(string selectString) + { var cmd = new SqlCommand(selectString, (SqlConnection)this.dbconn); if (CommandTimeout.HasValue) cmd.CommandTimeout = CommandTimeout.Value; @@ -85,7 +82,7 @@ internal override string ConcatString(params string[] myStrings) string ConcatedString = ""; for (int i = 0; i < myStrings.Length; i++) { - ConcatedString += "ISNULL("+ myStrings[i] + ",'')" + "+"; + ConcatedString += "ISNULL(" + myStrings[i] + ",'')" + "+"; } return ConcatedString.TrimEnd('+'); } diff --git a/PCAxis.Sql/SqlClientCleanup/PxSqlCommand.cs b/PCAxis.Sql/SqlClientCleanup/PxSqlCommand.cs index 085f81f..f167f78 100644 --- a/PCAxis.Sql/SqlClientCleanup/PxSqlCommand.cs +++ b/PCAxis.Sql/SqlClientCleanup/PxSqlCommand.cs @@ -1,13 +1,10 @@ using System; using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Linq; - -using System.Data; // For DataSet-objects. using System.Collections.Specialized; - +using System.Data; // For DataSet-objects. using System.Data.Common; +using System.Linq; + using log4net; using PCAxis.Sql.Exceptions; @@ -40,7 +37,7 @@ public class PxSqlCommandNoTempTables : IDisposable, PCAxis.Sql.PxSqlCommand private static readonly ILog log = LogManager.GetLogger(typeof(PxSqlCommand)); #if DEBUG - private static readonly log4net.ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(),"LogTime"); + private static readonly log4net.ILog logTime = LogManager.GetLogger(System.Reflection.Assembly.GetExecutingAssembly(), "LogTime"); #endif private readonly string connectionString; @@ -56,13 +53,16 @@ public class PxSqlCommandNoTempTables : IDisposable, PCAxis.Sql.PxSqlCommand /// /// Constructor with connection-parameters. /// - public PxSqlCommandNoTempTables(string dbType, string dataProvider, string connectionString) { + public PxSqlCommandNoTempTables(string dbType, string dataProvider, string connectionString) + { this.connectionString = connectionString; // dataProvider = "OleDb","Oracle","Sql","Odbc","SqlCe" - if ( String.IsNullOrEmpty(connectionString)) { + if (String.IsNullOrEmpty(connectionString)) + { throw new PxsException(37); } - if (String.IsNullOrEmpty(dataProvider)){ + if (String.IsNullOrEmpty(dataProvider)) + { throw new PxsException(38); } @@ -70,9 +70,12 @@ public PxSqlCommandNoTempTables(string dbType, string dataProvider, string conne //log.Debug("PxSqlCommand started with type: " + dbType + ", dataProvider:" + dataProvider + " and string:" + connectionString); String lDataProvider = dataProvider.ToUpper(); - if (lDataProvider.Equals("ORACLE")) { + if (lDataProvider.Equals("ORACLE")) + { myDbVendor = new MyDbVendorIsOracle(connectionString); - } else if (lDataProvider.Equals("SQL")) { + } + else if (lDataProvider.Equals("SQL")) + { myDbVendor = new MyDbVendorIsSql(connectionString); } /*else if (lDataProvider.Equals("OLEDB")) { @@ -81,7 +84,8 @@ public PxSqlCommandNoTempTables(string dbType, string dataProvider, string conne myDbVendor = new MyDbVendorIsOdbc(connectionString); } */ - else { + else + { // lDataProvider.Equals("SQLCE") could not find namespace throw new PxsException(39, "\"OleDb\",\"Oracle\",\"Sql\", \"Odbc\"", dataProvider); @@ -107,33 +111,36 @@ public DbConnectionStringBuilder connectionStringBuilder() ///
/// The SQL query (select). /// A "System.Data DataSet" with the data result from the query. - public DataSet ExecuteSelect(string selectString) { + public DataSet ExecuteSelect(string selectString) + { // Check SQL param - if (String.IsNullOrEmpty(selectString)) { + if (String.IsNullOrEmpty(selectString)) + { throw new BugException("Error PxSqlClient.PxSqlCommand.ExecuteSelect: Parameter \"selectString\" is empty/null!"); } log.Debug(selectString); - if(selectString.Contains(";")) + if (selectString.Contains(";")) { throw new BugException("Error PxSqlClient.PxSqlCommand.ExecuteSelect: Parameter \"selectString\" contains semicolon"); } - #if DEBUG - System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); - stopWatch.Start(); - #endif +#if DEBUG + System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); + stopWatch.Start(); +#endif DataSet pxDataSet = new DataSet(); - using (DbDataAdapter pxDataAdapter = myDbVendor.GetDbDataAdapter(selectString)) { + using (DbDataAdapter pxDataAdapter = myDbVendor.GetDbDataAdapter(selectString)) + { pxDataAdapter.Fill(pxDataSet); //TODO: Check for pxDataAdapter.FillError??? } - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " in ms = {0} for sql = {1}", stopWatch.ElapsedMilliseconds, selectString); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " in ms = {0} for sql = {1}", stopWatch.ElapsedMilliseconds, selectString); +#endif return pxDataSet; } @@ -152,10 +159,10 @@ public DataSet ExecuteSelect(string selectString, DbParameter[] parameters) throw new BugException("Error PxSqlClient.PxSqlCommand.ExecuteSelect: Parameter \"selectString\" is empty/null!"); } log.Debug(selectString); - #if DEBUG - System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); - stopWatch.Start(); - #endif +#if DEBUG + System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); + stopWatch.Start(); +#endif DataSet pxDataSet = new DataSet(); try @@ -178,46 +185,48 @@ public DataSet ExecuteSelect(string selectString, DbParameter[] parameters) } throw; } - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " in ms = {0} for sql = {1}", stopWatch.ElapsedMilliseconds, selectString); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " in ms = {0} for sql = {1}", stopWatch.ElapsedMilliseconds, selectString); +#endif return pxDataSet; } - /// - /// Returns a DbParameter with type= string and parameterName and parameterValue as given. - /// - public DbParameter GetStringParameter(string parameterName, string parameterValue) - { - DbParameter myOut = myDbVendor.GetEmptyDbParameter(); - myOut.DbType = DbType.String; - myOut.ParameterName = parameterName; - myOut.Value = parameterValue; - return myOut; - } - - /// - /// The reference to a parameter, e.g. @maintable,:maintable or just ? depending on your db - /// - /// The "base" e.g. maintable - /// @maintable,:maintable or just ? depending on your db - public string GetParameterRef(string propertyName) - { - return myDbVendor.GetParameterRef(propertyName); - } + /// + /// Returns a DbParameter with type= string and parameterName and parameterValue as given. + /// + public DbParameter GetStringParameter(string parameterName, string parameterValue) + { + DbParameter myOut = myDbVendor.GetEmptyDbParameter(); + myOut.DbType = DbType.String; + myOut.ParameterName = parameterName; + myOut.Value = parameterValue; + return myOut; + } + + /// + /// The reference to a parameter, e.g. @maintable,:maintable or just ? depending on your db + /// + /// The "base" e.g. maintable + /// @maintable,:maintable or just ? depending on your db + public string GetParameterRef(string propertyName) + { + return myDbVendor.GetParameterRef(propertyName); + } /// /// Execute a "non query" command (insert, update, delete, create, drop, ...). Explicit connection. /// /// The SQL command. /// For UPDATE, INSERT and DELETE statements. The return value is the number of rows affected by the command. For CREATE TABLE and DROP TABLE statements, the return value is 0. For all other types of statements, the return value is -1. - public int ExecuteNonQuery(string commandString) { + public int ExecuteNonQuery(string commandString) + { int numOfRowsAffected = -1; // Default value. // Check SQL - if (String.IsNullOrEmpty(commandString)) { + if (String.IsNullOrEmpty(commandString)) + { throw new BugException("PxSqlClient.PxSqlCommand.ExecuteNonQuery: Parameter \"commandString\" is empty/null!"); } log.Debug(commandString); @@ -226,9 +235,9 @@ public int ExecuteNonQuery(string commandString) { { throw new BugException("PxSqlClient.PxSqlCommand.ExecuteNonQuery: Parameter \"commandString\" contains semicolon"); } - #if DEBUG - System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); - stopWatch.Start(); +#if DEBUG + System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); + stopWatch.Start(); #endif using (DbCommand pxDbCommand = myDbVendor.GetDbCommand(commandString)) @@ -244,10 +253,10 @@ public int ExecuteNonQuery(string commandString) { - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0} for sql={1}", stopWatch.ElapsedMilliseconds, commandString); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(" Completed " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0} for sql={1}", stopWatch.ElapsedMilliseconds, commandString); +#endif return numOfRowsAffected; } @@ -261,7 +270,8 @@ public int ExecuteNonQuery(string commandString) { ///
/// The length of the rest of the tablename /// - public string getUniqueNumber(int lengthOfOtherChars) { + public string getUniqueNumber(int lengthOfOtherChars) + { int dbMaxLength = 30;// int outLength = dbMaxLength - lengthOfOtherChars - 15; @@ -284,16 +294,18 @@ public string getUniqueNumber(int lengthOfOtherChars) { /// /// /// - public int InsertBulk(StringCollection commandStrings, int numberInBulk) { + public int InsertBulk(StringCollection commandStrings, int numberInBulk) + { - if (commandStrings == null || commandStrings.Count == 0) { + if (commandStrings == null || commandStrings.Count == 0) + { throw new BugException("Error PxSqlClient.PxSqlCommand.InsertBulk: Parameter \"commandStrings\" is empty/null!"); } - #if DEBUG +#if DEBUG System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); logTime.DebugFormat(" Start " + System.Reflection.MethodBase.GetCurrentMethod().Name + " commandStrings.Count ={0}", commandStrings.Count); - #endif +#endif StringCollection sqlStrings = new StringCollection(); int numOfRowsAffected = 0; // jfi: denne var -1 @@ -305,16 +317,18 @@ public int InsertBulk(StringCollection commandStrings, int numberInBulk) { - foreach (string value in commandStrings) { + foreach (string value in commandStrings) + { if (value.Contains(";")) { - log.Error("Bad command: "+value); + log.Error("Bad command: " + value); throw new BugException("Error PxSqlClient.PxSqlCommand.InsertBulk: command contains semicolon"); } sqlStrings.Add(value); ValuesCounter += 1; Math.DivRem(ValuesCounter, numberInBulk, out rem); - if ((rem == 0) || ValuesCounter == commandStrings.Count) { + if ((rem == 0) || ValuesCounter == commandStrings.Count) + { numOfRowsAffected += this.InsertBulk(sqlStrings); sqlStrings.Clear(); } @@ -332,20 +346,21 @@ public int InsertBulk(StringCollection commandStrings, int numberInBulk) { } */ - #if DEBUG - stopWatch.Stop(); - logTime.DebugFormat(" " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0}", stopWatch.ElapsedMilliseconds); - #endif +#if DEBUG + stopWatch.Stop(); + logTime.DebugFormat(" " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Done in ms = {0}", stopWatch.ElapsedMilliseconds); +#endif return numOfRowsAffected; } - private int InsertBulk(StringCollection commandStrings) { - #if DEBUG - System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); - stopWatch.Start(); - #endif + private int InsertBulk(StringCollection commandStrings) + { +#if DEBUG + System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); + stopWatch.Start(); +#endif string command = myDbVendor.joinCommandStrings(commandStrings); log.Debug(command); @@ -379,7 +394,8 @@ private int InsertBulk(StringCollection commandStrings) { /// Returns "." for the datatables prefix for mssql otherwise "" ///
/// - public string getExtraDotForDatatables() { + public string getExtraDotForDatatables() + { return myDbVendor.mXtraDotForDatatables; } @@ -388,7 +404,8 @@ public string getExtraDotForDatatables() { /// Prefix for the tablename. Some vendors use this to indicate that a table is temporary. ///
/// "" or prefix - public string getPrefixIndicatingTempTable() { + public string getPrefixIndicatingTempTable() + { return myDbVendor.PrefixIndicatingTempTable; } @@ -396,7 +413,8 @@ public string getPrefixIndicatingTempTable() { /// Extra keyword for temp tables. Some vendors use this to indicate that a table is temporary. ///
/// spaces or Keyword - public string getKeywordAfterCreateIndicatingTempTable() { + public string getKeywordAfterCreateIndicatingTempTable() + { return " " + myDbVendor.KeywordAfterCreateIndicatingTempTable + " "; } @@ -404,7 +422,8 @@ public string getKeywordAfterCreateIndicatingTempTable() { /// Extra clause for temp tables. Some vendors use this when a table is temporary. ///
/// spaces or Keyword - public string getTempTableCreateCommandEndClause() { + public string getTempTableCreateCommandEndClause() + { return " " + myDbVendor.TempTableCreateCommandEndClause; } @@ -435,7 +454,8 @@ public string getOracleNinja2() /// Should clean up be done by this application ///
/// true false - public Boolean getProgramMustTruncAndDropTempTable() { + public Boolean getProgramMustTruncAndDropTempTable() + { return myDbVendor.ProgramMustTrunCAndDropTempTable; } @@ -458,10 +478,10 @@ public string getConcatString(params string[] myStrings) ///
public string MakeTempTableJustValues(string VariableName, string VariableNumber, bool UseTemporaryTables, StringCollection valueCodes) { - #if DEBUG +#if DEBUG System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); - #endif +#endif bool makeGroupFactorCol = false; string tempTableId = this.GetTempTableId(VariableNumber, UseTemporaryTables); @@ -479,7 +499,7 @@ public string MakeTempTableJustValues(string VariableName, string VariableNumber DbParameter[] parameters = new DbParameter[3]; parameters[0] = this.GetStringParameter("aValueCode1", "WillBeOverwritten"); - parameters[1] = this.GetStringParameter("aValueCode2","WillBeOverwritten"); + parameters[1] = this.GetStringParameter("aValueCode2", "WillBeOverwritten"); parameters[2] = this.myDbVendor.GetEmptyDbParameter(); parameters[2].DbType = DbType.Int32; parameters[2].ParameterName = "aValueCounter"; @@ -553,7 +573,7 @@ public string MakeTempTable(string VariableName, string VariableNumber, bool mak "(SELECT COUNT(*) FROM " + tempTableId + " a2 " + "WHERE a2.group" + VariableNumber + " = " + tempTableId + ".group" + VariableNumber + ")"; - int numberOfRowsAffected = this.ExecuteNonQuery(sqlString2); + int numberOfRowsAffected = this.ExecuteNonQuery(sqlString2); } return tempTableId; @@ -564,7 +584,8 @@ public string MakeTempTable(string VariableName, string VariableNumber, bool mak /// It har 3 or 4 columns. The first contains incomming codes, the second output codes and the third is an output code counter used in the extraction-sql group by. /// The fourth is used to determin if there are missing rows in the datatable, when the extraction uses sum and the default value for a missing row is a npm of type 3. ///
- private void createTempTable(string tempTableId, string VariableName, string VariableNumber, bool makeGroupFactorCol, bool UseTemporaryTables){ + private void createTempTable(string tempTableId, string VariableName, string VariableNumber, bool makeGroupFactorCol, bool UseTemporaryTables) + { log.Debug("tempTabellId:" + tempTableId + " tempTableId len:" + tempTableId.Length); string sqlString = "CREATE /*** SQLID: createTempTable_01 ***/"; @@ -608,7 +629,8 @@ private string GetTempTableId(string VariableNumber, bool UseTemporaryTables) #region IDisposable Members - public void Dispose() { + public void Dispose() + { myDbVendor.Dispose(); } diff --git a/PCAxis.Sql/SqlDbEncrypter.cs b/PCAxis.Sql/SqlDbEncrypter.cs index ade4d18..008b4f7 100644 --- a/PCAxis.Sql/SqlDbEncrypter.cs +++ b/PCAxis.Sql/SqlDbEncrypter.cs @@ -1,11 +1,8 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; using System.IO; using System.Security.Cryptography; using System.Security.Cryptography.Xml; +using System.Xml; namespace PCAxis.Encryption {