init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
139
BuildPipelineDefinitions/Kreta.Scheduled.yml
Normal file
139
BuildPipelineDefinitions/Kreta.Scheduled.yml
Normal file
|
@ -0,0 +1,139 @@
|
|||
parameters:
|
||||
- name: isPublish
|
||||
type: boolean
|
||||
displayName: 'Alkalmazásból készült csomagok publikálása a Pipeline Artifact-ba'
|
||||
default: true
|
||||
schedules:
|
||||
- cron: '0 4 * * 1-5'
|
||||
displayName: Kreta Test CD at 06:00
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- releases/Release_v2.111
|
||||
always: false
|
||||
- cron: '0 9 * * 1-5'
|
||||
displayName: Kreta Test CD at 11:00
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- releases/Release_v2.111
|
||||
always: false
|
||||
- cron: '0 12 * * 1-5'
|
||||
displayName: Kreta Test CD on at 14:00
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- releases/Release_v2.111
|
||||
always: false
|
||||
trigger: none
|
||||
pr: none
|
||||
resources:
|
||||
repositories:
|
||||
- repository: templates
|
||||
type: git
|
||||
name: KretaCore/Kreta.Core.PipelineYml
|
||||
variables:
|
||||
- name: buildConfiguration
|
||||
value: 'Release'
|
||||
- name: buildPlatform
|
||||
value: 'AnyCPU'
|
||||
- name: migratorProjectName
|
||||
value: 'Kreta.DataAccess.Migrations'
|
||||
- name: webProjectName
|
||||
value: 'Kreta.Web'
|
||||
- name: naploWebApiProjectName
|
||||
value: 'Kreta.Naplo.WebApi'
|
||||
- name: ellenorzoWebApiProjectName
|
||||
value: 'Kreta.Ellenorzo.WebApi'
|
||||
- name: eUgyintezesWebApiProjectName
|
||||
value: 'Kreta.eUgyintezes.WebApi'
|
||||
- name: userWebProjectName
|
||||
value: 'Kreta.User.WebApi'
|
||||
jobs:
|
||||
- template: BuildApplication.yml@templates
|
||||
parameters:
|
||||
versioningScheme: 'framework'
|
||||
versioningFilePath: 'Tools'
|
||||
artifactName: 'Kreta'
|
||||
isPublish: ${{ parameters.isPublish }}
|
||||
projectConfigurations:
|
||||
[
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.migratorProjectName }}',
|
||||
projectPath: '${{ variables.migratorProjectName }}\${{ variables.migratorProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.migratorProjectName }}',
|
||||
isWebApplication: false,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: false,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.migratorProjectName }}'
|
||||
},
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.webProjectName }}',
|
||||
projectPath: 'KretaWeb\${{ variables.webProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.webProjectName }}\_PublishedWebsites\${{ variables.webProjectName }}',
|
||||
isWebApplication: true,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: true,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.webProjectName }}'
|
||||
},
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.naploWebApiProjectName }}',
|
||||
projectPath: 'Kreta.WebApi\Naplo\${{ variables.naploWebApiProjectName }}\${{ variables.naploWebApiProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.naploWebApiProjectName }}\_PublishedWebsites\${{ variables.naploWebApiProjectName }}',
|
||||
isWebApplication: true,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: false,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.naploWebApiProjectName }}'
|
||||
},
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.ellenorzoWebApiProjectName }}',
|
||||
projectPath: 'Kreta.WebApi\Ellenorzo\${{ variables.ellenorzoWebApiProjectName }}\${{ variables.ellenorzoWebApiProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.ellenorzoWebApiProjectName }}\_PublishedWebsites\${{ variables.ellenorzoWebApiProjectName }}',
|
||||
isWebApplication: true,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: false,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.ellenorzoWebApiProjectName }}'
|
||||
},
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.eUgyintezesWebApiProjectName }}',
|
||||
projectPath: 'Kreta.WebApi\eUgyintezes\${{ variables.eUgyintezesWebApiProjectName }}\${{ variables.eUgyintezesWebApiProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.eUgyintezesWebApiProjectName }}\_PublishedWebsites\${{ variables.eUgyintezesWebApiProjectName }}',
|
||||
isWebApplication: true,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: false,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.eUgyintezesWebApiProjectName }}'
|
||||
},
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.userWebProjectName }}',
|
||||
projectPath: 'Kreta.WebApi\User\${{ variables.userWebProjectName }}\${{ variables.userWebProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.userWebProjectName }}\_PublishedWebsites\${{ variables.userWebProjectName }}',
|
||||
isWebApplication: true,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: false,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.userWebProjectName }}'
|
||||
}
|
||||
]
|
59
BuildPipelineDefinitions/Kreta.Validation.yml
Normal file
59
BuildPipelineDefinitions/Kreta.Validation.yml
Normal file
|
@ -0,0 +1,59 @@
|
|||
trigger: none
|
||||
pr: none
|
||||
resources:
|
||||
repositories:
|
||||
- repository: templates
|
||||
type: git
|
||||
name: KretaCore/Kreta.Core.PipelineYml
|
||||
variables:
|
||||
- template: VariablesTemplates/BuildVariables.yml@templates
|
||||
jobs:
|
||||
- job: RunKretaValidationBuild
|
||||
displayName: Run Kreta validation build
|
||||
pool: 'eKRETA'
|
||||
steps:
|
||||
- template: Tasks/NuGetRestore.yml@templates
|
||||
parameters:
|
||||
projectOrSolutionPath: KretaBuildSolution.sln
|
||||
nugetConfigPath: 'NuGet\NuGet.config'
|
||||
externalFeedCredentials: 'eKRETA nexus nuget feed'
|
||||
- template: Tasks/NuGetRestore.yml@templates
|
||||
parameters:
|
||||
projectOrSolutionPath: KretaMobile/KretaMobile.sln
|
||||
nugetConfigPath: 'NuGet\NuGet.config'
|
||||
externalFeedCredentials: 'eKRETA nexus nuget feed'
|
||||
- template: Tasks/MSBuild.yml@templates
|
||||
parameters:
|
||||
pathForProject: 'Kreta.DataAccess.Migrations\Kreta.DataAccess.Migrations.csproj'
|
||||
projectName: 'Kreta.DataAccess.Migrations'
|
||||
msbuildArguments: /p:OutputPath=$(Build.BinariesDirectory)\Kreta.DataAccess.Migrations
|
||||
- template: Tasks/MSBuild.yml@templates
|
||||
parameters:
|
||||
pathForProject: 'KretaWeb\Kreta.Web.csproj'
|
||||
projectName: 'Kreta.Web'
|
||||
msbuildArguments: /p:OutputPath=$(Build.BinariesDirectory)\Kreta.Web
|
||||
- template: Tasks/MSBuild.yml@templates
|
||||
parameters:
|
||||
pathForProject: 'Kreta.WebApi\Naplo\Kreta.Naplo.WebApi\Kreta.Naplo.WebApi.csproj'
|
||||
projectName: 'Kreta.Naplo.WebApi'
|
||||
msbuildArguments: /p:OutputPath=$(Build.BinariesDirectory)\Kreta.Naplo.WebApi
|
||||
- template: Tasks/MSBuild.yml@templates
|
||||
parameters:
|
||||
pathForProject: 'Kreta.WebApi\Ellenorzo\Kreta.Ellenorzo.WebApi\Kreta.Ellenorzo.WebApi.csproj'
|
||||
projectName: 'Kreta.Ellenorzo.WebApi'
|
||||
msbuildArguments: /p:OutputPath=$(Build.BinariesDirectory)\Kreta.Ellenorzo.WebApi
|
||||
- template: Tasks/MSBuild.yml@templates
|
||||
parameters:
|
||||
pathForProject: 'Kreta.WebApi\eUgyintezes\Kreta.eUgyintezes.WebApi\Kreta.eUgyintezes.WebApi.csproj'
|
||||
projectName: 'Kreta.eUgyintezes.WebApi'
|
||||
msbuildArguments: /p:OutputPath=$(Build.BinariesDirectory)\Kreta.eUgyintezes.WebApi
|
||||
- template: Tasks/MSBuild.yml@templates
|
||||
parameters:
|
||||
pathForProject: 'Kreta.WebApi\User\Kreta.User.WebApi\Kreta.User.WebApi.csproj'
|
||||
projectName: 'Kreta.User.WebApi'
|
||||
msbuildArguments: /p:OutputPath=$(Build.BinariesDirectory)\Kreta.User.WebApi
|
||||
- template: Tasks/DeleteFiles.yml@templates
|
||||
parameters:
|
||||
displayName: 'CleanUp Binaries Directory'
|
||||
sourceFolder: $(Build.BinariesDirectory)
|
||||
contents: '**'
|
122
BuildPipelineDefinitions/Kreta.yml
Normal file
122
BuildPipelineDefinitions/Kreta.yml
Normal file
|
@ -0,0 +1,122 @@
|
|||
parameters:
|
||||
- name: isPublish
|
||||
type: boolean
|
||||
displayName: 'Alkalmazásból készült csomagok publikálása a Pipeline Artifact-ba'
|
||||
default: false
|
||||
trigger:
|
||||
batch: 'true'
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- releases/*
|
||||
pr: none
|
||||
resources:
|
||||
repositories:
|
||||
- repository: templates
|
||||
type: git
|
||||
name: KretaCore/Kreta.Core.PipelineYml
|
||||
variables:
|
||||
- name: buildConfiguration
|
||||
value: 'Release'
|
||||
- name: buildPlatform
|
||||
value: 'AnyCPU'
|
||||
- name: migratorProjectName
|
||||
value: 'Kreta.DataAccess.Migrations'
|
||||
- name: webProjectName
|
||||
value: 'Kreta.Web'
|
||||
- name: naploWebApiProjectName
|
||||
value: 'Kreta.Naplo.WebApi'
|
||||
- name: ellenorzoWebApiProjectName
|
||||
value: 'Kreta.Ellenorzo.WebApi'
|
||||
- name: eUgyintezesWebApiProjectName
|
||||
value: 'Kreta.eUgyintezes.WebApi'
|
||||
- name: userWebProjectName
|
||||
value: 'Kreta.User.WebApi'
|
||||
jobs:
|
||||
- template: BuildApplication.yml@templates
|
||||
parameters:
|
||||
versioningScheme: 'framework'
|
||||
versioningFilePath: 'Tools'
|
||||
artifactName: 'Kreta'
|
||||
isPublish: ${{ parameters.isPublish }}
|
||||
projectConfigurations:
|
||||
[
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.migratorProjectName }}',
|
||||
projectPath: '${{ variables.migratorProjectName }}\${{ variables.migratorProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.migratorProjectName }}',
|
||||
isWebApplication: false,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: false,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.migratorProjectName }}'
|
||||
},
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.webProjectName }}',
|
||||
projectPath: 'KretaWeb\${{ variables.webProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.webProjectName }}\_PublishedWebsites\${{ variables.webProjectName }}',
|
||||
isWebApplication: true,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: true,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.webProjectName }}'
|
||||
},
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.naploWebApiProjectName }}',
|
||||
projectPath: 'Kreta.WebApi\Naplo\${{ variables.naploWebApiProjectName }}\${{ variables.naploWebApiProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.naploWebApiProjectName }}\_PublishedWebsites\${{ variables.naploWebApiProjectName }}',
|
||||
isWebApplication: true,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: false,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.naploWebApiProjectName }}'
|
||||
},
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.ellenorzoWebApiProjectName }}',
|
||||
projectPath: 'Kreta.WebApi\Ellenorzo\${{ variables.ellenorzoWebApiProjectName }}\${{ variables.ellenorzoWebApiProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.ellenorzoWebApiProjectName }}\_PublishedWebsites\${{ variables.ellenorzoWebApiProjectName }}',
|
||||
isWebApplication: true,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: false,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.ellenorzoWebApiProjectName }}'
|
||||
},
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.eUgyintezesWebApiProjectName }}',
|
||||
projectPath: 'Kreta.WebApi\eUgyintezes\${{ variables.eUgyintezesWebApiProjectName }}\${{ variables.eUgyintezesWebApiProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.eUgyintezesWebApiProjectName }}\_PublishedWebsites\${{ variables.eUgyintezesWebApiProjectName }}',
|
||||
isWebApplication: true,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: false,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.eUgyintezesWebApiProjectName }}'
|
||||
},
|
||||
{
|
||||
sdkType: 'framework',
|
||||
projectName: '${{ variables.userWebProjectName }}',
|
||||
projectPath: 'Kreta.WebApi\User\${{ variables.userWebProjectName }}\${{ variables.userWebProjectName }}.csproj',
|
||||
solutionPath: 'KretaBuildSolution.sln',
|
||||
nugetConfigPath: 'NuGet\NuGet.config',
|
||||
deploySourcePath: '$(Build.BinariesDirectory)\${{ variables.userWebProjectName }}\_PublishedWebsites\${{ variables.userWebProjectName }}',
|
||||
isWebApplication: true,
|
||||
runTest: false,
|
||||
npmInstall: false,
|
||||
gitTagEnabled: false,
|
||||
msBuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\${{ variables.userWebProjectName }}'
|
||||
}
|
||||
]
|
2116
Documentation/Ellenorzo_Mobile.postman_collection.json
Normal file
2116
Documentation/Ellenorzo_Mobile.postman_collection.json
Normal file
File diff suppressed because one or more lines are too long
61
Documentation/EnvironmentDEV.postman_environment.json
Normal file
61
Documentation/EnvironmentDEV.postman_environment.json
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"id": "3287c21c-7bf5-f6be-a0fb-1281a515c7e7",
|
||||
"name": "EnvironmentDEV",
|
||||
"values": [
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "NaploUrl",
|
||||
"value": "https://biatorbagyi.ekreta-dev.hu/Naplo"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "NaploSubroot",
|
||||
"value": "/V1"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "EllenorzoUrl",
|
||||
"value": "https://biatorbagyi.ekreta-dev.hu/mapi/api"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "EllenorzoSubroot",
|
||||
"value": "/V1"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "EllenorzoNewUrl",
|
||||
"value": "https://biatorbagyi.ekreta-dev.hu/Ellenorzo"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "EllenorzoNewSubroot",
|
||||
"value": "/V1"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "IDPURL",
|
||||
"value": "https://biatorbagyi.ekreta-dev.hu/idp/api/v1/token"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "CLIENTID",
|
||||
"value": "69bfdce9-2c9f-4a12-aa7b-4fe15e1228dc"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "TOKEN",
|
||||
"value": "eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZHA6dXNlcl9pZCI6IjAyOTBmOTQ2LTg1YzUtNDJiYS04OTY3LTJiZWE0NGM2MjFiZSIsImtyZXRhOmluc3RpdHV0ZV9jb2RlIjoiYmlhdG9yYmFneWkiLCJrcmV0YTppbnN0aXR1dGVfdXNlcl9pZCI6IjMwMzQiLCJrcmV0YTp0dXRlbGFyeV9pZCI6IiIsInJvbGUiOiJTdHVkZW50IiwiZXhwIjoxNTI4OTAxNTc1LCJpc3MiOiJrcmV0YS5pZGVudGl0eXByb3ZpZGVyIiwiYXVkIjoiNjliZmRjZTktMmM5Zi00YTEyLWFhN2ItNGZlMTVlMTIyOGRjIn0.78QG_R7xYgCeFqaT2Io7b_J3RzHFmTlZ68a9HdoTabQ"
|
||||
},
|
||||
{
|
||||
"key": "ApiKey",
|
||||
"value": "2bd5b13e-e178-47a8-8473-8d6756ce5c03",
|
||||
"description": "",
|
||||
"type": "text",
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"_postman_variable_scope": "environment",
|
||||
"_postman_exported_at": "2018-09-04T10:19:58.224Z",
|
||||
"_postman_exported_using": "Postman/6.2.5"
|
||||
}
|
59
Documentation/EnvironmentLocalDebug.postman_environment.json
Normal file
59
Documentation/EnvironmentLocalDebug.postman_environment.json
Normal file
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"id": "2d2ceb5a-0d21-d2e4-6c22-01c36b860670",
|
||||
"name": "EnvironmentLocalDebug",
|
||||
"values": [
|
||||
{
|
||||
"value": "http://naplo.ekreta.hu",
|
||||
"key": "NaploUrl",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "/V1",
|
||||
"key": "NaploSubroot",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "http://biatorbagyi.ekreta.hu/api/Mobile/Naplo",
|
||||
"key": "NaploKretaUrl",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "http://mobileapi.ekreta.hu/api/",
|
||||
"key": "EllenorzoUrl",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "/V1",
|
||||
"key": "EllenorzoSubroot",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "http://ellenorzo.ekreta.hu",
|
||||
"key": "EllenorzoNewUrl",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "/V1",
|
||||
"key": "EllenorzoNewSubroot",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "https://idp.ekreta.hu/api/v1/token",
|
||||
"key": "IDPURL",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "69bfdce9-2c9f-4a12-aa7b-4fe15e1228dc",
|
||||
"key": "CLIENTID",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZHA6dXNlcl9pZCI6ImJhMjY2NjI2LWQ4MTEtNGVmOC05OWQ4LWJjNjg4MTJjZDZlNiIsImtyZXRhOmluc3RpdHV0ZV9jb2RlIjoiYmlhdG9yYmFneWkiLCJrcmV0YTppbnN0aXR1dGVfdXNlcl9pZCI6IjkwNzEiLCJrcmV0YTp0dXRlbGFyeV9pZCI6IiIsInJvbGUiOiJUZWFjaGVyIiwiZXhwIjoxNTM2MDUzMjQzLCJpc3MiOiJrcmV0YS5pZGVudGl0eXByb3ZpZGVyIiwiYXVkIjoiNjliZmRjZTktMmM5Zi00YTEyLWFhN2ItNGZlMTVlMTIyOGRjIn0.drAdGcHBumMomTlboVbOPbKDeERTiWa3-KiwnAhmY10",
|
||||
"key": "TOKEN",
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"_postman_variable_scope": "environment",
|
||||
"_postman_exported_at": "2018-09-04T10:20:03.271Z",
|
||||
"_postman_exported_using": "Postman/6.2.5"
|
||||
}
|
60
Documentation/EnvironmentPROD.postman_environment.json
Normal file
60
Documentation/EnvironmentPROD.postman_environment.json
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
"id": "b84571bc-f139-48cf-b9e6-a55099d3784c",
|
||||
"name": "EnvironmentPROD",
|
||||
"values": [
|
||||
{
|
||||
"value": "https://klik037169001.e-kreta.hu/Naplo",
|
||||
"key": "NaploUrl",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "/V1",
|
||||
"key": "NaploSubroot",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "https://klik037169001.e-kreta.hu/mapi/api",
|
||||
"key": "EllenorzoUrl",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "/V1",
|
||||
"key": "EllenorzoSubroot",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "https://klik037169001.e-kreta.hu/Ellenorzo",
|
||||
"key": "EllenorzoNewUrl",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "/V1",
|
||||
"key": "EllenorzoNewSubroot",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "https://klik037169001.e-kreta.hu/idp/api/v1/token",
|
||||
"key": "IDPURL",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "919e0c1c-76a2-4646-a2fb-7085bbbf3c56",
|
||||
"key": "CLIENTID",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZHA6dXNlcl9pZCI6IjUxZDNjZjk3LWY4MTEtNGU5MC1hMDUzLWZlZThjNTBiNjUxZiIsImtyZXRhOmluc3RpdHV0ZV9jb2RlIjoia2xpazAzNzE2OTAwMSIsImtyZXRhOmluc3RpdHV0ZV91c2VyX2lkIjoiMjI4MjMxIiwia3JldGE6dHV0ZWxhcnlfaWQiOiIiLCJyb2xlIjoiU3R1ZGVudCIsImV4cCI6MTUzNTk3ODQ2OCwiaXNzIjoia3JldGEuaWRlbnRpdHlwcm92aWRlciIsImF1ZCI6IjkxOWUwYzFjLTc2YTItNDY0Ni1hMmZiLTcwODViYmJmM2M1NiJ9.ajxFBVooOdOQd1n-to7AfIrJyPPCg-llkuglwra0GJ4",
|
||||
"key": "TOKEN",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"key": "ApiKey",
|
||||
"value": "7856d350-1fda-45f5-822d-e1a2f3f1acf0",
|
||||
"description": "",
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"_postman_variable_scope": "environment",
|
||||
"_postman_exported_at": "2018-09-04T10:20:06.689Z",
|
||||
"_postman_exported_using": "Postman/6.2.5"
|
||||
}
|
61
Documentation/EnvironmentTEST.postman_environment.json
Normal file
61
Documentation/EnvironmentTEST.postman_environment.json
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"id": "043ecd65-744b-a043-c55f-2e3b8cbe44eb",
|
||||
"name": "EnvironmentTEST",
|
||||
"values": [
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "NaploUrl",
|
||||
"value": "https://biatorbagyi.ekreta-test.hu/Naplo"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "NaploSubroot",
|
||||
"value": "/V1"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "EllenorzoUrl",
|
||||
"value": "https://biatorbagyi.ekreta-test.hu/mapi/api"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "EllenorzoSubroot",
|
||||
"value": "/V1"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "EllenorzoNewUrl",
|
||||
"value": "https://biatorbagyi.ekreta-test.hu/Ellenorzo"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "EllenorzoNewSubroot",
|
||||
"value": "/V1"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "IDPURL",
|
||||
"value": "https://biatorbagyi.ekreta-test.hu/idp/api/v1/token"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "CLIENTID",
|
||||
"value": "4596201c-ec1c-4df7-99c0-940d035946c8"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"key": "TOKEN",
|
||||
"value": "eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZHA6dXNlcl9pZCI6IjkzMzY2NzVlLTI0M2MtNGE1NS1hZTU1LWNlNzc1ZTlkY2U5YyIsImtyZXRhOmluc3RpdHV0ZV9jb2RlIjoiYmlhdG9yYmFneWkiLCJrcmV0YTppbnN0aXR1dGVfdXNlcl9pZCI6IjMwMzQiLCJrcmV0YTp0dXRlbGFyeV9pZCI6IiIsInJvbGUiOiJTdHVkZW50IiwiZXhwIjoxNTI4OTcxNzk3LCJpc3MiOiJrcmV0YS5pZGVudGl0eXByb3ZpZGVyIiwiYXVkIjoiNDU5NjIwMWMtZWMxYy00ZGY3LTk5YzAtOTQwZDAzNTk0NmM4In0.rDQ23lKEMfrTJApjOo7FAX9b4JPj7TZaFg1sM6-bszs"
|
||||
},
|
||||
{
|
||||
"key": "ApiKey",
|
||||
"value": "c9f72983-a6c6-44d5-ab21-40d80b087366",
|
||||
"description": "",
|
||||
"type": "text",
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"_postman_variable_scope": "environment",
|
||||
"_postman_exported_at": "2018-09-04T10:20:09.533Z",
|
||||
"_postman_exported_using": "Postman/6.2.5"
|
||||
}
|
63
Documentation/EnvironmentUAT.postman_environment.json
Normal file
63
Documentation/EnvironmentUAT.postman_environment.json
Normal file
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"id": "06d9f7a5-ef07-71f3-e47f-c84c85abb9e7",
|
||||
"name": "EnvironmentUAT",
|
||||
"values": [
|
||||
{
|
||||
"value": "https://biatorbagyi.ekreta-uat.hu/Naplo",
|
||||
"key": "NaploUrl",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "/V1",
|
||||
"key": "NaploSubroot",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "https://biatorbagyi.ekreta-uat.hu/mapi/api",
|
||||
"key": "EllenorzoUrl",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "/V1",
|
||||
"key": "EllenorzoSubroot",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "https://biatorbagyi.ekreta-uat.hu/Ellenorzo",
|
||||
"key": "EllenorzoNewUrl",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "/V1",
|
||||
"key": "EllenorzoNewSubroot",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "https://biatorbagyi.ekreta-uat.hu/idp/api/v1/token",
|
||||
"key": "IDPURL",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "03f7bdba-526b-4f39-8cc7-a6329363f5f7",
|
||||
"key": "CLIENTID",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"value": "eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZHA6dXNlcl9pZCI6IjBmZGI5OTA4LWYyNGYtNDlkYi1iMjU0LWJhNjU2OTIwMmE4ZiIsImtyZXRhOmluc3RpdHV0ZV9jb2RlIjoiYmlhdG9yYmFneWkiLCJrcmV0YTppbnN0aXR1dGVfdXNlcl9pZCI6IjkzOTUiLCJrcmV0YTp0dXRlbGFyeV9pZCI6IiIsInJvbGUiOiJUZWFjaGVyIiwiZXhwIjoxNTM1OTgyNTgzLCJpc3MiOiJrcmV0YS5pZGVudGl0eXByb3ZpZGVyIiwiYXVkIjoiMDNmN2JkYmEtNTI2Yi00ZjM5LThjYzctYTYzMjkzNjNmNWY3In0.kIL7rnmZPyvf4dyTjyQpaFyESRNobWn5cH9j4Det9_g",
|
||||
"key": "TOKEN",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"description": {
|
||||
"content": "",
|
||||
"type": "text/plain"
|
||||
},
|
||||
"value": "34b347b2-bd69-4e4f-aef3-6709cf109e5b",
|
||||
"key": "ApiKey",
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"_postman_variable_scope": "environment",
|
||||
"_postman_exported_at": "2018-09-04T10:20:12.360Z",
|
||||
"_postman_exported_using": "Postman/6.2.5"
|
||||
}
|
135
Documentation/GlobalMobileApi.postman_collection.json
Normal file
135
Documentation/GlobalMobileApi.postman_collection.json
Normal file
|
@ -0,0 +1,135 @@
|
|||
{
|
||||
"info": {
|
||||
"_postman_id": "4606bc6a-73f3-4443-a6a7-23b7c6594e3d",
|
||||
"name": "GlobalMobileApi",
|
||||
"description": "Környezetenkénti global mobile api.",
|
||||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
||||
},
|
||||
"item": [
|
||||
{
|
||||
"name": "Institute",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "apiKey",
|
||||
"value": "{{ApiKey}}"
|
||||
}
|
||||
],
|
||||
"body": {},
|
||||
"url": {
|
||||
"raw": "https://kretaglobalmobileapiuat.ekreta.hu/api/v1/Institute",
|
||||
"protocol": "https",
|
||||
"host": ["kretaglobalmobileapiuat", "ekreta", "hu"],
|
||||
"path": ["api", "v1", "Institute"]
|
||||
},
|
||||
"description": "Mobilos intézmény választásához lista."
|
||||
},
|
||||
"response": [
|
||||
{
|
||||
"name": "OK",
|
||||
"originalRequest": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "apiKey",
|
||||
"value": "{{ApiKey}}",
|
||||
"disabled": false
|
||||
}
|
||||
],
|
||||
"body": {},
|
||||
"url": {
|
||||
"raw": "https://kretaglobalmobileapiuat.ekreta.hu/api/v1/Institute",
|
||||
"protocol": "https",
|
||||
"host": ["kretaglobalmobileapiuat", "ekreta", "hu"],
|
||||
"path": ["api", "v1", "Institute"]
|
||||
}
|
||||
},
|
||||
"status": "OK",
|
||||
"code": 200,
|
||||
"_postman_previewlanguage": "json",
|
||||
"header": [
|
||||
{
|
||||
"key": "Cache-Control",
|
||||
"value": "no-cache",
|
||||
"name": "Cache-Control",
|
||||
"description": "Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds"
|
||||
},
|
||||
{
|
||||
"key": "Content-Encoding",
|
||||
"value": "gzip",
|
||||
"name": "Content-Encoding",
|
||||
"description": "The type of encoding used on the data."
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json; charset=utf-8",
|
||||
"name": "Content-Type",
|
||||
"description": "The mime type of this content"
|
||||
},
|
||||
{
|
||||
"key": "Date",
|
||||
"value": "Mon, 27 Aug 2018 12:40:19 GMT",
|
||||
"name": "Date",
|
||||
"description": "The date and time that the message was sent"
|
||||
},
|
||||
{
|
||||
"key": "Expires",
|
||||
"value": "-1",
|
||||
"name": "Expires",
|
||||
"description": "Gives the date/time after which the response is considered stale"
|
||||
},
|
||||
{
|
||||
"key": "Pragma",
|
||||
"value": "no-cache",
|
||||
"name": "Pragma",
|
||||
"description": "Implementation-specific headers that may have various effects anywhere along the request-response chain."
|
||||
},
|
||||
{
|
||||
"key": "Server",
|
||||
"value": "Microsoft-IIS/10.0",
|
||||
"name": "Server",
|
||||
"description": "A name for the server"
|
||||
},
|
||||
{
|
||||
"key": "Transfer-Encoding",
|
||||
"value": "chunked",
|
||||
"name": "Transfer-Encoding",
|
||||
"description": "The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity."
|
||||
},
|
||||
{
|
||||
"key": "Vary",
|
||||
"value": "Accept-Encoding",
|
||||
"name": "Vary",
|
||||
"description": "Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server."
|
||||
},
|
||||
{
|
||||
"key": "X-AspNet-Version",
|
||||
"value": "4.0.30319",
|
||||
"name": "X-AspNet-Version",
|
||||
"description": "Custom header"
|
||||
},
|
||||
{
|
||||
"key": "X-Powered-By",
|
||||
"value": "ASP.NET",
|
||||
"name": "X-Powered-By",
|
||||
"description": "Specifies the technology (ASP.NET, PHP, JBoss, e.g.) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)"
|
||||
}
|
||||
],
|
||||
"cookie": [
|
||||
{
|
||||
"expires": "Tue Jan 19 2038 04:14:07 GMT+0100 (Central Europe Standard Time)",
|
||||
"httpOnly": true,
|
||||
"domain": "kretaglobalmobileapiuat.ekreta.hu",
|
||||
"path": "/",
|
||||
"secure": false,
|
||||
"value": "d0fd332e2e657cc5a5784e0cd0ebc3d6a210cb33ba1518793cbc811b1e894878",
|
||||
"key": "ARRAffinity"
|
||||
}
|
||||
],
|
||||
"body": "[\r\n {\r\n \"InstituteId\": 1,\r\n \"InstituteCode\": \"biatorbagyi\",\r\n \"Name\": \"Biatorbágyi általános iskola* 88\",\r\n \"Url\": \"https://biatorbagyi.ekreta-uat.hu\",\r\n \"City\": \"Budapest\",\r\n \"AdvertisingUrl\": \"\",\r\n \"FeatureToggleSet\": {\r\n \"JustificationFeatureEnabled\": \"false\"\r\n }\r\n },\r\n {\r\n \"InstituteId\": 3,\r\n \"InstituteCode\": \"dobokata\",\r\n \"Name\": \"Dobó Katalin Általános Iskola\",\r\n \"Url\": \"https://dobokata.ekreta-uat.hu\",\r\n \"City\": \"Debrecen\",\r\n \"AdvertisingUrl\": \"\",\r\n \"FeatureToggleSet\": {\r\n \"JustificationFeatureEnabled\": \"false\"\r\n }\r\n },\r\n {\r\n \"InstituteId\": 16,\r\n \"InstituteCode\": \"biatorbagyi-dev\",\r\n \"Name\": \"Biatorbágyi Dev\",\r\n \"Url\": \"https://biatorbagyi.ekreta-dev.hu\",\r\n \"City\": \"Budapest\",\r\n \"AdvertisingUrl\": \"\",\r\n \"FeatureToggleSet\": {\r\n \"JustificationFeatureEnabled\": \"false\"\r\n }\r\n }\r\n]"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
3558
Documentation/KretaWebApi.postman_collection.json
Normal file
3558
Documentation/KretaWebApi.postman_collection.json
Normal file
File diff suppressed because one or more lines are too long
3562
Documentation/Naplo_Mobile.postman_collection.json
Normal file
3562
Documentation/Naplo_Mobile.postman_collection.json
Normal file
File diff suppressed because one or more lines are too long
65
Framework/Actions/ProtectedDictionaryItemException.cs
Normal file
65
Framework/Actions/ProtectedDictionaryItemException.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework.Actions
|
||||
{
|
||||
/// <summary>
|
||||
/// Védett kódtételre történő írási műveletet jelző kivétel.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>A Generált kód használja.</para>
|
||||
/// <para>
|
||||
/// Védettnek az a kódtétel minősül, amelynek a típusa a modellben védetté van nyilvánítva,
|
||||
/// vagy a Protected tulajdonsága true.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[FriendlyName(1000039, "A kódtétel írásvédett, módosítása nem lehetséges.")]
|
||||
[ErrorCode(Events.ACTION_INVALIDREQUEST)]
|
||||
[Serializable]
|
||||
public sealed class ProtectedDictionaryItemException : FrameworkException
|
||||
{
|
||||
const string _errorMessage = "The dictionary item is write-protected.";
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItemType">A kódtétel típusa</param>
|
||||
public ProtectedDictionaryItemException(string dictionaryItemType)
|
||||
: base(_errorMessage, null)
|
||||
{
|
||||
SetValue("DictionaryItemType", dictionaryItemType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItemType">A kódtétel típusa</param>
|
||||
/// <param name="dictionaryItemId">A kódtétel adatbázisbeli azonosítója</param>
|
||||
public ProtectedDictionaryItemException(string dictionaryItemType, int dictionaryItemId)
|
||||
: base(_errorMessage, null)
|
||||
{
|
||||
SetValue("DictionaryItemType", dictionaryItemType);
|
||||
SetValue("DictionaryItemId", dictionaryItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public ProtectedDictionaryItemException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public ProtectedDictionaryItemException(string message, Exception innerException)
|
||||
: base(message, innerException) { }
|
||||
|
||||
ProtectedDictionaryItemException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
20
Framework/Caching/Cache.cs
Normal file
20
Framework/Caching/Cache.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
namespace Kreta.Framework.Caching
|
||||
{
|
||||
/// <summary>
|
||||
/// A gyorsítótárak ősosztálya.
|
||||
/// </summary>
|
||||
public abstract class Cache
|
||||
{
|
||||
public CacheManager CacheManager { get; }
|
||||
|
||||
protected Cache(CacheManager cachemanager)
|
||||
{
|
||||
CacheManager = cachemanager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Kiüríti a gyorsítótárat.
|
||||
/// </summary>
|
||||
public abstract void Reset();
|
||||
}
|
||||
}
|
64
Framework/Caching/CacheManager.cs
Normal file
64
Framework/Caching/CacheManager.cs
Normal file
|
@ -0,0 +1,64 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Framework.Caching
|
||||
{
|
||||
public class CacheManager
|
||||
{
|
||||
private Dictionary<Type, Cache> m_Caches = new Dictionary<Type, Cache>();
|
||||
private System.Threading.ReaderWriterLockSlim m_CacheManagerLock = new System.Threading.ReaderWriterLockSlim();
|
||||
|
||||
public CacheManager()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adott cache kérése a managertől
|
||||
/// </summary>
|
||||
/// <typeparam name="CacheType">Cache típusa</typeparam>
|
||||
/// <returns>Cache példány</returns>
|
||||
public CacheType AquireCache<CacheType>() where CacheType : Cache
|
||||
{
|
||||
m_CacheManagerLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
if (!m_Caches.ContainsKey(typeof(CacheType)))
|
||||
{
|
||||
m_Caches.Add(typeof(CacheType), (Cache)Activator.CreateInstance(typeof(CacheType), new object[] { this }));
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_CacheManagerLock.ExitWriteLock();
|
||||
}
|
||||
return (CacheType)m_Caches[typeof(CacheType)];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adott cache kérése a managertől, mobilból
|
||||
/// </summary>
|
||||
/// <typeparam name="CacheType">Cache típusa</typeparam>
|
||||
/// <returns>Cache példány</returns>
|
||||
public CacheType AquireCacheMobile<CacheType>() where CacheType : Cache
|
||||
{
|
||||
m_CacheManagerLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
if (!m_Caches.ContainsKey(typeof(CacheType)))
|
||||
{
|
||||
m_Caches.Add(typeof(CacheType), (Cache)Activator.CreateInstance(typeof(CacheType), new object[] { this }));
|
||||
}
|
||||
return (CacheType)m_Caches[typeof(CacheType)];
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SDAServer.Instance.Logger.ExceptionThrown(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_CacheManagerLock.ExitWriteLock();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
204
Framework/Caching/DictionaryItem.cs
Normal file
204
Framework/Caching/DictionaryItem.cs
Normal file
|
@ -0,0 +1,204 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Framework.Caching
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class DictionaryItem
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public DictionaryItem(
|
||||
int id,
|
||||
int? value,
|
||||
string name,
|
||||
string name1,
|
||||
string name2,
|
||||
string name3,
|
||||
string name4,
|
||||
bool isVisible,
|
||||
string code,
|
||||
string type,
|
||||
bool isProtected,
|
||||
string color,
|
||||
int? order,
|
||||
string bgColor,
|
||||
string description,
|
||||
bool isActive,
|
||||
string shortName,
|
||||
int dictionaryTypeId)
|
||||
{
|
||||
Validate(name, type);
|
||||
|
||||
Id = id;
|
||||
Value = value;
|
||||
Name = name;
|
||||
Name1 = name1;
|
||||
Name2 = name2;
|
||||
Name3 = name3;
|
||||
Name4 = name4;
|
||||
IsVisible = isVisible;
|
||||
Code = code;
|
||||
Type = type;
|
||||
IsProtected = isProtected;
|
||||
Color = color;
|
||||
Order = order;
|
||||
BgColor = bgColor;
|
||||
Description = description;
|
||||
IsActive = isActive;
|
||||
ShortName = shortName;
|
||||
DictionaryTypeId = dictionaryTypeId;
|
||||
}
|
||||
|
||||
public DictionaryItem(DictionaryItem dictionaryItem)
|
||||
{
|
||||
Validate(dictionaryItem.Name, dictionaryItem.Type);
|
||||
|
||||
Id = dictionaryItem.Id;
|
||||
Value = dictionaryItem.Value;
|
||||
Name = dictionaryItem.Name;
|
||||
Name1 = dictionaryItem.Name1;
|
||||
Name2 = dictionaryItem.Name2;
|
||||
Name3 = dictionaryItem.Name3;
|
||||
Name4 = dictionaryItem.Name4;
|
||||
IsVisible = dictionaryItem.IsVisible;
|
||||
Code = dictionaryItem.Code;
|
||||
Type = dictionaryItem.Type;
|
||||
IsProtected = dictionaryItem.IsProtected;
|
||||
Color = dictionaryItem.Color;
|
||||
Order = dictionaryItem.Order;
|
||||
BgColor = dictionaryItem.BgColor;
|
||||
Description = dictionaryItem.Description;
|
||||
IsActive = dictionaryItem.IsActive;
|
||||
ShortName = dictionaryItem.ShortName;
|
||||
DictionaryTypeId = dictionaryItem.DictionaryTypeId;
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel azonosítója
|
||||
/// </summary>
|
||||
public int Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel értéke
|
||||
/// </summary>
|
||||
public int? Value { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel neve
|
||||
/// </summary>
|
||||
public string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel neve 1
|
||||
/// </summary>
|
||||
public string Name1 { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel neve 2
|
||||
/// </summary>
|
||||
public string Name2 { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel neve 3
|
||||
/// </summary>
|
||||
public string Name3 { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel neve 4
|
||||
/// </summary>
|
||||
public string Name4 { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel látható-e
|
||||
/// </summary>
|
||||
public bool IsVisible { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel kódja
|
||||
/// </summary>
|
||||
public string Code { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel típusa
|
||||
/// </summary>
|
||||
public string Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel védett-e
|
||||
/// </summary>
|
||||
public bool IsProtected { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel szín kódja
|
||||
/// </summary>
|
||||
public string Color { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel sorrendje
|
||||
/// </summary>
|
||||
public int? Order { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel háttérszín kódja
|
||||
/// </summary>
|
||||
public string BgColor { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel leírása
|
||||
/// </summary>
|
||||
public string Description { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel aktív-e
|
||||
/// </summary>
|
||||
public bool IsActive { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel rövid neve
|
||||
/// </summary>
|
||||
public string ShortName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A kódtétel típusának azonosítója
|
||||
/// </summary>
|
||||
public int DictionaryTypeId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Egyedi szótártáblák kiegészítő tulajdonságai
|
||||
/// </summary>
|
||||
public Dictionary<string, object> ExtendedProperties { get; set; }
|
||||
|
||||
#endregion Properties
|
||||
|
||||
private static void Validate(string name, string type)
|
||||
{
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(name));
|
||||
}
|
||||
|
||||
if (name.Length == 0)
|
||||
{
|
||||
throw new ArgumentException(@"The string can not be empty.", nameof(name));
|
||||
}
|
||||
|
||||
if (type == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(type));
|
||||
}
|
||||
|
||||
if (type.Length == 0)
|
||||
{
|
||||
throw new ArgumentException(@"The string can not be empty.", nameof(type));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class AgazatReszSzakmaTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public AgazatReszSzakmaTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Az ágazat rész szakma típus oktatás nevelési feladat azonosítója
|
||||
/// </summary>
|
||||
public int? OktatasiNevelesiFeladatId => (int?)ExtendedProperties[nameof(OktatasiNevelesiFeladatId)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class AgazatUjSzktTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public AgazatUjSzktTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Az ágazat új SZKT típus ágazati besorolása
|
||||
/// </summary>
|
||||
public int? AgazatiBesorolas => (int?)ExtendedProperties[nameof(AgazatiBesorolas)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class AllampolgarsagDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public AllampolgarsagDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Az állampolgárság kód 2
|
||||
/// </summary>
|
||||
public string Kod2 => (string)ExtendedProperties[nameof(Kod2)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class CsoportTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public CsoportTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Művészeti-e a csoport típus?
|
||||
/// </summary>
|
||||
public bool IsMuveszeti => (bool)ExtendedProperties[nameof(IsMuveszeti)];
|
||||
|
||||
/// <summary>
|
||||
/// Tanórai célű-e a csoport típus?
|
||||
/// </summary>
|
||||
public bool IsTanoraiCelu => (bool)ExtendedProperties[nameof(IsTanoraiCelu)];
|
||||
|
||||
/// <summary>
|
||||
/// A csoport típus óra perce?
|
||||
/// </summary>
|
||||
public int? OraPerc => (int?)ExtendedProperties[nameof(OraPerc)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class DokumentumKulcsszoTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public DokumentumKulcsszoTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// A dokumentum kulcsszó típus poszeidon kulcsszó típusa
|
||||
/// </summary>
|
||||
public string PoszeidonKulcsszoTipus => (string)ExtendedProperties[nameof(PoszeidonKulcsszoTipus)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ErtekelesModDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public ErtekelesModDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Félkövér-e az értékelés mód?
|
||||
/// </summary>
|
||||
public bool IsBold => (bool)ExtendedProperties[nameof(IsBold)];
|
||||
|
||||
/// <summary>
|
||||
/// Az értékelés mód számonkérés korlátozott-e?
|
||||
/// </summary>
|
||||
public bool IsSzamonkeresKorlatozott => (bool)ExtendedProperties[nameof(IsSzamonkeresKorlatozott)];
|
||||
|
||||
/// <summary>
|
||||
/// Az értékelés mód súlyozása
|
||||
/// </summary>
|
||||
public int Suly => (int)ExtendedProperties[nameof(Suly)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ErtekelesTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public ErtekelesTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Egyszer adható-e az értékelés típus?
|
||||
/// </summary>
|
||||
public bool IsEgyszerAdhato => (bool)ExtendedProperties[nameof(IsEgyszerAdhato)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class EsemenyTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public EsemenyTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Ellenőrzőben megjelenik-e az esemény típus?
|
||||
/// </summary>
|
||||
public bool IsEllenorzobenMegjelenik => (bool)ExtendedProperties[nameof(IsEllenorzobenMegjelenik)];
|
||||
|
||||
/// <summary>
|
||||
/// Naplóban megjelenik-e az esemény típus?
|
||||
/// </summary>
|
||||
public bool IsNaplobanMegjelenik => (bool)ExtendedProperties[nameof(IsNaplobanMegjelenik)];
|
||||
|
||||
/// <summary>
|
||||
/// Törzslapon megjelenik-e az esemény típus?
|
||||
/// </summary>
|
||||
public bool IsTorzslaponMegjelenik => (bool)ExtendedProperties[nameof(IsTorzslaponMegjelenik)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class EvfolyamTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public EvfolyamTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Az évfolyam típus alap óraszáma
|
||||
/// </summary>
|
||||
public double AlapOraszam => (double)ExtendedProperties[nameof(AlapOraszam)];
|
||||
|
||||
/// <summary>
|
||||
/// Összevont-e az évfolyam típus?
|
||||
/// </summary>
|
||||
public bool IsOsszevont => (bool)ExtendedProperties[nameof(IsOsszevont)];
|
||||
|
||||
/// <summary>
|
||||
/// A következő évfolyam típus azonosítója
|
||||
/// </summary>
|
||||
public int? KovetkezoEvfolyamTipusId => (int?)ExtendedProperties[nameof(KovetkezoEvfolyamTipusId)];
|
||||
|
||||
/// <summary>
|
||||
/// Az évfolyam típus minimum óraszáma
|
||||
/// </summary>
|
||||
public double MinimumOraszam => (double)ExtendedProperties[nameof(MinimumOraszam)];
|
||||
|
||||
/// <summary>
|
||||
/// Az évfolyam típus viszonyítási létszáma
|
||||
/// </summary>
|
||||
public double ViszonyitasiLetszam => (double)ExtendedProperties[nameof(ViszonyitasiLetszam)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class MunkakorTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public MunkakorTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Az alkalmazott munkakör típusának azonosítója
|
||||
/// </summary>
|
||||
public int? AlkalmazottMunkaKorTipusId => (int?)ExtendedProperties[nameof(AlkalmazottMunkaKorTipusId)];
|
||||
|
||||
/// <summary>
|
||||
/// SZIR oktató-e?
|
||||
/// </summary>
|
||||
public bool IsSzirStatOktato => (bool)ExtendedProperties[nameof(IsSzirStatOktato)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class NapTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public NapTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Le nem kötött munkaidő-e a nap típus?
|
||||
/// </summary>
|
||||
public bool IsLeNemKotottMunkaido => (bool)ExtendedProperties[nameof(IsLeNemKotottMunkaido)];
|
||||
|
||||
/// <summary>
|
||||
/// Sorszámozandó-e a nap típus?
|
||||
/// </summary>
|
||||
public bool IsSorszamozando => (bool)ExtendedProperties[nameof(IsSorszamozando)];
|
||||
|
||||
/// <summary>
|
||||
/// Tanítási nap-e a nap típus?
|
||||
/// </summary>
|
||||
public bool IsTanitasiNap => (bool)ExtendedProperties[nameof(IsTanitasiNap)];
|
||||
|
||||
/// <summary>
|
||||
/// Tanórai-e a nap típus?
|
||||
/// </summary>
|
||||
public bool IsTanorai => (bool)ExtendedProperties[nameof(IsTanorai)];
|
||||
|
||||
/// <summary>
|
||||
/// Tanórán kívüli-e a nap típus?
|
||||
/// </summary>
|
||||
public bool IsTanoranKivuli => (bool)ExtendedProperties[nameof(IsTanoranKivuli)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class OktNevelesiKategoriaDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public OktNevelesiKategoriaDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Az oktatás nevelési kategória feladat csoport tanuló osztály kapcsolat max száma
|
||||
/// </summary>
|
||||
public int FeladatCsoportTanuloOsztalyKapcsolatMaxSzama => (int)ExtendedProperties[nameof(FeladatCsoportTanuloOsztalyKapcsolatMaxSzama)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class OktatasiNevelesiFeladatDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public OktatasiNevelesiFeladatDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Az oktatás nevelési feladat ESL köepes átlaga
|
||||
/// </summary>
|
||||
public double EslKozepesAtlag => (double)ExtendedProperties[nameof(EslKozepesAtlag)];
|
||||
|
||||
/// <summary>
|
||||
/// Az oktatás nevelési feladat feladat kategória azonosítója
|
||||
/// </summary>
|
||||
public int FeladatKategoriaId => (int)ExtendedProperties[nameof(FeladatKategoriaId)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class OraTulajdonsagTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public OraTulajdonsagTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// BoolDefault-e az óra tulajdonság típus?
|
||||
/// </summary>
|
||||
public bool BoolDefault => (bool)ExtendedProperties[nameof(BoolDefault)];
|
||||
|
||||
/// <summary>
|
||||
/// Órarendi óra-e az óra tulajdonság típus?
|
||||
/// </summary>
|
||||
public bool IsOrarendiOra => (bool)ExtendedProperties[nameof(IsOrarendiOra)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class OrszagTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public OrszagTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Az ország típus ISO kódja
|
||||
/// </summary>
|
||||
public string IsoKod => (string)ExtendedProperties[nameof(IsoKod)];
|
||||
|
||||
/// <summary>
|
||||
/// Az ország típus kód 2
|
||||
/// </summary>
|
||||
public string Kod2 => (string)ExtendedProperties[nameof(Kod2)];
|
||||
|
||||
/// <summary>
|
||||
/// Az ország típus OECD kódja
|
||||
/// </summary>
|
||||
public int? OecdKod => (int?)ExtendedProperties[nameof(OecdKod)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SorolasOkaTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public SorolasOkaTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Bizonyítványban megjelenik-e a sorolás oka típus?
|
||||
/// </summary>
|
||||
public bool IsBizonyitvanybanMegjelenik => (bool)ExtendedProperties[nameof(IsBizonyitvanybanMegjelenik)];
|
||||
|
||||
/// <summary>
|
||||
/// Naplóban megjelenik-e a sorolás oka típus?
|
||||
/// </summary>
|
||||
public bool IsNaplobanMegjelenik => (bool)ExtendedProperties[nameof(IsNaplobanMegjelenik)];
|
||||
|
||||
/// <summary>
|
||||
/// Törzslapon megjelenik-e a sorolás oka típus?
|
||||
/// </summary>
|
||||
public bool IsTorzslaponMegjelenik => (bool)ExtendedProperties[nameof(IsTorzslaponMegjelenik)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SzakkepesitesTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public SzakkepesitesTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// A szakképesítés típus szintje
|
||||
/// </summary>
|
||||
public int? SzakkepesitesSzint => (int?)ExtendedProperties[nameof(SzakkepesitesSzint)];
|
||||
|
||||
/// <summary>
|
||||
/// A szakképesítés típus tanulmányi területe
|
||||
/// </summary>
|
||||
public int? TanulmanyiTerulet => (int?)ExtendedProperties[nameof(TanulmanyiTerulet)];
|
||||
|
||||
/// <summary>
|
||||
/// A szakképesítés típus terület sorszáma
|
||||
/// </summary>
|
||||
public int? TeruletSorszam => (int?)ExtendedProperties[nameof(TeruletSorszam)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SzakmaTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public SzakmaTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// A szakma típus ágazat azonosítója
|
||||
/// </summary>
|
||||
public int? AgazatId => (int?)ExtendedProperties[nameof(AgazatId)];
|
||||
|
||||
/// <summary>
|
||||
/// A szakma típus alapfokú oktatási időtartama
|
||||
/// </summary>
|
||||
public int? AlapfokuOktatasiIdotartam => (int?)ExtendedProperties[nameof(AlapfokuOktatasiIdotartam)];
|
||||
|
||||
/// <summary>
|
||||
/// A szakma típus digitális kompetencia keretszintje
|
||||
/// </summary>
|
||||
public int? DigitalisKompetenciaKeretszint => (int?)ExtendedProperties[nameof(DigitalisKompetenciaKeretszint)];
|
||||
|
||||
/// <summary>
|
||||
/// A szakma típus érettségi oktatási időtartama
|
||||
/// </summary>
|
||||
public int? ErettsegiOktatasiIdotartam => (int?)ExtendedProperties[nameof(ErettsegiOktatasiIdotartam)];
|
||||
|
||||
/// <summary>
|
||||
/// A szakma típus szakképesítés azonosítószáma
|
||||
/// </summary>
|
||||
public string SzakkepesitesAzonositoszam => (string)ExtendedProperties[nameof(SzakkepesitesAzonositoszam)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Caching.DictionaryItemTables
|
||||
{
|
||||
/// <summary>
|
||||
/// Kódtétel osztály.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class TavolletTipusDictionaryItem : DictionaryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem">Kódtétel elem</param>
|
||||
public TavolletTipusDictionaryItem(DictionaryItem dictionaryItem) : base(dictionaryItem)
|
||||
{
|
||||
ExtendedProperties = dictionaryItem.ExtendedProperties;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// A távollét típus SAP kódja
|
||||
/// </summary>
|
||||
public string SapKod => (string)ExtendedProperties[nameof(SapKod)];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
1255
Framework/Caching/DictionaryTableCache.cs
Normal file
1255
Framework/Caching/DictionaryTableCache.cs
Normal file
File diff suppressed because it is too large
Load diff
140
Framework/Caching/GenericCache.cs
Normal file
140
Framework/Caching/GenericCache.cs
Normal file
|
@ -0,0 +1,140 @@
|
|||
using System;
|
||||
using CacheManager.Core;
|
||||
using CacheManager.Core.Internal;
|
||||
|
||||
namespace Kreta.Framework.Caching
|
||||
{
|
||||
public abstract class GenericCache<TCacheValueType> : Cache, IDisposable
|
||||
{
|
||||
private ICacheManager<TCacheValueType> cache;
|
||||
|
||||
protected GenericCache(CacheManager cacheManager, string cacheName) : base(cacheManager)
|
||||
{
|
||||
cache = CacheFactory.FromConfiguration<TCacheValueType>(cacheName);
|
||||
|
||||
cache.OnRemoveByHandle += Cache_OnRemoveByHandle;
|
||||
}
|
||||
|
||||
protected bool Exists(string key)
|
||||
{
|
||||
return cache.Exists(key);
|
||||
}
|
||||
|
||||
protected TCacheValueType Get(string key)
|
||||
{
|
||||
return cache.Get(key);
|
||||
}
|
||||
|
||||
protected TCacheValueType GetByKeyAndRegion(string key, string region)
|
||||
{
|
||||
return cache.Get(key, region);
|
||||
}
|
||||
|
||||
protected TCacheValueType GetOrAdd(string key, Func<string, TCacheValueType> valueFactory)
|
||||
{
|
||||
return cache.GetOrAdd(key, valueFactory);
|
||||
}
|
||||
|
||||
protected bool Add(string key, string region, TCacheValueType value)
|
||||
{
|
||||
return cache.Add(key, value, region);
|
||||
}
|
||||
|
||||
protected TCacheValueType GetOrAddWithRegion(string key, string region, Func<string, string, TCacheValueType> valueFactory)
|
||||
{
|
||||
return cache.GetOrAdd(key, region, valueFactory);
|
||||
}
|
||||
|
||||
protected TCacheValueType AddOrUpdate(string key, TCacheValueType addValue, Func<TCacheValueType, TCacheValueType> updateValueFactory)
|
||||
{
|
||||
return cache.AddOrUpdate(key, addValue, updateValueFactory);
|
||||
}
|
||||
|
||||
protected TCacheValueType AddOrUpdateWithRegion(string key, string region, TCacheValueType addValue, Func<TCacheValueType, TCacheValueType> updateValueFactory)
|
||||
{
|
||||
return cache.AddOrUpdate(key, region, addValue, updateValueFactory);
|
||||
}
|
||||
|
||||
protected void Put(string key, TCacheValueType value)
|
||||
{
|
||||
cache.Put(key, value);
|
||||
}
|
||||
|
||||
protected void PutWithRegion(string key, TCacheValueType value, string region)
|
||||
{
|
||||
cache.Put(key, value, region);
|
||||
}
|
||||
|
||||
protected void Update(string key, Func<TCacheValueType, TCacheValueType> valueFactory)
|
||||
{
|
||||
cache.Update(key, valueFactory);
|
||||
}
|
||||
|
||||
protected void Remove(string key)
|
||||
{
|
||||
cache.Remove(key);
|
||||
}
|
||||
|
||||
protected void RemoveFromRegion(string key, string region)
|
||||
{
|
||||
cache.Remove(key, region);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///Clear the cache region, removeing all items from the specific region only
|
||||
/// </summary>
|
||||
/// <param name="region"></param>
|
||||
protected void ClearRegion(string region)
|
||||
{
|
||||
cache.ClearRegion(region);
|
||||
}
|
||||
|
||||
protected void Expire(string key, ExpirationMode mode, TimeSpan timeout)
|
||||
{
|
||||
cache.Expire(key, mode, timeout);
|
||||
}
|
||||
|
||||
protected void AddWithAbsoluteExpiration(string key, TimeSpan timeSpan, TCacheValueType value)
|
||||
{
|
||||
cache.Add(new CacheItem<TCacheValueType>(key, value, ExpirationMode.Absolute, timeSpan));
|
||||
|
||||
}
|
||||
|
||||
protected virtual void Cache_OnRemoveByHandle(object sender, CacheItemRemovedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
cache.Clear();
|
||||
}
|
||||
|
||||
bool disposed;
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (!disposed && disposing)
|
||||
{
|
||||
if (cache != null)
|
||||
{
|
||||
cache.Dispose();
|
||||
cache = null;
|
||||
}
|
||||
}
|
||||
|
||||
disposed = true;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
~GenericCache()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
}
|
||||
}
|
61
Framework/Caching/LoginInfoCache.cs
Normal file
61
Framework/Caching/LoginInfoCache.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using CacheManager.Core;
|
||||
using CacheManager.Core.Internal;
|
||||
using Kreta.Framework.Security;
|
||||
|
||||
namespace Kreta.Framework.Caching
|
||||
{
|
||||
public sealed class LoginInfoCache : GenericCache<LoginInfo>
|
||||
{
|
||||
private static readonly string LoginInfoCacheKeyPrefix = $"{nameof(Kreta)}_{nameof(LoginInfoCache)}_";
|
||||
|
||||
private static string GetCacheKey(string sessionId)
|
||||
{
|
||||
return $"{LoginInfoCacheKeyPrefix}{sessionId}";
|
||||
}
|
||||
|
||||
public LoginInfoCache(CacheManager cacheManager) : base(cacheManager, nameof(LoginInfoCache))
|
||||
{
|
||||
}
|
||||
|
||||
public int SessionTimeout { get; set; }
|
||||
|
||||
public void PutLoginInfo(LoginInfo loginInfo)
|
||||
{
|
||||
Put(GetCacheKey(loginInfo.SessionID), loginInfo);
|
||||
}
|
||||
|
||||
public void UpdateLoginInfo(LoginInfo loginInfo)
|
||||
{
|
||||
Update(GetCacheKey(loginInfo.SessionID), _ => loginInfo);
|
||||
}
|
||||
|
||||
public void RemoveLoginInfo(string sessionId)
|
||||
{
|
||||
Remove(GetCacheKey(sessionId));
|
||||
}
|
||||
|
||||
protected override void Cache_OnRemoveByHandle(object sender, CacheItemRemovedEventArgs e)
|
||||
{
|
||||
if (e.Key.StartsWith(LoginInfoCacheKeyPrefix, StringComparison.Ordinal) && e.Reason == CacheItemRemovedReason.Expired)
|
||||
{
|
||||
SDAServer.Instance.SessionManager.DeleteSession((LoginInfo)e.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public LoginInfo GetLoginInfo(string sessionId)
|
||||
{
|
||||
return Get(GetCacheKey(sessionId));
|
||||
}
|
||||
|
||||
public bool IsExistsLoginInfo(string sessionId)
|
||||
{
|
||||
return Exists(GetCacheKey(sessionId));
|
||||
}
|
||||
|
||||
public void Ping(string sessionId)
|
||||
{
|
||||
Expire(GetCacheKey(sessionId), ExpirationMode.Sliding, new TimeSpan(0, SessionTimeout, 0));
|
||||
}
|
||||
}
|
||||
}
|
26
Framework/Caching/ManualEnumCache.cs
Normal file
26
Framework/Caching/ManualEnumCache.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Framework.Caching
|
||||
{
|
||||
internal sealed class ManualEnumCache : Cache
|
||||
{
|
||||
private ConcurrentDictionary<string, Dictionary<string, string>> cache;
|
||||
|
||||
public ManualEnumCache(CacheManager cacheManager) : base(cacheManager)
|
||||
{
|
||||
cache = new ConcurrentDictionary<string, Dictionary<string, string>>();
|
||||
}
|
||||
|
||||
public Dictionary<string, string> GetOrAdd(string key, Func<string, Dictionary<string, string>> valueFactory)
|
||||
{
|
||||
return cache.GetOrAdd(key, valueFactory);
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
cache.Clear();
|
||||
}
|
||||
}
|
||||
}
|
80
Framework/Caching/StringResourcesCache.cs
Normal file
80
Framework/Caching/StringResourcesCache.cs
Normal file
|
@ -0,0 +1,80 @@
|
|||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.IO;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Kreta.Framework.Caching
|
||||
{
|
||||
public sealed class StringResourcesCache : Cache
|
||||
{
|
||||
private const int DefaultLcid = 1038; // magyar
|
||||
private const string StringResourcesFileName = "StringResources.kres";
|
||||
|
||||
private ConcurrentDictionary<string, string> cache;
|
||||
|
||||
public StringResourcesCache(CacheManager cacheManager) : base(cacheManager)
|
||||
{
|
||||
cache = new ConcurrentDictionary<string, string>();
|
||||
LoadCache();
|
||||
}
|
||||
|
||||
private string GetStringResourcesKey(int id, int lcid)
|
||||
{
|
||||
return $"{id}¤{lcid}";
|
||||
}
|
||||
|
||||
private void LoadCache()
|
||||
{
|
||||
string[] stringResourcesFilePath = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, StringResourcesFileName, SearchOption.AllDirectories);
|
||||
if (stringResourcesFilePath.Length == 0)
|
||||
{
|
||||
throw new Exception($"Not found {StringResourcesFileName} file!");
|
||||
}
|
||||
|
||||
var root = XElement.Load(stringResourcesFilePath[0]);
|
||||
|
||||
foreach (XElement text in root.Elements())
|
||||
{
|
||||
foreach (XElement language in text.Elements())
|
||||
{
|
||||
string stringResourcesKey = GetStringResourcesKey(Convert.ToInt32(text.Attribute("ID").Value), Convert.ToInt32(language.Attribute("LCID").Value));
|
||||
string value = language.Value.Replace("\n", "<br/>");
|
||||
|
||||
cache.AddOrUpdate(stringResourcesKey, key => value, (k, v) => value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetDefaultText(int id, int lcid)
|
||||
{
|
||||
return $"Nincs fordítása -> ID:{id} - LCID:{lcid}!";
|
||||
}
|
||||
|
||||
public string Get(int id, int lcid)
|
||||
{
|
||||
return Get(id, lcid, GetDefaultText(id, lcid));
|
||||
}
|
||||
|
||||
public string Get(int id, int lcid, string defaultText)
|
||||
{
|
||||
var result = cache.GetOrAdd(GetStringResourcesKey(id, lcid), key => GetDefaultText(id, lcid));
|
||||
|
||||
if (result == null && lcid != DefaultLcid)
|
||||
{
|
||||
result = cache.GetOrAdd(GetStringResourcesKey(id, DefaultLcid), key => GetDefaultText(id, DefaultLcid));
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
result = defaultText;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
cache.Clear();
|
||||
}
|
||||
}
|
||||
}
|
82
Framework/Collections/Generic/AssociatedEntityCollection.cs
Normal file
82
Framework/Collections/Generic/AssociatedEntityCollection.cs
Normal file
|
@ -0,0 +1,82 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Collections.Generic
|
||||
{
|
||||
public class AssociatedEntityCollection<OwnerEntityType, CollectionEntityType> : EntityCollection<CollectionEntityType>, IAssociatedEntityCollection<CollectionEntityType>, IAssociatedEntityCollection
|
||||
where OwnerEntityType : Kreta.Framework.Entities.Entity
|
||||
where CollectionEntityType : Kreta.Framework.Entities.Entity
|
||||
{
|
||||
private IEntityCollectionDA<CollectionEntityType> m_DA = null;
|
||||
|
||||
public AssociatedEntityCollection(IEntityCollectionDA<CollectionEntityType> collectionDA)
|
||||
{
|
||||
m_DA = collectionDA;
|
||||
}
|
||||
|
||||
protected override void DoAdd(CollectionEntityType entity)
|
||||
{
|
||||
m_DA.AddItem(entity);
|
||||
base.DoAdd(entity);
|
||||
}
|
||||
|
||||
protected override void DoRemove(CollectionEntityType entity)
|
||||
{
|
||||
m_DA.DeleteItem(entity);
|
||||
base.DoRemove(entity);
|
||||
}
|
||||
|
||||
protected override void DoClear()
|
||||
{
|
||||
throw new NotSupportedException("AssociatedEntityCollection<OwnerEntityType, CollectionEntityType>.DoClear()");
|
||||
}
|
||||
|
||||
public void Remove(CollectionEntityType entity)
|
||||
{
|
||||
DoRemove(entity);
|
||||
}
|
||||
|
||||
public void Delete(CollectionEntityType entity)
|
||||
{
|
||||
DoRemove(entity);
|
||||
}
|
||||
|
||||
public void RemoveAll()
|
||||
{
|
||||
CollectionEntityType[] tmp = new CollectionEntityType[m_Entities.Count];
|
||||
m_Entities.CopyTo(tmp);
|
||||
foreach (CollectionEntityType entity in tmp)
|
||||
{
|
||||
DoRemove(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public void Load()
|
||||
{
|
||||
m_DA.LoadCollection(this);
|
||||
}
|
||||
|
||||
#region IAssociatedEntityCollection Members
|
||||
|
||||
void IAssociatedEntityCollection.Remove(Kreta.Framework.Entities.Entity entity)
|
||||
{
|
||||
Remove((CollectionEntityType)entity);
|
||||
}
|
||||
|
||||
void IAssociatedEntityCollection.Delete(Kreta.Framework.Entities.Entity entity)
|
||||
{
|
||||
Delete((CollectionEntityType)entity);
|
||||
}
|
||||
|
||||
void IAssociatedEntityCollection.RemoveAll()
|
||||
{
|
||||
RemoveAll();
|
||||
}
|
||||
|
||||
void IAssociatedEntityCollection.Load()
|
||||
{
|
||||
Load();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
400
Framework/Collections/Generic/EntityCollection.cs
Normal file
400
Framework/Collections/Generic/EntityCollection.cs
Normal file
|
@ -0,0 +1,400 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Kreta.Framework.Collections.Generic
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitás lista felülete.
|
||||
/// </summary>
|
||||
public class EntityCollection<EntityType> : IEntityCollection<EntityType>, IEntityCollection, IList
|
||||
where EntityType : Kreta.Framework.Entities.Entity
|
||||
{
|
||||
protected List<EntityType> m_Entities = new List<EntityType>();
|
||||
|
||||
public EntityCollection()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Külön bejárat a DA számára
|
||||
/// </summary>
|
||||
/// <param name="entity">Entitás példány</param>
|
||||
protected internal void InternalAdd(EntityType entity)
|
||||
{
|
||||
m_Entities.Add(entity);
|
||||
}
|
||||
|
||||
#region Internal operations
|
||||
protected virtual void DoRemove(EntityType entity)
|
||||
{
|
||||
if (entity.ID == -1)
|
||||
{
|
||||
m_Entities.Remove(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Entities.RemoveAll(e => e.ID == entity.ID);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void DoAdd(EntityType entity)
|
||||
{
|
||||
if (!Contains(entity))
|
||||
{
|
||||
m_Entities.Add(entity);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void DoClear()
|
||||
{
|
||||
m_Entities.Clear();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region IList<EntityType> Members
|
||||
|
||||
int IList<EntityType>.IndexOf(EntityType item)
|
||||
{
|
||||
return IndexOf(item);
|
||||
}
|
||||
|
||||
void IList<EntityType>.Insert(int index, EntityType item)
|
||||
{
|
||||
throw new NotSupportedException("IList<EntityType>.Insert");
|
||||
}
|
||||
|
||||
void IList<EntityType>.RemoveAt(int index)
|
||||
{
|
||||
DoRemove(m_Entities[index]);
|
||||
}
|
||||
|
||||
EntityType IList<EntityType>.this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Entities[index];
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new NotSupportedException("EntityType IList<EntityType>.this[int index] setter");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICollection<EntityType> Members
|
||||
|
||||
void ICollection<EntityType>.Add(EntityType item)
|
||||
{
|
||||
DoAdd(item);
|
||||
}
|
||||
|
||||
void ICollection<EntityType>.Clear()
|
||||
{
|
||||
DoClear();
|
||||
}
|
||||
|
||||
bool ICollection<EntityType>.Contains(EntityType item)
|
||||
{
|
||||
return Contains(item);
|
||||
}
|
||||
|
||||
void ICollection<EntityType>.CopyTo(EntityType[] array, int arrayIndex)
|
||||
{
|
||||
m_Entities.CopyTo(array, arrayIndex);
|
||||
}
|
||||
|
||||
int ICollection<EntityType>.Count
|
||||
{
|
||||
get { return m_Entities.Count; }
|
||||
}
|
||||
|
||||
bool ICollection<EntityType>.IsReadOnly
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
bool ICollection<EntityType>.Remove(EntityType item)
|
||||
{
|
||||
if (Contains(item))
|
||||
{
|
||||
DoRemove(item);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEnumerable<EntityType> Members
|
||||
|
||||
IEnumerator<EntityType> IEnumerable<EntityType>.GetEnumerator()
|
||||
{
|
||||
return m_Entities.GetEnumerator();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEnumerable Members
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return m_Entities.GetEnumerator();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IList Members
|
||||
|
||||
int IList.Add(object value)
|
||||
{
|
||||
DoAdd((EntityType)value);
|
||||
return IndexOf((EntityType)value);
|
||||
}
|
||||
|
||||
void IList.Clear()
|
||||
{
|
||||
DoClear();
|
||||
}
|
||||
|
||||
bool IList.Contains(object value)
|
||||
{
|
||||
return Contains((EntityType)value);
|
||||
}
|
||||
|
||||
int IList.IndexOf(object value)
|
||||
{
|
||||
return IndexOf((EntityType)value);
|
||||
}
|
||||
|
||||
void IList.Insert(int index, object value)
|
||||
{
|
||||
throw new NotSupportedException("void IList.Insert(int index, object value)");
|
||||
}
|
||||
|
||||
bool IList.IsFixedSize
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
bool IList.IsReadOnly
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
void IList.Remove(object value)
|
||||
{
|
||||
DoRemove((EntityType)value);
|
||||
}
|
||||
|
||||
void IList.RemoveAt(int index)
|
||||
{
|
||||
DoRemove(m_Entities[index]);
|
||||
}
|
||||
|
||||
object IList.this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Entities[index];
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new NotSupportedException("object IList.this[int index] setter");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICollection Members
|
||||
|
||||
void ICollection.CopyTo(Array array, int index)
|
||||
{
|
||||
((ICollection)m_Entities).CopyTo(array, index);
|
||||
}
|
||||
|
||||
int ICollection.Count
|
||||
{
|
||||
get { return m_Entities.Count; }
|
||||
}
|
||||
|
||||
bool ICollection.IsSynchronized
|
||||
{
|
||||
get { return ((ICollection)m_Entities).IsSynchronized; }
|
||||
}
|
||||
|
||||
object ICollection.SyncRoot
|
||||
{
|
||||
get { return ((ICollection)m_Entities).SyncRoot; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEntityCollection<EntityType> Members
|
||||
public int Count
|
||||
{
|
||||
get { return m_Entities.Count; }
|
||||
}
|
||||
|
||||
public EntityType this[int index] => m_Entities[index];
|
||||
|
||||
public int Add(EntityType entity)
|
||||
{
|
||||
DoAdd(entity);
|
||||
return IndexOf(entity);
|
||||
}
|
||||
|
||||
public bool Contains(EntityType entity)
|
||||
{
|
||||
if (entity.ID == -1)
|
||||
{
|
||||
return m_Entities.Contains(entity);
|
||||
}
|
||||
|
||||
return m_Entities.Any(e => e.ID == entity.ID);
|
||||
}
|
||||
|
||||
public void DeleteAll(bool logikai = true)
|
||||
{
|
||||
foreach (EntityType entity in m_Entities)
|
||||
{
|
||||
entity.Delete(false, logikai);
|
||||
}
|
||||
|
||||
m_Entities.Clear();
|
||||
}
|
||||
|
||||
public void DeleteMany(IList<int> ids, bool logikai = true)
|
||||
{
|
||||
foreach (EntityType entity in m_Entities)
|
||||
{
|
||||
if (!ids.Contains(entity.ID))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
entity.Delete(false, logikai);
|
||||
}
|
||||
m_Entities.Clear();
|
||||
}
|
||||
|
||||
public void DeleteAll(bool runHandler, bool logikai = true)
|
||||
{
|
||||
foreach (EntityType entity in m_Entities)
|
||||
{
|
||||
entity.Delete(runHandler, logikai);
|
||||
}
|
||||
|
||||
m_Entities.Clear();
|
||||
}
|
||||
|
||||
public void CascadeDeleteAll(bool logikai = true)
|
||||
{
|
||||
foreach (EntityType entity in m_Entities)
|
||||
{
|
||||
entity.CascadeDelete(logikai);
|
||||
}
|
||||
|
||||
m_Entities.Clear();
|
||||
}
|
||||
|
||||
public void CascadeDeleteAll(bool runHandler, bool logikai = true)
|
||||
{
|
||||
foreach (EntityType entity in m_Entities)
|
||||
{
|
||||
entity.CascadeDelete(runHandler, logikai);
|
||||
}
|
||||
|
||||
m_Entities.Clear();
|
||||
}
|
||||
|
||||
public EntityType FindEntityById(int entityId)
|
||||
{
|
||||
foreach (EntityType entity in m_Entities)
|
||||
{
|
||||
if (entity.ID == entityId)
|
||||
{
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
DoClear();
|
||||
}
|
||||
|
||||
public int IndexOf(EntityType entity)
|
||||
{
|
||||
if (entity.ID == -1)
|
||||
{
|
||||
return m_Entities.IndexOf(entity);
|
||||
}
|
||||
|
||||
var found = m_Entities.Find(e => e.ID == entity.ID);
|
||||
return found == null ? -1 : m_Entities.IndexOf(found);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region IEntityCollection Members
|
||||
|
||||
int IEntityCollection.Count
|
||||
{
|
||||
get { return Count; }
|
||||
}
|
||||
|
||||
Kreta.Framework.Entities.Entity IEntityCollection.this[int index]
|
||||
{
|
||||
get { return this[index]; }
|
||||
}
|
||||
|
||||
int IEntityCollection.Add(Kreta.Framework.Entities.Entity entity) => Add((EntityType)entity);
|
||||
|
||||
bool IEntityCollection.Contains(Kreta.Framework.Entities.Entity entity)
|
||||
{
|
||||
return Contains((EntityType)entity);
|
||||
}
|
||||
|
||||
void IEntityCollection.DeleteAll()
|
||||
{
|
||||
DeleteAll();
|
||||
}
|
||||
|
||||
void IEntityCollection.DeleteAll(bool runHandler)
|
||||
{
|
||||
DeleteAll(runHandler);
|
||||
}
|
||||
|
||||
void IEntityCollection.CascadeDeleteAll()
|
||||
{
|
||||
CascadeDeleteAll();
|
||||
}
|
||||
|
||||
void IEntityCollection.CascadeDeleteAll(bool runHandler)
|
||||
{
|
||||
CascadeDeleteAll(runHandler);
|
||||
}
|
||||
|
||||
Kreta.Framework.Entities.Entity IEntityCollection.FindEntityById(int entityId)
|
||||
{
|
||||
return FindEntityById(entityId);
|
||||
}
|
||||
|
||||
void IEntityCollection.Clear()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
int IEntityCollection.IndexOf(Kreta.Framework.Entities.Entity entity)
|
||||
{
|
||||
return IndexOf((EntityType)entity);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
32
Framework/Collections/Generic/EntityCollectionDA.cs
Normal file
32
Framework/Collections/Generic/EntityCollectionDA.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
namespace Kreta.Framework.Collections.Generic
|
||||
{
|
||||
public abstract class EntityCollectionDA<OwnerEntityType, CollectionEntityType> : IEntityCollectionDA<CollectionEntityType>
|
||||
where OwnerEntityType : Kreta.Framework.Entities.Entity
|
||||
where CollectionEntityType : Kreta.Framework.Entities.Entity
|
||||
{
|
||||
private OwnerEntityType m_Owner = null;
|
||||
|
||||
protected internal EntityCollectionDA(OwnerEntityType owner)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
private EntityCollectionDA()
|
||||
{
|
||||
}
|
||||
|
||||
protected OwnerEntityType Owner
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Owner;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void LoadCollection(IAssociatedEntityCollection<CollectionEntityType> collection);
|
||||
|
||||
public abstract void AddItem(CollectionEntityType entity);
|
||||
|
||||
public abstract void DeleteItem(CollectionEntityType entity);
|
||||
}
|
||||
}
|
12
Framework/Collections/Generic/IAssociatedEntityCollection.cs
Normal file
12
Framework/Collections/Generic/IAssociatedEntityCollection.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
namespace Kreta.Framework.Collections.Generic
|
||||
{
|
||||
public interface IAssociatedEntityCollection<EntityType> : IEntityCollection<EntityType>
|
||||
where EntityType : Kreta.Framework.Entities.Entity
|
||||
{
|
||||
void Delete(EntityType entity);
|
||||
|
||||
void RemoveAll();
|
||||
|
||||
void Load();
|
||||
}
|
||||
}
|
21
Framework/Collections/Generic/IEntityCollection.cs
Normal file
21
Framework/Collections/Generic/IEntityCollection.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Framework.Collections.Generic
|
||||
{
|
||||
public interface IEntityCollection<EntityType> : IList<EntityType>
|
||||
where EntityType : Kreta.Framework.Entities.Entity
|
||||
{
|
||||
void DeleteAll(bool logikai = true);
|
||||
|
||||
void DeleteAll(bool runHandler, bool logikai = true);
|
||||
|
||||
void DeleteMany(IList<int> ids, bool logikai = true);
|
||||
|
||||
void CascadeDeleteAll(bool logikai = true);
|
||||
|
||||
void CascadeDeleteAll(bool runHandler, bool logikai = true);
|
||||
|
||||
EntityType FindEntityById(int entityId);
|
||||
|
||||
}
|
||||
}
|
12
Framework/Collections/Generic/IEntityCollectionDA.cs
Normal file
12
Framework/Collections/Generic/IEntityCollectionDA.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
namespace Kreta.Framework.Collections.Generic
|
||||
{
|
||||
public interface IEntityCollectionDA<CollectionEntityType>
|
||||
where CollectionEntityType : Kreta.Framework.Entities.Entity
|
||||
{
|
||||
void LoadCollection(IAssociatedEntityCollection<CollectionEntityType> collection);
|
||||
|
||||
void AddItem(CollectionEntityType entity);
|
||||
|
||||
void DeleteItem(CollectionEntityType entity);
|
||||
}
|
||||
}
|
16
Framework/Collections/IAssociatedEntityCollection.cs
Normal file
16
Framework/Collections/IAssociatedEntityCollection.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System.Collections;
|
||||
using Kreta.Framework.Entities;
|
||||
|
||||
namespace Kreta.Framework.Collections
|
||||
{
|
||||
public interface IAssociatedEntityCollection : IEntityCollection, IEnumerable
|
||||
{
|
||||
void Remove(Entity entity);
|
||||
|
||||
void Delete(Entity entity);
|
||||
|
||||
void RemoveAll();
|
||||
|
||||
void Load();
|
||||
}
|
||||
}
|
36
Framework/Collections/IEntityCollection.cs
Normal file
36
Framework/Collections/IEntityCollection.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System.Collections;
|
||||
using Kreta.Framework.Entities;
|
||||
|
||||
namespace Kreta.Framework.Collections
|
||||
{
|
||||
public interface IEntityCollection : IEnumerable
|
||||
{
|
||||
int Count
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
Entity this[int index]
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
int Add(Entity entity);
|
||||
|
||||
bool Contains(Entity entity);
|
||||
|
||||
void DeleteAll();
|
||||
|
||||
void DeleteAll(bool runHandler);
|
||||
|
||||
void CascadeDeleteAll();
|
||||
|
||||
void CascadeDeleteAll(bool runHandler);
|
||||
|
||||
Entity FindEntityById(int entityId);
|
||||
|
||||
void Clear();
|
||||
|
||||
int IndexOf(Entity entity);
|
||||
}
|
||||
}
|
19
Framework/Entities/Associations/AssociationAttribute.cs
Normal file
19
Framework/Entities/Associations/AssociationAttribute.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Entities.Associations
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
|
||||
public class AssociationAttribute : Attribute
|
||||
{
|
||||
public string AssociationName
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public AssociationAttribute(string associationName)
|
||||
{
|
||||
AssociationName = associationName;
|
||||
}
|
||||
}
|
||||
}
|
32
Framework/Entities/Associations/AssociationHandler.cs
Normal file
32
Framework/Entities/Associations/AssociationHandler.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
namespace Kreta.Framework.Entities.Associations
|
||||
{
|
||||
public class AssociationHandler<LeftEntity, RightEntity>
|
||||
where LeftEntity : Entity
|
||||
where RightEntity : Entity
|
||||
{
|
||||
internal protected AssociationHandler()
|
||||
{
|
||||
//for internal constructs only
|
||||
}
|
||||
|
||||
public virtual void BeforeInsert(LeftEntity leftEntity, RightEntity rightEntity)
|
||||
{
|
||||
//dummy handler
|
||||
}
|
||||
|
||||
public virtual void AfterInsert(LeftEntity leftEntity, RightEntity rightEntity)
|
||||
{
|
||||
//dummy handler
|
||||
}
|
||||
|
||||
public virtual void BeforeDelete(LeftEntity leftEntity, RightEntity rightEntity)
|
||||
{
|
||||
//dummy handler
|
||||
}
|
||||
|
||||
public virtual void AfterDelete(LeftEntity leftEntity, RightEntity rightEntity)
|
||||
{
|
||||
//dummy handler
|
||||
}
|
||||
}
|
||||
}
|
43
Framework/Entities/Associations/AssociationHandlerManager.cs
Normal file
43
Framework/Entities/Associations/AssociationHandlerManager.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Kreta.Framework.Entities.Associations
|
||||
{
|
||||
public static class AssociationHandlerManager
|
||||
{
|
||||
private static Dictionary<string, Type> associationHandlers = null;
|
||||
|
||||
private static void Initialize()
|
||||
{
|
||||
if (associationHandlers == null)
|
||||
{
|
||||
associationHandlers = new Dictionary<string, Type>();
|
||||
var handlers = from assembly in AppDomain.CurrentDomain.GetAssemblies()
|
||||
where SDAServer.Instance.IsAssemblyAllowed(assembly)
|
||||
from type in assembly.GetTypes()
|
||||
where type.IsDefined(typeof(AssociationAttribute), false)
|
||||
select new
|
||||
{
|
||||
AssociationName = ((AssociationAttribute)type.GetCustomAttributes(typeof(AssociationAttribute), false)[0]).AssociationName.ToLower(),
|
||||
HandlerType = type,
|
||||
};
|
||||
foreach (var handler in handlers)
|
||||
{
|
||||
associationHandlers.Add(handler.AssociationName, handler.HandlerType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static AssociationHandler<LeftEntity, RightEntity> Create<LeftEntity, RightEntity>(string associationName)
|
||||
where LeftEntity : Entity
|
||||
where RightEntity : Entity
|
||||
{
|
||||
Initialize();
|
||||
|
||||
return associationHandlers.TryGetValue(associationName.ToLower(), out Type type)
|
||||
? (AssociationHandler<LeftEntity, RightEntity>)Activator.CreateInstance(type, true)
|
||||
: new AssociationHandler<LeftEntity, RightEntity>();
|
||||
}
|
||||
}
|
||||
}
|
19
Framework/Entities/ColumnFilterMode.cs
Normal file
19
Framework/Entities/ColumnFilterMode.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitás betöltés oszlopszűrés módja
|
||||
/// </summary>
|
||||
public enum ColumnFilterMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Alapértelmezetten minden oszlop engedélyezett
|
||||
/// </summary>
|
||||
DEFAULT_ALLOWED,
|
||||
|
||||
/// <summary>
|
||||
/// Alapértelmezetten minden ozslop tiltott,
|
||||
/// kivéve: ID, SERIAL, LASTCHANGED, CREATED, MODIFIER, CREATOR, és a kapcsoló mezők
|
||||
/// </summary>
|
||||
DEFAULT_DENIED,
|
||||
}
|
||||
}
|
468
Framework/Entities/DAUtil.cs
Normal file
468
Framework/Entities/DAUtil.cs
Normal file
|
@ -0,0 +1,468 @@
|
|||
using System;
|
||||
using SDA.DataProvider;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// A generált DataAccessor-ok által használt statikus segédosztály,
|
||||
/// a generált kód mennyiségének csökkentésére. Az osztály kézzel írt kód számára tabu.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Az osztály metódusai teljesítménykritikusak, ezért paraméterellenőrzés nem történik bennük,
|
||||
/// megbízunk a hívóban.
|
||||
/// </remarks>
|
||||
public sealed class DAUtil
|
||||
{
|
||||
// <<Facade>>
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
/// <remarks>Az osztály statikus, példányosítását nem szándékozzuk.</remarks>
|
||||
private DAUtil()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Létrehoz egy új SDA.DataProvider.SDACommand parancsobjektumot,
|
||||
/// és inicializálja a Commandtext, Connection, Transaction tulajdonságait.
|
||||
/// </summary>
|
||||
/// <param name="commandText">A parancsobjektum sql szövege</param>
|
||||
/// <returns>A létrehozott <see cref="SDA.DataProvider.SDACommand"/> parancsobjektum</returns>
|
||||
public static SDACommand CreateCommand(string commandText)
|
||||
{
|
||||
SDACommand result = new SDACommand
|
||||
{
|
||||
CommandText = commandText,
|
||||
Connection = UserContext.Instance.SDAConnection,
|
||||
Transaction = UserContext.Instance.SDATransaction
|
||||
};
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás felvétele után utólag lekérdezi az entitás ID-ját.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int? GetEntityID(SDAConnection connection, SDATransaction transaction)
|
||||
{
|
||||
using (SDACommand command = new SDACommand())
|
||||
{
|
||||
command.Connection = connection;
|
||||
command.Transaction = transaction;
|
||||
command.CommandText = "SELECT @@IDENTITY as ID";
|
||||
|
||||
var id = command.ExecuteScalar();
|
||||
|
||||
return id != DBNull.Value ? Convert.ToInt32(id) : (int?)null;
|
||||
}
|
||||
}
|
||||
|
||||
#region BindParameter
|
||||
|
||||
/// <summary>
|
||||
/// Hozzáad a parancsobjektumhoz egy új paramétert.
|
||||
/// </summary>
|
||||
/// <param name="command">A tulajdonos <see cref="SDA.DataProvider.SDACommand"/> objektum</param>
|
||||
/// <param name="parameterName">A paraméter neve</param>
|
||||
/// <param name="type">A paraméter típusa</param>
|
||||
/// <param name="length">A paraméter hossza</param>
|
||||
/// <param name="value">A paraméter értéke</param>
|
||||
/// <param name="isNull">A paraméter null-e vagy sem</param>
|
||||
public static void BindParameter(SDA.DataProvider.SDACommand command, string parameterName, SDA.DataProvider.SDADBType type, int length, object value, bool isNull)
|
||||
{
|
||||
if (isNull || value == null)
|
||||
{
|
||||
command.Parameters.Add(parameterName, type, length).Value = DBNull.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
command.Parameters.Add(parameterName, type, length).Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hozzáad a parancsobjektumhoz egy új paramétert.
|
||||
/// </summary>
|
||||
/// <param name="command">A tulajdonos <see cref="SDA.DataProvider.SDACommand"/> objektum</param>
|
||||
/// <param name="parameterName">A paraméter neve</param>
|
||||
/// <param name="type">A paraméter típusa</param>
|
||||
/// <param name="value">A paraméter értéke</param>
|
||||
/// <param name="isNull">A paraméter null-e vagy sem</param>
|
||||
public static void BindParameter(SDA.DataProvider.SDACommand command, string parameterName, SDA.DataProvider.SDADBType type, object value, bool isNull)
|
||||
{
|
||||
if (isNull || value == null)
|
||||
{
|
||||
command.Parameters.Add(parameterName, type).Value = DBNull.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
command.Parameters.Add(parameterName, type).Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hozzáad a parancsobjektumhoz egy új paramétert.
|
||||
/// </summary>
|
||||
/// <param name="command">A tulajdonos <see cref="SDA.DataProvider.SDACommand"/> objektum</param>
|
||||
/// <param name="parameterName">A paraméter neve</param>
|
||||
/// <param name="value">A paraméter értéke</param>
|
||||
public static void BindIdParameter(SDA.DataProvider.SDACommand command, string parameterName, int value)
|
||||
{
|
||||
if (value == -1)
|
||||
{
|
||||
command.Parameters.Add(parameterName, SDA.DataProvider.SDADBType.Int).Value = DBNull.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
command.Parameters.Add(parameterName, SDA.DataProvider.SDADBType.Int).Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ReadAttribute
|
||||
|
||||
/// <summary>
|
||||
/// Bináris típusú attribútum értékét olvassa be.
|
||||
/// </summary>
|
||||
/// <param name="reader">A forrás <see cref="SDA.DataProvider.SDADataReader"/> objektum</param>
|
||||
/// <param name="index">Az attribútum indexe</param>
|
||||
/// <param name="defaultValue">Alapértelmezett érték null olvasása esetén</param>
|
||||
/// <returns>True, ha nem null lett olvasva; egyébként false</returns>
|
||||
public static bool ReadBinaryAttribute(SDA.DataProvider.SDADataReader reader, int index, ref byte[] target, ref bool isNull, byte[] defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
isNull = true;
|
||||
target = defaultValue;
|
||||
return false;
|
||||
}
|
||||
|
||||
isNull = false;
|
||||
target = (byte[])reader.GetValue(index);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static byte[] ReadBinaryAttribute(SDA.DataProvider.SDADataReader reader, int index, byte[] defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return (byte[])reader.GetValue(index);
|
||||
}
|
||||
|
||||
public static byte[] ReadBinaryAttribute(SDA.DataProvider.SDADataReader reader, int index)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return (byte[])reader.GetValue(index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logikai típusú attribútum értékét olvassa be.
|
||||
/// </summary>
|
||||
/// <param name="reader">A forrás <see cref="SDA.DataProvider.SDADataReader"/> objektum</param>
|
||||
/// <param name="index">Az attribútum indexe</param>
|
||||
/// <param name="defaultValue">Alapértelmezett érték null olvasása esetén</param>
|
||||
/// <returns>True, ha nem null lett olvasva; egyébként false</returns>
|
||||
public static bool ReadBooleanAttribute(SDA.DataProvider.SDADataReader reader, int index, ref bool target, ref bool isNull, bool defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
isNull = true;
|
||||
target = defaultValue;
|
||||
return false;
|
||||
}
|
||||
|
||||
isNull = false;
|
||||
char tmp = reader.GetString(index)[0];
|
||||
target = (tmp == 'T' || tmp == 'I');
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool ReadBooleanAttribute(SDA.DataProvider.SDADataReader reader, int index, bool defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
char tmp = reader.GetString(index)[0];
|
||||
return (tmp == 'T' || tmp == 'I');
|
||||
}
|
||||
|
||||
public static bool? ReadBooleanAttribute(SDA.DataProvider.SDADataReader reader, int index)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
char tmp = reader.GetString(index)[0];
|
||||
return (tmp == 'T' || tmp == 'I');
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dátum típusú attribútum értékét olvassa be.
|
||||
/// </summary>
|
||||
/// <param name="reader">A forrás <see cref="SDA.DataProvider.SDADataReader"/> objektum</param>
|
||||
/// <param name="index">Az attribútum indexe</param>
|
||||
/// <param name="defaultValue">Alapértelmezett érték null olvasása esetén</param>
|
||||
/// <returns>True, ha nem null lett olvasva; egyébként false</returns>
|
||||
public static bool ReadDateTimeAttribute(SDA.DataProvider.SDADataReader reader, int index, ref DateTime target, ref bool isNull, DateTime defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
isNull = true;
|
||||
target = defaultValue;
|
||||
return false;
|
||||
}
|
||||
|
||||
isNull = false;
|
||||
target = reader.GetDateTime(index);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static DateTime ReadDateTimeAttribute(SDA.DataProvider.SDADataReader reader, int index, DateTime defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return reader.GetDateTime(index);
|
||||
}
|
||||
|
||||
public static DateTime? ReadDateTimeAttribute(SDA.DataProvider.SDADataReader reader, int index)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return reader.GetDateTime(index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lebegőpontos típusú attribútum értékét olvassa be.
|
||||
/// </summary>
|
||||
/// <param name="reader">A forrás <see cref="SDA.DataProvider.SDADataReader"/> objektum</param>
|
||||
/// <param name="index">Az attribútum indexe</param>
|
||||
/// <param name="defaultValue">Alapértelmezett érték null olvasása esetén</param>
|
||||
/// <returns>True, ha nem null lett olvasva; egyébként false</returns>
|
||||
public static bool ReadDoubleAttribute(SDA.DataProvider.SDADataReader reader, int index, ref double target, ref bool isNull, double defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
isNull = true;
|
||||
target = defaultValue;
|
||||
return false;
|
||||
}
|
||||
|
||||
isNull = false;
|
||||
target = Convert.ToDouble(reader.GetValue(index));
|
||||
return true;
|
||||
}
|
||||
|
||||
public static double ReadDoubleAttribute(SDA.DataProvider.SDADataReader reader, int index, double defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return Convert.ToDouble(reader.GetValue(index));
|
||||
}
|
||||
|
||||
public static double? ReadDoubleAttribute(SDA.DataProvider.SDADataReader reader, int index)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return Convert.ToDouble(reader.GetValue(index));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ID típusú attribútum értékét olvassa be.
|
||||
/// </summary>
|
||||
/// <param name="reader">A forrás <see cref="SDA.DataProvider.SDADataReader"/> objektum</param>
|
||||
/// <param name="index">Az attribútum indexe</param>
|
||||
/// <param name="target">A cél</param>
|
||||
/// <param name="defaultValue">Alapértelmezett érték null olvasása esetén</param>
|
||||
/// <returns>True, ha nem null lett olvasva; egyébként false</returns>
|
||||
public static bool ReadIDAttribute(SDA.DataProvider.SDADataReader reader, int index, ref int target, int defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
target = defaultValue;
|
||||
return false;
|
||||
}
|
||||
|
||||
target = Convert.ToInt32(reader.GetValue(index));
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Egész típusú attribútum értékét olvassa be.
|
||||
/// </summary>
|
||||
/// <param name="reader">A forrás <see cref="SDA.DataProvider.SDADataReader"/> objektum</param>
|
||||
/// <param name="index">Az attribútum indexe</param>
|
||||
/// <param name="defaultValue">Alapértelmezett érték null olvasása esetén</param>
|
||||
/// <returns>True, ha nem null lett olvasva; egyébként false</returns>
|
||||
public static bool ReadIntegerAttribute(SDA.DataProvider.SDADataReader reader, int index, ref int target, ref bool isNull, int defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
isNull = true;
|
||||
target = defaultValue;
|
||||
return false;
|
||||
}
|
||||
|
||||
isNull = false;
|
||||
target = Convert.ToInt32(reader.GetValue(index));
|
||||
return true;
|
||||
}
|
||||
|
||||
public static int ReadIntegerAttribute(SDA.DataProvider.SDADataReader reader, int index, int defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return Convert.ToInt32(reader.GetValue(index));
|
||||
}
|
||||
|
||||
public static int? ReadIntegerAttribute(SDA.DataProvider.SDADataReader reader, int index)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return Convert.ToInt32(reader.GetValue(index));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Karakterlánc típusú attribútum értékét olvassa be.
|
||||
/// </summary>
|
||||
/// <param name="reader">A forrás <see cref="SDA.DataProvider.SDADataReader"/> objektum</param>
|
||||
/// <param name="index">Az attribútum indexe</param>
|
||||
/// <param name="target">A cél</param>
|
||||
/// <param name="isNull">Null-t olvasott vagy nem null-t</param>
|
||||
/// <param name="defaultValue">Alapértelmezett érték null olvasása esetén</param>
|
||||
/// <returns>True, ha nem null lett olvasva; egyébként false</returns>
|
||||
public static bool ReadStringAttribute(SDA.DataProvider.SDADataReader reader, int index, ref string target, ref bool isNull, string defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
isNull = true;
|
||||
target = defaultValue;
|
||||
return false;
|
||||
}
|
||||
|
||||
isNull = false;
|
||||
target = reader.GetString(index);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string ReadStringAttribute(SDA.DataProvider.SDADataReader reader, int index, string defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return reader.GetString(index);
|
||||
}
|
||||
|
||||
public static string ReadStringAttribute(SDA.DataProvider.SDADataReader reader, int index)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return reader.GetString(index);
|
||||
}
|
||||
|
||||
public static bool ReadGuidAttribute(SDA.DataProvider.SDADataReader reader, int index, ref Guid target, ref bool isNull, Guid defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
isNull = true;
|
||||
target = defaultValue;
|
||||
return false;
|
||||
}
|
||||
|
||||
isNull = false;
|
||||
target = Guid.Parse(reader.GetString(index));
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Guid ReadGuidAttribute(SDA.DataProvider.SDADataReader reader, int index, Guid defaultValue)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return reader.GetGuid(index);
|
||||
}
|
||||
|
||||
public static Guid? ReadGuidAttribute(SDA.DataProvider.SDADataReader reader, int index)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return reader.GetGuid(index);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Read methods for framework
|
||||
/// <summary>
|
||||
/// DateTime? típusú értékét olvas be
|
||||
/// </summary>
|
||||
/// <param name="reader">A forrás <see cref="SDA.DataProvider.SDADataReader"/> objektum</param>
|
||||
/// <param name="index">Az attribútum indexe</param>
|
||||
/// <returns>A beolvasott dátum, vagy null</returns>
|
||||
internal static DateTime? ReadDateTime(SDA.DataProvider.SDADataReader reader, int index)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return reader.GetDateTime(index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Karakterlánc típusú attribútum értékét olvas be
|
||||
/// </summary>
|
||||
/// <param name="reader">A forrás <see cref="SDA.DataProvider.SDADataReader"/> objektum</param>
|
||||
/// <param name="index">Az attribútum indexe</param>
|
||||
/// <returns>A beolvasott string vagy null</returns>
|
||||
internal static string ReadString(SDA.DataProvider.SDADataReader reader, int index)
|
||||
{
|
||||
if (reader.IsDBNull(index))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return reader.GetString(index);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
911
Framework/Entities/Entity.cs
Normal file
911
Framework/Entities/Entity.cs
Normal file
|
@ -0,0 +1,911 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Framework.Util;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Az entitások absztrakt ősosztálya.
|
||||
/// </summary>
|
||||
public abstract class Entity
|
||||
{
|
||||
// <<Layer Supertype>>
|
||||
|
||||
//private static Hashtable m_EntityAttributeCache = Hashtable.Synchronized(new Hashtable());
|
||||
protected int m_ID;
|
||||
protected EntityState m_State;
|
||||
protected int m_Serial;
|
||||
protected DateTime? m_EntityLastChanged = null;
|
||||
protected DateTime? m_EntityCreated = null;
|
||||
protected bool m_Torolt = false;
|
||||
protected int? m_EntityModifier = null;
|
||||
protected int m_EntityCreator = -1;
|
||||
private Hashtable m_OriginalValues = new Hashtable();
|
||||
private Hashtable m_CurrentValues = new Hashtable();
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
protected Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#region Belső dolgok
|
||||
|
||||
/// <summary>
|
||||
/// Ellenőrzi, hogy az entitás módosítható állapotban van.
|
||||
/// </summary>
|
||||
/// <exception cref="EntityStateException">Ha nem módosítható az entitás</exception>
|
||||
protected void CheckModifyable()
|
||||
{
|
||||
if (!CanModifyFields)
|
||||
{
|
||||
throw new EntityStateException(m_State);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Alapállapotba állítja az objektumot
|
||||
/// </summary>
|
||||
protected virtual void Reset()
|
||||
{
|
||||
m_State = EntityState.Uninitialized;
|
||||
m_ID = -1;
|
||||
m_Serial = -1;
|
||||
m_EntityCreated = null;
|
||||
m_EntityCreator = -1;
|
||||
m_EntityLastChanged = null;
|
||||
m_Torolt = false;
|
||||
m_EntityModifier = null;
|
||||
m_CurrentValues.Clear();
|
||||
m_OriginalValues.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja az entitás adatbázisműveleteit végző <see cref="IEntityDataAccessor"/> objektumát.
|
||||
/// </summary>
|
||||
/// <returns>Az entitás adatbázisműveleteit végző <see cref="IEntityDataAccessor"/> objektum</returns>
|
||||
protected abstract IEntityDataAccessor GetDataAccessor();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nyilvános felület
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja az entitás nevét.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Az entitás nevét a rajta lévő <see cref="EntityAttribute"/> attribútum definiálja.
|
||||
/// A névnek rendszer szinten egyedinek kell lennie.
|
||||
/// </remarks>
|
||||
public string GetEntityName()
|
||||
{
|
||||
return EntityAttributeCache.GetEntityNameFromCache(GetType());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás azonosítója
|
||||
/// </summary>
|
||||
/// <value>Az entitást azonosító nemnegatív egész szám</value>
|
||||
public int ID
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ID;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ID = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás utolsó módosításának ideje
|
||||
/// </summary>
|
||||
public virtual DateTime? EntityLastChanged
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_EntityLastChanged;
|
||||
}
|
||||
internal protected set
|
||||
{
|
||||
m_EntityLastChanged = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás létrehozásának ideje
|
||||
/// </summary>
|
||||
public virtual DateTime? EntityCreated
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_EntityCreated;
|
||||
}
|
||||
internal protected set
|
||||
{
|
||||
m_EntityCreated = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás létrehozójának adatai
|
||||
/// </summary>
|
||||
public virtual int EntityCreator
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_EntityCreator;
|
||||
}
|
||||
internal protected set
|
||||
{
|
||||
m_EntityCreator = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás logikailag törölve van.
|
||||
/// </summary>
|
||||
public virtual bool Torolt
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Torolt;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Torolt = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás módosítójának adatai
|
||||
/// </summary>
|
||||
public virtual int? EntityModifier
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_EntityModifier;
|
||||
}
|
||||
internal protected set
|
||||
{
|
||||
m_EntityModifier = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás verziója
|
||||
/// </summary>
|
||||
/// <value>Az entitás verziója</value>
|
||||
/// <remarks>Az entitás verziója kezdetben nulla, és minden mentésnél eggyel no.</remarks>
|
||||
public int Serial
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Serial;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Serial = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás jelenlegi állapota.
|
||||
/// </summary>
|
||||
public EntityState State
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_State;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetState(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Új állapotba hozza az entitást.
|
||||
/// </summary>
|
||||
/// <param name="state">Új állapot</param>
|
||||
public void SetState(EntityState state)
|
||||
{
|
||||
m_State = state;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Betöltött állapotba helyezi az entitást.
|
||||
/// </summary>
|
||||
public void SetLoaded()
|
||||
{
|
||||
m_State = EntityState.Initialized;
|
||||
StoreOriginalValues();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ellenőrzi, hogy az entitás attribútumai érvényes értékeket tartalmaznak-e.
|
||||
/// </summary>
|
||||
/// <exception cref="InvalidEntityAttributeException">
|
||||
/// Ha valamelyik attribútum értéke érvénytelen.
|
||||
/// </exception>
|
||||
protected virtual void Validate(bool skipValidateAttributes = false)
|
||||
{
|
||||
// Az ősosztályban nem kell csinálnunk semmit.
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Állapottal kapcsolatos dolgok
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja, hogy az entitás be van-e már töltve.
|
||||
/// </summary>
|
||||
public bool IsInitialized
|
||||
{
|
||||
get
|
||||
{
|
||||
return (m_State == EntityState.Initialized || m_State == EntityState.Modified);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja, hogy az entitás módosítva lett-e.
|
||||
/// </summary>
|
||||
public bool IsModified
|
||||
{
|
||||
get
|
||||
{
|
||||
return (m_State == EntityState.Modified);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja, hogy az entitás törölve lett-e.
|
||||
/// </summary>
|
||||
public bool IsDeleted
|
||||
{
|
||||
get
|
||||
{
|
||||
return (m_State == EntityState.Removed);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ellenőrzi, hogy az entitás állapota megfelelő-e a betöltés művelethez.
|
||||
/// </summary>
|
||||
/// <value>True, ha az entitás betölthető; egyébként false</value>
|
||||
protected bool CanLoad
|
||||
{
|
||||
get
|
||||
{
|
||||
return (m_State == EntityState.Uninitialized);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ellenőrzi, hogy az entitás állapota megfelelő-e a beszúrás művelethez.
|
||||
/// </summary>
|
||||
/// <value>True, ha az entitás beszúrható az adatbázisba; egyébként false</value>
|
||||
protected bool CanInsert
|
||||
{
|
||||
get
|
||||
{
|
||||
return (m_State == EntityState.New || m_State == EntityState.Uninitialized);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ellenőrzi, hogy az entitás állapota megfelelő-e a módosítás művelethez.
|
||||
/// </summary>
|
||||
/// <value>True, ha az entitás módosítható az adatbázisban; egyébként false</value>
|
||||
protected bool CanUpdate
|
||||
{
|
||||
get
|
||||
{
|
||||
return (m_State == EntityState.Modified || m_State == EntityState.Initialized);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ellenőrzi, hogy az entitás állapota megfelelő-e a törléshez.
|
||||
/// </summary>
|
||||
/// <value>True, ha az entitás törölhető az adatbázisban; egyébként false</value>
|
||||
protected bool CanRemove
|
||||
{
|
||||
get
|
||||
{
|
||||
return (m_State != EntityState.Uninitialized);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ellenőrzi, hogy az entitás állapota megfelelő-e az attribútumainak módosításához.
|
||||
/// </summary>
|
||||
/// <value>True, ha az entitás attribútumai módosíthatóak; egyébként false</value>
|
||||
protected bool CanModifyFields
|
||||
{
|
||||
get
|
||||
{
|
||||
return (m_State != EntityState.Removed);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CRUD logika
|
||||
|
||||
/// <summary>
|
||||
/// Azonosító alapján feltölti az entitást az adatbázisból
|
||||
/// </summary>
|
||||
/// <param name="id">Az entitás azonosítója</param>
|
||||
/// <returns>True, ha sikeres; egyébként False</returns>
|
||||
public bool LoadEntityByID(int id)
|
||||
{
|
||||
if (m_State != EntityState.Uninitialized)
|
||||
{
|
||||
throw new EntityStateException(m_State);
|
||||
}
|
||||
m_ID = id;
|
||||
if (!GetDataAccessor().LoadEntity(this, id))
|
||||
{
|
||||
m_ID = -1;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Azonosító alapján feltölti az entitást az adatbázisból, minden oszloppal
|
||||
/// </summary>
|
||||
/// <param name="id">Az entitás azonosítója</param>
|
||||
/// <exception cref="EntityNotFoundException">Ha a megadott azonosítójú entitás nem található.</exception>
|
||||
public void LoadByID(int id)
|
||||
{
|
||||
if (m_State != EntityState.Uninitialized)
|
||||
{
|
||||
throw new EntityStateException(m_State);
|
||||
}
|
||||
m_ID = id;
|
||||
if (!GetDataAccessor().LoadEntity(this, id))
|
||||
{
|
||||
m_ID = -1;
|
||||
throw new EntityNotFoundException(GetEntityName(), id);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Azonosító alapján feltölti az entitást az adatbázisból, tiltó oszlopszűréssel
|
||||
/// </summary>
|
||||
/// <param name="id">Az entitás azonosítója</param>
|
||||
/// <param name="filteredColumns">A betöltésre nem kerülő oszlopok</param>
|
||||
public void LoadByID(int id, IEnumerable<string> filteredColumns)
|
||||
{
|
||||
this.LoadByID(id, ColumnFilterMode.DEFAULT_ALLOWED, filteredColumns);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Azonosító alapján feltölti az entitást az adatbázisból, oszlopszűréssel
|
||||
/// </summary>
|
||||
/// <param name="id">Az entitás azonosítója</param>
|
||||
/// <param name="columnFilterMode">A szűrés módja, megengedő vagy tiltó</param>
|
||||
/// <param name="columns">A szűrendő oszlopok felsorolása</param>
|
||||
public void LoadByID(int id, ColumnFilterMode columnFilterMode, IEnumerable<string> columns)
|
||||
{
|
||||
if (m_State != EntityState.Uninitialized)
|
||||
{
|
||||
throw new EntityStateException(m_State);
|
||||
}
|
||||
m_ID = id;
|
||||
if (!GetDataAccessor().FilteredLoadEntity(this, id, columnFilterMode, columns))
|
||||
{
|
||||
m_ID = -1;
|
||||
throw new EntityNotFoundException(GetEntityName(), id);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Azonosító alapján feltölti az entitást adatbázisból.
|
||||
/// </summary>
|
||||
/// <param name="id">Az entitás azonosítója</param>
|
||||
/// <param name="serial">Az entitás verziószáma</param>
|
||||
/// <exception cref="EntityExpiredException">Ha az entitás verziószáma nem egyezik a megadottal.</exception>
|
||||
/// <exception cref="EntityNotFoundException">Ha a megadott azonosítójú entitás nem található.</exception>
|
||||
public void LoadByID(int id, int serial)
|
||||
{
|
||||
LoadByID(id);
|
||||
|
||||
if (m_Serial != serial)
|
||||
{
|
||||
throw new EntityExpiredException(GetEntityName(), ID, m_Serial, serial);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Azonosító alapján feltölti az entitást adatbázisból, oszlopszűréssel
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="serial"></param>
|
||||
/// <param name="columnFilterMode"></param>
|
||||
/// <param name="columns"></param>
|
||||
public void LoadByID(int id, int serial, ColumnFilterMode columnFilterMode, IEnumerable<string> columns)
|
||||
{
|
||||
LoadByID(id, columnFilterMode, columns);
|
||||
|
||||
if (m_Serial != serial)
|
||||
{
|
||||
throw new EntityExpiredException(GetEntityName(), ID, m_Serial, serial);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adatbázisba menti a még nem létező entitást.
|
||||
/// </summary>
|
||||
public void Insert()
|
||||
{
|
||||
Insert(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adatbázisba menti a még nem létező entitást.
|
||||
/// </summary>
|
||||
/// <param name="runHandler">Futtassa-e a hozzá tartozó <see cref="EntityHandler"/> objektumot, vagy sem</param>
|
||||
public void Insert(bool runHandler)
|
||||
{
|
||||
try
|
||||
{
|
||||
// <<Template Method>>
|
||||
IEntityHandler handler = null;
|
||||
if (runHandler)
|
||||
{
|
||||
handler = EntityHandler.Create(GetType());
|
||||
handler.BeforeInsert(this);
|
||||
}
|
||||
|
||||
DoInsert();
|
||||
|
||||
if (runHandler)
|
||||
{
|
||||
handler.AfterInsert(this);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
EntityState es = this.State;
|
||||
this.State = EntityState.New; // biztos ami biztos
|
||||
this.StoreOriginalValues(); // hogy legyen mit logolni
|
||||
//EntityHistoryLogger.LogErrorHistory(this);
|
||||
this.State = es;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adatbázisba menti a már létező entitás tulajdonságait.
|
||||
/// </summary>
|
||||
public void Update()
|
||||
{
|
||||
Update(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adatbázisba menti a már létező entitás tulajdonságait.
|
||||
/// </summary>
|
||||
/// <param name="runHandler">Futtassa-e a hozzá tartozó <see cref="EntityHandler"/> objektumot, vagy sem</param>
|
||||
public void Update(bool runHandler)
|
||||
{
|
||||
try
|
||||
{
|
||||
// <<Template Method>>
|
||||
IEntityHandler handler = null;
|
||||
if (runHandler)
|
||||
{
|
||||
handler = EntityHandler.Create(GetType());
|
||||
handler.BeforeUpdate(this);
|
||||
}
|
||||
|
||||
DoUpdate(true, false);
|
||||
|
||||
if (runHandler)
|
||||
{
|
||||
handler.AfterUpdate(this);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
EntityState es = this.State;
|
||||
this.State = EntityState.Modified; // különben nem logol
|
||||
//EntityHistoryLogger.LogErrorHistory(this);
|
||||
this.State = es;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adatbázisba menti az entitás asszociációit.
|
||||
/// </summary>
|
||||
/// <remarks>Valójában csak azokat, amelyeknél a kapcsolómező ennek az entitásnak a táblájában van!</remarks>
|
||||
public void UpdateAssociations()
|
||||
{
|
||||
UpdateAssociations(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adatbázisba menti az entitás asszociációit.
|
||||
/// </summary>
|
||||
/// <param name="runHandler">Futtassa-e a hozzá tartozó <see cref="EntityHandler"/> objektumot, vagy sem</param>
|
||||
/// <remarks>Valójában csak azokat, amelyeknél a kapcsolómező ennek az entitásnak a táblájában van!</remarks>
|
||||
public void UpdateAssociations(bool runHandler)
|
||||
{
|
||||
try
|
||||
{
|
||||
// <<Template Method>>
|
||||
IEntityHandler handler = null;
|
||||
if (runHandler)
|
||||
{
|
||||
handler = EntityHandler.Create(GetType());
|
||||
handler.BeforeUpdate(this);
|
||||
}
|
||||
|
||||
DoUpdate(false, true);
|
||||
|
||||
if (runHandler)
|
||||
{
|
||||
handler.AfterUpdate(this);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
EntityState es = this.State;
|
||||
this.State = EntityState.Modified; // különben nem logol
|
||||
//EntityHistoryLogger.LogErrorHistory(this);
|
||||
this.State = es;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adatbázisba menti a már létező entitás tulajdonságait és asszociációit.
|
||||
/// </summary>
|
||||
public void FullUpdate()
|
||||
{
|
||||
FullUpdate(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adatbázisba menti a már létező entitás tulajdonságait és asszociációit.
|
||||
/// </summary>
|
||||
/// <param name="runHandler">Futtassa-e a hozzá tartozó <see cref="EntityHandler"/> objektumot, vagy sem</param>
|
||||
public void FullUpdate(bool runHandler)
|
||||
{
|
||||
try
|
||||
{
|
||||
// <<Template Method>>
|
||||
IEntityHandler handler = null;
|
||||
if (runHandler)
|
||||
{
|
||||
handler = EntityHandler.Create(GetType());
|
||||
handler.BeforeUpdate(this);
|
||||
}
|
||||
|
||||
DoUpdate(true, true);
|
||||
|
||||
if (runHandler)
|
||||
{
|
||||
handler.AfterUpdate(this);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
EntityState es = this.State;
|
||||
this.State = EntityState.Modified; // különben nem logol
|
||||
//EntityHistoryLogger.LogErrorHistory(this);
|
||||
this.State = es;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Törli az entitást az adatbázisból.
|
||||
/// </summary>
|
||||
/// <remarks>Sikeres törlés esetén az entitás 'EntityState.REMOVED' állapotba kerül.</remarks>
|
||||
public void Delete(bool logikai = true)
|
||||
{
|
||||
Delete(true, logikai);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Leellenőrzi az aktív kapcsolatait törléshez.
|
||||
/// </summary>
|
||||
void CheckActiveConnections()
|
||||
{
|
||||
var entityNames = new List<string>() { GetEntityName() };
|
||||
|
||||
var entityType = this.GetType();
|
||||
if (entityType.BaseType != typeof(Entity))
|
||||
{
|
||||
entityNames.Add(EntityAttributeCache.GetEntityNameFromCache(entityType.BaseType));
|
||||
}
|
||||
|
||||
var EntitasKapcsolatok = EntityUtils.GetEntitiesConnections(new List<int>() { this.ID }, entityNames);
|
||||
|
||||
// ha van az entitásnak kapcsolata, akkor elszáll
|
||||
if (EntitasKapcsolatok.Count > 0 && EntitasKapcsolatok[ID].Count > 0)
|
||||
{
|
||||
throw new EntityDeleteFailedException(StringResourcesUtil.GetString(3478), EntitasKapcsolatok[ID]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Törli az entitást az adatbázisból.
|
||||
/// </summary>
|
||||
/// <param name="runHandler">Futtassa-e a hozzá tartozó <see cref="EntityHandler"/> objektumot, vagy sem</param>
|
||||
public void Delete(bool runHandler, bool logikai = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
// <<Template Method>>
|
||||
IEntityHandler handler = null;
|
||||
if (runHandler)
|
||||
{
|
||||
handler = EntityHandler.Create(GetType());
|
||||
handler.BeforeDelete(this);
|
||||
}
|
||||
|
||||
// ellenőrzi az aktív kapcsolatait
|
||||
CheckActiveConnections();
|
||||
DoDelete(false, runHandler, logikai);
|
||||
|
||||
if (runHandler)
|
||||
{
|
||||
handler.AfterDelete(this);
|
||||
}
|
||||
}
|
||||
catch /*(Exception ex)*/
|
||||
{
|
||||
EntityState es = this.State;
|
||||
this.State = EntityState.Removed; // biztos ami biztos
|
||||
//EntityHistoryLogger.LogErrorHistory(this);
|
||||
this.State = es;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Törli az entitást az adatbázisból a kapcsolódásaival együtt.
|
||||
/// </summary>
|
||||
/// <remarks>Sikeres törlés esetén az entitás 'EntityState.REMOVED' állapotba kerül.</remarks>
|
||||
public void CascadeDelete(bool logikai = true)
|
||||
{
|
||||
CascadeDelete(false, logikai);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Törli az entitást az adatbázisból a kapcsolódásaival együtt.
|
||||
/// </summary>
|
||||
/// <param name="runHandler">Futtassa-e a hozzá tartozó <see cref="EntityHandler"/> objektumot, vagy sem</param>
|
||||
public void CascadeDelete(bool runHandler, bool logikai = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
// <<Template Method>>
|
||||
IEntityHandler handler = null;
|
||||
if (runHandler)
|
||||
{
|
||||
handler = EntityHandler.Create(GetType());
|
||||
handler.BeforeDelete(this);
|
||||
}
|
||||
|
||||
DoDelete(true, runHandler);
|
||||
|
||||
if (runHandler)
|
||||
{
|
||||
handler.AfterDelete(this);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
EntityState es = this.State;
|
||||
this.State = EntityState.Removed; // biztos ami biztos
|
||||
//EntityHistoryLogger.LogErrorHistory(this);
|
||||
this.State = es;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elvégzi az entitás törlése előtti szétkapcsolásokat és kaszkád törléseket.
|
||||
/// </summary>
|
||||
protected virtual void DeAssociateBeforeDelete(bool runHandler = false)
|
||||
{
|
||||
// Az ősosztályban nem kell csinálnunk semmit.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elvégzi az entitás törlését.
|
||||
/// </summary>
|
||||
/// <param name="performCascadeDelete">Kaszkádosított törlés legyen-e, vagy sem</param>
|
||||
protected virtual void DoDelete(bool performCascadeDelete, bool runHandler = false, bool logikai = true)
|
||||
{
|
||||
if (!CanRemove)
|
||||
{
|
||||
throw new EntityStateException(m_State);
|
||||
}
|
||||
|
||||
if (performCascadeDelete)
|
||||
{
|
||||
DeAssociateBeforeDelete(runHandler);
|
||||
}
|
||||
|
||||
GetDataAccessor().DeleteEntity(this, logikai);
|
||||
SetState(EntityState.Removed);
|
||||
//EntityHistoryLogger.LogHistory(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// elvegzi az entitás update-jet
|
||||
/// </summary>
|
||||
protected virtual void DoUpdate(bool withattributes, bool withassociations)
|
||||
{
|
||||
if (!CanUpdate)
|
||||
{
|
||||
throw new EntityStateException(m_State);
|
||||
}
|
||||
|
||||
Validate(!withattributes);
|
||||
|
||||
if (withattributes)
|
||||
{
|
||||
if (!GetDataAccessor().UpdateEntity(this))
|
||||
{
|
||||
throw new EntityExpiredException(GetEntityName(), ID, m_Serial);
|
||||
}
|
||||
}
|
||||
|
||||
if (withassociations)
|
||||
{
|
||||
if (!GetDataAccessor().UpdateAssociations(this))
|
||||
{
|
||||
throw new EntityExpiredException(GetEntityName(), ID, m_Serial);
|
||||
}
|
||||
}
|
||||
//EntityHistoryLogger.LogHistory(this);
|
||||
SetState(EntityState.Initialized);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// elvegzi az entitas insertjet
|
||||
/// </summary>
|
||||
protected virtual void DoInsert()
|
||||
{
|
||||
if (!CanInsert)
|
||||
{
|
||||
throw new EntityStateException(m_State);
|
||||
}
|
||||
|
||||
Validate();
|
||||
|
||||
GetDataAccessor().InsertEntity(this);
|
||||
|
||||
StoreOriginalValues();
|
||||
|
||||
//EntityHistoryLogger.LogHistory(this);
|
||||
SetState(EntityState.Initialized);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Oszlopszintű naplózás támogatása
|
||||
|
||||
/// <summary>
|
||||
/// Eltárolja az entitás összes attribútumának adatbázisban tárolt értékét.
|
||||
/// </summary>
|
||||
protected virtual void StoreOriginalValues()
|
||||
{
|
||||
m_OriginalValues.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A függvény eltárolja egy attribútum értékének megváltozását.
|
||||
/// </summary>
|
||||
/// <param name="attributeName">A módosult attribútum neve</param>
|
||||
/// <param name="value">A módosult attribútum új értéke</param>
|
||||
/// <remarks>Ezt a metódust meg kell hívni minden olyan esetben, amikor olyan attribútum módosult,
|
||||
/// amelyet oszlop szinten naplózni kell.</remarks>
|
||||
protected void FieldModified(string attributeName, object value)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(attributeName))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(attributeName));
|
||||
}
|
||||
|
||||
if (m_State == EntityState.Initialized)
|
||||
{
|
||||
SetState(EntityState.Modified);
|
||||
}
|
||||
else if (m_State == EntityState.Uninitialized)
|
||||
{
|
||||
SetState(EntityState.New);
|
||||
}
|
||||
|
||||
m_CurrentValues[attributeName] = (value ?? DBNull.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás eredeti naplózandó attribútumai.
|
||||
/// </summary>
|
||||
protected internal Hashtable OriginalValues
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_OriginalValues;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás módosult naplózandó attribútumai a jelenlegi értékükkel.
|
||||
/// </summary>
|
||||
protected internal Hashtable CurrentValues
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_CurrentValues;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja egy attribútum eredeti értékét.
|
||||
/// </summary>
|
||||
/// <param name="attributeName">Az attribútum neve</param>
|
||||
/// <returns>Az attribútum eredeti értéke</returns>
|
||||
/// <exception cref="ArgumentException">Ha az entitás nem rendelkezik a magadott attribútummal, vagy az nem naplózandó.</exception>
|
||||
public object GetOriginalValue(string attributeName)
|
||||
{
|
||||
if (!m_OriginalValues.ContainsKey(attributeName))
|
||||
{
|
||||
throw new ArgumentException("The entity does not contain the original value for the specified attribute.", nameof(attributeName));
|
||||
}
|
||||
|
||||
object result = m_OriginalValues[attributeName];
|
||||
|
||||
if (result == DBNull.Value)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Megvizsgálja, hogy egy attribútum eredeti értéke null-e, vagy sem.
|
||||
/// </summary>
|
||||
/// <param name="attributeName">Az attribútum neve</param>
|
||||
/// <returns>True, ha az attribútum eredeti értéke null; egyébként false</returns>
|
||||
/// <exception cref="ArgumentException">Ha az entitás nem rendelkezik a magadott attribútummal, vagy az nem naplózandó.</exception>
|
||||
public bool IsOriginalValueNull(string attributeName)
|
||||
{
|
||||
return (GetOriginalValue(attributeName) == null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Megvizsgálja, hogy egy attribútum értéke változott-e, vagy sem.
|
||||
/// </summary>
|
||||
/// <param name="attributeName">Az attribútum neve</param>
|
||||
/// <returns>True, ha változott; egyébként false</returns>
|
||||
public bool HasChanged(string attributeName)
|
||||
{
|
||||
return m_CurrentValues.ContainsKey(attributeName);
|
||||
}
|
||||
|
||||
public IEnumerable<string> ChangedAttributes()
|
||||
{
|
||||
string[] result = new string[m_CurrentValues.Count];
|
||||
m_CurrentValues.Keys.CopyTo(result, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
33
Framework/Entities/EntityAttribute.cs
Normal file
33
Framework/Entities/EntityAttribute.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitást jelző attribútum.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class EntityAttribute : Attribute
|
||||
{
|
||||
private string m_Name;
|
||||
|
||||
/// <summary>
|
||||
/// Az attribútum konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="name">Az entitás neve</param>
|
||||
public EntityAttribute(string name)
|
||||
{
|
||||
m_Name = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás neve.
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
49
Framework/Entities/EntityAttributeCache.cs
Normal file
49
Framework/Entities/EntityAttributeCache.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
internal static class EntityAttributeCache
|
||||
{
|
||||
private static Hashtable m_EntityAttributeCache = new Hashtable();
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja az entitás nevét a rajta lévő <see cref="EntityAttribute"/> attribútum alapján.
|
||||
/// </summary>
|
||||
/// <param name="entityType">Az entitás típusa</param>
|
||||
/// <returns>Az entitás neve, ha van <see cref="EntityAttribute"/> attribútuma; egyébként 'Ismeretlen'</returns>
|
||||
private static string GetEntityName(Type entityType)
|
||||
{
|
||||
EntityAttribute[] attributes = (EntityAttribute[])entityType.GetCustomAttributes(typeof(EntityAttribute), true);
|
||||
if (attributes.Length > 0)
|
||||
{
|
||||
return attributes[0].Name;
|
||||
}
|
||||
|
||||
if (entityType.BaseType != null)
|
||||
{
|
||||
return GetEntityName(entityType.BaseType);
|
||||
}
|
||||
|
||||
return "Ismeretlen";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja az entitás nevét, cache-elve
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Az entitás nevét a rajta lévő <see cref="EntityAttribute"/> attribútum definiálja.
|
||||
/// A névnek rendszer szinten egyedinek kell lennie.
|
||||
/// </remarks>
|
||||
internal static string GetEntityNameFromCache(Type entityType)
|
||||
{
|
||||
string result = m_EntityAttributeCache[entityType] as string;
|
||||
if (result == null)
|
||||
{
|
||||
result = GetEntityName(entityType);
|
||||
m_EntityAttributeCache[entityType] = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
54
Framework/Entities/EntityAttributeError.cs
Normal file
54
Framework/Entities/EntityAttributeError.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using Kreta.Framework.Localization;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Érvénytelen entitás attribútum hibakódjai, az <see cref="InvalidEntityAttributeException"/> kivétel használja.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public enum EntityAttributeError
|
||||
{
|
||||
/// <summary>
|
||||
/// Érvénytelen
|
||||
/// </summary>
|
||||
[FriendlyName(1000032, "érvénytelen")]
|
||||
Unknown = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Értéke túl hosszú
|
||||
/// </summary>
|
||||
[FriendlyName(1000033, "értéke túl hosszú")]
|
||||
TooLong,
|
||||
|
||||
/// <summary>
|
||||
/// Nincs kitöltve
|
||||
/// </summary>
|
||||
[FriendlyName(1000034, "nincs kitöltve")]
|
||||
Empty,
|
||||
|
||||
/// <summary>
|
||||
/// Nem megfelelő formátumú
|
||||
/// </summary>
|
||||
[FriendlyName(1000035, "nem megfelelő formátumú")]
|
||||
WrongFormat,
|
||||
|
||||
/// <summary>
|
||||
/// Értéke túl nagy vagy túl kicsi
|
||||
/// </summary>
|
||||
[FriendlyName(1000036, "értéke túl nagy vagy túl kicsi")]
|
||||
OutOfRange,
|
||||
|
||||
/// <summary>
|
||||
/// Értéke nem megengedett
|
||||
/// </summary>
|
||||
[FriendlyName(1000037, "értéke nem megengedett")]
|
||||
NotAllowed,
|
||||
|
||||
/// <summary>
|
||||
/// Értéke inkonzinsztens
|
||||
/// </summary>
|
||||
[FriendlyName(1000038, "értéke inkonzinsztens")]
|
||||
Inconsistent,
|
||||
}
|
||||
}
|
11
Framework/Entities/EntityConnectionModel.cs
Normal file
11
Framework/Entities/EntityConnectionModel.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
public class EntityConnectionModel
|
||||
{
|
||||
public string TargetTableName { get; set; }
|
||||
|
||||
public string TargetColumnName { get; set; }
|
||||
|
||||
public int RowsCount { get; set; }
|
||||
}
|
||||
}
|
18
Framework/Entities/EntityCopyMethod.cs
Normal file
18
Framework/Entities/EntityCopyMethod.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitás másolásának fajtái. Lásd még <see cref="EntityPropertyAttribute"/>.
|
||||
/// </summary>
|
||||
public enum EntityCopyMethod
|
||||
{
|
||||
/// <summary>
|
||||
/// Mély másolás
|
||||
/// </summary>
|
||||
DeepCopy,
|
||||
|
||||
/// <summary>
|
||||
/// Sekély másolás
|
||||
/// </summary>
|
||||
ShallowCopy,
|
||||
}
|
||||
}
|
569
Framework/Entities/EntityDeleteFailedException.cs
Normal file
569
Framework/Entities/EntityDeleteFailedException.cs
Normal file
|
@ -0,0 +1,569 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Az entitás nem törölhető, mert egy vagy több kapcsolódása még van.
|
||||
/// </summary>
|
||||
[FriendlyName(3478, "Az entitás nem törölhető, mert egy vagy több kapcsolódása még van: {Description} ({EntityName}.{AssociationName}).")]
|
||||
[ErrorCode(Events.ENTITY_DELETEFAILED)]
|
||||
[Serializable]
|
||||
public sealed class EntityDeleteFailedException : EntityException
|
||||
{
|
||||
private const string ErrorMessage = "The entity could not be deleted due to one or more of its associations.";
|
||||
|
||||
private static readonly Dictionary<string, string> s_connectionErrorTableList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
|
||||
{"T_ADATSZOLGALTATASENAPLO", ConnectionErrorTableResource.T_ADATSZOLGALTATASENAPLO},
|
||||
{"T_ADATSZOLGALTATASENAPLO_OSSZES", ConnectionErrorTableResource.T_ADATSZOLGALTATASENAPLO_OSSZES},
|
||||
{"T_AGAZATTIPUS", ConnectionErrorTableResource.T_AGAZATTIPUS},
|
||||
{"T_AGAZATTIPUS_OSSZES", ConnectionErrorTableResource.T_AGAZATTIPUS_OSSZES},
|
||||
{"T_ALKALMAZOTT", ConnectionErrorTableResource.T_ALKALMAZOTT},
|
||||
{"T_ALKALMAZOTT_OSSZES", ConnectionErrorTableResource.T_ALKALMAZOTT_OSSZES},
|
||||
{"T_ALLAMPOLGARSAG", ConnectionErrorTableResource.T_ALLAMPOLGARSAG},
|
||||
{"T_ALLAMPOLGARSAG_OSSZES", ConnectionErrorTableResource.T_ALLAMPOLGARSAG_OSSZES},
|
||||
{"T_ANYANYELV", ConnectionErrorTableResource.T_ANYANYELV},
|
||||
{"T_ANYANYELV_OSSZES", ConnectionErrorTableResource.T_ANYANYELV_OSSZES},
|
||||
{"T_BESOROLASIFOKOZATTIPUS", ConnectionErrorTableResource.T_BESOROLASIFOKOZATTIPUS},
|
||||
{"T_BESOROLASIFOKOZATTIPUS_OSSZES", ConnectionErrorTableResource.T_BESOROLASIFOKOZATTIPUS_OSSZES},
|
||||
{"T_CIM", ConnectionErrorTableResource.T_CIM},
|
||||
{"T_CIM_OSSZES", ConnectionErrorTableResource.T_CIM_OSSZES},
|
||||
{"T_CIMTIPUS", ConnectionErrorTableResource.T_CIMTIPUS},
|
||||
{"T_CIMTIPUS_OSSZES", ConnectionErrorTableResource.T_CIMTIPUS_OSSZES},
|
||||
{"T_CSENGETESIREND", ConnectionErrorTableResource.T_CSENGETESIREND},
|
||||
{"T_CSENGETESIREND_OSSZES", ConnectionErrorTableResource.T_CSENGETESIREND_OSSZES},
|
||||
{"T_CSENGETESIRENDORA", ConnectionErrorTableResource.T_CSENGETESIRENDORA},
|
||||
{"T_CSENGETESIRENDORA_OSSZES", ConnectionErrorTableResource.T_CSENGETESIRENDORA_OSSZES},
|
||||
{"T_CSOPORT", ConnectionErrorTableResource.T_CSOPORT},
|
||||
{"T_CSOPORT_OSSZES", ConnectionErrorTableResource.T_CSOPORT_OSSZES},
|
||||
{"T_CSOPORTTIPUS", ConnectionErrorTableResource.T_CSOPORTTIPUS},
|
||||
{"T_CSOPORTTIPUS_OSSZES", ConnectionErrorTableResource.T_CSOPORTTIPUS_OSSZES},
|
||||
{"T_CSOPORTTIPUS_FOGLALKOZASTIPU", ConnectionErrorTableResource.T_CSOPORTTIPUS_FOGLALKOZASTIPU},
|
||||
{"T_CSOPORTTIPUS_FOGLALKOZASTIPU_OSSZES", ConnectionErrorTableResource.T_CSOPORTTIPUS_FOGLALKOZASTIPU_OSSZES},
|
||||
{"T_DASHBOARDUZENETFELHASZNALO_OSSZES", ConnectionErrorTableResource.T_DASHBOARDUZENETFELHASZNALO_OSSZES},
|
||||
{"T_DBVERSION", ConnectionErrorTableResource.T_DBVERSION},
|
||||
{"T_DBVERSION_OSSZES", ConnectionErrorTableResource.T_DBVERSION_OSSZES},
|
||||
{"T_DIAKIGAZOLVANYIGENYSTATUSZ", ConnectionErrorTableResource.T_DIAKIGAZOLVANYIGENYSTATUSZ},
|
||||
{"T_DIAKIGAZOLVANYIGENYSTATUSZ_OSSZES", ConnectionErrorTableResource.T_DIAKIGAZOLVANYIGENYSTATUSZ_OSSZES},
|
||||
{"T_DIAKIGAZOLVANYIGENYTIPUS", ConnectionErrorTableResource.T_DIAKIGAZOLVANYIGENYTIPUS},
|
||||
{"T_DIAKIGAZOLVANYIGENYTIPUS_OSSZES", ConnectionErrorTableResource.T_DIAKIGAZOLVANYIGENYTIPUS_OSSZES},
|
||||
{"T_DIAKOLIMPIA_OSSZES", ConnectionErrorTableResource.T_DIAKOLIMPIA_OSSZES},
|
||||
{"T_DICTIONARYITEMBASE", ConnectionErrorTableResource.T_DICTIONARYITEMBASE},
|
||||
{"T_DICTIONARYITEMBASE_OSSZES", ConnectionErrorTableResource.T_DICTIONARYITEMBASE_OSSZES},
|
||||
{"T_DICTIONARYTYPE", ConnectionErrorTableResource.T_DICTIONARYTYPE},
|
||||
{"T_DICTIONARYTYPE_OSSZES", ConnectionErrorTableResource.T_DICTIONARYTYPE_OSSZES},
|
||||
{"T_DKT_FELADAT", ConnectionErrorTableResource.T_DKT_FELADAT},
|
||||
{"T_DKT_FELADAT_OSSZES", ConnectionErrorTableResource.T_DKT_FELADAT},
|
||||
{"T_DKT_FILE", ConnectionErrorTableResource.T_DKT_FILE},
|
||||
{"T_DKT_FILE_OSSZES", ConnectionErrorTableResource.T_DKT_FILE},
|
||||
{"T_ELEARNING", ConnectionErrorTableResource.T_ELEARNING},
|
||||
{"T_ELEARNING_OSSZES", ConnectionErrorTableResource.T_ELEARNING_OSSZES},
|
||||
{"T_ELETPALYAMODELLFOKOZATTIPUS", ConnectionErrorTableResource.T_ELETPALYAMODELLFOKOZATTIPUS},
|
||||
{"T_ELETPALYAMODELLFOKOZATTIPUS_OSSZES", ConnectionErrorTableResource.T_ELETPALYAMODELLFOKOZATTIPUS_OSSZES},
|
||||
{"T_ELETPALYAMODELLSTATUSZOK", ConnectionErrorTableResource.T_ELETPALYAMODELLSTATUSZOK},
|
||||
{"T_ELETPALYAMODELLSTATUSZOK_OSSZES", ConnectionErrorTableResource.T_ELETPALYAMODELLSTATUSZOK_OSSZES},
|
||||
{"T_ELSODLEGESIKTESZKOZ", ConnectionErrorTableResource.T_ELSODLEGESIKTESZKOZ},
|
||||
{"T_ELSODLEGESIKTESZKOZ_OSSZES", ConnectionErrorTableResource.T_ELSODLEGESIKTESZKOZ_OSSZES},
|
||||
{"T_EMAIL", ConnectionErrorTableResource.T_EMAIL},
|
||||
{"T_EMAIL_OSSZES", ConnectionErrorTableResource.T_EMAIL_OSSZES},
|
||||
{"T_EMAILTIPUS", ConnectionErrorTableResource.T_EMAILTIPUS},
|
||||
{"T_EMAILTIPUS_OSSZES", ConnectionErrorTableResource.T_EMAILTIPUS_OSSZES},
|
||||
{"T_ENAPLOFORRAS", ConnectionErrorTableResource.T_ENAPLOFORRAS},
|
||||
{"T_ENAPLOFORRAS_OSSZES", ConnectionErrorTableResource.T_ENAPLOFORRAS_OSSZES},
|
||||
{"T_ENAPLOHASZNALAT", ConnectionErrorTableResource.T_ENAPLOHASZNALAT},
|
||||
{"T_ENAPLOHASZNALAT_OSSZES", ConnectionErrorTableResource.T_ENAPLOHASZNALAT_OSSZES},
|
||||
{"T_ENAPLOINFRA", ConnectionErrorTableResource.T_ENAPLOINFRA},
|
||||
{"T_ENAPLOINFRA_OSSZES", ConnectionErrorTableResource.T_ENAPLOINFRA_OSSZES},
|
||||
{"T_ENAPLOTIPUS", ConnectionErrorTableResource.T_ENAPLOTIPUS},
|
||||
{"T_ENAPLOTIPUS_OSSZES", ConnectionErrorTableResource.T_ENAPLOTIPUS_OSSZES},
|
||||
{"T_ENTITYATTRIBUTEHISTORY", ConnectionErrorTableResource.T_ENTITYATTRIBUTEHISTORY},
|
||||
{"T_ENTITYATTRIBUTEHISTORY_OSSZES", ConnectionErrorTableResource.T_ENTITYATTRIBUTEHISTORY_OSSZES},
|
||||
{"T_ENTITYHISTORY", ConnectionErrorTableResource.T_ENTITYHISTORY},
|
||||
{"T_ENTITYHISTORY_OSSZES", ConnectionErrorTableResource.T_ENTITYHISTORY_OSSZES},
|
||||
{"T_ERETTSEGIEREDMENY", ConnectionErrorTableResource.T_ERETTSEGIEREDMENY},
|
||||
{"T_ERETTSEGIEREDMENY_OSSZES", ConnectionErrorTableResource.T_ERETTSEGIEREDMENY_OSSZES},
|
||||
{"T_ERETTSEGIKERDES", ConnectionErrorTableResource.T_ERETTSEGIKERDES},
|
||||
{"T_ERETTSEGIKERDES_OSSZES", ConnectionErrorTableResource.T_ERETTSEGIKERDES_OSSZES},
|
||||
{"T_ERETTSEGISZINT", ConnectionErrorTableResource.T_ERETTSEGISZINT},
|
||||
{"T_ERETTSEGISZINT_OSSZES", ConnectionErrorTableResource.T_ERETTSEGISZINT_OSSZES},
|
||||
{"T_ERETTSEGITANTARGY", ConnectionErrorTableResource.T_ERETTSEGITANTARGY},
|
||||
{"T_ERETTSEGITANTARGY_OSSZES", ConnectionErrorTableResource.T_ERETTSEGITANTARGY_OSSZES},
|
||||
{"T_ERETTSEGITANTARGYADATOK", ConnectionErrorTableResource.T_ERETTSEGITANTARGYADATOK},
|
||||
{"T_ERETTSEGITANTARGYADATOK_OSSZES", ConnectionErrorTableResource.T_ERETTSEGITANTARGYADATOK_OSSZES},
|
||||
{"T_ERETTSEGITIPUS", ConnectionErrorTableResource.T_ERETTSEGITIPUS},
|
||||
{"T_ERETTSEGITIPUS_OSSZES", ConnectionErrorTableResource.T_ERETTSEGITIPUS_OSSZES},
|
||||
{"T_ERETTSEGIVALASZ", ConnectionErrorTableResource.T_ERETTSEGIVALASZ},
|
||||
{"T_ERETTSEGIVALASZ_OSSZES", ConnectionErrorTableResource.T_ERETTSEGIVALASZ_OSSZES},
|
||||
{"T_ERRORSTATUS", ConnectionErrorTableResource.T_ERRORSTATUS},
|
||||
{"T_ERRORSTATUS_OSSZES", ConnectionErrorTableResource.T_ERRORSTATUS_OSSZES},
|
||||
{"T_ERRORTYPE", ConnectionErrorTableResource.T_ERRORTYPE},
|
||||
{"T_ERRORTYPE_OSSZES", ConnectionErrorTableResource.T_ERRORTYPE_OSSZES},
|
||||
{"T_ERTEKELESMOD", ConnectionErrorTableResource.T_ERTEKELESMOD},
|
||||
{"T_ERTEKELESMOD_OSSZES", ConnectionErrorTableResource.T_ERTEKELESMOD_OSSZES},
|
||||
{"T_ERTEKELESMONDATBANK", ConnectionErrorTableResource.T_ERTEKELESMONDATBANK},
|
||||
{"T_ERTEKELESMONDATBANK_OSSZES", ConnectionErrorTableResource.T_ERTEKELESMONDATBANK_OSSZES},
|
||||
{"T_ERTEKELESTIPUS", ConnectionErrorTableResource.T_ERTEKELESTIPUS},
|
||||
{"T_ERTEKELESTIPUS_OSSZES", ConnectionErrorTableResource.T_ERTEKELESTIPUS_OSSZES},
|
||||
{"T_ERTELMIFOGYATEKOSTIPUS", ConnectionErrorTableResource.T_ERTELMIFOGYATEKOSTIPUS},
|
||||
{"T_ERTELMIFOGYATEKOSTIPUS_OSSZES", ConnectionErrorTableResource.T_ERTELMIFOGYATEKOSTIPUS_OSSZES},
|
||||
{"T_ERTESITES", ConnectionErrorTableResource.T_ERTESITES},
|
||||
{"T_ERTESITES_OSSZES", ConnectionErrorTableResource.T_ERTESITES_OSSZES},
|
||||
{"T_ERTESITESGENERALASTORTENET", ConnectionErrorTableResource.T_ERTESITESGENERALASTORTENET},
|
||||
{"T_ERTESITESGENERALASTORTENET_OSSZES", ConnectionErrorTableResource.T_ERTESITESGENERALASTORTENET_OSSZES},
|
||||
{"T_ERTESITESSZINTIPUS", ConnectionErrorTableResource.T_ERTESITESSZINTIPUS},
|
||||
{"T_ERTESITESSZINTIPUS_OSSZES", ConnectionErrorTableResource.T_ERTESITESSZINTIPUS_OSSZES},
|
||||
{"T_ERTESITESTIPUS", ConnectionErrorTableResource.T_ERTESITESTIPUS},
|
||||
{"T_ERTESITESTIPUS_OSSZES", ConnectionErrorTableResource.T_ERTESITESTIPUS_OSSZES},
|
||||
{"T_ESEMENYSTATUSZ", ConnectionErrorTableResource.T_ESEMENYSTATUSZ},
|
||||
{"T_ESEMENYSTATUSZ_OSSZES", ConnectionErrorTableResource.T_ESEMENYSTATUSZ_OSSZES},
|
||||
{"T_ESEMENYTIPUS", ConnectionErrorTableResource.T_ESEMENYTIPUS},
|
||||
{"T_ESEMENYTIPUS_OSSZES", ConnectionErrorTableResource.T_ESEMENYTIPUS_OSSZES},
|
||||
{"T_ESLADAT", ConnectionErrorTableResource.T_ESLADAT},
|
||||
{"T_ESLADAT_OSSZES", ConnectionErrorTableResource.T_ESLADAT_OSSZES},
|
||||
{"T_ESLADATTIPUS", ConnectionErrorTableResource.T_ESLADATTIPUS},
|
||||
{"T_ESLADATTIPUS_OSSZES", ConnectionErrorTableResource.T_ESLADATTIPUS_OSSZES},
|
||||
{"T_ESZKOZ", ConnectionErrorTableResource.T_ESZKOZ},
|
||||
{"T_ESZKOZ_OSSZES", ConnectionErrorTableResource.T_ESZKOZ_OSSZES},
|
||||
{"T_ESZKOZCEL", ConnectionErrorTableResource.T_ESZKOZCEL},
|
||||
{"T_ESZKOZCEL_OSSZES", ConnectionErrorTableResource.T_ESZKOZCEL_OSSZES},
|
||||
{"T_ESZKOZJELLEG", ConnectionErrorTableResource.T_ESZKOZJELLEG},
|
||||
{"T_ESZKOZJELLEG_OSSZES", ConnectionErrorTableResource.T_ESZKOZJELLEG_OSSZES},
|
||||
{"T_ESZKOZKATEGORIA", ConnectionErrorTableResource.T_ESZKOZKATEGORIA},
|
||||
{"T_ESZKOZKATEGORIA_OSSZES", ConnectionErrorTableResource.T_ESZKOZKATEGORIA_OSSZES},
|
||||
{"T_ESZKOZTIPUS", ConnectionErrorTableResource.T_ESZKOZTIPUS},
|
||||
{"T_ESZKOZTIPUS_OSSZES", ConnectionErrorTableResource.T_ESZKOZTIPUS_OSSZES},
|
||||
{"T_ETKEZESIKEDVEZMENYTIPUS", ConnectionErrorTableResource.T_ETKEZESIKEDVEZMENYTIPUS},
|
||||
{"T_ETKEZESIKEDVEZMENYTIPUS_OSSZES", ConnectionErrorTableResource.T_ETKEZESIKEDVEZMENYTIPUS_OSSZES},
|
||||
{"T_EVFOLYAMTIPUS", ConnectionErrorTableResource.T_EVFOLYAMTIPUS},
|
||||
{"T_EVFOLYAMTIPUS_OSSZES", ConnectionErrorTableResource.T_EVFOLYAMTIPUS_OSSZES},
|
||||
{"T_EVFOLYAMTIPUS_OKTATASINEVELE", ConnectionErrorTableResource.T_EVFOLYAMTIPUS_OKTATASINEVELE},
|
||||
{"T_EVFOLYAMTIPUS_OKTATASINEVELE_OSSZES", ConnectionErrorTableResource.T_EVFOLYAMTIPUS_OKTATASINEVELE_OSSZES},
|
||||
{"T_FELADATELLATASIHELY", ConnectionErrorTableResource.T_FELADATELLATASIHELY},
|
||||
{"T_FELADATELLATASIHELY_OSSZES", ConnectionErrorTableResource.T_FELADATELLATASIHELY_OSSZES},
|
||||
{"T_FELHASZNALO", ConnectionErrorTableResource.T_FELHASZNALO},
|
||||
{"T_FELHASZNALO_OSSZES", ConnectionErrorTableResource.T_FELHASZNALO_OSSZES},
|
||||
{"T_FELHASZNALOBELEPES", ConnectionErrorTableResource.T_FELHASZNALOBELEPES},
|
||||
{"T_FELHASZNALOBELEPES_OSSZES", ConnectionErrorTableResource.T_FELHASZNALOBELEPES_OSSZES},
|
||||
{"T_FELHASZNALOBELEPESTORTENET", ConnectionErrorTableResource.T_FELHASZNALOBELEPESTORTENET},
|
||||
{"T_FELHASZNALOBELEPESTORTENET_OSSZES", ConnectionErrorTableResource.T_FELHASZNALOBELEPESTORTENET_OSSZES},
|
||||
{"T_FELHASZNALOBELEPESTORTENET_S", ConnectionErrorTableResource.T_FELHASZNALOBELEPESTORTENET_S},
|
||||
{"T_FELHASZNALO_SZEREPKOR", ConnectionErrorTableResource.T_FELHASZNALO_SZEREPKOR},
|
||||
{"T_FELJEGYZESTIPUS", ConnectionErrorTableResource.T_FELJEGYZESTIPUS},
|
||||
{"T_FELJEGYZESTIPUS_OSSZES", ConnectionErrorTableResource.T_FELJEGYZESTIPUS_OSSZES},
|
||||
{"T_FELVETELSTATUSZATIPUS", ConnectionErrorTableResource.T_FELVETELSTATUSZATIPUS},
|
||||
{"T_FELVETELSTATUSZATIPUS_OSSZES", ConnectionErrorTableResource.T_FELVETELSTATUSZATIPUS_OSSZES},
|
||||
{"T_FENNTARTO", ConnectionErrorTableResource.T_FENNTARTO},
|
||||
{"T_FENNTARTO_OSSZES", ConnectionErrorTableResource.T_FENNTARTO_OSSZES},
|
||||
{"T_FENNTARTOTIPUS", ConnectionErrorTableResource.T_FENNTARTOTIPUS},
|
||||
{"T_FENNTARTOTIPUS_OSSZES", ConnectionErrorTableResource.T_FENNTARTOTIPUS_OSSZES},
|
||||
{"T_FOGADOORA", ConnectionErrorTableResource.T_FOGADOORA},
|
||||
{"T_FOGADOORA_OSSZES", ConnectionErrorTableResource.T_FOGADOORA_OSSZES},
|
||||
{"T_FOGLALKOZAS", ConnectionErrorTableResource.T_FOGLALKOZAS},
|
||||
{"T_FOGLALKOZAS_OSSZES", ConnectionErrorTableResource.T_FOGLALKOZAS_OSSZES},
|
||||
{"T_FOGLALKOZASAMITANULO_OSSZES", ConnectionErrorTableResource.T_FOGLALKOZASAMITANULO_OSSZES },
|
||||
{"T_FOGLALKOZASARCHIV", ConnectionErrorTableResource.T_FOGLALKOZASARCHIV},
|
||||
{"T_FOGLALKOZASARCHIV_OSSZES", ConnectionErrorTableResource.T_FOGLALKOZASARCHIV_OSSZES},
|
||||
{"T_FOGLALKOZASOK_TANAROK", ConnectionErrorTableResource.T_FOGLALKOZASOK_TANAROK},
|
||||
{"T_FOGLALKOZASTIPUS", ConnectionErrorTableResource.T_FOGLALKOZASTIPUS},
|
||||
{"T_FOGLALKOZASTIPUS_OSSZES", ConnectionErrorTableResource.T_FOGLALKOZASTIPUS_OSSZES},
|
||||
{"T_FOGLALKOZTATASTIPUSA", ConnectionErrorTableResource.T_FOGLALKOZTATASTIPUSA},
|
||||
{"T_FOGLALKOZTATASTIPUSA_OSSZES", ConnectionErrorTableResource.T_FOGLALKOZTATASTIPUSA_OSSZES},
|
||||
{"T_FORRAS", ConnectionErrorTableResource.T_FORRAS},
|
||||
{"T_FORRAS_OSSZES", ConnectionErrorTableResource.T_FORRAS_OSSZES},
|
||||
{"T_GIMNAZIUMIEVFOLYAMTIPUS", ConnectionErrorTableResource.T_GIMNAZIUMIEVFOLYAMTIPUS},
|
||||
{"T_GIMNAZIUMIEVFOLYAMTIPUS_OSSZES", ConnectionErrorTableResource.T_GIMNAZIUMIEVFOLYAMTIPUS_OSSZES},
|
||||
{"T_GONDVISELO", ConnectionErrorTableResource.T_GONDVISELO},
|
||||
{"T_GONDVISELO_OSSZES", ConnectionErrorTableResource.T_GONDVISELO_OSSZES},
|
||||
{"T_HALLASSERULTTIPUS", ConnectionErrorTableResource.T_HALLASSERULTTIPUS},
|
||||
{"T_HALLASSERULTTIPUS_OSSZES", ConnectionErrorTableResource.T_HALLASSERULTTIPUS_OSSZES},
|
||||
{"T_HATRANYOSHELYZETTIPUS", ConnectionErrorTableResource.T_HATRANYOSHELYZETTIPUS},
|
||||
{"T_HATRANYOSHELYZETTIPUS_OSSZES", ConnectionErrorTableResource.T_HATRANYOSHELYZETTIPUS_OSSZES},
|
||||
{"T_HAZIFELADATOK", ConnectionErrorTableResource.T_HAZIFELADATOK},
|
||||
{"T_HAZIFELADATOK_OSSZES", ConnectionErrorTableResource.T_HAZIFELADATOK_OSSZES},
|
||||
{"T_HELYETTESITESIIDOSZAK", ConnectionErrorTableResource.T_HELYETTESITESIIDOSZAK},
|
||||
{"T_HELYETTESITESIIDOSZAK_OSSZES", ConnectionErrorTableResource.T_HELYETTESITESIIDOSZAK_OSSZES},
|
||||
{"T_HELYETTESITESTIPUS", ConnectionErrorTableResource.T_HELYETTESITESTIPUS},
|
||||
{"T_HELYETTESITESTIPUS_OSSZES", ConnectionErrorTableResource.T_HELYETTESITESTIPUS_OSSZES},
|
||||
{"T_HETIRENDTIPUS", ConnectionErrorTableResource.T_HETIRENDTIPUS},
|
||||
{"T_HETIRENDTIPUS_OSSZES", ConnectionErrorTableResource.T_HETIRENDTIPUS_OSSZES},
|
||||
{"T_HETNAPJATIPUS", ConnectionErrorTableResource.T_HETNAPJATIPUS},
|
||||
{"T_HETNAPJATIPUS_OSSZES", ConnectionErrorTableResource.T_HETNAPJATIPUS_OSSZES},
|
||||
{"T_HIBAJEGYSTATUSZ", ConnectionErrorTableResource.T_HIBAJEGYSTATUSZ},
|
||||
{"T_HIBAJEGYSTATUSZ_OSSZES", ConnectionErrorTableResource.T_HIBAJEGYSTATUSZ_OSSZES},
|
||||
{"T_HITTANADATSZOLGALTATAS", ConnectionErrorTableResource.T_HITTANADATSZOLGALTATAS},
|
||||
{"T_HITTANADATSZOLGALTATAS_OSSZES", ConnectionErrorTableResource.T_HITTANADATSZOLGALTATAS_OSSZES},
|
||||
{"T_HITTANTIPUS", ConnectionErrorTableResource.T_HITTANTIPUS},
|
||||
{"T_HITTANTIPUS_OSSZES", ConnectionErrorTableResource.T_HITTANTIPUS_OSSZES},
|
||||
{"T_HONAPOK", ConnectionErrorTableResource.T_HONAPOK},
|
||||
{"T_HONAPOK_OSSZES", ConnectionErrorTableResource.T_HONAPOK_OSSZES},
|
||||
{"T_IDOKERET", ConnectionErrorTableResource.T_IDOKERET},
|
||||
{"T_IDOKERET_OSSZES", ConnectionErrorTableResource.T_IDOKERET_OSSZES},
|
||||
{"T_IGAZOLAS", ConnectionErrorTableResource.T_IGAZOLAS},
|
||||
{"T_IGAZOLAS_OSSZES", ConnectionErrorTableResource.T_IGAZOLAS_OSSZES},
|
||||
{"T_IGAZOLASTIPUS", ConnectionErrorTableResource.T_IGAZOLASTIPUS},
|
||||
{"T_IGAZOLASTIPUS_OSSZES", ConnectionErrorTableResource.T_IGAZOLASTIPUS_OSSZES},
|
||||
{"T_IGAZOLVANYTIPUS", ConnectionErrorTableResource.T_IGAZOLVANYTIPUS},
|
||||
{"T_IGAZOLVANYTIPUS_OSSZES", ConnectionErrorTableResource.T_IGAZOLVANYTIPUS_OSSZES},
|
||||
{"T_IKTATOTTDOKUMENTUM", ConnectionErrorTableResource.T_IKTATOTTDOKUMENTUM},
|
||||
{"T_IKTATOTTDOKUMENTUM_OSSZES", ConnectionErrorTableResource.T_IKTATOTTDOKUMENTUM_OSSZES},
|
||||
{"T_IKTATOTTDOKUMENTUMOK", ConnectionErrorTableResource.T_IKTATOTTDOKUMENTUMOK},
|
||||
{"T_IKTATOTTDOKUMENTUMOK_OSSZES", ConnectionErrorTableResource.T_IKTATOTTDOKUMENTUMOK_OSSZES},
|
||||
{"T_IKTESZKOZHASZNALATMOD", ConnectionErrorTableResource.T_IKTESZKOZHASZNALATMOD},
|
||||
{"T_IKTESZKOZHASZNALATMOD_OSSZES", ConnectionErrorTableResource.T_IKTESZKOZHASZNALATMOD_OSSZES},
|
||||
{"T_IKTKOMPETENCIASZINT", ConnectionErrorTableResource.T_IKTKOMPETENCIASZINT},
|
||||
{"T_IKTKOMPETENCIASZINT_OSSZES", ConnectionErrorTableResource.T_IKTKOMPETENCIASZINT_OSSZES},
|
||||
{"T_INGYENESTANKONYVELLATAS", ConnectionErrorTableResource.T_INGYENESTANKONYVELLATAS},
|
||||
{"T_INGYENESTANKONYVELLATAS_OSSZES", ConnectionErrorTableResource.T_INGYENESTANKONYVELLATAS_OSSZES},
|
||||
{"T_INTEZMENY", ConnectionErrorTableResource.T_INTEZMENY},
|
||||
{"T_INTEZMENY_OSSZES", ConnectionErrorTableResource.T_INTEZMENY_OSSZES},
|
||||
{"T_INTEZMENYADATOK", ConnectionErrorTableResource.T_INTEZMENYADATOK},
|
||||
{"T_INTEZMENYADATOK_OSSZES", ConnectionErrorTableResource.T_INTEZMENYADATOK_OSSZES},
|
||||
{"T_INTEZMENYADATSZOLGALTATAS", ConnectionErrorTableResource.T_INTEZMENYADATSZOLGALTATAS},
|
||||
{"T_INTEZMENYADATSZOLGALTATAS_OSSZES", ConnectionErrorTableResource.T_INTEZMENYADATSZOLGALTATAS_OSSZES},
|
||||
{"T_INTEZMENYESZKOZADATSZOLGALTA", ConnectionErrorTableResource.T_INTEZMENYESZKOZADATSZOLGALTA},
|
||||
{"T_INTEZMENYESZKOZADATSZOLGALTA_OSSZES", ConnectionErrorTableResource.T_INTEZMENYESZKOZADATSZOLGALTA_OSSZES},
|
||||
{"T_JELSZOVISSZAALLITAS", ConnectionErrorTableResource.T_JELSZOVISSZAALLITAS},
|
||||
{"T_JELSZOVISSZAALLITAS_OSSZES", ConnectionErrorTableResource.T_JELSZOVISSZAALLITAS_OSSZES},
|
||||
{"T_JOGOSULTFELHASZNALOK_HOZZARE", ConnectionErrorTableResource.T_JOGOSULTFELHASZNALOK_HOZZARE},
|
||||
{"T_JOGOSULTSAG", ConnectionErrorTableResource.T_JOGOSULTSAG},
|
||||
{"T_JOGOSULTSAG_OSSZES", ConnectionErrorTableResource.T_JOGOSULTSAG_OSSZES},
|
||||
{"T_JOGOSULTSAG_FELHASZNALO", ConnectionErrorTableResource.T_JOGOSULTSAG_FELHASZNALO},
|
||||
{"T_JUTTATAS", ConnectionErrorTableResource.T_JUTTATAS},
|
||||
{"T_JUTTATAS_OSSZES", ConnectionErrorTableResource.T_JUTTATAS},
|
||||
{"T_KEPESITES", ConnectionErrorTableResource.T_KEPESITES},
|
||||
{"T_KEPESITES_OSSZES", ConnectionErrorTableResource.T_KEPESITES_OSSZES},
|
||||
{"T_KEPESITES_VEGZETTSEG", ConnectionErrorTableResource.T_KEPESITES_VEGZETTSEG},
|
||||
{"T_KIRTELEPHELY", ConnectionErrorTableResource.T_KIRTELEPHELY},
|
||||
{"T_KIRTELEPHELY_OSSZES", ConnectionErrorTableResource.T_KIRTELEPHELY_OSSZES},
|
||||
{"T_KIZAROCSOPORTTIPUS", ConnectionErrorTableResource.T_KIZAROCSOPORTTIPUS},
|
||||
{"T_KIZAROCSOPORTTIPUS_OSSZES", ConnectionErrorTableResource.T_KIZAROCSOPORTTIPUS_OSSZES},
|
||||
{"T_KKAMIVEGZETTSEG", ConnectionErrorTableResource.T_KKAMIVEGZETTSEG},
|
||||
{"T_KKAMIVEGZETTSEG_OSSZES", ConnectionErrorTableResource.T_KKAMIVEGZETTSEG_OSSZES},
|
||||
{"T_KKGYOGYPEDVEGZETTSEG", ConnectionErrorTableResource.T_KKGYOGYPEDVEGZETTSEG},
|
||||
{"T_KKGYOGYPEDVEGZETTSEG_OSSZES", ConnectionErrorTableResource.T_KKGYOGYPEDVEGZETTSEG_OSSZES},
|
||||
{"T_KKTANARVEGZETTSEG", ConnectionErrorTableResource.T_KKTANARVEGZETTSEG},
|
||||
{"T_KKTANARVEGZETTSEG_OSSZES", ConnectionErrorTableResource.T_KKTANARVEGZETTSEG_OSSZES},
|
||||
{"T_KKTANITOVEZGETTSEG", ConnectionErrorTableResource.T_KKTANITOVEZGETTSEG},
|
||||
{"T_KKTANITOVEZGETTSEG_OSSZES", ConnectionErrorTableResource.T_KKTANITOVEZGETTSEG_OSSZES},
|
||||
{"T_KOZMUSZAMLA", ConnectionErrorTableResource.T_KOZMUSZAMLA},
|
||||
{"T_KOZMUSZAMLA_OSSZES", ConnectionErrorTableResource.T_KOZMUSZAMLA_OSSZES},
|
||||
{"T_KOZMUSZAMLATIPUS", ConnectionErrorTableResource.T_KOZMUSZAMLATIPUS},
|
||||
{"T_KOZMUSZAMLATIPUS_OSSZES", ConnectionErrorTableResource.T_KOZMUSZAMLATIPUS_OSSZES},
|
||||
{"T_KOZOSSEGISZOLGALATTIPUS", ConnectionErrorTableResource.T_KOZOSSEGISZOLGALATTIPUS},
|
||||
{"T_KOZOSSEGISZOLGALATTIPUS_OSSZES", ConnectionErrorTableResource.T_KOZOSSEGISZOLGALATTIPUS_OSSZES},
|
||||
{"T_KOZTERULETJELLEG", ConnectionErrorTableResource.T_KOZTERULETJELLEG},
|
||||
{"T_KOZTERULETJELLEG_OSSZES", ConnectionErrorTableResource.T_KOZTERULETJELLEG_OSSZES},
|
||||
{"T_KRETATIPUS", ConnectionErrorTableResource.T_KRETATIPUS},
|
||||
{"T_KRETATIPUS_OSSZES", ConnectionErrorTableResource.T_KRETATIPUS_OSSZES},
|
||||
{"T_KULFOLDISTATUSZTIPUS", ConnectionErrorTableResource.T_KULFOLDISTATUSZTIPUS},
|
||||
{"T_KULFOLDISTATUSZTIPUS_OSSZES", ConnectionErrorTableResource.T_KULFOLDISTATUSZTIPUS_OSSZES},
|
||||
{"T_LATASSERULTTIPUS", ConnectionErrorTableResource.T_LATASSERULTTIPUS},
|
||||
{"T_LATASSERULTTIPUS_OSSZES", ConnectionErrorTableResource.T_LATASSERULTTIPUS_OSSZES},
|
||||
{"T_LICENCE", ConnectionErrorTableResource.T_LICENCE},
|
||||
{"T_LICENCE_OSSZES", ConnectionErrorTableResource.T_LICENCE_OSSZES},
|
||||
{"T_LICENCEFUNKCIOKTIPUS", ConnectionErrorTableResource.T_LICENCEFUNKCIOKTIPUS},
|
||||
{"T_LICENCEFUNKCIOKTIPUS_OSSZES", ConnectionErrorTableResource.T_LICENCEFUNKCIOKTIPUS_OSSZES},
|
||||
{"T_LOG", ConnectionErrorTableResource.T_LOG},
|
||||
{"T_LOG_OSSZES", ConnectionErrorTableResource.T_LOG_OSSZES},
|
||||
{"T_LOGEVENTTYPE", ConnectionErrorTableResource.T_LOGEVENTTYPE},
|
||||
{"T_LOGEVENTTYPE_OSSZES", ConnectionErrorTableResource.T_LOGEVENTTYPE_OSSZES},
|
||||
{"T_LOGLEVELTYPE", ConnectionErrorTableResource.T_LOGLEVELTYPE},
|
||||
{"T_LOGLEVELTYPE_OSSZES", ConnectionErrorTableResource.T_LOGLEVELTYPE_OSSZES},
|
||||
{"T_MAGANTANULOSAGOKA", ConnectionErrorTableResource.T_MAGANTANULOSAGOKA},
|
||||
{"T_MAGANTANULOSAGOKA_OSSZES", ConnectionErrorTableResource.T_MAGANTANULOSAGOKA_OSSZES},
|
||||
{"T_MAGATARTASERTEKELESTIPUS", ConnectionErrorTableResource.T_MAGATARTASERTEKELESTIPUS},
|
||||
{"T_MAGATARTASERTEKELESTIPUS_OSSZES", ConnectionErrorTableResource.T_MAGATARTASERTEKELESTIPUS_OSSZES},
|
||||
{"T_MEGYE", ConnectionErrorTableResource.T_MEGYE},
|
||||
{"T_MEGYE_OSSZES", ConnectionErrorTableResource.T_MEGYE_OSSZES},
|
||||
{"T_MEROALLAS", ConnectionErrorTableResource.T_MEROALLAS},
|
||||
{"T_MEROALLAS_OSSZES", ConnectionErrorTableResource.T_MEROALLAS_OSSZES},
|
||||
{"T_MEROHELY", ConnectionErrorTableResource.T_MEROHELY},
|
||||
{"T_MEROHELY_OSSZES", ConnectionErrorTableResource.T_MEROHELY_OSSZES},
|
||||
{"T_MEROHELYTIPUS", ConnectionErrorTableResource.T_MEROHELYTIPUS},
|
||||
{"T_MEROHELYTIPUS_OSSZES", ConnectionErrorTableResource.T_MEROHELYTIPUS_OSSZES},
|
||||
{"T_MERTEKEGYSEGTIPUS", ConnectionErrorTableResource.T_MERTEKEGYSEGTIPUS},
|
||||
{"T_MERTEKEGYSEGTIPUS_OSSZES", ConnectionErrorTableResource.T_MERTEKEGYSEGTIPUS_OSSZES},
|
||||
{"T_MESSAGESTATUS", ConnectionErrorTableResource.T_MESSAGESTATUS},
|
||||
{"T_MESSAGESTATUS_OSSZES", ConnectionErrorTableResource.T_MESSAGESTATUS_OSSZES},
|
||||
{"T_MUKODESIHELY", ConnectionErrorTableResource.T_MUKODESIHELY},
|
||||
{"T_MUKODESIHELY_OSSZES", ConnectionErrorTableResource.T_MUKODESIHELY_OSSZES},
|
||||
{"T_MUKODESIHELYADATSZOLGALTATAS", ConnectionErrorTableResource.T_MUKODESIHELYADATSZOLGALTATAS},
|
||||
{"T_MUKODESIHELYADATSZOLGALTATAS_OSSZES", ConnectionErrorTableResource.T_MUKODESIHELYADATSZOLGALTATAS_OSSZES},
|
||||
{"T_MUKODESIHELYTIPUS", ConnectionErrorTableResource.T_MUKODESIHELYTIPUS},
|
||||
{"T_MUKODESIHELYTIPUS_OSSZES", ConnectionErrorTableResource.T_MUKODESIHELYTIPUS_OSSZES},
|
||||
{"T_MULASZTASSTATISZTIKATIPUS", ConnectionErrorTableResource.T_MULASZTASSTATISZTIKATIPUS},
|
||||
{"T_MULASZTASSTATISZTIKATIPUS_OSSZES", ConnectionErrorTableResource.T_MULASZTASSTATISZTIKATIPUS_OSSZES},
|
||||
{"T_MULASZTASTIPUS", ConnectionErrorTableResource.T_MULASZTASTIPUS},
|
||||
{"T_MULASZTASTIPUS_OSSZES", ConnectionErrorTableResource.T_MULASZTASTIPUS_OSSZES},
|
||||
{"T_MUNKAIDOKEDVEZMENYOKA", ConnectionErrorTableResource.T_MUNKAIDOKEDVEZMENYOKA},
|
||||
{"T_MUNKAIDOKEDVEZMENYOKA_OSSZES", ConnectionErrorTableResource.T_MUNKAIDOKEDVEZMENYOKA_OSSZES},
|
||||
{"T_MUNKAKORTIPUS", ConnectionErrorTableResource.T_MUNKAKORTIPUS},
|
||||
{"T_MUNKAKORTIPUS_OSSZES", ConnectionErrorTableResource.T_MUNKAKORTIPUS_OSSZES},
|
||||
{"T_MUNKAUGYIADATOK", ConnectionErrorTableResource.T_MUNKAUGYIADATOK},
|
||||
{"T_MUNKAUGYIADATOK_OSSZES", ConnectionErrorTableResource.T_MUNKAUGYIADATOK_OSSZES},
|
||||
{"T_MUNKAVISZONYJELLEGE", ConnectionErrorTableResource.T_MUNKAVISZONYJELLEGE},
|
||||
{"T_MUNKAVISZONYJELLEGE_OSSZES", ConnectionErrorTableResource.T_MUNKAVISZONYJELLEGE_OSSZES},
|
||||
{"T_MUNKAVISZONYTIPUS", ConnectionErrorTableResource.T_MUNKAVISZONYTIPUS},
|
||||
{"T_MUNKAVISZONYTIPUS_OSSZES", ConnectionErrorTableResource.T_MUNKAVISZONYTIPUS_OSSZES},
|
||||
{"T_NAPLOELLENORZES", ConnectionErrorTableResource.T_NAPLOELLENORZES},
|
||||
{"T_NAPLOELLENORZES_OSSZES", ConnectionErrorTableResource.T_NAPLOELLENORZES_OSSZES},
|
||||
{"T_NAPTARIHET", ConnectionErrorTableResource.T_NAPTARIHET},
|
||||
{"T_NAPTARIHET_OSSZES", ConnectionErrorTableResource.T_NAPTARIHET_OSSZES},
|
||||
{"T_NAPTARINAP", ConnectionErrorTableResource.T_NAPTARINAP},
|
||||
{"T_NAPTARINAP_OSSZES", ConnectionErrorTableResource.T_NAPTARINAP_OSSZES},
|
||||
{"T_NAPTIPUS", ConnectionErrorTableResource.T_NAPTIPUS},
|
||||
{"T_NAPTIPUS_OSSZES", ConnectionErrorTableResource.T_NAPTIPUS_OSSZES},
|
||||
{"T_NATKERDOIV", ConnectionErrorTableResource.T_NATKERDOIV},
|
||||
{"T_NATKERDOIV_OSSZES", ConnectionErrorTableResource.T_NATKERDOIV_OSSZES},
|
||||
{"T_NEBULO", ConnectionErrorTableResource.T_NEBULO},
|
||||
{"T_NEBULO_OSSZES", ConnectionErrorTableResource.T_NEBULO_OSSZES},
|
||||
{"T_NEM", ConnectionErrorTableResource.T_NEM},
|
||||
{"T_NEM_OSSZES", ConnectionErrorTableResource.T_NEM_OSSZES},
|
||||
{"T_NEMKOTOTTMUNKAIDO", ConnectionErrorTableResource.T_NEMKOTOTTMUNKAIDO},
|
||||
{"T_NEMKOTOTTMUNKAIDO_OSSZES", ConnectionErrorTableResource.T_NEMKOTOTTMUNKAIDO_OSSZES},
|
||||
{"T_OKTATASINEVELESIFELADAT", ConnectionErrorTableResource.T_OKTATASINEVELESIFELADAT},
|
||||
{"T_OKTATASINEVELESIFELADAT_OSSZES", ConnectionErrorTableResource.T_OKTATASINEVELESIFELADAT_OSSZES},
|
||||
{"T_OLDALLATOGATOTTSAG", ConnectionErrorTableResource.T_OLDALLATOGATOTTSAG},
|
||||
{"T_OLDALLATOGATOTTSAG_OSSZES", ConnectionErrorTableResource.T_OLDALLATOGATOTTSAG_OSSZES},
|
||||
{"T_ORAK_TANAROK", ConnectionErrorTableResource.T_ORAK_TANAROK},
|
||||
{"T_ORALATOGATAS", ConnectionErrorTableResource.T_ORALATOGATAS},
|
||||
{"T_ORALATOGATAS_OSSZES", ConnectionErrorTableResource.T_ORALATOGATAS_OSSZES},
|
||||
{"T_ORAREND", ConnectionErrorTableResource.T_ORAREND},
|
||||
{"T_ORAREND_OSSZES", ConnectionErrorTableResource.T_ORAREND_OSSZES},
|
||||
{"T_ORARENDIORA", ConnectionErrorTableResource.T_ORARENDIORA},
|
||||
{"T_ORARENDIORA_OSSZES", ConnectionErrorTableResource.T_ORARENDIORA_OSSZES},
|
||||
{"T_ORARENDIORATULAJDONSAG", ConnectionErrorTableResource.T_ORARENDIORATULAJDONSAG},
|
||||
{"T_ORARENDIORATULAJDONSAG_OSSZES", ConnectionErrorTableResource.T_ORARENDIORATULAJDONSAG_OSSZES},
|
||||
{"T_ORARENDORATULAJDONSAG", ConnectionErrorTableResource.T_ORARENDORATULAJDONSAG},
|
||||
{"T_ORARENDORATULAJDONSAG_OSSZES", ConnectionErrorTableResource.T_ORARENDORATULAJDONSAG_OSSZES},
|
||||
{"T_ORARENDSABLON", ConnectionErrorTableResource.T_ORARENDSABLON},
|
||||
{"T_ORARENDSABLON_OSSZES", ConnectionErrorTableResource.T_ORARENDSABLON_OSSZES},
|
||||
{"T_ORATERV", ConnectionErrorTableResource.T_ORATERV},
|
||||
{"T_ORATERV_OSSZES", ConnectionErrorTableResource.T_ORATERV_OSSZES},
|
||||
{"T_ORATERVTARGY", ConnectionErrorTableResource.T_ORATERVTARGY},
|
||||
{"T_ORATERVTARGY_OSSZES", ConnectionErrorTableResource.T_ORATERVTARGY_OSSZES},
|
||||
{"T_ORATULAJDONSAGTIPUS", ConnectionErrorTableResource.T_ORATULAJDONSAGTIPUS},
|
||||
{"T_ORATULAJDONSAGTIPUS_OSSZES", ConnectionErrorTableResource.T_ORATULAJDONSAGTIPUS_OSSZES},
|
||||
{"T_ORSZAGTIPUS", ConnectionErrorTableResource.T_ORSZAGTIPUS},
|
||||
{"T_ORSZAGTIPUS_OSSZES", ConnectionErrorTableResource.T_ORSZAGTIPUS_OSSZES},
|
||||
{"T_OSSZEGTULLEPESTIPUS", ConnectionErrorTableResource.T_OSSZEGTULLEPESTIPUS},
|
||||
{"T_OSSZEGTULLEPESTIPUS_OSSZES", ConnectionErrorTableResource.T_OSSZEGTULLEPESTIPUS_OSSZES},
|
||||
{"T_OSZTALY", ConnectionErrorTableResource.T_OSZTALY},
|
||||
{"T_OSZTALY_OSSZES", ConnectionErrorTableResource.T_OSZTALY_OSSZES},
|
||||
{"T_OSZTALYCSOPORT", ConnectionErrorTableResource.T_OSZTALYCSOPORT},
|
||||
{"T_OSZTALYCSOPORT_OSSZES", ConnectionErrorTableResource.T_OSZTALYCSOPORT_OSSZES},
|
||||
{"T_OSZTALYCSOPORT_TANEVRENDJE", ConnectionErrorTableResource.T_OSZTALYCSOPORT_TANEVRENDJE},
|
||||
{"T_OSZTALYCSOPORT_TANULOESEMENY", ConnectionErrorTableResource.T_OSZTALYCSOPORT_TANULOESEMENY},
|
||||
{"T_OSZTALYFONOKIERTEKELES", ConnectionErrorTableResource.T_OSZTALYFONOKIERTEKELES},
|
||||
{"T_OSZTALYFONOKIERTEKELES_OSSZES", ConnectionErrorTableResource.T_OSZTALYFONOKIERTEKELES_OSSZES},
|
||||
{"T_OSZTALYZATERTEKELES", ConnectionErrorTableResource.T_OSZTALYZATERTEKELES},
|
||||
{"T_OSZTALYZATERTEKELES_OSSZES", ConnectionErrorTableResource.T_OSZTALYZATERTEKELES_OSSZES},
|
||||
{"T_OSZTALYZATTIPUS", ConnectionErrorTableResource.T_OSZTALYZATTIPUS},
|
||||
{"T_OSZTALYZATTIPUS_OSSZES", ConnectionErrorTableResource.T_OSZTALYZATTIPUS_OSSZES},
|
||||
{"T_PEDAGOGUSELETPALYAMODELL", ConnectionErrorTableResource.T_PEDAGOGUSELETPALYAMODELL},
|
||||
{"T_PEDAGOGUSELETPALYAMODELL_OSSZES", ConnectionErrorTableResource.T_PEDAGOGUSELETPALYAMODELL_OSSZES},
|
||||
{"T_PEDAGOGUSIKTADATSZOLGALTATAS", ConnectionErrorTableResource.T_PEDAGOGUSIKTADATSZOLGALTATAS},
|
||||
{"T_PEDAGOGUSIKTADATSZOLGALTATAS_OSSZES", ConnectionErrorTableResource.T_PEDAGOGUSIKTADATSZOLGALTATAS_OSSZES},
|
||||
{"T_PEDAGOGUSSTATUSZ", ConnectionErrorTableResource.T_PEDAGOGUSSTATUSZ},
|
||||
{"T_PEDAGOGUSSTATUSZ_OSSZES", ConnectionErrorTableResource.T_PEDAGOGUSSTATUSZ_OSSZES},
|
||||
{"T_PENZNEMTIPUS", ConnectionErrorTableResource.T_PENZNEMTIPUS},
|
||||
{"T_PENZNEMTIPUS_OSSZES", ConnectionErrorTableResource.T_PENZNEMTIPUS_OSSZES},
|
||||
{"T_PRIORITAS", ConnectionErrorTableResource.T_PRIORITAS},
|
||||
{"T_PRIORITAS_OSSZES", ConnectionErrorTableResource.T_PRIORITAS_OSSZES},
|
||||
{"T_RENDSZERBEALLITAS", ConnectionErrorTableResource.T_RENDSZERBEALLITAS},
|
||||
{"T_RENDSZERBEALLITAS_OSSZES", ConnectionErrorTableResource.T_RENDSZERBEALLITAS_OSSZES},
|
||||
{"T_RENDSZERBEALLITASTIPUS", ConnectionErrorTableResource.T_RENDSZERBEALLITASTIPUS},
|
||||
{"T_RENDSZERBEALLITASTIPUS_OSSZES", ConnectionErrorTableResource.T_RENDSZERBEALLITASTIPUS_OSSZES},
|
||||
{"T_RENDSZERERTESITESEK", ConnectionErrorTableResource.T_RENDSZERERTESITESEK},
|
||||
{"T_RENDSZERERTESITESEK_OSSZES", ConnectionErrorTableResource.T_RENDSZERERTESITESEK_OSSZES},
|
||||
{"T_RESZSZAKKEPESITESTIPUS", ConnectionErrorTableResource.T_RESZSZAKKEPESITESTIPUS},
|
||||
{"T_RESZSZAKKEPESITESTIPUS_OSSZES", ConnectionErrorTableResource.T_RESZSZAKKEPESITESTIPUS_OSSZES},
|
||||
{"T_ROKONSAGIFOK", ConnectionErrorTableResource.T_ROKONSAGIFOK},
|
||||
{"T_ROKONSAGIFOK_OSSZES", ConnectionErrorTableResource.T_ROKONSAGIFOK_OSSZES},
|
||||
{"T_SMSMESSAGESTATUS", ConnectionErrorTableResource.T_SMSMESSAGESTATUS},
|
||||
{"T_SMSMESSAGESTATUS_OSSZES", ConnectionErrorTableResource.T_SMSMESSAGESTATUS_OSSZES},
|
||||
{"T_SOROLASOKATIPUS", ConnectionErrorTableResource.T_SOROLASOKATIPUS},
|
||||
{"T_SOROLASOKATIPUS_OSSZES", ConnectionErrorTableResource.T_SOROLASOKATIPUS_OSSZES},
|
||||
{"T_SYSTEMSETTINGSCONTROLTYPE", ConnectionErrorTableResource.T_SYSTEMSETTINGSCONTROLTYPE},
|
||||
{"T_SYSTEMSETTINGSCONTROLTYPE_OSSZES", ConnectionErrorTableResource.T_SYSTEMSETTINGSCONTROLTYPE_OSSZES},
|
||||
{"T_SZAKKEPESITESTIPUS", ConnectionErrorTableResource.T_SZAKKEPESITESTIPUS},
|
||||
{"T_SZAKKEPESITESTIPUS_OSSZES", ConnectionErrorTableResource.T_SZAKKEPESITESTIPUS_OSSZES},
|
||||
{"T_SZAKMACSOPORTTIPUS", ConnectionErrorTableResource.T_SZAKMACSOPORTTIPUS},
|
||||
{"T_SZAKMACSOPORTTIPUS_OSSZES", ConnectionErrorTableResource.T_SZAKMACSOPORTTIPUS_OSSZES},
|
||||
{"T_SZEREPKOR", ConnectionErrorTableResource.T_SZEREPKOR},
|
||||
{"T_SZEREPKOR_OSSZES", ConnectionErrorTableResource.T_SZEREPKOR_OSSZES},
|
||||
{"T_SZEREPKORTIPUS", ConnectionErrorTableResource.T_SZEREPKORTIPUS},
|
||||
{"T_SZEREPKORTIPUS_OSSZES", ConnectionErrorTableResource.T_SZEREPKORTIPUS_OSSZES},
|
||||
{"T_SZERVEZET", ConnectionErrorTableResource.T_SZERVEZET},
|
||||
{"T_SZERVEZET_OSSZES", ConnectionErrorTableResource.T_SZERVEZET_OSSZES},
|
||||
{"T_SZERZODOSZEMELYPOZICIO", ConnectionErrorTableResource.T_SZERZODOSZEMELYPOZICIO},
|
||||
{"T_SZERZODOSZEMELYPOZICIO_OSSZES", ConnectionErrorTableResource.T_SZERZODOSZEMELYPOZICIO_OSSZES},
|
||||
{"T_SZORGALOMERTEKELESTIPUS", ConnectionErrorTableResource.T_SZORGALOMERTEKELESTIPUS},
|
||||
{"T_SZORGALOMERTEKELESTIPUS_OSSZES", ConnectionErrorTableResource.T_SZORGALOMERTEKELESTIPUS_OSSZES},
|
||||
{"T_SZOVEGESERTEKELESEK", ConnectionErrorTableResource.T_SZOVEGESERTEKELESEK},
|
||||
{"T_SZOVEGESERTEKELESEK_OSSZES", ConnectionErrorTableResource.T_SZOVEGESERTEKELESEK_OSSZES},
|
||||
{"T_TAGOZATTIPUS", ConnectionErrorTableResource.T_TAGOZATTIPUS},
|
||||
{"T_TAGOZATTIPUS_OSSZES", ConnectionErrorTableResource.T_TAGOZATTIPUS_OSSZES},
|
||||
{"T_TANARIATLAGSULY", ConnectionErrorTableResource.T_TANARIATLAGSULY},
|
||||
{"T_TANARIATLAGSULY_OSSZES", ConnectionErrorTableResource.T_TANARIATLAGSULY_OSSZES},
|
||||
{"T_TANARTARGYATLAG", ConnectionErrorTableResource.T_TANARTARGYATLAG},
|
||||
{"T_TANEV", ConnectionErrorTableResource.T_TANEV},
|
||||
{"T_TANEV_OSSZES", ConnectionErrorTableResource.T_TANEV_OSSZES},
|
||||
{"T_TANEVRENDJE", ConnectionErrorTableResource.T_TANEVRENDJE},
|
||||
{"T_TANEVRENDJE_OSSZES", ConnectionErrorTableResource.T_TANEVRENDJE_OSSZES},
|
||||
{"T_TANITASIORA", ConnectionErrorTableResource.T_TANITASIORA},
|
||||
{"T_TANITASIORA_OSSZES", ConnectionErrorTableResource.T_TANITASIORA_OSSZES},
|
||||
{"T_TANITASIORATULAJDONSAG", ConnectionErrorTableResource.T_TANITASIORATULAJDONSAG},
|
||||
{"T_TANITASIORATULAJDONSAG_OSSZES", ConnectionErrorTableResource.T_TANITASIORATULAJDONSAG_OSSZES},
|
||||
{"T_TANMENET", ConnectionErrorTableResource.T_TANMENET},
|
||||
{"T_TANMENET_OSSZES", ConnectionErrorTableResource.T_TANMENET_OSSZES},
|
||||
{"T_TANORA", ConnectionErrorTableResource.T_TANORA},
|
||||
{"T_TANORA_OSSZES", ConnectionErrorTableResource.T_TANORA_OSSZES},
|
||||
{"T_TANORAORATULAJDONSAG", ConnectionErrorTableResource.T_TANORAORATULAJDONSAG},
|
||||
{"T_TANORAORATULAJDONSAG_OSSZES", ConnectionErrorTableResource.T_TANORAORATULAJDONSAG_OSSZES},
|
||||
{"T_TANTARGY", ConnectionErrorTableResource.T_TANTARGY},
|
||||
{"T_TANTARGY_OSSZES", ConnectionErrorTableResource.T_TANTARGY_OSSZES},
|
||||
{"T_TANTARGYNEVHEZKATEGORIA", ConnectionErrorTableResource.T_TANTARGYNEVHEZKATEGORIA},
|
||||
{"T_TANTARGYNEVHEZKATEGORIA_OSSZES", ConnectionErrorTableResource.T_TANTARGYNEVHEZKATEGORIA_OSSZES},
|
||||
{"T_TANTERV", ConnectionErrorTableResource.T_TANTERV},
|
||||
{"T_TANTERV_OSSZES", ConnectionErrorTableResource.T_TANTERV_OSSZES},
|
||||
{"T_TANTERVIJELLEG", ConnectionErrorTableResource.T_TANTERVIJELLEG},
|
||||
{"T_TANTERVIJELLEG_OSSZES", ConnectionErrorTableResource.T_TANTERVIJELLEG_OSSZES},
|
||||
{"T_TANULO", ConnectionErrorTableResource.T_TANULO},
|
||||
{"T_TANULO_OSSZES", ConnectionErrorTableResource.T_TANULO_OSSZES},
|
||||
{"T_TANULOCSOPORT", ConnectionErrorTableResource.T_TANULOCSOPORT},
|
||||
{"T_TANULOCSOPORT_OSSZES", ConnectionErrorTableResource.T_TANULOCSOPORT_OSSZES},
|
||||
{"T_TANULOERTEKELES", ConnectionErrorTableResource.T_TANULOERTEKELES},
|
||||
{"T_TANULOERTEKELES_OSSZES", ConnectionErrorTableResource.T_TANULOERTEKELES_OSSZES},
|
||||
{"T_TANULOERTEKELESLATTAMOZAS", ConnectionErrorTableResource.T_TANULOERTEKELESLATTAMOZAS},
|
||||
{"T_TANULOERTEKELESLATTAMOZAS_OSSZES", ConnectionErrorTableResource.T_TANULOERTEKELESLATTAMOZAS_OSSZES},
|
||||
{"T_TANULOESEMENY", ConnectionErrorTableResource.T_TANULOESEMENY},
|
||||
{"T_TANULOESEMENY_OSSZES", ConnectionErrorTableResource.T_TANULOESEMENY_OSSZES},
|
||||
{"T_TANULOESEMENYLATTAMOZAS", ConnectionErrorTableResource.T_TANULOESEMENYLATTAMOZAS},
|
||||
{"T_TANULOESEMENYLATTAMOZAS_OSSZES", ConnectionErrorTableResource.T_TANULOESEMENYLATTAMOZAS_OSSZES},
|
||||
{"T_TANULOESLADATOK", ConnectionErrorTableResource.T_TANULOESLADATOK},
|
||||
{"T_TANULOESLADATOK_OSSZES", ConnectionErrorTableResource.T_TANULOESLADATOK_OSSZES},
|
||||
{"T_TANULOHAZIFELADAT", ConnectionErrorTableResource.T_TANULOHAZIFELADAT},
|
||||
{"T_TANULOHAZIFELADAT_OSSZES", ConnectionErrorTableResource.T_TANULOHAZIFELADAT_OSSZES},
|
||||
{"T_TANULOHAZIFELADATSTATUSZ", ConnectionErrorTableResource.T_TANULOHAZIFELADATSTATUSZ},
|
||||
{"T_TANULOHAZIFELADATSTATUSZ_OSSZES", ConnectionErrorTableResource.T_TANULOHAZIFELADATSTATUSZ_OSSZES},
|
||||
{"T_TANULOKOZOSSEGISZOLGALAT", ConnectionErrorTableResource.T_TANULOKOZOSSEGISZOLGALAT},
|
||||
{"T_TANULOKOZOSSEGISZOLGALAT_OSSZES", ConnectionErrorTableResource.T_TANULOKOZOSSEGISZOLGALAT_OSSZES},
|
||||
{"T_TANULOMENTESSEG", ConnectionErrorTableResource.T_TANULOMENTESSEG},
|
||||
{"T_TANULOMENTESSEG_OSSZES", ConnectionErrorTableResource.T_TANULOMENTESSEG_OSSZES},
|
||||
{"T_TANULOMULASZTAS", ConnectionErrorTableResource.T_TANULOMULASZTAS},
|
||||
{"T_TANULOMULASZTAS_OSSZES", ConnectionErrorTableResource.T_TANULOMULASZTAS_OSSZES},
|
||||
{"T_TANULOMULASZTASLATTAMOZAS", ConnectionErrorTableResource.T_TANULOMULASZTASLATTAMOZAS},
|
||||
{"T_TANULOMULASZTASLATTAMOZAS_OSSZES", ConnectionErrorTableResource.T_TANULOMULASZTASLATTAMOZAS_OSSZES},
|
||||
{"T_TANULOMULASZTASSTATISZTIKA", ConnectionErrorTableResource.T_TANULOMULASZTASSTATISZTIKA},
|
||||
{"T_TANULOMULASZTASSTATISZTIKA_OSSZES", ConnectionErrorTableResource.T_TANULOMULASZTASSTATISZTIKA_OSSZES},
|
||||
{"T_TANULOTANTARGYATLAG", ConnectionErrorTableResource.T_TANULOTANTARGYATLAG},
|
||||
{"T_TANULOTANTARGYATLAG_OSSZES", ConnectionErrorTableResource.T_TANULOTANTARGYATLAG_OSSZES},
|
||||
{"T_TANULOTANUGYIADATOK", ConnectionErrorTableResource.T_TANULO},
|
||||
{"T_TANULOTANUGYIADATOK_OSSZES", ConnectionErrorTableResource.T_TANULO},
|
||||
{"T_TANULOTARGYMULASZTASSTATISZT", ConnectionErrorTableResource.T_TANULOTARGYMULASZTASSTATISZT},
|
||||
{"T_TANULOTARGYMULASZTASSTATISZT_OSSZES", ConnectionErrorTableResource.T_TANULOTARGYMULASZTASSTATISZT_OSSZES},
|
||||
{"T_TANULO_TANULOESEMENY", ConnectionErrorTableResource.T_TANULO_TANULOESEMENY},
|
||||
{"T_TARGYKATEGORIATIPUS", ConnectionErrorTableResource.T_TARGYKATEGORIATIPUS},
|
||||
{"T_TARGYKATEGORIATIPUS_OSSZES", ConnectionErrorTableResource.T_TARGYKATEGORIATIPUS_OSSZES},
|
||||
{"T_TARGYOSZTALYATLAG", ConnectionErrorTableResource.T_TARGYOSZTALYATLAG},
|
||||
{"T_TARGYTANULOATLAG", ConnectionErrorTableResource.T_TARGYTANULOATLAG},
|
||||
{"T_TBJOGVISZONY", ConnectionErrorTableResource.T_TBJOGVISZONY},
|
||||
{"T_TBJOGVISZONY_OSSZES", ConnectionErrorTableResource.T_TBJOGVISZONY},
|
||||
{"T_TELEFON", ConnectionErrorTableResource.T_TELEFON},
|
||||
{"T_TELEFON_OSSZES", ConnectionErrorTableResource.T_TELEFON_OSSZES},
|
||||
{"T_TELEFONTIPUS", ConnectionErrorTableResource.T_TELEFONTIPUS},
|
||||
{"T_TELEFONTIPUS_OSSZES", ConnectionErrorTableResource.T_TELEFONTIPUS_OSSZES},
|
||||
{"T_TELEPULES", ConnectionErrorTableResource.T_TELEPULES},
|
||||
{"T_TELEPULES_OSSZES", ConnectionErrorTableResource.T_TELEPULES_OSSZES},
|
||||
{"T_TEREM", ConnectionErrorTableResource.T_TEREM},
|
||||
{"T_TEREM_OSSZES", ConnectionErrorTableResource.T_TEREM_OSSZES},
|
||||
{"T_TEREMTIPUS", ConnectionErrorTableResource.T_TEREMTIPUS},
|
||||
{"T_TEREMTIPUS_OSSZES", ConnectionErrorTableResource.T_TEREMTIPUS_OSSZES},
|
||||
{"T_TESTNEVELESTIPUS", ConnectionErrorTableResource.T_TESTNEVELESTIPUS},
|
||||
{"T_TESTNEVELESTIPUS_OSSZES", ConnectionErrorTableResource.T_TESTNEVELESTIPUS_OSSZES},
|
||||
{"T_TEVEKENYSEG", ConnectionErrorTableResource.T_TEVEKENYSEG},
|
||||
{"T_TEVEKENYSEG_OSSZES", ConnectionErrorTableResource.T_TEVEKENYSEG_OSSZES},
|
||||
{"T_TEVEKENYSEGTIPUS", ConnectionErrorTableResource.T_TEVEKENYSEGTIPUS},
|
||||
{"T_TEVEKENYSEGTIPUS_OSSZES", ConnectionErrorTableResource.T_TEVEKENYSEGTIPUS_OSSZES},
|
||||
{"T_TOVABBIMUNKAUGYIADATOK", ConnectionErrorTableResource.T_TOVABBIMUNKAUGYIADATOK},
|
||||
{"T_TOVABBIMUNKAUGYIADATOK_OSSZES", ConnectionErrorTableResource.T_TOVABBIMUNKAUGYIADATOK_OSSZES},
|
||||
{"T_USERPROFILE", ConnectionErrorTableResource.T_USERPROFILE},
|
||||
{"T_USERPROFILE_OSSZES", ConnectionErrorTableResource.T_USERPROFILE_OSSZES},
|
||||
{"T_UZENETJOGKORTIPUS", ConnectionErrorTableResource.T_UZENETJOGKORTIPUS},
|
||||
{"T_UZENETJOGKORTIPUS_OSSZES", ConnectionErrorTableResource.T_UZENETJOGKORTIPUS_OSSZES},
|
||||
{"T_VALLAS", ConnectionErrorTableResource.T_VALLAS},
|
||||
{"T_VALLAS_OSSZES", ConnectionErrorTableResource.T_VALLAS_OSSZES},
|
||||
{"T_VEGZETTSEG", ConnectionErrorTableResource.T_VEGZETTSEG},
|
||||
{"T_VEGZETTSEG_OSSZES", ConnectionErrorTableResource.T_VEGZETTSEG_OSSZES},
|
||||
{"T_VEGZETTSEGTIPUS", ConnectionErrorTableResource.T_VEGZETTSEGTIPUS},
|
||||
{"T_VEGZETTSEGTIPUS_OSSZES", ConnectionErrorTableResource.T_VEGZETTSEGTIPUS_OSSZES},
|
||||
{"T_VEZETOIORASZAMOKTIPUS", ConnectionErrorTableResource.T_VEZETOIORASZAMOKTIPUS},
|
||||
{"T_VEZETOIORASZAMOKTIPUS_OSSZES", ConnectionErrorTableResource.T_VEZETOIORASZAMOKTIPUS_OSSZES},
|
||||
{"T_WIFIELERES", ConnectionErrorTableResource.T_WIFIELERES},
|
||||
{"T_WIFIELERES_OSSZES", ConnectionErrorTableResource.T_WIFIELERES_OSSZES},
|
||||
{"T_ZARADEK", ConnectionErrorTableResource.T_ZARADEK},
|
||||
{"T_ZARADEK_OSSZES", ConnectionErrorTableResource.T_ZARADEK},
|
||||
{"T_ZARADEKNYELV", ConnectionErrorTableResource.T_ZARADEK},
|
||||
{"T_ZARADEKNYELV_OSSZES", ConnectionErrorTableResource.T_ZARADEK},
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora. Lásd még <see cref="EntityUtil.GetAssociationDescription"/>.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="associationName">Az asszociáció neve</param>
|
||||
/// <param name="description">Az asszociáció leírása</param>
|
||||
public EntityDeleteFailedException(string entityName, string associationName, string description)
|
||||
: base(ErrorMessage)
|
||||
{
|
||||
SetValue("EntityName", entityName);
|
||||
SetValue("AssociationName", associationName);
|
||||
SetValue("Description", description);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
public EntityDeleteFailedException(string message, List<EntityConnectionModel> connections)
|
||||
: base(message)
|
||||
{
|
||||
if (connections != null)
|
||||
{
|
||||
_connectionErrorMessage = string.Join(", ",
|
||||
connections.GroupBy(c => c.TargetTableName, StringComparer.OrdinalIgnoreCase)
|
||||
.Select(c => string.Format("{0}: {1} db", s_connectionErrorTableList.TryGetValue(c.Key, out var tableName) ? tableName : c.Key, c.Max(a => a.RowsCount))));
|
||||
}
|
||||
else
|
||||
{
|
||||
_connectionErrorMessage = string.Empty;
|
||||
}
|
||||
|
||||
SetValue("ConnectionErrorMessage", ConnectionErrorMessage);
|
||||
}
|
||||
|
||||
private string _connectionErrorMessage;
|
||||
public string ConnectionErrorMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return _connectionErrorMessage;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
public EntityDeleteFailedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||
}
|
||||
}
|
64
Framework/Entities/EntityDictionaryItemPropertyAttribute.cs
Normal file
64
Framework/Entities/EntityDictionaryItemPropertyAttribute.cs
Normal file
|
@ -0,0 +1,64 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitás DictionaryItem tulajdonságait leíró attribútum.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = true)]
|
||||
public sealed class EntityDictionaryItemPropertyAttribute : Attribute
|
||||
{
|
||||
private string m_DictionaryItemFieldName;
|
||||
private string m_DictionaryItemClassName;
|
||||
private Type m_DictionaryItemClassType;
|
||||
|
||||
/// <summary>
|
||||
/// Az attributum konstruktora
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItemFieldName">A dictitem mező neve</param>
|
||||
/// <param name="dictionaryItemClassName">A dictitem osztály neve</param>
|
||||
/// <param name="dictionaryItemClassType">A dictitem osztály típusa</param>
|
||||
public EntityDictionaryItemPropertyAttribute(string dictionaryItemFieldName, string dictionaryItemClassName, Type dictionaryItemClassType)
|
||||
{
|
||||
m_DictionaryItemClassName = dictionaryItemClassName;
|
||||
m_DictionaryItemFieldName = dictionaryItemFieldName;
|
||||
m_DictionaryItemClassType = dictionaryItemClassType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az attributum konstruktora
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItemFieldName">A dictitem mező neve</param>
|
||||
/// <param name="dictionaryItemClassName">A dictitem osztály neve</param>
|
||||
public EntityDictionaryItemPropertyAttribute(string dictionaryItemFieldName, string dictionaryItemClassName)
|
||||
{
|
||||
m_DictionaryItemClassName = dictionaryItemClassName;
|
||||
m_DictionaryItemFieldName = dictionaryItemFieldName;
|
||||
m_DictionaryItemClassType = null;
|
||||
}
|
||||
|
||||
public string DictionaryItemFieldName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_DictionaryItemFieldName;
|
||||
}
|
||||
}
|
||||
|
||||
public string DictionaryItemClassName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_DictionaryItemClassName;
|
||||
}
|
||||
}
|
||||
|
||||
public Type DictionaryItemClassType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_DictionaryItemClassType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
47
Framework/Entities/EntityException.cs
Normal file
47
Framework/Entities/EntityException.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitás kivételek absztrakt ősosztálya.
|
||||
/// </summary>
|
||||
[ErrorCode(Events.ENTITY_GENERAL)]
|
||||
[FriendlyName(1000017, "Ismeretlen entitáshiba történt, kérjük értesítse az üzemeltetőt.\r\nHivatkozási hiba azonosító: {Id}")]
|
||||
[Serializable]
|
||||
public abstract class EntityException : FrameworkException
|
||||
{
|
||||
const string _errorMessage = "Unknown entity error occurred.";
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
protected EntityException()
|
||||
: base(_errorMessage) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
protected EntityException(string message)
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
protected EntityException(string message, Exception innerException)
|
||||
: base(message, innerException) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
protected EntityException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
79
Framework/Entities/EntityExpiredException.cs
Normal file
79
Framework/Entities/EntityExpiredException.cs
Normal file
|
@ -0,0 +1,79 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Hivatkozás lejárt entitás verziója.
|
||||
/// </summary>
|
||||
[FriendlyName(1000029, "Az entitás verziója eltér a megadottól.")]
|
||||
[ErrorCode(Events.ENTITY_EXPIREDVERSION)]
|
||||
[Serializable]
|
||||
public sealed class EntityExpiredException : EntityException
|
||||
{
|
||||
const string _errorMessage = "The referred entity version is not up-to date.";
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="entityId">Az entitás adatbázisbeli azonosítója</param>
|
||||
/// <param name="entitySerial">Az entitás verziószáma</param>
|
||||
public EntityExpiredException(string entityName, int entityId, int entitySerial)
|
||||
: base(_errorMessage + " [EntityName: {EntityName}, EntityId: {EntityId}, EntitySerial: {EntitySerial}]")
|
||||
{
|
||||
SetValue("EntityName", entityName);
|
||||
SetValue("EntityId", entityId);
|
||||
SetValue("EntitySerial", entitySerial);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="entityId">Az entitás adatbázisbeli azonosítója</param>
|
||||
/// <param name="entitySerial">Az entitás verziószáma</param>
|
||||
/// <param name="requestedSerial">Az entitás hivatkozott verziószáma</param>
|
||||
public EntityExpiredException(string entityName, int entityId, int entitySerial, int requestedSerial)
|
||||
: base(_errorMessage + " [EntityName: {EntityName}, EntityId: {EntityId}, EntitySerial: {EntitySerial}, RequestedSerial: {RequestedSerial}]")
|
||||
{
|
||||
SetValue("EntityName", entityName);
|
||||
SetValue("EntityId", entityId);
|
||||
SetValue("EntitySerial", entitySerial);
|
||||
SetValue("RequestedSerial", requestedSerial);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityExpiredException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityExpiredException(string message)
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityExpiredException(string message, Exception innerException)
|
||||
: base(message, innerException) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
EntityExpiredException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
138
Framework/Entities/EntityHandler.cs
Normal file
138
Framework/Entities/EntityHandler.cs
Normal file
|
@ -0,0 +1,138 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Az <see cref="IEntityHandler"/> megvalósítások ősosztálya.
|
||||
/// </summary>
|
||||
public class EntityHandler : IEntityHandler
|
||||
{
|
||||
private static Hashtable m_Handlers = new Hashtable();
|
||||
|
||||
/// <summary>
|
||||
/// Létre van-e hozva az entitáshoz EntityHandler
|
||||
/// </summary>
|
||||
public bool IsCreated { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Létrehoz egy <see cref="IEntityHandler"/> objektumot a
|
||||
/// megadott entitáshoz.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <returns>Az entitáshoz tartozó <see cref="IEntityHandler"/> objektum</returns>
|
||||
public static IEntityHandler Create(Type entityType)
|
||||
{
|
||||
// <<Factory Method>>
|
||||
Type handlertype = null;
|
||||
|
||||
while (handlertype == null && entityType != typeof(Entity))
|
||||
{
|
||||
var entityName = EntityAttributeCache.GetEntityNameFromCache(entityType);
|
||||
if (string.IsNullOrWhiteSpace(entityName))
|
||||
{
|
||||
throw new ArgumentNullException("entityName");
|
||||
}
|
||||
|
||||
handlertype = m_Handlers[entityName.ToLower()] as Type;
|
||||
|
||||
entityType = entityType.BaseType;
|
||||
}
|
||||
|
||||
bool isCreated = true;
|
||||
if (handlertype == null)
|
||||
{
|
||||
isCreated = false;
|
||||
handlertype = typeof(EntityHandler);
|
||||
}
|
||||
|
||||
var entityHandler = (IEntityHandler)Activator.CreateInstance(handlertype, true);
|
||||
entityHandler.IsCreated = isCreated; // van-e lefejlesztve hozzá EntityHandler
|
||||
|
||||
return entityHandler;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inicializálja az entitás esemény kezelőket.
|
||||
/// </summary>
|
||||
internal static void Init()
|
||||
{
|
||||
Hashtable handlers = new Hashtable();
|
||||
var handlertypes = from assembly in AppDomain.CurrentDomain.GetAssemblies()
|
||||
where SDAServer.Instance.IsAssemblyAllowed(assembly)
|
||||
from type in assembly.GetTypes()
|
||||
where (type.IsDefined(typeof(EntityHandlerAttribute), false)) && (typeof(IEntityHandler).IsAssignableFrom(type))
|
||||
select type;
|
||||
|
||||
foreach (var handlertype in handlertypes)
|
||||
{
|
||||
foreach (EntityHandlerAttribute attribute in handlertype.GetCustomAttributes(typeof(EntityHandlerAttribute), false))
|
||||
{
|
||||
string name = attribute.EntityName.ToLower();
|
||||
if (!handlers.ContainsKey(name))
|
||||
{
|
||||
handlers[name] = handlertype;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Kreta.Framework.DataIntegrityException("Egy entitáshoz több Handler-t találtam: " + attribute.EntityName);
|
||||
}
|
||||
}
|
||||
}
|
||||
m_Handlers = handlers;
|
||||
}
|
||||
|
||||
#region IEntityHandler
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás insert művelete előtt fut le. Ha a leszármazott nem írja felül, akkor nem csinál semmit.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
public virtual void BeforeInsert(Entity entity)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás insert művelete után fut le. Ha a leszármazott nem írja felül, akkor nem csinál semmit.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
public virtual void AfterInsert(Entity entity)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás update művelete előtt fut le. Ha a leszármazott nem írja felül, akkor nem csinál semmit.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
public virtual void BeforeUpdate(Entity entity)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás update művelete után fut le. Ha a leszármazott nem írja felül, akkor nem csinál semmit.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
public virtual void AfterUpdate(Entity entity)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás delete művelete előtt fut le. Ha a leszármazott nem írja felül, akkor nem csinál semmit.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
public virtual void BeforeDelete(Entity entity)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás delete művelete után fut le. Ha a leszármazott nem írja felül, akkor nem csinál semmit.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
public virtual void AfterDelete(Entity entity)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
37
Framework/Entities/EntityHandlerAttribute.cs
Normal file
37
Framework/Entities/EntityHandlerAttribute.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Az attribútum egy adott entitáshoz tartozó esemény kezelő osztályt azonosít.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Az attribútumot olyan osztályra kell tenni, amely megvalósítja az
|
||||
/// <see cref="IEntityHandler"/> felületet.
|
||||
/// </remarks>
|
||||
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
|
||||
public sealed class EntityHandlerAttribute : Attribute
|
||||
{
|
||||
private string m_EntityName;
|
||||
|
||||
/// <summary>
|
||||
/// Az attribútum konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve, amihez a kezelő tartozik</param>
|
||||
public EntityHandlerAttribute(string entityName)
|
||||
{
|
||||
m_EntityName = entityName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás neve, amihez a kezelő tartozik.
|
||||
/// </summary>
|
||||
public string EntityName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_EntityName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
89
Framework/Entities/EntityNotFoundException.cs
Normal file
89
Framework/Entities/EntityNotFoundException.cs
Normal file
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Nem létező entitásra történt hivatkozás.
|
||||
/// </summary>
|
||||
[FriendlyName(1000024, "A hivatkozott entitás nem található.")]
|
||||
[ErrorCode(Events.ENTITY_NOTFOUND)]
|
||||
[Serializable]
|
||||
public sealed class EntityNotFoundException : EntityException
|
||||
{
|
||||
const string _errorMessage = "The entity does not exist.";
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="entityId">Az entitás adatbázisbeli azonosítója</param>
|
||||
public EntityNotFoundException(string entityName, int entityId)
|
||||
: base(_errorMessage)
|
||||
{
|
||||
SetValue("EntityName", entityName);
|
||||
SetValue("EntityId", entityId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="associationName">Az asszociáció neve</param>
|
||||
/// <param name="partnerId">Az asszociációs partner azonosítója</param>
|
||||
public EntityNotFoundException(string entityName, string associationName, int partnerId)
|
||||
: base(_errorMessage)
|
||||
{
|
||||
SetValue("EntityName", entityName);
|
||||
SetValue("AssociationName", associationName);
|
||||
SetValue("PartnerId", partnerId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="entityId">Az entitás adatbázisbeli azonosítója</param>
|
||||
/// <param name="entitySerial">Az entitás verziószáma</param>
|
||||
public EntityNotFoundException(string entityName, int entityId, int entitySerial)
|
||||
: base(_errorMessage)
|
||||
{
|
||||
SetValue("EntityName", entityName);
|
||||
SetValue("EntityId", entityId);
|
||||
SetValue("EntitySerial", entitySerial);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityNotFoundException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityNotFoundException(string message)
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityNotFoundException(string message, Exception innerException)
|
||||
: base(message, innerException) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
EntityNotFoundException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
154
Framework/Entities/EntityPropertyAttribute.cs
Normal file
154
Framework/Entities/EntityPropertyAttribute.cs
Normal file
|
@ -0,0 +1,154 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitás tulajdonságait leíró attribútum.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = true)]
|
||||
public sealed class EntityPropertyAttribute : Attribute
|
||||
{
|
||||
private string m_Name;
|
||||
private EntityPropertyBaseType m_BaseType;
|
||||
private Type m_PropertyType;
|
||||
private EntityCopyMethod m_CopyMethod;
|
||||
private string m_AssocFieldName;
|
||||
private string m_TableName;
|
||||
private string m_PartnerAssocFieldName;
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora
|
||||
/// </summary>
|
||||
/// <param name="name">A tulajdonság neve</param>
|
||||
/// <param name="baseType">A tulajdonság alaptípusa</param>
|
||||
/// <param name="propertyType">A tulajdonság .NET típusa</param>
|
||||
/// <param name="copyMethod">A tulajdonság másolási módja</param>
|
||||
public EntityPropertyAttribute(string name, EntityPropertyBaseType baseType, Type propertyType, EntityCopyMethod copyMethod)
|
||||
{
|
||||
m_Name = name;
|
||||
m_BaseType = baseType;
|
||||
m_PropertyType = propertyType;
|
||||
m_CopyMethod = copyMethod;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora
|
||||
/// </summary>
|
||||
/// <param name="name">A tulajdonság neve</param>
|
||||
/// <param name="baseType">A tulajdonság alaptípusa</param>
|
||||
/// <param name="propertyType">A tulajdonság .NET típusa</param>
|
||||
/// <param name="copyMethod">A tulajdonság másolási módja</param>
|
||||
/// <param name="assocfieldname">A tulajdonság asszociációs osztályának kapcsoló ID mezője.</param>
|
||||
public EntityPropertyAttribute(string name, EntityPropertyBaseType baseType, Type propertyType, EntityCopyMethod copyMethod, string assocfieldname)
|
||||
{
|
||||
m_Name = name;
|
||||
m_BaseType = baseType;
|
||||
m_PropertyType = propertyType;
|
||||
m_CopyMethod = copyMethod;
|
||||
m_AssocFieldName = assocfieldname;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora
|
||||
/// </summary>
|
||||
/// <param name="name">A tulajdonság neve</param>
|
||||
/// <param name="baseType">A tulajdonság alaptípusa</param>
|
||||
/// <param name="propertyType">A tulajdonság .NET típusa</param>
|
||||
/// <param name="copyMethod">A tulajdonság másolási módja</param>
|
||||
/// <param name="assocfieldname">A tulajdonság asszociációs osztályának kapcsoló ID mezője.</param>
|
||||
public EntityPropertyAttribute(string name, EntityPropertyBaseType baseType, Type propertyType, EntityCopyMethod copyMethod, string assocfieldname, string partnerassocfieldname, string tablename)
|
||||
{
|
||||
m_Name = name;
|
||||
m_BaseType = baseType;
|
||||
m_PropertyType = propertyType;
|
||||
m_CopyMethod = copyMethod;
|
||||
m_AssocFieldName = assocfieldname;
|
||||
m_PartnerAssocFieldName = partnerassocfieldname;
|
||||
m_TableName = tablename;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A tulajdonság neve.
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
}
|
||||
|
||||
public string AssocFieldName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_AssocFieldName;
|
||||
}
|
||||
}
|
||||
|
||||
public string PartnerAssocFieldName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_PartnerAssocFieldName;
|
||||
}
|
||||
}
|
||||
|
||||
public string TableName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_TableName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A tulajdonság fajtája.
|
||||
/// </summary>
|
||||
public EntityPropertyBaseType BaseType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_BaseType;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A tulajdonság típusa.
|
||||
/// </summary>
|
||||
public Type PropertyType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_PropertyType;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A tulajdonság másolási módja.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Entitás másolásánál használatos, és megmondja, hogy a másolat entitásnál
|
||||
/// a tulajdonságot milyen módon kell másolni. Asszociációknál van értelmezve.
|
||||
/// <list type="bullet">
|
||||
/// <item>
|
||||
/// <term>DeepCopy</term>
|
||||
/// <description>Az asszociációs partnert is le kell másolni.</description>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term>ShallowCopy</term>
|
||||
/// <description>Az asszociációs partnert nem kell másolni, a másolat identitása megegyezhet
|
||||
/// az eredetivel.
|
||||
/// </description>
|
||||
/// </item>
|
||||
/// </list>
|
||||
/// </remarks>
|
||||
public EntityCopyMethod CopyMethod
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_CopyMethod;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
23
Framework/Entities/EntityPropertyBaseType.cs
Normal file
23
Framework/Entities/EntityPropertyBaseType.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitás tulajdonság alap típusa.
|
||||
/// </summary>
|
||||
public enum EntityPropertyBaseType
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitás
|
||||
/// </summary>
|
||||
Entity = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Entitás lista
|
||||
/// </summary>
|
||||
EntityCollection = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Érték típus
|
||||
/// </summary>
|
||||
ValueType = 2,
|
||||
}
|
||||
}
|
61
Framework/Entities/EntityReadOnlyException.cs
Normal file
61
Framework/Entities/EntityReadOnlyException.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Hivatkozás lejárt entitás verziója.
|
||||
/// </summary>
|
||||
[FriendlyName(1000076, "Az adott rekordra nincs írási joga! ({EntityName}: {EntityId})")]
|
||||
[ErrorCode(Events.ENTITY_READONLY)]
|
||||
[Serializable]
|
||||
public sealed class EntityReadOnlyException : EntityException
|
||||
{
|
||||
const string _errorMessage = "Az adott rekordra nincs írási joga! ({EntityName}: {EntityId})";
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="entityId">Az entitás adatbázisbeli azonosítója</param>
|
||||
public EntityReadOnlyException(string entityName, int entityId)
|
||||
: base(_errorMessage)
|
||||
{
|
||||
SetValue("EntityName", entityName);
|
||||
SetValue("EntityId", entityId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityReadOnlyException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityReadOnlyException(string message)
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityReadOnlyException(string message, Exception innerException)
|
||||
: base(message, innerException) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
EntityReadOnlyException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
33
Framework/Entities/EntityState.cs
Normal file
33
Framework/Entities/EntityState.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitások lehetséges állapotai
|
||||
/// </summary>
|
||||
public enum EntityState
|
||||
{
|
||||
/// <summary>
|
||||
/// Az entitás inicializálatlan
|
||||
/// </summary>
|
||||
Uninitialized = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás új, és még nincs mentve
|
||||
/// </summary>
|
||||
New = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás attribútumai inicializáltak
|
||||
/// </summary>
|
||||
Initialized = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás attribútumai módosultak
|
||||
/// </summary>
|
||||
Modified = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás törölt, műveletvégzés nem lehetséges rajta
|
||||
/// </summary>
|
||||
Removed = 4,
|
||||
}
|
||||
}
|
59
Framework/Entities/EntityStateException.cs
Normal file
59
Framework/Entities/EntityStateException.cs
Normal file
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Érvénytelen entitás művelet.
|
||||
/// </summary>
|
||||
[FriendlyName(1000011, "Súlyos üzleti logikai hiba, kérjük értesítse az üzemeltetőt.\r\nHivatkozási hiba azonosító: {Id}")]
|
||||
[ErrorCode(Events.ENTITY_INVALIDSTATE)]
|
||||
[Serializable]
|
||||
public sealed class EntityStateException : EntityException
|
||||
{
|
||||
const string _errorMessage = "The operation cannot be completed according to state of the entity.";
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="currentState">Az entitás jelenlegi állapota.</param>
|
||||
public EntityStateException(EntityState currentState)
|
||||
: base(_errorMessage)
|
||||
{
|
||||
this.SetValue("CurrentState", currentState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityStateException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityStateException(string message)
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public EntityStateException(string message, Exception innerException)
|
||||
: base(message, innerException) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
EntityStateException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
177
Framework/Entities/EntityUtil.cs
Normal file
177
Framework/Entities/EntityUtil.cs
Normal file
|
@ -0,0 +1,177 @@
|
|||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Segédosztály entitás funkcionalitások részére.
|
||||
/// </summary>
|
||||
public static class EntityUtil
|
||||
{
|
||||
// <<Facade>>
|
||||
|
||||
/// <summary>
|
||||
/// A jelenlegi nyelv indexe, kizárólag a generált kód használja, kézi kód számára tabu.
|
||||
/// </summary>
|
||||
public static int CurrentLanguageIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return LanguageContext.Current.LanguageIndex;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja egy asszociáció leírását, ha az definiált.
|
||||
/// </summary>
|
||||
/// <param name="sourceTable">A forrás tábla neve</param>
|
||||
/// <param name="sourceColumn">Az asszociáció kapcsolómezőjének neve</param>
|
||||
/// <returns>Az asszociáció leírása, ha az létezik; egyébként 'N/A'.</returns>
|
||||
public static string GetAssociationDescription(string sourceTable, string sourceColumn)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(sourceTable) || string.IsNullOrWhiteSpace(sourceColumn))
|
||||
{
|
||||
return "N/A";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using (SDA.DataProvider.SDACommand command = new SDA.DataProvider.SDACommand())
|
||||
{
|
||||
command.Connection = UserContext.Instance.SDAConnection;
|
||||
command.Transaction = UserContext.Instance.SDATransaction;
|
||||
command.CommandText = @"
|
||||
select distinct
|
||||
T_DSTRANSLATION.C_DISPLAYTEXT
|
||||
from
|
||||
T_FDLPALETTELINK
|
||||
left join T_DSTRANSLATION on T_DSTRANSLATION.C_FDLPALETTELINKID = T_FDLPALETTELINK.ID
|
||||
where
|
||||
lower(T_FDLPALETTELINK.C_DBKEYTABLEOFSOURCE) = :pTABLE
|
||||
and
|
||||
lower(T_FDLPALETTELINK.C_DBKEYFIELDOFSOURCE) = :pCOLUMN
|
||||
";
|
||||
command.Parameters.Add("pTABLE", sourceTable.ToLower());
|
||||
command.Parameters.Add("pCOLUMN", sourceColumn.ToLower());
|
||||
object result = command.ExecuteScalar();
|
||||
if (result != null && !(result is DBNull))
|
||||
{
|
||||
return result.ToString().Replace("\u0001", "\n");
|
||||
}
|
||||
|
||||
return "N/A";
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
SDAServer.Instance.Logger.ExceptionThrown(exception);
|
||||
return "N/A";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reguláris kifejezéseket elemző függvény. A generált kód használja, kézi kód számára tabu.
|
||||
/// </summary>
|
||||
/// <param name="data">Ezt a karakterláncot elemezzük, hogy megfelel-e a kifejezésünknek</param>
|
||||
/// <param name="regexPattern">Ezt a mintát keressuk a karakterláncban</param>
|
||||
/// <returns>True, ha illeszkedik; egyébként false</returns>
|
||||
public static bool VerifyRegEx(char data, string regexPattern)
|
||||
{
|
||||
return VerifyRegEx(data.ToString(), regexPattern);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reguláris kifejezéseket elemző függvény. A generált kód használja, kézi kód számára tabu.
|
||||
/// </summary>
|
||||
/// <param name="data">Ezt a karakterláncot elemezzük, hogy megfelel-e a kifejezésünknek</param>
|
||||
/// <param name="regexPattern">Ezt a mintát keressuk a karakterláncban</param>
|
||||
/// <returns>True, ha illeszkedik; egyébként false</returns>
|
||||
public static bool VerifyRegEx(string data, string regexPattern)
|
||||
{
|
||||
if (data == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
RegexOptions options = RegexOptions.Singleline;
|
||||
MatchCollection matches = Regex.Matches(data, regexPattern, options);
|
||||
|
||||
foreach (Match match in matches)
|
||||
{
|
||||
if (match.Success && match.Index == 0 && match.Length == data.Length)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#region CRUD Logika weben
|
||||
|
||||
/// <summary>
|
||||
/// Azonosító alapján feltölti az entitást adatbázisból.
|
||||
/// </summary>
|
||||
/// <param name="entity">A betöltendő entitás</param>
|
||||
/// <param name="sessionId">A munkamenet azonosítója</param>
|
||||
/// <param name="id">Az entitás azonosítója</param>
|
||||
/// <param name="serial">Az entitás verziószáma</param>
|
||||
public static void LoadById(Entity entity, string sessionId, int id, int serial)
|
||||
{
|
||||
if (UserContext.Instance == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
SDAServer.Instance.SessionManager.ActivateSession(sessionId);
|
||||
entity.LoadByID(id, serial);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
SDAServer.Instance.Logger.ExceptionThrown(exception);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
SDAServer.Instance.SessionManager.DeActivateSession(sessionId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.LoadByID(id, serial);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Azonosító alapján feltölti az entitást adatbázisból.
|
||||
/// </summary>
|
||||
/// <param name="entity">A betöltendő entitás</param>
|
||||
/// <param name="sessionId">A munkamenet azonosítója</param>
|
||||
/// <param name="id">Az entitás azonosítója</param>
|
||||
public static void LoadById(Entity entity, string sessionId, int id)
|
||||
{
|
||||
if (UserContext.Instance == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
SDAServer.Instance.SessionManager.ActivateSession(sessionId);
|
||||
entity.LoadByID(id);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
SDAServer.Instance.Logger.ExceptionThrown(exception);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
SDAServer.Instance.SessionManager.DeActivateSession(sessionId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.LoadByID(id);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
215
Framework/Entities/Generic/EntityDBHelper.cs
Normal file
215
Framework/Entities/Generic/EntityDBHelper.cs
Normal file
|
@ -0,0 +1,215 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Kreta.Framework.Collections.Generic;
|
||||
|
||||
namespace Kreta.Framework.Entities.Generic
|
||||
{
|
||||
public abstract class EntityDBHelper<EntityType> : IEntityDBHelper<EntityType> //, IEntityDBHelper
|
||||
where EntityType : Kreta.Framework.Entities.Entity
|
||||
{
|
||||
protected abstract EntityType CreateEntityInstance();
|
||||
|
||||
#region IEntityDBHelper<EntityType> Members
|
||||
|
||||
public abstract string EmptyQueryCommandText
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract string DynamicQueryCommandText
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract IDictionary<string, string> DynamicColumns
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public SDA.DataProvider.SDACommand CreateEmptyQueryCommand()
|
||||
{
|
||||
return DAUtil.CreateCommand(EmptyQueryCommandText);
|
||||
}
|
||||
|
||||
public SDA.DataProvider.SDACommand CreateDynamicQueryCommand(ColumnFilterMode columnFilterMode, IEnumerable<string> columns)
|
||||
{
|
||||
if (columns == null)
|
||||
{
|
||||
columns = new List<string>();
|
||||
}
|
||||
|
||||
var columnText = "";
|
||||
foreach (var column in DynamicColumns.Where(dc => (columnFilterMode == ColumnFilterMode.DEFAULT_ALLOWED) ^ (columns.Contains(dc.Key))))
|
||||
{
|
||||
columnText += column.Value + ",";
|
||||
}
|
||||
|
||||
var queryCommandText = DynamicQueryCommandText.Replace("{COLUMNS}", columnText);
|
||||
return DAUtil.CreateCommand(queryCommandText);
|
||||
}
|
||||
|
||||
public abstract void LoadEntityFields(EntityType entity, SDA.DataProvider.SDADataReader reader, ColumnFilterMode columnFilterMode, IEnumerable<string> columns);
|
||||
public abstract void LoadEntityFields(EntityType entity, SDA.DataProvider.SDADataReader reader);
|
||||
|
||||
public void LoadFromReader(EntityType entity, SDA.DataProvider.SDADataReader reader)
|
||||
{
|
||||
entity.ID = ((int)reader.GetDecimal(0));
|
||||
|
||||
LoadEntityFields(entity, reader);
|
||||
|
||||
int index = reader.FieldCount - 6;
|
||||
entity.Torolt = reader[index] != DBNull.Value && reader.GetBoolean(index);
|
||||
index++;
|
||||
entity.Serial = ((int)reader.GetDecimal(index++));
|
||||
entity.EntityCreated = DAUtil.ReadDateTime(reader, index++);
|
||||
entity.EntityCreator = reader[index] != DBNull.Value ? reader.GetInt32(index) : 0;
|
||||
index++;
|
||||
entity.EntityLastChanged = DAUtil.ReadDateTime(reader, index++);
|
||||
entity.EntityModifier = reader[index] != DBNull.Value ? reader.GetInt32(index) : new int?();
|
||||
|
||||
entity.SetLoaded();
|
||||
}
|
||||
|
||||
public void LoadFromReader(EntityType entity, SDA.DataProvider.SDADataReader reader, ColumnFilterMode columnFilterMode, IEnumerable<string> columns)
|
||||
{
|
||||
entity.ID = ((int)reader.GetDecimal(0));
|
||||
|
||||
LoadEntityFields(entity, reader, columnFilterMode, columns);
|
||||
|
||||
int index = reader.FieldCount - 6;
|
||||
entity.Torolt = reader[index] != DBNull.Value && reader.GetBoolean(index);
|
||||
index++;
|
||||
entity.Serial = ((int)reader.GetDecimal(index++));
|
||||
entity.EntityCreated = DAUtil.ReadDateTime(reader, index++);
|
||||
entity.EntityCreator = reader[index] != DBNull.Value ? reader.GetInt32(index) : 0;
|
||||
index++;
|
||||
entity.EntityLastChanged = DAUtil.ReadDateTime(reader, index++);
|
||||
entity.EntityModifier = reader[index] != DBNull.Value ? reader.GetInt32(index++) : new int?();
|
||||
entity.SetLoaded();
|
||||
}
|
||||
|
||||
public bool LoadEntityCollection(IEntityCollection<EntityType> collection, SDA.DataProvider.SDACommand command)
|
||||
{
|
||||
using (SDA.DataProvider.SDADataReader reader = command.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
EntityType entity = CreateEntityInstance();
|
||||
LoadFromReader(entity, reader);
|
||||
((EntityCollection<EntityType>)collection).InternalAdd(entity);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoadEntityCollection(IEntityCollection<EntityType> collection, SDA.DataProvider.SDACommand command, ColumnFilterMode columnFilterMode, IEnumerable<string> columns)
|
||||
{
|
||||
using (SDA.DataProvider.SDADataReader reader = command.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
EntityType entity = CreateEntityInstance();
|
||||
LoadFromReader(entity, reader, columnFilterMode, columns);
|
||||
((EntityCollection<EntityType>)collection).InternalAdd(entity);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoadSingleEntity(EntityType entity, SDA.DataProvider.SDACommand command)
|
||||
{
|
||||
using (SDA.DataProvider.SDADataReader reader = command.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
LoadFromReader(entity, reader);
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
throw new Kreta.Framework.DataIntegrityException("Egyediség megsértése: " + entity.GetEntityName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoadSingleEntity(EntityType entity, SDA.DataProvider.SDACommand command, ColumnFilterMode columnFilterMode, IEnumerable<string> columns)
|
||||
{
|
||||
using (SDA.DataProvider.SDADataReader reader = command.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
LoadFromReader(entity, reader, columnFilterMode, columns);
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
throw new Kreta.Framework.DataIntegrityException("Egyediség megsértése: " + entity.GetEntityName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoadByPartnerId(EntityType entity, string filterText, int partnerId)
|
||||
{
|
||||
using (SDA.DataProvider.SDACommand command = CreateEmptyQueryCommand())
|
||||
{
|
||||
command.CommandText += filterText;
|
||||
command.Parameters.Add("pID", SDA.DataProvider.SDADBType.Int).Value = partnerId;
|
||||
return LoadSingleEntity(entity, command, ColumnFilterMode.DEFAULT_ALLOWED, null);
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoadByPartnerId(IEntityCollection<EntityType> collection, string filterText, int partnerId)
|
||||
{
|
||||
using (SDA.DataProvider.SDACommand command = CreateEmptyQueryCommand())
|
||||
{
|
||||
command.CommandText += filterText;
|
||||
command.Parameters.Add("pID", SDA.DataProvider.SDADBType.Int).Value = partnerId;
|
||||
return LoadEntityCollection(collection, command, ColumnFilterMode.DEFAULT_ALLOWED, null);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void BindAttributes(EntityType entity, SDA.DataProvider.SDACommand command);
|
||||
|
||||
public abstract void BindAssociations(EntityType entity, SDA.DataProvider.SDACommand command);
|
||||
|
||||
public abstract void DynamicBindAttributes(EntityType entity, SDA.DataProvider.SDACommand command);
|
||||
|
||||
public void CreateParameterBinding(SDA.DataProvider.SDACommand command, Dictionary<string, object> commandParameters)
|
||||
{
|
||||
if (commandParameters != null)
|
||||
{
|
||||
foreach (KeyValuePair<string, object> kvp in commandParameters)
|
||||
{
|
||||
// mssql nem szereti parameter nevben a ":"-ot
|
||||
string pName = kvp.Key;
|
||||
if (pName.StartsWith(":"))
|
||||
{
|
||||
pName = pName.TrimStart(new char[] { ':' });
|
||||
}
|
||||
|
||||
if (kvp.Value.GetType() == typeof(int))
|
||||
{
|
||||
command.Parameters.Add(pName, SDA.DataProvider.SDADBType.Int).Value = Convert.ToInt32(kvp.Value);
|
||||
}
|
||||
if (kvp.Value.GetType() == typeof(string))
|
||||
{
|
||||
command.Parameters.Add(pName, SDA.DataProvider.SDADBType.String).Value = Convert.ToString(kvp.Value);
|
||||
}
|
||||
if (kvp.Value.GetType() == typeof(DateTime))
|
||||
{
|
||||
command.Parameters.Add(pName, SDA.DataProvider.SDADBType.DateTime).Value = Convert.ToDateTime(kvp.Value, LanguageContext.Current.RegionSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
107
Framework/Entities/Generic/EntityDataAccessor.cs
Normal file
107
Framework/Entities/Generic/EntityDataAccessor.cs
Normal file
|
@ -0,0 +1,107 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Framework.Collections;
|
||||
using Kreta.Framework.Collections.Generic;
|
||||
|
||||
namespace Kreta.Framework.Entities.Generic
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitások adatbázisműveleteit végző objektumának őse
|
||||
/// </summary>
|
||||
public abstract class EntityDataAccessor<EntityType> : IEntityDataAccessor<EntityType>, IEntityDataAccessor
|
||||
where EntityType : Kreta.Framework.Entities.Entity
|
||||
{
|
||||
|
||||
protected abstract IEntityDBHelper<EntityType> dbhelper
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Beállítja a létrehozóját egy entitásnak
|
||||
/// </summary>
|
||||
/// <param name="entity">A beállítandó entitás</param>
|
||||
protected void SetEntityCreator(EntityType entity, DateTime timestamp, int uniqueidentifier)
|
||||
{
|
||||
entity.EntityCreated = timestamp;
|
||||
entity.EntityCreator = uniqueidentifier;
|
||||
//entity.EntitySubsCreator = UserContext.Instance.SubstituteEmployeePrintName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Beállítja a módosítóját egy entitásnak
|
||||
/// </summary>
|
||||
/// <param name="entity">A beállítandó entitás</param>
|
||||
protected void SetEntityModifier(EntityType entity, DateTime timestamp, int uniqueidentifier)
|
||||
{
|
||||
entity.EntityLastChanged = timestamp;
|
||||
entity.EntityModifier = uniqueidentifier;
|
||||
//entity.EntitySubsLastModifier = UserContext.Instance.SubstituteEmployeePrintName;
|
||||
}
|
||||
|
||||
#region ISDAEntityDataAccessor<EntityType> Members
|
||||
|
||||
public abstract bool LoadEntity(EntityType entity, int entityId);
|
||||
|
||||
public virtual bool FilteredLoadEntity(EntityType entity, int entityId, ColumnFilterMode columnFilterMode, IEnumerable<string> columns)
|
||||
{
|
||||
return LoadEntity(entity, entityId);
|
||||
}
|
||||
|
||||
public abstract void LoadWithFilter(IEntityCollection<EntityType> collection, string filter, Dictionary<string, object> commandParameters);
|
||||
|
||||
public virtual void LoadWithFilter(IEntityCollection<EntityType> collection, string filter, ColumnFilterMode columnFilterMode, IEnumerable<string> columns, Dictionary<string, object> commandParameters)
|
||||
{
|
||||
LoadWithFilter(collection, filter, commandParameters);
|
||||
}
|
||||
|
||||
public abstract void InsertEntity(EntityType entity);
|
||||
|
||||
public abstract bool UpdateEntity(EntityType entity);
|
||||
|
||||
public abstract bool UpdateAssociations(EntityType entity);
|
||||
|
||||
public abstract void DeleteEntity(EntityType entity, bool logikai = true);
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEntityDataAccessor Members
|
||||
|
||||
bool IEntityDataAccessor.LoadEntity(Entity entity, int entityId)
|
||||
{
|
||||
return LoadEntity((EntityType)entity, entityId);
|
||||
}
|
||||
|
||||
bool IEntityDataAccessor.FilteredLoadEntity(Entity entity, int entityId, ColumnFilterMode columnFilterMode, IEnumerable<string> columns)
|
||||
{
|
||||
return FilteredLoadEntity((EntityType)entity, entityId, columnFilterMode, columns);
|
||||
}
|
||||
|
||||
void IEntityDataAccessor.LoadWithFilter(IEntityCollection collection, string filter, Dictionary<string, object> commandParameters)
|
||||
{
|
||||
LoadWithFilter((IEntityCollection<EntityType>)collection, filter, commandParameters);
|
||||
}
|
||||
|
||||
void IEntityDataAccessor.InsertEntity(Entity entity)
|
||||
{
|
||||
InsertEntity((EntityType)entity);
|
||||
}
|
||||
|
||||
bool IEntityDataAccessor.UpdateEntity(Entity entity)
|
||||
{
|
||||
return UpdateEntity((EntityType)entity);
|
||||
}
|
||||
|
||||
bool IEntityDataAccessor.UpdateAssociations(Entity entity)
|
||||
{
|
||||
return UpdateAssociations((EntityType)entity);
|
||||
}
|
||||
|
||||
void IEntityDataAccessor.DeleteEntity(Entity entity, bool logikai)
|
||||
{
|
||||
DeleteEntity((EntityType)entity, logikai);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
39
Framework/Entities/Generic/IEntityDBHelper.cs
Normal file
39
Framework/Entities/Generic/IEntityDBHelper.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System.Collections.Generic;
|
||||
using Kreta.Framework.Collections.Generic;
|
||||
|
||||
namespace Kreta.Framework.Entities.Generic
|
||||
{
|
||||
public interface IEntityDBHelper<EntityType>
|
||||
where EntityType : Kreta.Framework.Entities.Entity
|
||||
{
|
||||
string EmptyQueryCommandText { get; }
|
||||
|
||||
SDA.DataProvider.SDACommand CreateEmptyQueryCommand();
|
||||
|
||||
SDA.DataProvider.SDACommand CreateDynamicQueryCommand(ColumnFilterMode columnFilterMode, IEnumerable<string> columns);
|
||||
|
||||
void LoadEntityFields(EntityType entity, SDA.DataProvider.SDADataReader reader, ColumnFilterMode columnFilterMode, IEnumerable<string> columns);
|
||||
|
||||
void LoadFromReader(EntityType entity, SDA.DataProvider.SDADataReader reader, ColumnFilterMode columnFilterMode, IEnumerable<string> columns);
|
||||
|
||||
bool LoadEntityCollection(IEntityCollection<EntityType> collection, SDA.DataProvider.SDACommand command);
|
||||
|
||||
bool LoadEntityCollection(IEntityCollection<EntityType> collection, SDA.DataProvider.SDACommand command, ColumnFilterMode columnFilterMode, IEnumerable<string> columns);
|
||||
|
||||
bool LoadSingleEntity(EntityType entity, SDA.DataProvider.SDACommand command);
|
||||
|
||||
bool LoadSingleEntity(EntityType entity, SDA.DataProvider.SDACommand command, ColumnFilterMode columnFilterMode, IEnumerable<string> columns);
|
||||
|
||||
bool LoadByPartnerId(EntityType entity, string filterText, int partnerId);
|
||||
|
||||
bool LoadByPartnerId(IEntityCollection<EntityType> collection, string filterText, int partnerId);
|
||||
|
||||
void BindAttributes(EntityType entity, SDA.DataProvider.SDACommand command);
|
||||
|
||||
void DynamicBindAttributes(EntityType entity, SDA.DataProvider.SDACommand command);
|
||||
|
||||
void BindAssociations(EntityType entity, SDA.DataProvider.SDACommand command);
|
||||
|
||||
void CreateParameterBinding(SDA.DataProvider.SDACommand command, Dictionary<string, object> commandParameters);
|
||||
}
|
||||
}
|
75
Framework/Entities/Generic/IEntityDataAccessor.cs
Normal file
75
Framework/Entities/Generic/IEntityDataAccessor.cs
Normal file
|
@ -0,0 +1,75 @@
|
|||
using System.Collections.Generic;
|
||||
using Kreta.Framework.Collections.Generic;
|
||||
|
||||
namespace Kreta.Framework.Entities.Generic
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitások adatbázisműveleteit végző objektumának felülete.
|
||||
/// </summary>
|
||||
public interface IEntityDataAccessor<EntityType>
|
||||
where EntityType : Kreta.Framework.Entities.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// Betölti egy entitás állapotát az adatbázisból.
|
||||
/// </summary>
|
||||
/// <param name="entity">A betöltendő entitás</param>
|
||||
/// <param name="entityId">Az entitás adatbázisbeli azonosítója</param>
|
||||
/// <returns>True, ha sikeres; egyébként false</returns>
|
||||
bool LoadEntity(EntityType entity, int entityId);
|
||||
|
||||
/// <summary>
|
||||
/// Oszlopszűrten beltölti egy entitás állapotát az adatbázisból
|
||||
/// </summary>
|
||||
/// <param name="entity">A betöltendő entitás</param>
|
||||
/// <param name="entityId">Az entitás adatbázisbeli azonosítója</param>
|
||||
/// <param name="columnFilterMode">A szűrés módja, megengedő vagy tiltó</param>
|
||||
/// <param name="columns">A szűrendő oszlopok felsorolása</param>
|
||||
/// <returns>True, ha sikeres; egyébként False</returns>
|
||||
bool FilteredLoadEntity(EntityType entity, int entityId, ColumnFilterMode columnFilterMode, IEnumerable<string> columns);
|
||||
|
||||
/// <summary>
|
||||
/// Betölt egy entitás listát a megadott szűrő feltétellel.
|
||||
/// </summary>
|
||||
/// <param name="collection">A feltöltendő lista</param>
|
||||
/// <param name="filter">A szűrő SQL töredék</param>
|
||||
/// <param name="commandParameters">a szűrőben megadott paraméterek commandBinding atalakitasa</param>
|
||||
void LoadWithFilter(IEntityCollection<EntityType> collection, string filter, Dictionary<string, object> commandParameters);
|
||||
|
||||
/// <summary>
|
||||
/// Oszlopszűrten betölt egy entitás listát a megadott szűrő feltétellel.
|
||||
/// </summary>
|
||||
/// <param name="collection">A feltöltendő lista</param>
|
||||
/// <param name="filter">A szűrő SQL töredék</param>
|
||||
/// <param name="columnFilterMode">A szűrés módja, megengedő vagy tiltó</param>
|
||||
/// <param name="columns">A szűrendő oszlopok felsorolása</param>
|
||||
/// <param name="commandParameters">a szűrőben megadott paraméterek commandBinding atalakitasa</param>
|
||||
void LoadWithFilter(IEntityCollection<EntityType> collection, string filter, ColumnFilterMode columnFilterMode, IEnumerable<string> columns, Dictionary<string, object> commandParameters);
|
||||
|
||||
/// <summary>
|
||||
/// Létrehoz egy új entitás példányt az adatbázisban.
|
||||
/// </summary>
|
||||
/// <param name="entity">A létrehozandó entitás</param>
|
||||
void InsertEntity(EntityType entity);
|
||||
|
||||
/// <summary>
|
||||
/// Módosít egy entitás példányt az adatbázisban.
|
||||
/// </summary>
|
||||
/// <param name="entity">A módosítandó entitás</param>
|
||||
/// <returns>True, ha sikeres; egyébként false</returns>
|
||||
bool UpdateEntity(EntityType entity);
|
||||
|
||||
/// <summary>
|
||||
/// Módosítja egy entitás példány asszociációs kapcsolómezőit az adatbázisban.
|
||||
/// </summary>
|
||||
/// <param name="entity">A módosítandó entitás</param>
|
||||
/// <returns>True, ha sikeres; egyébként false</returns>
|
||||
bool UpdateAssociations(EntityType entity);
|
||||
|
||||
/// <summary>
|
||||
/// Töröl egy entitás példányt az adatbázisból.
|
||||
/// </summary>
|
||||
/// <param name="entity">A törlendő entitás</param>
|
||||
/// <param name="logikai">Logikai törlés (Archiv flag)</param>
|
||||
void DeleteEntity(EntityType entity, bool logikai = true);
|
||||
}
|
||||
}
|
62
Framework/Entities/IEntityDataAccessor.cs
Normal file
62
Framework/Entities/IEntityDataAccessor.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
using System.Collections.Generic;
|
||||
using Kreta.Framework.Collections;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitások adatbázisműveleteit végző objektumának felülete.
|
||||
/// </summary>
|
||||
public interface IEntityDataAccessor
|
||||
{
|
||||
/// <summary>
|
||||
/// Betölti egy entitás állapotát az adatbázisból.
|
||||
/// </summary>
|
||||
/// <param name="entity">A betöltendő entitás</param>
|
||||
/// <param name="entityId">Az entitás adatbázisbeli azonosítója</param>
|
||||
/// <returns>True, ha sikeres; egyébként False</returns>
|
||||
bool LoadEntity(Entity entity, int entityId);
|
||||
|
||||
/// <summary>
|
||||
/// Oszlopszűrten beltölti egy entitás állapotát az adatbázisból
|
||||
/// </summary>
|
||||
/// <param name="entity">A betöltendő entitás</param>
|
||||
/// <param name="entityId">Az entitás adatbázisbeli azonosítója</param>
|
||||
/// <param name="columnFilterMode">A szűrés módja, megengedő vagy tiltó</param>
|
||||
/// <param name="columns">A szűrendő oszlopok felsorolása</param>
|
||||
/// <returns>True, ha sikeres; egyébként False</returns>
|
||||
bool FilteredLoadEntity(Entity entity, int entityId, ColumnFilterMode columnFilterMode, IEnumerable<string> columns);
|
||||
|
||||
/// <summary>
|
||||
/// Betölt egy entitás listát a megadott szűrő feltétellel.
|
||||
/// </summary>
|
||||
/// <param name="collection">A feltöltendő lista</param>
|
||||
/// <param name="filter">A szűrő SQL töredék</param>
|
||||
void LoadWithFilter(IEntityCollection collection, string filter, Dictionary<string, object> commandParameters);
|
||||
|
||||
/// <summary>
|
||||
/// Létrehoz egy új entitás példányt az adatbázisban.
|
||||
/// </summary>
|
||||
/// <param name="entity">A létrehozandó entitás</param>
|
||||
void InsertEntity(Entity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Módosít egy entitás példányt az adatbázisban.
|
||||
/// </summary>
|
||||
/// <param name="entity">A módosítandó entitás</param>
|
||||
/// <returns>True, ha sikeres; egyébként false</returns>
|
||||
bool UpdateEntity(Entity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Módosítja egy entitás példány asszociációs kapcsolómezőit az adatbázisban.
|
||||
/// </summary>
|
||||
/// <param name="entity">A módosítandó entitás</param>
|
||||
/// <returns>True, ha sikeres; egyébként false</returns>
|
||||
bool UpdateAssociations(Entity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Töröl egy entitás példányt az adatbázisból.
|
||||
/// </summary>
|
||||
/// <param name="entity">A törlendő entitás</param>
|
||||
void DeleteEntity(Entity entity, bool logikai = true);
|
||||
}
|
||||
}
|
49
Framework/Entities/IEntityHandler.cs
Normal file
49
Framework/Entities/IEntityHandler.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Entitás eseményeket kezelő osztályok felülete. Lásd még <see cref="EntityHandler"/>.
|
||||
/// </summary>
|
||||
public interface IEntityHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Az entitás insert művelete előtt fut le.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
void BeforeInsert(Entity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás insert művelete után fut le.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
void AfterInsert(Entity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás update művelete előtt fut le.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
void BeforeUpdate(Entity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás update művelete után fut le.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
void AfterUpdate(Entity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás delete művelete előtt fut le.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
void BeforeDelete(Entity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Az entitás delete művelete után fut le.
|
||||
/// </summary>
|
||||
/// <param name="entity">Az entitás</param>
|
||||
void AfterDelete(Entity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Létre van-e hozva az entitáshoz EntityHandler
|
||||
/// </summary>
|
||||
bool IsCreated { get; set; }
|
||||
}
|
||||
}
|
81
Framework/Entities/InvalidEntityAttributeException.cs
Normal file
81
Framework/Entities/InvalidEntityAttributeException.cs
Normal file
|
@ -0,0 +1,81 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Érvénytelen entitás attribútumot jelző kivétel.
|
||||
/// </summary>
|
||||
[FriendlyName(1000027, "Az entitás érvénytelen attribútummal rendelkezik: a(z) {AttributeName} {Error}.")]
|
||||
[ErrorCode(Events.ENTITY_INVALIDDATA)]
|
||||
[Serializable]
|
||||
public sealed class InvalidEntityAttributeException : EntityException
|
||||
{
|
||||
const string _errorMessage = "The entity has invalid attribute: {AttributeName} {Error}.";
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="attributeName">Az attribútum neve</param>
|
||||
public InvalidEntityAttributeException(string entityName, string attributeName)
|
||||
: this(entityName, attributeName, EntityAttributeError.Unknown) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="attributeName">Az attribútum neve</param>
|
||||
/// <param name="error">A hiba típusa</param>
|
||||
public InvalidEntityAttributeException(string entityName, string attributeName, EntityAttributeError error)
|
||||
: this(entityName, attributeName, error, null) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="attributeName">Az attribútum neve</param>
|
||||
/// <param name="error">A hiba típusa</param>
|
||||
/// <param name="innerException">Az előző kivétel</param>
|
||||
public InvalidEntityAttributeException(string entityName, string attributeName, EntityAttributeError error, Exception innerException)
|
||||
: base(_errorMessage, innerException)
|
||||
{
|
||||
SetValue("EntityName", entityName);
|
||||
SetValue("AttributeName", attributeName);
|
||||
SetValue("Error", error);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public InvalidEntityAttributeException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public InvalidEntityAttributeException(string message)
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public InvalidEntityAttributeException(string message, Exception innerException)
|
||||
: base(message, innerException) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
InvalidEntityAttributeException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
61
Framework/Entities/ReadOnlyEntityAttributeException.cs
Normal file
61
Framework/Entities/ReadOnlyEntityAttributeException.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Módosítási kísérlet történt az entitás csak olvasható attribútumára.
|
||||
/// </summary>
|
||||
[FriendlyName(1000005, "A(z) '{AttributeName}' attribútum csak olvasható.")]
|
||||
[ErrorCode(Events.ENTITY_READONLYATTRIBUTE)]
|
||||
[Serializable]
|
||||
public sealed class ReadOnlyEntityAttributeException : EntityException
|
||||
{
|
||||
const string _errorMessage = "The attribute is read-only.";
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="entityName">Az entitás neve</param>
|
||||
/// <param name="attributeName">Az attribútum neve</param>
|
||||
public ReadOnlyEntityAttributeException(string entityName, string attributeName)
|
||||
: base(_errorMessage)
|
||||
{
|
||||
SetValue("EntityName", entityName);
|
||||
SetValue("AttributeName", attributeName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public ReadOnlyEntityAttributeException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public ReadOnlyEntityAttributeException(string message)
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public ReadOnlyEntityAttributeException(string message, Exception innerException)
|
||||
: base(message, innerException) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
ReadOnlyEntityAttributeException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
14
Framework/Exceptions/ArchivBelepesException.cs
Normal file
14
Framework/Exceptions/ArchivBelepesException.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework
|
||||
{
|
||||
[Serializable]
|
||||
public class ArchivBelepesException : ServerException
|
||||
{
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public ArchivBelepesException() { }
|
||||
|
||||
public ArchivBelepesException(string message)
|
||||
: base(message) { }
|
||||
}
|
||||
}
|
45
Framework/Exceptions/DataIntegrityException.cs
Normal file
45
Framework/Exceptions/DataIntegrityException.cs
Normal file
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// Sérült adat integritás.
|
||||
/// </summary>
|
||||
[FriendlyName(1000021, "Sérült adat integritás, kérjük értesítse az üzemeltetőt.\r\nHivatkozási hiba azonosító: {Id}")]
|
||||
[ErrorCode(Events.FRAMEWORK_DATAINTEGRITYVIOLATION)]
|
||||
[Serializable]
|
||||
public class DataIntegrityException : ServerException
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public DataIntegrityException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
public DataIntegrityException(string message)
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
public DataIntegrityException(string message, Exception innerException)
|
||||
: base(message, innerException, true) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
protected DataIntegrityException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
62
Framework/Exceptions/ExceptionUtil.cs
Normal file
62
Framework/Exceptions/ExceptionUtil.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
|
||||
namespace Kreta.Framework.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Kivételek segédosztálya.
|
||||
/// </summary>
|
||||
public static class ExceptionUtil
|
||||
{
|
||||
/// <summary>
|
||||
/// Ember számára olvasható karakterlánccá alakít egy kivételt.
|
||||
/// </summary>
|
||||
/// <param name="exception">A kivétel</param>
|
||||
/// <returns>
|
||||
/// A visszatérési érték tartalmazza a kivétel osztályának a nevét, a kivétel üzenetét, a kivétel vermét, és a belső kivételt.
|
||||
/// </returns>
|
||||
public static string ExceptionToString(Exception exception)
|
||||
{
|
||||
if (exception == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.Append(exception);
|
||||
for (Exception innerException = exception; innerException != null; innerException = innerException.InnerException)
|
||||
{
|
||||
if (innerException == exception)
|
||||
{
|
||||
builder.Append(Environment.NewLine);
|
||||
builder.AppendLine("Data:");
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.Append(Environment.NewLine);
|
||||
builder.Append("Inner exception data:");
|
||||
}
|
||||
foreach (DictionaryEntry entry in exception.Data)
|
||||
{
|
||||
string key = entry.Key.ToString();
|
||||
if (key.StartsWith("$", StringComparison.OrdinalIgnoreCase)
|
||||
||
|
||||
entry.Value == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
builder.AppendFormat("{0}={1}", key, entry.Value);
|
||||
builder.AppendLine();
|
||||
}
|
||||
}
|
||||
TypeLoadException typeLoadException = exception as TypeLoadException;
|
||||
// ReSharper disable once InvertIf
|
||||
if (typeLoadException != null)
|
||||
{
|
||||
builder.AppendFormat("Type: {0}", typeLoadException.TypeName);
|
||||
builder.AppendLine();
|
||||
}
|
||||
return builder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
228
Framework/Exceptions/FrameworkException.cs
Normal file
228
Framework/Exceptions/FrameworkException.cs
Normal file
|
@ -0,0 +1,228 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// A keretrendszer kivételeinek absztrakt ősosztálya.
|
||||
/// </summary>
|
||||
[FriendlyName(1000003, "Ismeretlen rendszerhiba történt.")]
|
||||
[LogLevel(LogLevel.ERROR)]
|
||||
[ErrorCode(Events.FRAMEWORK_EXCEPTION)]
|
||||
[Serializable]
|
||||
public abstract class FrameworkException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Belső osztály a nyelvesítés támogatására.
|
||||
/// </summary>
|
||||
sealed class FrameworkExceptionLocalizer : ExceptionLocalizer
|
||||
{
|
||||
public override string Localize(Exception exception, CultureInfo cultureInfo)
|
||||
{
|
||||
return ReplaceParameters(exception as FrameworkException, base.Localize(exception, cultureInfo), cultureInfo);
|
||||
}
|
||||
|
||||
static string ReplaceParameters(FrameworkException exception, string template, CultureInfo cultureInfo)
|
||||
{
|
||||
if (exception == null)
|
||||
{
|
||||
return template;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(template))
|
||||
{
|
||||
return exception.Message;
|
||||
}
|
||||
string result = template;
|
||||
foreach (DictionaryEntry entry in exception.Data)
|
||||
{
|
||||
string placeholder = "{" + entry.Key + "}";
|
||||
object value = entry.Value;
|
||||
result = result.Replace(placeholder, value != null ? Localizer.Localize(value, cultureInfo) : "N/A");
|
||||
}
|
||||
result = result.Replace("{InnerException}", exception.InnerException != null ? Localizer.Localize(exception.InnerException, cultureInfo) : "");
|
||||
result = result.Replace("{Message}", exception.Message);
|
||||
result = result.Replace("{Id}", exception.Id);
|
||||
string formattedClientErrorCode = string.Format(CultureInfo.InvariantCulture, "{0} ({1})", exception.ClientErrorCode, (int)exception.ClientErrorCode);
|
||||
result = result.Replace("{ClientErrorCode}", formattedClientErrorCode);
|
||||
return result.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
const string _errorMessage = "Unknown system error occurred.";
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály statikus konstruktora.
|
||||
/// </summary>
|
||||
static FrameworkException()
|
||||
{
|
||||
Localizer.SetLocalizer(typeof(FrameworkException), new FrameworkExceptionLocalizer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
protected FrameworkException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
// ReSharper disable DoNotCallOverridableMethodsInConstructor
|
||||
Data["$Id"] = Guid.NewGuid().ToString();
|
||||
Data["$IsLogged"] = false;
|
||||
// ReSharper restore DoNotCallOverridableMethodsInConstructor
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
protected FrameworkException()
|
||||
: this(_errorMessage, null) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
protected FrameworkException(string message)
|
||||
: this(message, null) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
protected FrameworkException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
|
||||
/// <summary>
|
||||
/// Beállítja egy paraméter értékét.
|
||||
/// </summary>
|
||||
/// <param name="key">A paraméter neve</param>
|
||||
/// <param name="value">A paraméter értéke</param>
|
||||
protected internal void SetValue(string key, object value)
|
||||
{
|
||||
if (value != null
|
||||
&&
|
||||
key != null
|
||||
&&
|
||||
key.Length > 0)
|
||||
{
|
||||
Data[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Naplózási szint.
|
||||
/// </summary>
|
||||
internal LogLevel LogLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
LogLevelAttribute attribute =
|
||||
GetType()
|
||||
.GetCustomAttributes(typeof(LogLevelAttribute), true)
|
||||
.OfType<LogLevelAttribute>()
|
||||
.FirstOrDefault();
|
||||
return attribute == null ? LogLevel.UNKNOWN : attribute.LogLevel;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A kivétel üzenete.
|
||||
/// </summary>
|
||||
public override string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = base.Message;
|
||||
foreach (DictionaryEntry entry in Data)
|
||||
{
|
||||
string placeholder = "{" + entry.Key + "}";
|
||||
object value = entry.Value;
|
||||
result = result.Replace(placeholder, value != null ? value.ToString() : "N/A");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A kivétel adattartalma XML-ben.
|
||||
/// </summary>
|
||||
public string DataXml
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = "<data>";
|
||||
foreach (DictionaryEntry entry in Data.Cast<DictionaryEntry>().Where(entry => entry.Key.ToString() != "RequestXml"))
|
||||
{
|
||||
result += "<item name=\"";
|
||||
result += entry.Key;
|
||||
result += "\">";
|
||||
object value = entry.Value;
|
||||
string valuestring = value != null ? value.ToString() : "N/A";
|
||||
result += valuestring;
|
||||
result += "</item>";
|
||||
}
|
||||
result += "</data>";
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A kliensre visszaadott hibakód.
|
||||
/// </summary>
|
||||
internal Events ClientErrorCode
|
||||
{
|
||||
get
|
||||
{
|
||||
ErrorCodeAttribute attribute =
|
||||
GetType()
|
||||
.GetCustomAttributes(typeof(ErrorCodeAttribute), true)
|
||||
.OfType<ErrorCodeAttribute>()
|
||||
.FirstOrDefault();
|
||||
return attribute == null ? Events.GENERAL : attribute.ErrorCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A kivétel azonosítója, naplózáshoz használt.
|
||||
/// </summary>
|
||||
internal string Id
|
||||
{
|
||||
get
|
||||
{
|
||||
string result = Data["$Id"] as string;
|
||||
if (result != null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
result = Guid.NewGuid().ToString();
|
||||
Data["$Id"] = result;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A kivétel naplózva lett-e már, vagy sem.
|
||||
/// </summary>
|
||||
internal bool IsLogged
|
||||
{
|
||||
get
|
||||
{
|
||||
return Equals(Data["$IsLogged"], true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Naplózottá minősíti a kivételt.
|
||||
/// </summary>
|
||||
internal void SetLogged()
|
||||
{
|
||||
Data["$IsLogged"] = true;
|
||||
}
|
||||
}
|
||||
}
|
54
Framework/Exceptions/InvalidConfigurationException.cs
Normal file
54
Framework/Exceptions/InvalidConfigurationException.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// Érvénytelen konfiguráció.
|
||||
/// </summary>
|
||||
[FriendlyName(1000023, "Érvénytelen konfiguráció.")]
|
||||
[ErrorCode(Events.FRAMEWORK_CONFIG_INVALIDCONFIG)]
|
||||
[Serializable]
|
||||
public sealed class InvalidConfigurationException : ServerException
|
||||
{
|
||||
const string _errorMessage = "Invalid configuration.";
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
public InvalidConfigurationException()
|
||||
: this(_errorMessage, null) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
public InvalidConfigurationException(string message)
|
||||
: this(message, null) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
public InvalidConfigurationException(Exception innerException)
|
||||
: this(_errorMessage, innerException) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">A belső kivétel</param>
|
||||
public InvalidConfigurationException(string message, Exception innerException)
|
||||
: base(message, innerException, true) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
InvalidConfigurationException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
52
Framework/Exceptions/InvalidSessionException.cs
Normal file
52
Framework/Exceptions/InvalidSessionException.cs
Normal file
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
using Kreta.Framework.Logging;
|
||||
|
||||
namespace Kreta.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// Munkamenet-hibákkal kapcsolatos okok
|
||||
/// </summary>
|
||||
public enum SessionReason
|
||||
{
|
||||
/// <summary>
|
||||
/// A munkamenet nem létezik
|
||||
/// </summary>
|
||||
NOT_EXISTS,
|
||||
|
||||
/// <summary>
|
||||
/// A munkamenet már létezik
|
||||
/// </summary>
|
||||
EXISTS
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Érvénytelen munkamenet azonosító.
|
||||
/// </summary>
|
||||
[FriendlyName(1000043, "Érvénytelen vagy lejárt munkamenet.")]
|
||||
[ErrorCode(Events.FRAMEWORK_SESSION_INVALID)]
|
||||
[Serializable]
|
||||
public sealed class InvalidSessionException : FrameworkException
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="sessionid">A munkamenet azonosítója</param>
|
||||
/// <param name="reason">A kivétel oka</param>
|
||||
public InvalidSessionException(string sessionid, SessionReason reason)
|
||||
: base("Érvénytelen vagy lejárt munkamenet.", null)
|
||||
{
|
||||
Data.Add(LogParameter.REASON, reason);
|
||||
Data.Add(LogParameter.SESSIONID, sessionid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Sorosítási adatfolyam</param>
|
||||
InvalidSessionException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
15
Framework/Exceptions/JelszoValtoztatasKotelezoException.cs
Normal file
15
Framework/Exceptions/JelszoValtoztatasKotelezoException.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework
|
||||
{
|
||||
[Serializable]
|
||||
public class JelszoValtoztatasKotelezoException : ServerException
|
||||
{
|
||||
public string Link { get; }
|
||||
|
||||
public JelszoValtoztatasKotelezoException(string link) : base()
|
||||
{
|
||||
this.Link = link;
|
||||
}
|
||||
}
|
||||
}
|
14
Framework/Exceptions/NextTanevBelepesException.cs
Normal file
14
Framework/Exceptions/NextTanevBelepesException.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework
|
||||
{
|
||||
[Serializable]
|
||||
public class NextTanevBelepesException : ServerException
|
||||
{
|
||||
[Obsolete("Ezt a konstruktort ne használd!")]
|
||||
public NextTanevBelepesException() { }
|
||||
|
||||
public NextTanevBelepesException(string message)
|
||||
: base(message) { }
|
||||
}
|
||||
}
|
21
Framework/Exceptions/PanicException.cs
Normal file
21
Framework/Exceptions/PanicException.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Kreta.Framework.Exceptions
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class PanicException : Exception
|
||||
{
|
||||
const string _defaultMessage = "Don't panic!";
|
||||
|
||||
public PanicException() : base(_defaultMessage) { }
|
||||
|
||||
public PanicException(string message) : base(message) { }
|
||||
|
||||
public PanicException(string message, Exception inner) : base(message, inner) { }
|
||||
|
||||
public PanicException(Exception inner) : base(_defaultMessage, inner) { }
|
||||
|
||||
PanicException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||
}
|
||||
}
|
68
Framework/Exceptions/ServerException.cs
Normal file
68
Framework/Exceptions/ServerException.cs
Normal file
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
|
||||
namespace Kreta.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// Általános kiszolgáló hiba.
|
||||
/// </summary>
|
||||
[FriendlyName(1000000, "Ismeretlen kiszolgálóhiba történt!")]
|
||||
[Serializable]
|
||||
public class ServerException : FrameworkException
|
||||
{
|
||||
/// <summary>
|
||||
/// A kivétel végzetes-e, vagy sem.
|
||||
/// </summary>
|
||||
public bool IsFatal { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
public ServerException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A felhasználónak szánt hibaüzenet</param>
|
||||
public ServerException(string message)
|
||||
: this(message, null, false) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A felhasználónak szánt hibaüzenet</param>
|
||||
/// <param name="innerException">Az előző kivétel, ami történt</param>
|
||||
public ServerException(string message, Exception innerException)
|
||||
: this(message, innerException, false) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Környezeti információk</param>
|
||||
protected ServerException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A felhasználónak szánt hibaüzenet</param>
|
||||
/// <param name="isFatal">A kivétel végzetes-e, vagy sem</param>
|
||||
public ServerException(string message, bool isFatal)
|
||||
: this(message, null, isFatal) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="message">A felhasználónak szánt hibaüzenet</param>
|
||||
/// <param name="innerException">Az előző kivétel, ami történt</param>
|
||||
/// <param name="isFatal">A kivétel végzetes-e, vagy sem</param>
|
||||
public ServerException(string message, Exception innerException, bool isFatal)
|
||||
: base(message, innerException)
|
||||
{
|
||||
IsFatal = isFatal;
|
||||
SetValue("IsFatal", isFatal.ToString());
|
||||
}
|
||||
}
|
||||
}
|
49
Framework/Exceptions/ServerStartException.cs
Normal file
49
Framework/Exceptions/ServerStartException.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Kreta.Framework.Localization;
|
||||
|
||||
namespace Kreta.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// A kiszolgáló nem indítható el.
|
||||
/// </summary>
|
||||
[FriendlyName(1000002, "Hiba történt a kiszolgáló indítása során. A részleteket lásd a naplóban.")]
|
||||
[Serializable]
|
||||
public sealed class ServerStartException : ServerException
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora
|
||||
/// </summary>
|
||||
public ServerStartException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
public ServerStartException(string message)
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora
|
||||
/// </summary>
|
||||
/// <param name="message">A kivétel üzenete</param>
|
||||
/// <param name="innerException">Az előző kivétel, ami történt</param>
|
||||
public ServerStartException(string message, Exception innerException)
|
||||
: base(message, innerException) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora
|
||||
/// </summary>
|
||||
/// <param name="innerException">Az előző kivétel, ami történt</param>
|
||||
public ServerStartException(Exception innerException)
|
||||
: base("Error occurred during server startup.", innerException) { }
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora
|
||||
/// </summary>
|
||||
/// <param name="info">Sorosítási adatok</param>
|
||||
/// <param name="context">Környezeti információk</param>
|
||||
ServerStartException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
}
|
325
Framework/Kreta.Framework.csproj
Normal file
325
Framework/Kreta.Framework.csproj
Normal file
|
@ -0,0 +1,325 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{320EF478-7155-441D-B1E9-47EC3E57FB45}</ProjectGuid>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>Kreta.Framework</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Kreta.Framework</RootNamespace>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<UseVSHostingProcess>true</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CacheManager.Core, Version=1.2.0.0, Culture=neutral, PublicKeyToken=5b450b4fb65c4cdb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CacheManager.Core.1.2.0\lib\net45\CacheManager.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Configuration.Install" />
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.ServiceModel">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web">
|
||||
<Name>System.Web</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Tools\SharedAssemblyInfo.cs">
|
||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Actions\ProtectedDictionaryItemException.cs" />
|
||||
<Compile Include="Caching\Cache.cs" />
|
||||
<Compile Include="Caching\CacheManager.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\DokumentumKulcsszoTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\OktNevelesiKategoriaDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\AgazatUjSzktTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\SzakmaTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\AgazatReszSzakmaTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\TavolletTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\OraTulajdonsagTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\SzakkepesitesTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\EsemenyTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\SorolasOkaTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\NapTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\OktatasiNevelesiFeladatDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\CsoportTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\OrszagTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\MunkakorTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\ErtekelesModDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\AllampolgarsagDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\EvfolyamTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryItemTables\ErtekelesTipusDictionaryItem.cs" />
|
||||
<Compile Include="Caching\DictionaryTableCache.cs" />
|
||||
<Compile Include="Caching\DictionaryItem.cs" />
|
||||
<Compile Include="Caching\LoginInfoCache.cs" />
|
||||
<Compile Include="Caching\GenericCache.cs" />
|
||||
<Compile Include="Caching\ManualEnumCache.cs" />
|
||||
<Compile Include="Caching\StringResourcesCache.cs" />
|
||||
<Compile Include="Collections\Generic\IAssociatedEntityCollection.cs" />
|
||||
<Compile Include="Collections\Generic\IEntityCollection.cs" />
|
||||
<Compile Include="Collections\Generic\IEntityCollectionDA.cs" />
|
||||
<Compile Include="Collections\IAssociatedEntityCollection.cs" />
|
||||
<Compile Include="Collections\Generic\AssociatedEntityCollection.cs" />
|
||||
<Compile Include="Collections\Generic\EntityCollectionDA.cs" />
|
||||
<Compile Include="Collections\IEntityCollection.cs" />
|
||||
<Compile Include="Entities\Associations\AssociationAttribute.cs" />
|
||||
<Compile Include="Entities\Associations\AssociationHandler.cs" />
|
||||
<Compile Include="Entities\Associations\AssociationHandlerManager.cs" />
|
||||
<Compile Include="Entities\ColumnFilterMode.cs" />
|
||||
<Compile Include="Entities\EntityConnectionModel.cs" />
|
||||
<Compile Include="Entities\EntityReadOnlyException.cs" />
|
||||
<Compile Include="Exceptions\JelszoValtoztatasKotelezoException.cs" />
|
||||
<Compile Include="Exceptions\ArchivBelepesException.cs" />
|
||||
<Compile Include="Exceptions\NextTanevBelepesException.cs" />
|
||||
<Compile Include="Exceptions\PanicException.cs" />
|
||||
<Compile Include="Localization\EnumLocalizer.cs" />
|
||||
<Compile Include="Localization\ExceptionLocalizer.cs" />
|
||||
<Compile Include="Localization\FriendlyNameAttribute.cs" />
|
||||
<Compile Include="Localization\GenericLocalizer.cs" />
|
||||
<Compile Include="Localization\ILocalizable.cs" />
|
||||
<Compile Include="Localization\ILocalizer.cs" />
|
||||
<Compile Include="Localization\Localizer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Entities\Generic\IEntityDataAccessor.cs" />
|
||||
<Compile Include="Entities\EntityAttributeCache.cs" />
|
||||
<Compile Include="Entities\EntityDictionaryItemPropertyAttribute.cs" />
|
||||
<Compile Include="Entities\DAUtil.cs" />
|
||||
<Compile Include="Entities\Entity.cs" />
|
||||
<Compile Include="Entities\EntityAttribute.cs" />
|
||||
<Compile Include="Entities\EntityAttributeError.cs" />
|
||||
<Compile Include="Entities\EntityCopyMethod.cs" />
|
||||
<Compile Include="Entities\EntityDeleteFailedException.cs" />
|
||||
<Compile Include="Entities\EntityException.cs" />
|
||||
<Compile Include="Entities\EntityExpiredException.cs" />
|
||||
<Compile Include="Entities\EntityHandler.cs" />
|
||||
<Compile Include="Entities\EntityHandlerAttribute.cs" />
|
||||
<Compile Include="Entities\EntityNotFoundException.cs" />
|
||||
<Compile Include="Entities\EntityPropertyAttribute.cs" />
|
||||
<Compile Include="Entities\EntityPropertyBaseType.cs" />
|
||||
<Compile Include="Entities\EntityState.cs" />
|
||||
<Compile Include="Entities\EntityStateException.cs" />
|
||||
<Compile Include="Entities\EntityUtil.cs" />
|
||||
<Compile Include="Entities\Generic\IEntityDBHelper.cs" />
|
||||
<Compile Include="Entities\IEntityDataAccessor.cs" />
|
||||
<Compile Include="Entities\IEntityHandler.cs" />
|
||||
<Compile Include="Entities\InvalidEntityAttributeException.cs" />
|
||||
<Compile Include="Collections\Generic\EntityCollection.cs" />
|
||||
<Compile Include="Entities\ReadOnlyEntityAttributeException.cs" />
|
||||
<Compile Include="Entities\Generic\EntityDataAccessor.cs" />
|
||||
<Compile Include="Entities\Generic\EntityDBHelper.cs" />
|
||||
<Compile Include="Exceptions\ExceptionUtil.cs" />
|
||||
<Compile Include="Exceptions\FrameworkException.cs" />
|
||||
<Compile Include="Logging\ConsoleLogWriter.cs" />
|
||||
<Compile Include="Logging\DatabaseLogWriter.cs" />
|
||||
<Compile Include="Logging\ErrorCodeAttribute.cs" />
|
||||
<Compile Include="Logging\Events.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Logging\ILogMessage.cs" />
|
||||
<Compile Include="Logging\ILogWriter.cs" />
|
||||
<Compile Include="Logging\Logger.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Logging\LogLevel.cs" />
|
||||
<Compile Include="Logging\LogLevelAttribute.cs" />
|
||||
<Compile Include="Logging\LogMessage.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Logging\LogUtil.cs" />
|
||||
<Compile Include="Logging\LogWriterBase.cs" />
|
||||
<Compile Include="Logging\LogWriterException.cs" />
|
||||
<Compile Include="Logging\LogParameter.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Logging\MulticastLogWriter.cs" />
|
||||
<Compile Include="Security\PasswordCrypting\BasePasswordCrypter.cs" />
|
||||
<Compile Include="Session\ConnectionManager.cs" />
|
||||
<Compile Include="Session\Instrumentation\SessionLogger.cs" />
|
||||
<Compile Include="Session\ServiceSystemSession.cs" />
|
||||
<Compile Include="Session\SessionEventArgs.cs" />
|
||||
<Compile Include="Session\OrganizationSystemSession.cs" />
|
||||
<Compile Include="Session\TransactionContext.cs" />
|
||||
<Compile Include="Util\EntityUtils.cs" />
|
||||
<Compile Include="Util\FrameworkEnumExtensions.cs" />
|
||||
<Compile Include="Util\GridParameters.cs" />
|
||||
<Compile Include="Util\LanguageUtil.cs" />
|
||||
<Compile Include="Util\ProtectedAttribute.cs" />
|
||||
<Compile Include="Security\IncorrectPasswordException.cs" />
|
||||
<Compile Include="Security\LoginInfo.cs" />
|
||||
<Compile Include="Security\SecurityException.cs" />
|
||||
<Compile Include="Security\UserNotFoundException.cs" />
|
||||
<Compile Include="Exceptions\DataIntegrityException.cs" />
|
||||
<Compile Include="Exceptions\InvalidConfigurationException.cs" />
|
||||
<Compile Include="Exceptions\ServerException.cs" />
|
||||
<Compile Include="Exceptions\ServerStartException.cs" />
|
||||
<Compile Include="Session\SessionManager.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Session\SystemSession.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Session\UserContext.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Util\Configuration.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Exceptions\InvalidSessionException.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Util\LanguageContext.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Util\SaltGenerator.cs" />
|
||||
<Compile Include="Util\SDAServer.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Util\StreamUtil.cs" />
|
||||
<Compile Include="Util\StringValueAttribute.cs" />
|
||||
<Compile Include="Util\StringResourcesUtil.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Util\StringResourcesIdAttribute.cs" />
|
||||
<Compile Include="Util\StringValueUtils.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="sn.snk" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Kreta.Resources\Kreta.Resources.csproj">
|
||||
<Project>{DFCB4D33-B599-42B2-98C6-B60FD220DB0C}</Project>
|
||||
<Name>Kreta.Resources</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Sda.DataProvider\Sda.DataProvider.csproj">
|
||||
<Project>{9ac4fd13-81f5-48ac-aa21-ba774c4dc771}</Project>
|
||||
<Name>Sda.DataProvider</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
69
Framework/Localization/EnumLocalizer.cs
Normal file
69
Framework/Localization/EnumLocalizer.cs
Normal file
|
@ -0,0 +1,69 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Kreta.Framework.Caching;
|
||||
|
||||
namespace Kreta.Framework.Localization
|
||||
{
|
||||
/// <summary>
|
||||
/// Felsorolások nyelvesítésére szolgáló <see cref="ILocalizer"/> megvalósítás.
|
||||
/// </summary>
|
||||
internal sealed class EnumLocalizer : ILocalizer
|
||||
{
|
||||
private static object SyncObject = new object();
|
||||
|
||||
private static readonly Dictionary<Enum, FriendlyNameAttribute> friendlyNameAttributeCache = new Dictionary<Enum, FriendlyNameAttribute>();
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
public EnumLocalizer()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lásd <see cref="ILocalizer.Localize"/>.
|
||||
/// </summary>
|
||||
/// <param name="value">Lásd <see cref="ILocalizer.Localize"/></param>
|
||||
/// <param name="cultureInfo">Lásd <see cref="ILocalizer.Localize"/></param>
|
||||
/// <returns>Lásd <see cref="ILocalizer.Localize"/></returns>
|
||||
string ILocalizer.Localize(object value, CultureInfo cultureInfo)
|
||||
{
|
||||
return Localize((Enum)value, cultureInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lásd <see cref="ILocalizer.Localize"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A nyelvesítés a felsorolás mezőire tett <see cref="FriendlyNameAttribute"/> attribútum
|
||||
/// alapján történik. A felsorolás mezője ilyet nem tartalmaz, akkor egyszerűen a <see cref="Enum.ToString()"/>
|
||||
/// metódus lesz használva.
|
||||
/// </remarks>
|
||||
/// <param name="value">Lásd <see cref="ILocalizer.Localize"/></param>
|
||||
/// <param name="cultureInfo">Lásd <see cref="ILocalizer.Localize"/></param>
|
||||
/// <returns>Lásd <see cref="ILocalizer.Localize"/></returns>
|
||||
public string Localize(Enum value, CultureInfo cultureInfo)
|
||||
{
|
||||
FriendlyNameAttribute attribute;
|
||||
lock (SyncObject)
|
||||
{
|
||||
if (!friendlyNameAttributeCache.ContainsKey(value))
|
||||
{
|
||||
System.Reflection.FieldInfo fieldinfo = value.GetType().GetField(value.ToString());
|
||||
attribute = (FriendlyNameAttribute)fieldinfo.GetCustomAttributes(typeof(FriendlyNameAttribute), false).FirstOrDefault(); // no inheritance
|
||||
friendlyNameAttributeCache[value] = attribute;
|
||||
}
|
||||
else
|
||||
{
|
||||
attribute = friendlyNameAttributeCache[value];
|
||||
}
|
||||
}
|
||||
|
||||
return attribute != null
|
||||
? SDAServer.Instance.CacheManager.AquireCache<StringResourcesCache>().Get(attribute.StringResourceId, cultureInfo.LCID, attribute.DisplayText)
|
||||
: value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
48
Framework/Localization/ExceptionLocalizer.cs
Normal file
48
Framework/Localization/ExceptionLocalizer.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Kreta.Framework.Caching;
|
||||
|
||||
namespace Kreta.Framework.Localization
|
||||
{
|
||||
/// <summary>
|
||||
/// Kivételek nyelvesítésére szolgáló <see cref="ILocalizer"/> megvalósítás.
|
||||
/// </summary>
|
||||
internal class ExceptionLocalizer : ILocalizer
|
||||
{
|
||||
private static object SyncObject = new object();
|
||||
// <<Monostate>>
|
||||
private static readonly Dictionary<Type, FriendlyNameAttribute> friendlyNameAttributeCache = new Dictionary<Type, FriendlyNameAttribute>();
|
||||
|
||||
string ILocalizer.Localize(object value, CultureInfo cultureInfo)
|
||||
{
|
||||
return Localize((Exception)value, cultureInfo);
|
||||
}
|
||||
|
||||
public virtual string Localize(Exception exception, CultureInfo cultureInfo)
|
||||
{
|
||||
FriendlyNameAttribute attribute;
|
||||
lock (SyncObject)
|
||||
{
|
||||
var exceptionType = exception.GetType();
|
||||
if (!friendlyNameAttributeCache.TryGetValue(exceptionType, out attribute))
|
||||
{
|
||||
attribute = (FriendlyNameAttribute)exceptionType.GetCustomAttributes(typeof(FriendlyNameAttribute), true).FirstOrDefault(); //inherited but allowed only one
|
||||
friendlyNameAttributeCache[exceptionType] = attribute;
|
||||
}
|
||||
}
|
||||
|
||||
if (attribute != null)
|
||||
{
|
||||
if (attribute.StringResourceId == -1)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return SDAServer.Instance.CacheManager.AquireCache<StringResourcesCache>().Get(attribute.StringResourceId, cultureInfo.LCID, attribute.DisplayText);
|
||||
}
|
||||
return exception.Message;
|
||||
}
|
||||
}
|
||||
}
|
34
Framework/Localization/FriendlyNameAttribute.cs
Normal file
34
Framework/Localization/FriendlyNameAttribute.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Framework.Localization
|
||||
{
|
||||
/// <summary>
|
||||
/// Kultúrafüggő barátságos nevet definiáló attribútum.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
|
||||
public sealed class FriendlyNameAttribute : Attribute
|
||||
{
|
||||
public int StringResourceId
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public string DisplayText
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az attribútum konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="cultureName">A kultúra neve</param>
|
||||
/// <param name="value">A barátságos név</param>
|
||||
public FriendlyNameAttribute(int stringResourceId, string displayText)
|
||||
{
|
||||
StringResourceId = stringResourceId;
|
||||
DisplayText = displayText;
|
||||
}
|
||||
}
|
||||
}
|
49
Framework/Localization/GenericLocalizer.cs
Normal file
49
Framework/Localization/GenericLocalizer.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Kreta.Framework.Localization
|
||||
{
|
||||
/// <summary>
|
||||
/// Általános <see cref="ILocalizer"/> megvalósítás.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Az általános megvalósítás egyenértékű az objektumon végrehajtott <see cref="object.ToString()"/> hívással,
|
||||
/// azzal a különbséggel, hogy figyelembe veszi, ha az objektum megvalósítja az <see cref="IFormattable"/>
|
||||
/// felületet.
|
||||
/// </remarks>
|
||||
internal sealed class GenericLocalizer : ILocalizer
|
||||
{
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
public GenericLocalizer()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lásd <see cref="ILocalizer.Localize"/>.
|
||||
/// </summary>
|
||||
/// <param name="value">Lásd <see cref="ILocalizer.Localize"/></param>
|
||||
/// <param name="cultureInfo">Lásd <see cref="ILocalizer.Localize"/></param>
|
||||
/// <returns>Lásd <see cref="ILocalizer.Localize"/></returns>
|
||||
public string Localize(object value, CultureInfo cultureInfo)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (value is IFormattable formattable)
|
||||
{
|
||||
if (cultureInfo.IsNeutralCulture)
|
||||
{
|
||||
return formattable.ToString(null, CultureInfo.CreateSpecificCulture(cultureInfo.Name));
|
||||
}
|
||||
|
||||
return formattable.ToString(null, cultureInfo);
|
||||
}
|
||||
|
||||
return value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
17
Framework/Localization/ILocalizable.cs
Normal file
17
Framework/Localization/ILocalizable.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System.Globalization;
|
||||
|
||||
namespace Kreta.Framework.Localization
|
||||
{
|
||||
/// <summary>
|
||||
/// Önmagukat nyelvesíteni képes osztályok felülete. Lásd <see cref="Localizer"/>.
|
||||
/// </summary>
|
||||
public interface ILocalizable
|
||||
{
|
||||
/// <summary>
|
||||
/// Nyelvesíti az objektumot.
|
||||
/// </summary>
|
||||
/// <param name="cultureInfo">A nyelv</param>
|
||||
/// <returns>Az objektum nyelvesítve</returns>
|
||||
string Localize(CultureInfo cultureInfo);
|
||||
}
|
||||
}
|
20
Framework/Localization/ILocalizer.cs
Normal file
20
Framework/Localization/ILocalizer.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System.Globalization;
|
||||
|
||||
namespace Kreta.Framework.Localization
|
||||
{
|
||||
/// <summary>
|
||||
/// A nyelvesítő osztályok felülete. Lásd <see cref="Localizer"/>.
|
||||
/// </summary>
|
||||
public interface ILocalizer
|
||||
{
|
||||
// <<Strategy>>
|
||||
|
||||
/// <summary>
|
||||
/// Nyelvesíti a megadott objektumot.
|
||||
/// </summary>
|
||||
/// <param name="value">A nyelvesítendő objektum</param>
|
||||
/// <param name="cultureInfo">A nyelv</param>
|
||||
/// <returns>Az objektum nyelvesítve</returns>
|
||||
string Localize(object value, CultureInfo cultureInfo);
|
||||
}
|
||||
}
|
184
Framework/Localization/Localizer.cs
Normal file
184
Framework/Localization/Localizer.cs
Normal file
|
@ -0,0 +1,184 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Kreta.Framework.Localization
|
||||
{
|
||||
/// <summary>
|
||||
/// Objektumok nyelvesítését koordináló osztály.
|
||||
/// </summary>
|
||||
public sealed class Localizer
|
||||
{
|
||||
private static Hashtable m_RegisteredLocalizers = Hashtable.Synchronized(new Hashtable());
|
||||
private static Hashtable m_LocalizerCache = Hashtable.Synchronized(new Hashtable());
|
||||
private static ILocalizer m_DefaultLocalizer = new GenericLocalizer();
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály statikus konstruktora.
|
||||
/// </summary>
|
||||
static Localizer()
|
||||
{
|
||||
SetLocalizer(typeof(Exception), new ExceptionLocalizer());
|
||||
SetLocalizer(typeof(Enum), new EnumLocalizer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
/// <remarks>Az osztály statikus, példányosítását nem szándékozzuk.</remarks>
|
||||
private Localizer()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja a típushoz regisztrált nyelvesítő objektumot.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Ha a típushoz nem tartozik explicit regisztrált nyelvesítő, akkor az
|
||||
/// ősosztály nyelvesítőjét fogja visszaadni (rekurzívan). Ha ilyen sincs,
|
||||
/// akkor az alapértelmezett nyelvesítővel fog visszatérni.
|
||||
/// </remarks>
|
||||
/// <param name="type">A típus</param>
|
||||
/// <returns>A típus nyelvesítője</returns>
|
||||
private static ILocalizer FindRegisteredLocalizer(Type type)
|
||||
{
|
||||
ILocalizer result = m_RegisteredLocalizers[type] as ILocalizer;
|
||||
if (result != null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
if (type != typeof(object))
|
||||
{
|
||||
return FindRegisteredLocalizer(type.BaseType);
|
||||
}
|
||||
|
||||
return m_DefaultLocalizer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az alapértelmezett nyelvesítő objektum, értéke sosem lehet null.
|
||||
/// </summary>
|
||||
public static ILocalizer DefaultLocalizer
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_DefaultLocalizer;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_DefaultLocalizer = value ?? throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja a típushoz tartozó nyelvesítőt.
|
||||
/// </summary>
|
||||
/// <param name="type">A típus</param>
|
||||
/// <returns>A típus nyelvesítője</returns>
|
||||
public static ILocalizer GetLocalizer(Type type)
|
||||
{
|
||||
ILocalizer result = m_LocalizerCache[type] as ILocalizer;
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
result = FindRegisteredLocalizer(type);
|
||||
m_LocalizerCache[type] = result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Beállítja egy típushoz a hozzá tartozó nyelvesítő objektumot.
|
||||
/// </summary>
|
||||
/// <param name="type">A típus</param>
|
||||
/// <param name="localizer">A típus nyelvesítője</param>
|
||||
public static void SetLocalizer(Type type, ILocalizer localizer)
|
||||
{
|
||||
if (type == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(type));
|
||||
}
|
||||
|
||||
m_RegisteredLocalizers[type] = localizer;
|
||||
m_LocalizerCache.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nyelvesíti a megadott objektumot.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A nyelvként a <see cref="System.Globalization.CultureInfo.CurrentUICulture"/>
|
||||
/// értéke lesz használva.
|
||||
/// </remarks>
|
||||
/// <param name="value">A nyelvesítendő objektum</param>
|
||||
/// <returns>Az objektum nyelvesítve</returns>
|
||||
public static string Localize(object value)
|
||||
{
|
||||
return Localize(value, LanguageContext.Current.RegionSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nyelvesíti a megadott objektumot.
|
||||
/// </summary>
|
||||
/// <param name="value">A nyelvesítendő objektum</param>
|
||||
/// <param name="cultureName">A kultúra neve</param>
|
||||
/// <returns>Az objektum nyelvesítve</returns>
|
||||
public static string Localize(object value, string cultureName)
|
||||
{
|
||||
return Localize(value, CultureInfo.GetCultureInfo(cultureName));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nyelvesíti a megadott objektumot.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Ha az objektum megvalósítja az <see cref="ILocalizable"/> fületet, akkor azt használja;
|
||||
/// egyébként megkeresi a megfelelő - előzőleg beregisztrált <see cref="ILocalizer"/> -
|
||||
/// objektumos, és azon keresztül történik a nyelvesítés.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <param name="value">A nyelvesítendő objektum</param>
|
||||
/// <param name="cultureInfo">A nyelv</param>
|
||||
/// <returns>Az objektum nyelvesítve</returns>
|
||||
/// <exception cref="ArgumentNullException">Ha valamelyik paraméter értéke null.</exception>
|
||||
public static string Localize(object value, CultureInfo cultureInfo)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
|
||||
if (cultureInfo == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(cultureInfo));
|
||||
}
|
||||
|
||||
ILocalizable localizable = value as ILocalizable;
|
||||
|
||||
string result;
|
||||
if (localizable != null)
|
||||
{
|
||||
result = localizable.Localize(cultureInfo);
|
||||
if (result != null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
ILocalizer localizer = GetLocalizer(value.GetType());
|
||||
|
||||
result = localizer.Localize(value, cultureInfo);
|
||||
|
||||
if (result != null || localizer == m_DefaultLocalizer)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
return m_DefaultLocalizer.Localize(value, cultureInfo);
|
||||
}
|
||||
}
|
||||
}
|
216
Framework/Logging/ConsoleLogWriter.cs
Normal file
216
Framework/Logging/ConsoleLogWriter.cs
Normal file
|
@ -0,0 +1,216 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Kreta.Framework.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Konzol naplóvezető.
|
||||
/// </summary>
|
||||
public sealed class ConsoleLogWriter : LogWriterBase
|
||||
{
|
||||
const ConsoleColor _defaultConsoleColor = ConsoleColor.Gray;
|
||||
const ConsoleColor _entrySeparatorColor = ConsoleColor.Cyan;
|
||||
const string _entrySeparator = ">> ";
|
||||
|
||||
static readonly object _syncRoot = new object();
|
||||
|
||||
static ConsoleLogWriter()
|
||||
{
|
||||
SetDebug();
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
static void SetDebug()
|
||||
{
|
||||
DebugEnabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja a naplózási szinthez tartozó színt.
|
||||
/// </summary>
|
||||
/// <param name="level">A naplózási szint</param>
|
||||
/// <returns></returns>
|
||||
static ConsoleColor GetConsoleForegroundColor(LogLevel level)
|
||||
{
|
||||
switch (level)
|
||||
{
|
||||
case LogLevel.DEBUG:
|
||||
{
|
||||
return ConsoleColor.Gray;
|
||||
}
|
||||
case LogLevel.INFO:
|
||||
{
|
||||
return ConsoleColor.Green;
|
||||
}
|
||||
case LogLevel.WARNING:
|
||||
{
|
||||
return ConsoleColor.Yellow;
|
||||
}
|
||||
case LogLevel.ERROR:
|
||||
{
|
||||
return ConsoleColor.Red;
|
||||
}
|
||||
case LogLevel.FATAL:
|
||||
{
|
||||
return ConsoleColor.Magenta;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return _defaultConsoleColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Konzolra és a Debug-ra írja a megadott szöveget. Sortöréssel.
|
||||
/// </summary>
|
||||
/// <param name="messageText">A kiírandó szöveg</param>
|
||||
/// <param name="level">A naplózási szint</param>
|
||||
public static void WriteLine(string messageText, LogLevel level)
|
||||
{
|
||||
WriteLineToDebug(messageText, level);
|
||||
WriteLineToConsole(messageText, level, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Konzolra és a Debug-ra írja a megadott szöveget.
|
||||
/// </summary>
|
||||
/// <param name="messageText">A kiírandó szöveg</param>
|
||||
/// <param name="level">A naplózási szint</param>
|
||||
public static void Write(string messageText, LogLevel level)
|
||||
{
|
||||
WriteToDebug(messageText, level);
|
||||
WriteToConsole(messageText, level);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Konzolra ír egy üzenetet. Sortöréssel
|
||||
/// </summary>
|
||||
/// <param name="messageText">Az üzenet szövege</param>
|
||||
public static void WriteLine(string messageText)
|
||||
{
|
||||
WriteLine(messageText, LogLevel.UNKNOWN);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Konzolra ír egy üzenetet.
|
||||
/// </summary>
|
||||
/// <param name="messageText">Az üzenet szövege</param>
|
||||
public static void Write(string messageText)
|
||||
{
|
||||
Write(messageText, LogLevel.UNKNOWN);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Naplóba vezeti az üzenetet.
|
||||
/// </summary>
|
||||
/// <param name="message">A naplóba vezetendő üzenet</param>
|
||||
protected override Guid? DoLog(ILogMessage message)
|
||||
{
|
||||
string messagetext = LogUtil.FormatMessageCompact(message);
|
||||
WriteLineToDebug(messagetext, message.Level);
|
||||
WriteLineToConsole(messagetext, message.Level, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void DoLog(ILogMessage message, Guid logId)
|
||||
{
|
||||
DoLog(message);
|
||||
}
|
||||
|
||||
#region inneroperations
|
||||
|
||||
static void WriteToConsole(string messagetext, LogLevel level)
|
||||
{
|
||||
if (!ConsoleEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
lock (_syncRoot)
|
||||
{
|
||||
Console.ForegroundColor = GetConsoleForegroundColor(level);
|
||||
Console.WriteLine(messagetext);
|
||||
Console.ForegroundColor = _defaultConsoleColor;
|
||||
}
|
||||
}
|
||||
|
||||
static void WriteLineToConsole(string messagetext, LogLevel level, bool islog)
|
||||
{
|
||||
if (!ConsoleEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
lock (_syncRoot)
|
||||
{
|
||||
if (islog)
|
||||
{
|
||||
Console.ForegroundColor = _entrySeparatorColor;
|
||||
Console.Write(_entrySeparator);
|
||||
}
|
||||
Console.ForegroundColor = GetConsoleForegroundColor(level);
|
||||
Console.WriteLine(messagetext);
|
||||
Console.ForegroundColor = _defaultConsoleColor;
|
||||
}
|
||||
}
|
||||
|
||||
static void WriteToDebug(string messagetext, LogLevel level)
|
||||
{
|
||||
if (!DebugEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
switch (level)
|
||||
{
|
||||
case LogLevel.DEBUG:
|
||||
Debug.Write(messagetext);
|
||||
break;
|
||||
case LogLevel.ERROR:
|
||||
case LogLevel.FATAL:
|
||||
Trace.TraceError(messagetext);
|
||||
break;
|
||||
case LogLevel.WARNING:
|
||||
Trace.TraceWarning(messagetext);
|
||||
break;
|
||||
default:
|
||||
Trace.TraceInformation(messagetext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void WriteLineToDebug(string messagetext, LogLevel level)
|
||||
{
|
||||
if (!DebugEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
switch (level)
|
||||
{
|
||||
case LogLevel.DEBUG:
|
||||
Debug.WriteLine(messagetext);
|
||||
break;
|
||||
case LogLevel.ERROR:
|
||||
case LogLevel.FATAL:
|
||||
Trace.TraceError(messagetext);
|
||||
break;
|
||||
case LogLevel.WARNING:
|
||||
Trace.TraceWarning(messagetext);
|
||||
break;
|
||||
default:
|
||||
Trace.TraceInformation(messagetext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Engedélyezi vagy tiltja a konzolra való naplózást. Alapértelmezésben tiltott.
|
||||
/// </summary>
|
||||
public static bool ConsoleEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Engedélyezi vagy tiltja a debug-ra való naplózást. Alapértelmezésben tiltott.
|
||||
/// </summary>
|
||||
public static bool DebugEnabled { get; set; }
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue