dont crash on missing controls
This commit is contained in:
parent
6a6d544b48
commit
579ea3cb8c
@ -17,10 +17,10 @@
|
|||||||
</system.serviceModel>
|
</system.serviceModel>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<!-- Die Zugangangsdaten, die für den Zugriff auf die DPMA Datenbank benötigt werden -->
|
<!-- Die Zugangangsdaten, die für den Zugriff auf die DPMA Datenbank benötigt werden -->
|
||||||
<add key="dpma_username" value="TestBrainpool"/>
|
<add key="dpma_username" value="BRAINPOOL"/>
|
||||||
<add key="dpma_password" value="09Test2015"/>
|
<add key="dpma_password" value="brainPOOL1"/>
|
||||||
<!-- query erwartet entweder eine mit Kommagetrennte List oder einen SQL Befehl, der ein einspaltiges Ergebnis liefert -->
|
<!-- query erwartet entweder eine mit Kommagetrennte List oder einen SQL Befehl, der ein einspaltiges Ergebnis liefert -->
|
||||||
<!-- <add key="dpma_query" value="SELECT [Unternehmen] FROM [DD_ECM].[dbo].[VWTEMP_PMO_FORM19] WHERE ProdUnternehmen = 1 ORDER BY Unternehmen"/> -->
|
<!--<add key="dpma_query" value="SELECT [Unternehmen] FROM [DD_ECM].[dbo].[VWTEMP_PMO_FORM19] WHERE ProdUnternehmen = 1 ORDER BY Unternehmen"/>-->
|
||||||
<add key="dpma_query" value="BRAINPOOL Artist und Content Services GmbH,BRAINPOOL TV GmbH,BRAINPOOL TV GmbH / Stein TV,Elton TV Produktions GmbH,Köln Comedy Festival GmbH,Kuttner TV GmbH,Ladykracher TV GmbH,MARIO BARTH TV Produktionsgesellschaft mbH ,mea culpa TV Production GmbH,Millionärswahl Formatentwicklungs- und -verwertungsgesellschaft mbH,Minestrone TV Produktions GbR ,Pocher TV GmbH,Princess TV GmbH ,Punani Enterprises GmbH,Raab TV-Produktion GmbH,Stein TV-Produktion GmbH,Ulmen Television GmbH"/>
|
<add key="dpma_query" value="BRAINPOOL Artist und Content Services GmbH,BRAINPOOL TV GmbH,BRAINPOOL TV GmbH / Stein TV,Elton TV Produktions GmbH,Köln Comedy Festival GmbH,Kuttner TV GmbH,Ladykracher TV GmbH,MARIO BARTH TV Produktionsgesellschaft mbH ,mea culpa TV Production GmbH,Millionärswahl Formatentwicklungs- und -verwertungsgesellschaft mbH,Minestrone TV Produktions GbR ,Pocher TV GmbH,Princess TV GmbH ,Punani Enterprises GmbH,Raab TV-Produktion GmbH,Stein TV-Produktion GmbH,Ulmen Television GmbH"/>
|
||||||
<!-- Die Verbindung, in die das Ergebnis des Imports eingelesen wird, damit werden auch dpma_searchvalues ausgelesen! -->
|
<!-- Die Verbindung, in die das Ergebnis des Imports eingelesen wird, damit werden auch dpma_searchvalues ausgelesen! -->
|
||||||
<add key="sql_connstring" value="Data Source=172.24.12.41\tests;Initial Catalog=DD_ECM;Persist Security Info=True;User ID=sa;Password=dd"/>
|
<add key="sql_connstring" value="Data Source=172.24.12.41\tests;Initial Catalog=DD_ECM;Persist Security Info=True;User ID=sa;Password=dd"/>
|
||||||
|
|||||||
@ -19,6 +19,13 @@ Public Class AppConfig
|
|||||||
Return New ConfigValues(username, password, query, connstring, database)
|
Return New ConfigValues(username, password, query, connstring, database)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function GetVersion()
|
||||||
|
Dim assembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
|
||||||
|
Dim fvi As FileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location)
|
||||||
|
Dim version As String = fvi.FileVersion
|
||||||
|
Return version
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Class ConfigValues
|
Public Class ConfigValues
|
||||||
|
|||||||
@ -21,6 +21,7 @@ Module Main
|
|||||||
|
|
||||||
Private query As String
|
Private query As String
|
||||||
Private config As ConfigValues
|
Private config As ConfigValues
|
||||||
|
Private version As String
|
||||||
Private marks As New List(Of Mark)
|
Private marks As New List(Of Mark)
|
||||||
Private props = New List(Of String) From {
|
Private props = New List(Of String) From {
|
||||||
"RegistrationOfficeCode",
|
"RegistrationOfficeCode",
|
||||||
@ -46,8 +47,9 @@ Module Main
|
|||||||
logger = LogManager.GetLogger("Main")
|
logger = LogManager.GetLogger("Main")
|
||||||
config = AppConfig.GetConfiguration()
|
config = AppConfig.GetConfiguration()
|
||||||
db = New DB(config.connstring, "DD_ECM")
|
db = New DB(config.connstring, "DD_ECM")
|
||||||
|
version = AppConfig.GetVersion()
|
||||||
|
|
||||||
logger.Info("{0} started", My.Application.Info.Title)
|
logger.Info("{0} (Version {1}) started", My.Application.Info.Title, version)
|
||||||
|
|
||||||
If Not Directory.Exists(DataDir) Then
|
If Not Directory.Exists(DataDir) Then
|
||||||
Directory.CreateDirectory(DataDir)
|
Directory.CreateDirectory(DataDir)
|
||||||
@ -118,6 +120,12 @@ Module Main
|
|||||||
Dim controlId = db.GetControlId(formId, prop)
|
Dim controlId = db.GetControlId(formId, prop)
|
||||||
' Wert für die aktuelle property holen
|
' Wert für die aktuelle property holen
|
||||||
Dim value = db.GetProperty(m, prop)
|
Dim value = db.GetProperty(m, prop)
|
||||||
|
|
||||||
|
If controlId = 0 Then
|
||||||
|
logger.Warn("Value NOT inserted - ControlId for Property {0} could not be found.")
|
||||||
|
Continue For
|
||||||
|
End If
|
||||||
|
|
||||||
' Wert einfügen
|
' Wert einfügen
|
||||||
db.InsertValue(controlId, recordId, value)
|
db.InsertValue(controlId, recordId, value)
|
||||||
|
|
||||||
|
|||||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
<Assembly: AssemblyVersion("1.0.1.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.1.0")>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user