Merge branch 'release/eni_7.8'

This commit is contained in:
Daniel Schick 2023-01-25 18:12:36 +01:00
commit 2009dee9bf
55 changed files with 17812 additions and 15763 deletions

View File

@ -892,6 +892,22 @@ namespace ENI2
#endregion #endregion
#region 4.1.23 no CREW effects warning for DE
if (crewaMessage != null)
{
MessageViolation mv = crewaMessage.ViolationList.Find((x) => x.PropertyName.Equals("Effects") && (x.ViolationCode == (int)ValidationCode.TRUNCATE));
if ((mv != null) && !Core.IsDK)
crewaMessage.ViolationList.Remove(mv);
}
if(crewdMessage != null)
{
MessageViolation mvd = crewdMessage.ViolationList.Find((x) => x.PropertyName.Equals("Effects") && (x.ViolationCode == (int)ValidationCode.TRUNCATE));
if ((mvd != null) && !Core.IsDK)
crewdMessage.ViolationList.Remove(mvd);
}
#endregion
#region WAS_RCPT double numbers #region WAS_RCPT double numbers
Dictionary<string, string> identDict = new Dictionary<string, string>(); Dictionary<string, string> identDict = new Dictionary<string, string>();

View File

@ -36,8 +36,8 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion> <MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>8</ApplicationRevision> <ApplicationRevision>6</ApplicationRevision>
<ApplicationVersion>7.7.0.%2a</ApplicationVersion> <ApplicationVersion>7.8.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -74,10 +74,11 @@ namespace ENI2.EditControls
private void CopyDeclarationDialog_Loaded(object sender, System.Windows.RoutedEventArgs e) private void CopyDeclarationDialog_Loaded(object sender, System.Windows.RoutedEventArgs e)
{ {
this.OKClicked += VisitIdDialog_OKClicked; this.OKClicked += VisitIdDialog_OKClicked;
List<KeyValuePair<bsmd.database.Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<bsmd.database.Message.NSWProvider, string>>() List<KeyValuePair<Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<Message.NSWProvider, string>>()
{ {
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DBH, "DBH" ), new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DBH, "DBH" ),
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ), new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DBH_MAERSK, "DBH / Maersk" ),
new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ),
}; };
this.comboBoxInitialHIS.ItemsSource = comboDataSource; this.comboBoxInitialHIS.ItemsSource = comboDataSource;

View File

@ -31,7 +31,8 @@ namespace ENI2.EditControls
List<KeyValuePair<Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<Message.NSWProvider, string>>() List<KeyValuePair<Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<Message.NSWProvider, string>>()
{ {
new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ), new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ),
new KeyValuePair<Message.NSWProvider, string>(Message.NSWProvider.DBH, "DBH") new KeyValuePair<Message.NSWProvider, string>(Message.NSWProvider.DBH, "DBH"),
new KeyValuePair<Message.NSWProvider, string>(Message.NSWProvider.DBH_MAERSK, "DBH / Maersk")
}; };
this.comboBoxInitialHIS.ItemsSource = comboDataSource; this.comboBoxInitialHIS.ItemsSource = comboDataSource;

View File

@ -27,10 +27,11 @@ namespace ENI2.EditControls
private void VisitIdDialog_Loaded(object sender, RoutedEventArgs e) private void VisitIdDialog_Loaded(object sender, RoutedEventArgs e)
{ {
this.OKClicked += VisitIdDialog_OKClicked; this.OKClicked += VisitIdDialog_OKClicked;
List<KeyValuePair<bsmd.database.Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<bsmd.database.Message.NSWProvider, string>>() List<KeyValuePair<Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<Message.NSWProvider, string>>()
{ {
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DBH, "DBH" ), new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ),
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ), new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DBH, "DBH" ),
new KeyValuePair<Message.NSWProvider, string>(Message.NSWProvider.DBH_MAERSK, "DBH / Maersk")
}; };
this.comboBoxInitialHIS.ItemsSource = comboDataSource; this.comboBoxInitialHIS.ItemsSource = comboDataSource;
@ -117,8 +118,8 @@ namespace ENI2.EditControls
isComplete &= this.datePickerETA.SelectedDate.HasValue; // ETA isComplete &= this.datePickerETA.SelectedDate.HasValue; // ETA
bool imo_OR_eni = ((doubleUpDownIMO.Value.HasValue) && (doubleUpDownIMO.Value >= 1000000) && (doubleUpDownIMO.Value <= 9999999)) || bool imo_OR_eni = (doubleUpDownIMO.Value.HasValue && (doubleUpDownIMO.Value >= 1000000) && (doubleUpDownIMO.Value <= 9999999)) ||
((doubleUpDownENI.Value.HasValue) && (doubleUpDownENI.Value >= 100000) && (doubleUpDownENI.Value <= 99999999)); (doubleUpDownENI.Value.HasValue && (doubleUpDownENI.Value >= 100000) && (doubleUpDownENI.Value <= 99999999));
isComplete &= imo_OR_eni; isComplete &= imo_OR_eni;

View File

@ -2061,7 +2061,6 @@ namespace ENI2.Excel
private static bool ScanCREW(Message crewMessage, ExcelReader reader, bool isOldVersion) private static bool ScanCREW(Message crewMessage, ExcelReader reader, bool isOldVersion)
{ {
crewMessage.DeleteElements(); crewMessage.DeleteElements();
string sheetTitle = "6. CREW - Arrival"; string sheetTitle = "6. CREW - Arrival";
// 6. CREW - Arrival // 6. CREW - Arrival
// 5.9.22: Changed this area to work like reading from a Dakosy Sheet (by values in rows, not cell names) // 5.9.22: Changed this area to work like reading from a Dakosy Sheet (by values in rows, not cell names)

View File

@ -593,10 +593,7 @@ namespace ENI2
} }
this.showIdDict.Remove(changedCore.Id.Value); this.showIdDict.Remove(changedCore.Id.Value);
// this._dbWatchDog.UnRegister(changedCore); // wird ggf später abgeräumt wenn der Tab geschlossen wird // this._dbWatchDog.UnRegister(changedCore); // wird ggf später abgeräumt wenn der Tab geschlossen wird
this.Dispatcher.Invoke(new Action(() => this.Dispatcher.Invoke(new Action(() => UpdateWaitIdLabel()));
{
UpdateWaitIdLabel();
}));
} }
if (this.openTabs.ContainsKey(changedCore.Id.Value)) if (this.openTabs.ContainsKey(changedCore.Id.Value))

11
SQL/Update_7.6_To_7.7.sql Normal file
View File

@ -0,0 +1,11 @@
-- Die DBH will fortlaufende Nummern an den versendeten Dateien. Das können sie
-- haben, aber wir legen eine Numerierung pro Meldeklasse an so dass kein Aufschluss
-- über die Gesamtzahl der versendeten Nachrichten möglich ist
PRINT N'Altering Table [dbo].[MessageHeader]...';
GO
ALTER TABLE [dbo].[MessageHeader]
ADD [FileNumSequence] INT NULL;
GO

View File

@ -2,8 +2,8 @@
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="SendNSWMessageService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> <section name="SendNSWMessageService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<log4net> <log4net>
@ -26,14 +26,14 @@
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
<userSettings> <applicationSettings>
<SendNSWMessageService.Properties.Settings> <SendNSWMessageService.Properties.Settings>
<setting name="SleepSeconds" serializeAs="String"> <setting name="SleepSeconds" serializeAs="String">
<value>0</value> <value>0</value>
</setting> </setting>
<setting name="ConnectionString" serializeAs="String"> <setting name="ConnectionString" serializeAs="String">
<value>Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=E:\DATA\DB\NSW.MDF;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False</value> <value>Initial Catalog=nswtest;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value>
</setting> </setting>
</SendNSWMessageService.Properties.Settings> </SendNSWMessageService.Properties.Settings>
</userSettings> </applicationSettings>
</configuration> </configuration>

View File

@ -183,7 +183,8 @@ namespace SendNSWMessageService
{ {
case Message.NSWProvider.DBH: case Message.NSWProvider.DBH:
sendSucceeded = bsmd.dbh.Request.SendMessage(message); case Message.NSWProvider.DBH_MAERSK:
sendSucceeded = bsmd.dbh.MessageController.SendMessage(core, message);
if (!sendSucceeded) if (!sendSucceeded)
message.InternalStatus = Message.BSMDStatus.SEND_FAILED; message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
else else
@ -245,7 +246,8 @@ namespace SendNSWMessageService
didSendSomething = true; didSendSomething = true;
break; break;
case Message.NSWProvider.DBH: case Message.NSWProvider.DBH:
coreSendSucceeded = bsmd.dbh.Request.SendCancelCore(core); case Message.NSWProvider.DBH_MAERSK:
coreSendSucceeded = bsmd.dbh.MessageController.SendCancelCore(core);
break; break;
default: default:
_log.WarnFormat("Cancelling for HIS {0} is not supported", core.InitialHIS); _log.WarnFormat("Cancelling for HIS {0} is not supported", core.InitialHIS);
@ -267,13 +269,14 @@ namespace SendNSWMessageService
} }
// external processing for HIS-Nord
bsmd.hisnord.transmitter.CallTransmitter(); bsmd.hisnord.transmitter.CallTransmitter();
// ob test oder nicht ist in stat. dict gespeichert
bsmd.hisnord.Request.ReadResponseFiles(); bsmd.hisnord.Request.ReadResponseFiles();
bsmd.hisnord.Response.ReadAnswers(); bsmd.hisnord.Response.ReadAnswers();
// external processing for dbh
bsmd.dbh.MessageController.SendAndReceive();
List<MessageCore> coresMarkedForStatusQuery = DBManager.Instance.GetMessageCoresWithNSWStatusFlag(); List<MessageCore> coresMarkedForStatusQuery = DBManager.Instance.GetMessageCoresWithNSWStatusFlag();
foreach (MessageCore core in coresMarkedForStatusQuery) foreach (MessageCore core in coresMarkedForStatusQuery)

View File

@ -23,30 +23,23 @@ namespace SendNSWMessageService.Properties {
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")] [global::System.Configuration.DefaultSettingValueAttribute("0")]
public int SleepSeconds { public int SleepSeconds {
get { get {
return ((int)(this["SleepSeconds"])); return ((int)(this["SleepSeconds"]));
} }
set {
this["SleepSeconds"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=E:\\DATA\\DB\\NSW.MDF;Integrated " + [global::System.Configuration.DefaultSettingValueAttribute("Initial Catalog=nswtest;Data Source=192.168.2.24\\SQLEXPRESS;Uid=dfuser;pwd=dfpass" +
"Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;Appl" + "wd;Persist Security Info=False;Connection Reset=false")]
"icationIntent=ReadWrite;MultiSubnetFailover=False")]
public string ConnectionString { public string ConnectionString {
get { get {
return ((string)(this["ConnectionString"])); return ((string)(this["ConnectionString"]));
} }
set {
this["ConnectionString"] = value;
}
} }
} }
} }

View File

@ -2,11 +2,11 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="SendNSWMessageService.Properties" GeneratedClassName="Settings"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="SendNSWMessageService.Properties" GeneratedClassName="Settings">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="SleepSeconds" Type="System.Int32" Scope="User"> <Setting Name="SleepSeconds" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">0</Value> <Value Profile="(Default)">0</Value>
</Setting> </Setting>
<Setting Name="ConnectionString" Type="System.String" Scope="User"> <Setting Name="ConnectionString" Type="System.String" Scope="Application">
<Value Profile="(Default)">Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=E:\DATA\DB\NSW.MDF;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False</Value> <Value Profile="(Default)">Initial Catalog=nswtest;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</Value>
</Setting> </Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -23,123 +23,75 @@ namespace bsmd.dakosy.Properties {
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("dakosy")] [global::System.Configuration.DefaultSettingValueAttribute("dakosy")]
public string SFTPSessionName { public string SFTPSessionName {
get { get {
return ((string)(this["SFTPSessionName"])); return ((string)(this["SFTPSessionName"]));
} }
set {
this["SFTPSessionName"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("c:\\temp\\sftp_log.xml")] [global::System.Configuration.DefaultSettingValueAttribute("c:\\temp\\sftp_log.xml")]
public string SFTPLog { public string SFTPLog {
get { get {
return ((string)(this["SFTPLog"])); return ((string)(this["SFTPLog"]));
} }
set {
this["SFTPLog"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dakosy\\out")] [global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dakosy\\out")]
public string SFTPOutDir { public string SFTPOutDir {
get { get {
return ((string)(this["SFTPOutDir"])); return ((string)(this["SFTPOutDir"]));
} }
set {
this["SFTPOutDir"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dakosy\\in")] [global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dakosy\\in")]
public string SFTPInDir { public string SFTPInDir {
get { get {
return ((string)(this["SFTPInDir"])); return ((string)(this["SFTPInDir"]));
} }
set {
this["SFTPInDir"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool TestMode {
get {
return ((bool)(this["TestMode"]));
}
set {
this["TestMode"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("E:\\Tools\\WinScp\\WinSCP.com")] [global::System.Configuration.DefaultSettingValueAttribute("E:\\Tools\\WinScp\\WinSCP.com")]
public string WINSCPFullPath { public string WINSCPFullPath {
get { get {
return ((string)(this["WINSCPFullPath"])); return ((string)(this["WINSCPFullPath"]));
} }
set {
this["WINSCPFullPath"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("in/prod/ed02")] [global::System.Configuration.DefaultSettingValueAttribute("in/prod/ed02")]
public string RemoteProdIncomingDir { public string RemoteIncomingDir {
get { get {
return ((string)(this["RemoteProdIncomingDir"])); return ((string)(this["RemoteIncomingDir"]));
}
set {
this["RemoteProdIncomingDir"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("in/test/ed02")]
public string RemoteTestIncomingDir {
get {
return ((string)(this["RemoteTestIncomingDir"]));
}
set {
this["RemoteTestIncomingDir"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("out/prod")] [global::System.Configuration.DefaultSettingValueAttribute("out/prod")]
public string RemoteProdOutgoingDir { public string RemoteOutgoingDir {
get { get {
return ((string)(this["RemoteProdOutgoingDir"])); return ((string)(this["RemoteOutgoingDir"]));
}
set {
this["RemoteProdOutgoingDir"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("out/test")] [global::System.Configuration.DefaultSettingValueAttribute("True")]
public string RemoteTestOutgoingDir { public bool TestMode {
get { get {
return ((string)(this["RemoteTestOutgoingDir"])); return ((bool)(this["TestMode"]));
}
set {
this["RemoteTestOutgoingDir"] = value;
} }
} }
} }

View File

@ -2,35 +2,29 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="bsmd.dakosy.Properties" GeneratedClassName="Settings"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="bsmd.dakosy.Properties" GeneratedClassName="Settings">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="SFTPSessionName" Type="System.String" Scope="User"> <Setting Name="SFTPSessionName" Type="System.String" Scope="Application">
<Value Profile="(Default)">dakosy</Value> <Value Profile="(Default)">dakosy</Value>
</Setting> </Setting>
<Setting Name="SFTPLog" Type="System.String" Scope="User"> <Setting Name="SFTPLog" Type="System.String" Scope="Application">
<Value Profile="(Default)">c:\temp\sftp_log.xml</Value> <Value Profile="(Default)">c:\temp\sftp_log.xml</Value>
</Setting> </Setting>
<Setting Name="SFTPOutDir" Type="System.String" Scope="User"> <Setting Name="SFTPOutDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">e:\temp\dakosy\out</Value> <Value Profile="(Default)">e:\temp\dakosy\out</Value>
</Setting> </Setting>
<Setting Name="SFTPInDir" Type="System.String" Scope="User"> <Setting Name="SFTPInDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">e:\temp\dakosy\in</Value> <Value Profile="(Default)">e:\temp\dakosy\in</Value>
</Setting> </Setting>
<Setting Name="TestMode" Type="System.Boolean" Scope="User"> <Setting Name="WINSCPFullPath" Type="System.String" Scope="Application">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="WINSCPFullPath" Type="System.String" Scope="User">
<Value Profile="(Default)">E:\Tools\WinScp\WinSCP.com</Value> <Value Profile="(Default)">E:\Tools\WinScp\WinSCP.com</Value>
</Setting> </Setting>
<Setting Name="RemoteProdIncomingDir" Type="System.String" Scope="User"> <Setting Name="RemoteIncomingDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">in/prod/ed02</Value> <Value Profile="(Default)">in/prod/ed02</Value>
</Setting> </Setting>
<Setting Name="RemoteTestIncomingDir" Type="System.String" Scope="User"> <Setting Name="RemoteOutgoingDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">in/test/ed02</Value>
</Setting>
<Setting Name="RemoteProdOutgoingDir" Type="System.String" Scope="User">
<Value Profile="(Default)">out/prod</Value> <Value Profile="(Default)">out/prod</Value>
</Setting> </Setting>
<Setting Name="RemoteTestOutgoingDir" Type="System.String" Scope="User"> <Setting Name="TestMode" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">out/test</Value> <Value Profile="(Default)">True</Value>
</Setting> </Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -155,8 +155,7 @@ namespace bsmd.dakosy
} }
break; break;
case Message.NotificationClass.NOA_NOD: case Message.NotificationClass.NOA_NOD:
bsmd.database.NOA_NOD noa_nod = aMessage.Elements[0] as bsmd.database.NOA_NOD; if (!(aMessage.Elements[0] is bsmd.database.NOA_NOD noa_nod)) throw new ApplicationException("dbEntity is no NOA_NOD message!");
if (noa_nod == null) throw new ApplicationException("dbEntity is no NOA_NOD message!");
vList.Visit[0].NOA_NOD = new NOA_NOD(); vList.Visit[0].NOA_NOD = new NOA_NOD();
//vList.Visit[0].NOA_NOD.CallPurpose //vList.Visit[0].NOA_NOD.CallPurpose
vList.Visit[0].NOA_NOD.EtaToKielCanalSpecified = noa_nod.ETAToKielCanal.HasValue; vList.Visit[0].NOA_NOD.EtaToKielCanalSpecified = noa_nod.ETAToKielCanal.HasValue;
@ -800,7 +799,7 @@ namespace bsmd.dakosy
if (!serializationFailed) if (!serializationFailed)
{ {
// call sftp client to send // call sftp client to send
sftp.Put(fileName, Properties.Settings.Default.RemoteProdIncomingDir); SFtp.Put(fileName, Properties.Settings.Default.RemoteIncomingDir);
} }
File.Delete(fileName); File.Delete(fileName);
@ -865,12 +864,10 @@ namespace bsmd.dakosy
} }
// call sftp client to send // call sftp client to send
sftp.Put(fileName, SFtp.Put(fileName, Properties.Settings.Default.RemoteIncomingDir);
Properties.Settings.Default.TestMode ?
Properties.Settings.Default.RemoteTestIncomingDir : Properties.Settings.Default.RemoteProdIncomingDir);
// remove sent file if not test mode // remove sent file if not test mode
if (!Properties.Settings.Default.TestMode) // if (!Properties.Settings.Default.TestMode)
File.Delete(fileName); File.Delete(fileName);
} }
@ -979,7 +976,7 @@ namespace bsmd.dakosy
// all das nur weil die Blödmänner andere Enums angelegt haben!!! // all das nur weil die Blödmänner andere Enums angelegt haben!!!
static IdentityDocumentType CrewDocumentFromNSWEnumeration(byte nswValue) internal static IdentityDocumentType CrewDocumentFromNSWEnumeration(byte nswValue)
{ {
switch(nswValue) switch(nswValue)
{ {
@ -993,7 +990,7 @@ namespace bsmd.dakosy
} }
} }
static GeneralCargoType CargoTypeFromNSWEnumeration(byte nswValue) internal static GeneralCargoType CargoTypeFromNSWEnumeration(byte nswValue)
{ {
switch(nswValue) switch(nswValue)
{ {
@ -1008,7 +1005,7 @@ namespace bsmd.dakosy
} }
} }
static WasteDisposalDeliveryType WDDTypeFromNSWEnumeration(byte nswValue) internal static WasteDisposalDeliveryType WDDTypeFromNSWEnumeration(byte nswValue)
{ {
switch(nswValue) switch(nswValue)
{ {
@ -1020,13 +1017,13 @@ namespace bsmd.dakosy
} }
} }
static CargoHandlingType CHTFromNSWEnumeration(byte nswValue) internal static CargoHandlingType CHTFromNSWEnumeration(byte nswValue)
{ {
if (nswValue == 0) return CargoHandlingType.LOAD; if (nswValue == 0) return CargoHandlingType.LOAD;
return CargoHandlingType.DISCHARGE; return CargoHandlingType.DISCHARGE;
} }
static ShippingAreaType SATFromNSWEnumeration(byte nswValue) internal static ShippingAreaType SATFromNSWEnumeration(byte nswValue)
{ {
switch (nswValue) switch (nswValue)
{ {
@ -1038,6 +1035,5 @@ namespace bsmd.dakosy
#endregion #endregion
} }
} }

View File

@ -21,20 +21,17 @@ using bsmd.database;
namespace bsmd.dakosy namespace bsmd.dakosy
{ {
public class Response public static class Response
{ {
private static ILog _log = LogManager.GetLogger(typeof(Request)); private static readonly ILog _log = LogManager.GetLogger(typeof(Request));
public static void ReadAll() public static void ReadAll()
{ {
// SFTP verbindung öffnen und alle Dateien herunterladen // SFTP verbindung öffnen und alle Dateien herunterladen
string localDir = Properties.Settings.Default.SFTPInDir; string localDir = Properties.Settings.Default.SFTPInDir;
string remoteDir = Properties.Settings.Default.RemoteOutgoingDir;
string remoteDir = Properties.Settings.Default.TestMode ? SFtp.TransmitAll(remoteDir, localDir, SFtp.Direction.INCOMING, Properties.Settings.Default.SFTPSessionName);
Properties.Settings.Default.RemoteTestOutgoingDir : Properties.Settings.Default.RemoteProdOutgoingDir;
sftp.GetAll(remoteDir);
// lokale Dateien verarbeiten // lokale Dateien verarbeiten
foreach (string inputFile in Directory.GetFiles(localDir)) foreach (string inputFile in Directory.GetFiles(localDir))
@ -48,7 +45,7 @@ namespace bsmd.dakosy
File.Delete(inputFile); // alternativ: move to archive folder File.Delete(inputFile); // alternativ: move to archive folder
} }
// remote Dateien löschen // remote Dateien löschen
sftp.RemoveProcessedFile(remoteDir, Path.GetFileName(inputFile)); SFtp.RemoveProcessedFile(remoteDir, Path.GetFileName(inputFile), Properties.Settings.Default.SFTPSessionName);
} }
} }
@ -70,13 +67,11 @@ namespace bsmd.dakosy
eDeclarationMessageInterchangeBodyEdiResponseList responseList = eDeclaration.InterchangeBody.Item as eDeclarationMessageInterchangeBodyEdiResponseList; eDeclarationMessageInterchangeBodyEdiResponseList responseList = eDeclaration.InterchangeBody.Item as eDeclarationMessageInterchangeBodyEdiResponseList;
foreach(EdiResponse ediResponse in responseList.EdiResponse) foreach(EdiResponse ediResponse in responseList.EdiResponse)
{ {
if (!Guid.TryParseExact(ediResponse.LocalReferenceNumber, "N", out Guid localReferenceId))
Guid localReferenceId, messageReferenceId;
if (!Guid.TryParseExact(ediResponse.LocalReferenceNumber, "N", out localReferenceId))
{ {
_log.ErrorFormat("unable to parse local reference number {0}", ediResponse.LocalReferenceNumber); _log.ErrorFormat("unable to parse local reference number {0}", ediResponse.LocalReferenceNumber);
} }
if (!Guid.TryParseExact(ediResponse.PreviousMessageNumber, "N", out messageReferenceId)) if (!Guid.TryParseExact(ediResponse.PreviousMessageNumber, "N", out Guid messageReferenceId))
{ {
_log.ErrorFormat("unable to parse message reference id {0}", ediResponse.MessageHeader.MessageReferenceNumber); _log.ErrorFormat("unable to parse message reference id {0}", ediResponse.MessageHeader.MessageReferenceNumber);
} }
@ -126,8 +121,8 @@ namespace bsmd.dakosy
foreach (ResponseError responseError in ediResponse.Errors) foreach (ResponseError responseError in ediResponse.Errors)
{ {
MessageError messageError = new MessageError(); MessageError messageError = new MessageError();
int errCode;
if (Int32.TryParse(responseError.ErrorCode, out errCode)) if (Int32.TryParse(responseError.ErrorCode, out int errCode))
messageError.ErrorCode = errCode; messageError.ErrorCode = errCode;
else else
_log.WarnFormat("cannot parse error code [{0}]", responseError.ErrorCode); _log.WarnFormat("cannot parse error code [{0}]", responseError.ErrorCode);

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="bsmd.dakosy.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> <section name="bsmd.dakosy.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<userSettings> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup><applicationSettings>
<bsmd.dakosy.Properties.Settings> <bsmd.dakosy.Properties.Settings>
<setting name="SFTPSessionName" serializeAs="String"> <setting name="SFTPSessionName" serializeAs="String">
<value>dakosy</value> <value>dakosy</value>
@ -19,24 +19,18 @@
<setting name="SFTPInDir" serializeAs="String"> <setting name="SFTPInDir" serializeAs="String">
<value>e:\temp\dakosy\in</value> <value>e:\temp\dakosy\in</value>
</setting> </setting>
<setting name="TestMode" serializeAs="String">
<value>True</value>
</setting>
<setting name="WINSCPFullPath" serializeAs="String"> <setting name="WINSCPFullPath" serializeAs="String">
<value>E:\Tools\WinScp\WinSCP.com</value> <value>E:\Tools\WinScp\WinSCP.com</value>
</setting> </setting>
<setting name="RemoteProdIncomingDir" serializeAs="String"> <setting name="RemoteIncomingDir" serializeAs="String">
<value>in/prod/ed02</value> <value>in/prod/ed02</value>
</setting> </setting>
<setting name="RemoteTestIncomingDir" serializeAs="String"> <setting name="RemoteOutgoingDir" serializeAs="String">
<value>in/test/ed02</value>
</setting>
<setting name="RemoteProdOutgoingDir" serializeAs="String">
<value>out/prod</value> <value>out/prod</value>
</setting> </setting>
<setting name="RemoteTestOutgoingDir" serializeAs="String"> <setting name="TestMode" serializeAs="String">
<value>out/test</value> <value>True</value>
</setting> </setting>
</bsmd.dakosy.Properties.Settings> </bsmd.dakosy.Properties.Settings>
</userSettings> </applicationSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration> </configuration>

View File

@ -70,7 +70,7 @@
</Compile> </Compile>
<Compile Include="Request.cs" /> <Compile Include="Request.cs" />
<Compile Include="Response.cs" /> <Compile Include="Response.cs" />
<Compile Include="sftp.cs" /> <Compile Include="SFtp.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\bsmdKey.snk" /> <None Include="..\bsmdKey.snk" />

File diff suppressed because it is too large Load Diff

View File

@ -7,12 +7,9 @@
// //
// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved. // Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved.
using System; using log4net;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using bsmd.database;
using System.Xml;
using System.Xml.XPath;
using System.Collections.Generic;
namespace bsmd.dakosy namespace bsmd.dakosy
{ {
@ -20,8 +17,16 @@ namespace bsmd.dakosy
/// Hilfsklasse zur Kommunikation via SFTP. Wir machen es uns hier leicht und verwenden das beliebte WINSCP im /// Hilfsklasse zur Kommunikation via SFTP. Wir machen es uns hier leicht und verwenden das beliebte WINSCP im
/// Process-Modus. (http://winscp.net/eng/docs/guide_dotnet) /// Process-Modus. (http://winscp.net/eng/docs/guide_dotnet)
/// </summary> /// </summary>
public static class sftp public static class SFtp
{ {
private static readonly ILog _log = LogManager.GetLogger(typeof(SFtp));
public enum Direction
{
INCOMING,
OUTGOING
}
public static void Put(string filename, string targetDir) public static void Put(string filename, string targetDir)
{ {
Process winscp = new Process(); Process winscp = new Process();
@ -47,8 +52,12 @@ namespace bsmd.dakosy
winscp.StandardInput.WriteLine(string.Format("mv {0} {1}", filename, dotlessFilename)); winscp.StandardInput.WriteLine(string.Format("mv {0} {1}", filename, dotlessFilename));
winscp.StandardInput.Close(); winscp.StandardInput.Close();
// Collect all output (not used in this example) // Collect all output
string output = winscp.StandardOutput.ReadToEnd(); string output = winscp.StandardOutput.ReadToEnd();
_log.Debug(output);
output = winscp.StandardError.ReadToEnd();
if (!output.Trim().IsNullOrEmpty())
_log.Warn(output);
// Wait until WinSCP finishes // Wait until WinSCP finishes
winscp.WaitForExit(); winscp.WaitForExit();
@ -88,7 +97,7 @@ namespace bsmd.dakosy
} }
public static void GetAll(string remoteDir) public static void TransmitAll(string remoteDir, string localDir, Direction direction, string sessionName)
{ {
Process winscp = new Process(); Process winscp = new Process();
winscp.StartInfo.FileName = Properties.Settings.Default.WINSCPFullPath; winscp.StartInfo.FileName = Properties.Settings.Default.WINSCPFullPath;
@ -96,28 +105,39 @@ namespace bsmd.dakosy
winscp.StartInfo.UseShellExecute = false; winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.RedirectStandardInput = true; winscp.StartInfo.RedirectStandardInput = true;
winscp.StartInfo.RedirectStandardOutput = true; winscp.StartInfo.RedirectStandardOutput = true;
winscp.StartInfo.RedirectStandardError = true;
winscp.StartInfo.CreateNoWindow = true; winscp.StartInfo.CreateNoWindow = true;
winscp.Start(); winscp.Start();
// Feed in the scripting commands // Feed in the scripting commands
winscp.StandardInput.WriteLine("option batch abort"); winscp.StandardInput.WriteLine("option batch abort");
winscp.StandardInput.WriteLine("option confirm off"); winscp.StandardInput.WriteLine("option confirm off");
winscp.StandardInput.WriteLine("open " + Properties.Settings.Default.SFTPSessionName); winscp.StandardInput.WriteLine("open " + sessionName);
winscp.StandardInput.WriteLine("lcd " + Properties.Settings.Default.SFTPInDir); winscp.StandardInput.WriteLine("lcd " + localDir);
// winscp.StandardInput.WriteLine("ls"); // winscp.StandardInput.WriteLine("ls");
if (remoteDir != null) if (remoteDir != null)
winscp.StandardInput.WriteLine("cd " + remoteDir); winscp.StandardInput.WriteLine("cd " + remoteDir);
winscp.StandardInput.WriteLine("get *.xml"); if(direction == Direction.INCOMING)
winscp.StandardInput.WriteLine("get *.xml");
if(direction == Direction.OUTGOING)
winscp.StandardInput.WriteLine("put *.xml");
// move back up since winscp session remembers the last folder
winscp.StandardInput.WriteLine("cd ..");
winscp.StandardInput.WriteLine("cd ..");
winscp.StandardInput.Close(); winscp.StandardInput.Close();
// Collect all output (not used in this example) // Collect all output
string output = winscp.StandardOutput.ReadToEnd(); string output = winscp.StandardOutput.ReadToEnd();
_log.Debug(output);
output = winscp.StandardError.ReadToEnd();
if(!output.Trim().IsNullOrEmpty())
_log.Warn(output);
// Wait until WinSCP finishes // Wait until WinSCP finishes
winscp.WaitForExit(); winscp.WaitForExit();
} }
public static void RemoveProcessedFile(string remoteDir, string filename) public static void RemoveProcessedFile(string remoteDir, string filename, string sessionName)
{ {
Process winscp = new Process(); Process winscp = new Process();
winscp.StartInfo.FileName = Properties.Settings.Default.WINSCPFullPath; winscp.StartInfo.FileName = Properties.Settings.Default.WINSCPFullPath;
@ -125,22 +145,33 @@ namespace bsmd.dakosy
winscp.StartInfo.UseShellExecute = false; winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.RedirectStandardInput = true; winscp.StartInfo.RedirectStandardInput = true;
winscp.StartInfo.RedirectStandardOutput = true; winscp.StartInfo.RedirectStandardOutput = true;
winscp.StartInfo.RedirectStandardError = true;
winscp.StartInfo.CreateNoWindow = true; winscp.StartInfo.CreateNoWindow = true;
winscp.Start(); winscp.Start();
// Feed in the scripting commands // Feed in the scripting commands
winscp.StandardInput.WriteLine("option batch abort"); winscp.StandardInput.WriteLine("option batch abort");
winscp.StandardInput.WriteLine("option confirm off"); winscp.StandardInput.WriteLine("option confirm off");
winscp.StandardInput.WriteLine("open " + Properties.Settings.Default.SFTPSessionName); winscp.StandardInput.WriteLine("open " + sessionName);
// winscp.StandardInput.WriteLine("ls"); // winscp.StandardInput.WriteLine("ls");
if (remoteDir != null) if (remoteDir != null)
winscp.StandardInput.WriteLine("cd " + remoteDir); winscp.StandardInput.WriteLine("cd " + remoteDir);
winscp.StandardInput.WriteLine("rm " + filename); winscp.StandardInput.WriteLine("rm " + filename);
if (remoteDir != null)
{
// move back up since winscp session remembers the last folder
winscp.StandardInput.WriteLine("cd ..");
winscp.StandardInput.WriteLine("cd ..");
}
winscp.StandardInput.Close(); winscp.StandardInput.Close();
// Collect all output (not used in this example) // Collect all output
string output = winscp.StandardOutput.ReadToEnd(); string output = winscp.StandardOutput.ReadToEnd();
_log.Debug(output);
output = winscp.StandardError.ReadToEnd();
if (!output.Trim().IsNullOrEmpty())
_log.Warn(output);
// Wait until WinSCP finishes // Wait until WinSCP finishes
winscp.WaitForExit(); winscp.WaitForExit();

View File

@ -454,6 +454,29 @@ namespace bsmd.database
return messageList[0]; return messageList[0];
} }
public Message GetMessageByFileSeqNum(int fileSeqNum)
{
Message aMessage = new Message();
SqlCommand cmd = new SqlCommand();
const Message.LoadFilter filter = Message.LoadFilter.BY_FILE_SEQ_NUM;
aMessage.PrepareLoadCommand(cmd, filter, fileSeqNum);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> messages = aMessage.LoadList(reader);
List<Message> messageList = new List<Message>();
foreach (Message message in messages)
messageList.Add(message);
if (messageList.Count == 0) return null;
this.LoadMessageDependencies(messageList);
if (messageList[0].MessageCoreId.HasValue)
messageList[0].MessageCore = this.GetMessageCoreById(messageList[0].MessageCoreId.Value);
return messageList[0];
}
public MessageCore GetMessageCoreById(Guid id) public MessageCore GetMessageCoreById(Guid id)
{ {
MessageCore aCore = new MessageCore(); MessageCore aCore = new MessageCore();
@ -544,8 +567,6 @@ namespace bsmd.database
return result; return result;
} }
public MessageCore GetMessageCoreByShipInfos(string imo, DateTime eta, string poc) public MessageCore GetMessageCoreByShipInfos(string imo, DateTime eta, string poc)
{ {
MessageCore aCore = new MessageCore(); MessageCore aCore = new MessageCore();
@ -741,6 +762,18 @@ namespace bsmd.database
} }
} }
public int? GetMessageFileMaxNum()
{
int? result = 0;
using (SqlCommand cmd = new SqlCommand())
{
cmd.CommandText = "SELECT MAX(FileNumSequence) FROM MessageHeader";
result = this.PerformReadIntQuery(cmd);
if (result == null) result = 0;
}
return result;
}
#endregion #endregion
#region internal/private funcs #region internal/private funcs
@ -1587,7 +1620,11 @@ namespace bsmd.database
{ {
this.CheckConnection(); this.CheckConnection();
cmd.Connection = this._con; cmd.Connection = this._con;
result = (int?)cmd.ExecuteScalar(); object r = cmd.ExecuteScalar();
if (r == null) { result = null; }
else if (r == DBNull.Value) { result = null; }
else { result = (int)r; }
} }
catch (SqlException ex) catch (SqlException ex)
{ {

View File

@ -142,6 +142,14 @@ namespace bsmd.database
return source.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"); return source.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'");
} }
public static DateTime ToUTCSerializableDateTime(this DateTime source)
{
return new DateTime(
source.Ticks - (source.Ticks % TimeSpan.TicksPerSecond),
DateTimeKind.Utc
);
}
public static List<string> RegexSplit(this string source) public static List<string> RegexSplit(this string source)
{ {
List<string> result = new List<string>(); List<string> result = new List<string>();

View File

@ -380,7 +380,10 @@ namespace bsmd.database
public void SaveElements() public void SaveElements()
{ {
foreach (IMDGPosition imdg in this.IMDGPositions) foreach (IMDGPosition imdg in this.IMDGPositions)
{
DBManager.Instance.Save(imdg); DBManager.Instance.Save(imdg);
((ISublistContainer)imdg).SaveElements();
}
foreach (IMSBCPosition imsbc in this.IMSBCPositions) foreach (IMSBCPosition imsbc in this.IMSBCPositions)
DBManager.Instance.Save(imsbc); DBManager.Instance.Save(imsbc);
foreach (IBCPosition ibc in this.IBCPositions) foreach (IBCPosition ibc in this.IBCPositions)

View File

@ -21,7 +21,7 @@ namespace bsmd.database
[TypeConverter(typeof(MessageClassConverter<IMDGPosition>))] [TypeConverter(typeof(MessageClassConverter<IMDGPosition>))]
[JsonConverter(typeof(NoTypeConverterJsonConverter<IMDGPosition>))] [JsonConverter(typeof(NoTypeConverterJsonConverter<IMDGPosition>))]
public class IMDGPosition : DatabaseEntity, ISublistElement public class IMDGPosition : DatabaseEntity, ISublistElement, ISublistContainer
{ {
public IMDGPosition() public IMDGPosition()
{ {
@ -229,7 +229,7 @@ namespace bsmd.database
else else
{ {
string[] risks = value.Split(','); string[] risks = value.Split(',');
List<SubsidiaryRisks> foundList = new List<database.SubsidiaryRisks>(); List<SubsidiaryRisks> foundList = new List<SubsidiaryRisks>();
for (int i = 0; i < risks.Length; i++) for (int i = 0; i < risks.Length; i++)
{ {
@ -441,6 +441,42 @@ namespace bsmd.database
#endregion #endregion
#region ISublistContainer implementation
public ISublistElement GetSublistElementWithIdentifier(string identifier)
{
foreach (ISublistElement sElem in this.SubsidiaryRiskList)
if (sElem.Identifier.Equals(identifier))
return sElem;
return null;
}
[Browsable(false)]
[JsonIgnore]
public int NumberOfExcelRows
{
get { return 1; }
}
public void SaveElements()
{
foreach (SubsidiaryRisks sr in this.SubsidiaryRiskList)
{
DBManager.Instance.Save(sr);
}
}
public void DeleteElements()
{
foreach (SubsidiaryRisks sr in this.SubsidiaryRiskList)
{
DBManager.GetSingleCon(DBManager.Instance.ConnectionString).Delete(sr);
}
this.SubsidiaryRiskList.Clear();
}
#endregion
#region Validation #region Validation
public override void Validate(List<MessageError> errors, List<MessageViolation> violations) public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
@ -479,6 +515,30 @@ namespace bsmd.database
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "IMOClass", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA")); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "IMOClass", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
} }
if(!this.Bay.IsNullOrEmpty())
{
const string pattern = @"^[0-9]{3}$";
Regex regex = new Regex(pattern);
if (!regex.IsMatch(this.Bay))
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Bay", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
}
if(!this.Row.IsNullOrEmpty())
{
const string pattern = @"^[0-9]{2}$";
Regex regex = new Regex(pattern);
if (!regex.IsMatch(this.Row))
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Row", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
}
if(!this.Tier.IsNullOrEmpty())
{
const string pattern = @"^[0-9]{2}$";
Regex regex = new Regex(pattern);
if (!regex.IsMatch(this.Tier))
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Tier", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
}
} }
#endregion #endregion

View File

@ -142,7 +142,8 @@ namespace bsmd.database
IMPORTHEADER_ID, IMPORTHEADER_ID,
BY_CORE_AND_CLASS, BY_CORE_AND_CLASS,
BY_AGE, BY_AGE,
WASRCPT_ID WASRCPT_ID,
BY_FILE_SEQ_NUM
} }
/// <summary> /// <summary>
@ -181,6 +182,8 @@ namespace bsmd.database
[Description("HIS-Nord")] [Description("HIS-Nord")]
DUDR, DUDR,
[Description("dbh / Maersk")]
DBH_MAERSK
} }
// Late to the party: generic flags Enum/Field // Late to the party: generic flags Enum/Field
@ -396,6 +399,12 @@ namespace bsmd.database
/// </summary> /// </summary>
public int Flags { get; set; } public int Flags { get; set; }
/// <summary>
/// If message was sent via dbh, this is the consecutive number used in the file name,
/// null if unused
/// </summary>
public int? FileSequenceNumber { get; set; }
#endregion #endregion
#region IDatabaseEntity implementation #region IDatabaseEntity implementation
@ -443,13 +452,14 @@ namespace bsmd.database
cmd.Parameters.AddWithNullableValue("@SENDSUCCESS", this.SendSuccess); cmd.Parameters.AddWithNullableValue("@SENDSUCCESS", this.SendSuccess);
cmd.Parameters.AddWithNullableValue("@SENTBY", this.SentBy); cmd.Parameters.AddWithNullableValue("@SENTBY", this.SentBy);
cmd.Parameters.AddWithValue("@FLAGS", this.Flags); cmd.Parameters.AddWithValue("@FLAGS", this.Flags);
cmd.Parameters.AddWithNullableValue("@FILESEQNUM", this.FileSequenceNumber);
if (this.IsNew) if (this.IsNew)
{ {
this.CreateId(); this.CreateId();
cmd.Parameters.AddWithValue("@ID", this.Id); cmd.Parameters.AddWithValue("@ID", this.Id);
string query = string.Format("INSERT INTO {0} (Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, Reset, Cancel, Status, ReportingPartyId, BSMDStatus, LastStatus, HIS, CreatedBy, ChangedBy, StatusInfo, SendSuccess, SentBy, Flags) " + string query = string.Format("INSERT INTO {0} (Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, Reset, Cancel, Status, ReportingPartyId, BSMDStatus, LastStatus, HIS, CreatedBy, ChangedBy, StatusInfo, SendSuccess, SentBy, Flags, FileNumSequence) " +
"VALUES (@ID, @CLIENTREQUESTID, @MESSAGECOREID, @MESSAGEID, @SENTAT, @RECEIVEDAT, @REQUESTEDAT, @NOTIFICATIONCLASS, @RESET, @CANCEL, @STATUS, @REPORTINGPARTYID, @BSMDSTATUS, @LASTSTATUS, @HIS, @CREATEDBY, @CHANGEDBY, @STATUSINFO, @SENDSUCCESS, @SENTBY, @FLAGS)", "VALUES (@ID, @CLIENTREQUESTID, @MESSAGECOREID, @MESSAGEID, @SENTAT, @RECEIVEDAT, @REQUESTEDAT, @NOTIFICATIONCLASS, @RESET, @CANCEL, @STATUS, @REPORTINGPARTYID, @BSMDSTATUS, @LASTSTATUS, @HIS, @CREATEDBY, @CHANGEDBY, @STATUSINFO, @SENDSUCCESS, @SENTBY, @FLAGS, @FILESEQNUM)",
this.Tablename); this.Tablename);
cmd.CommandText = query; cmd.CommandText = query;
} }
@ -458,7 +468,7 @@ namespace bsmd.database
cmd.Parameters.AddWithValue("@ID", this.Id); cmd.Parameters.AddWithValue("@ID", this.Id);
cmd.CommandText = string.Format("UPDATE {0} SET ClientRequestId = @CLIENTREQUESTID, MessageId = @MESSAGEID, SentAt = @SENTAT, ReceivedAt = @RECEIVEDAT, RequestedAt = @REQUESTEDAT, " + cmd.CommandText = string.Format("UPDATE {0} SET ClientRequestId = @CLIENTREQUESTID, MessageId = @MESSAGEID, SentAt = @SENTAT, ReceivedAt = @RECEIVEDAT, RequestedAt = @REQUESTEDAT, " +
"NotificationClass = @NOTIFICATIONCLASS, Reset = @RESET, Cancel = @CANCEL, Status = @STATUS, ReportingPartyId = @REPORTINGPARTYID, BSMDStatus = @BSMDSTATUS, LastStatus = @LASTSTATUS, HIS = @HIS, " + "NotificationClass = @NOTIFICATIONCLASS, Reset = @RESET, Cancel = @CANCEL, Status = @STATUS, ReportingPartyId = @REPORTINGPARTYID, BSMDStatus = @BSMDSTATUS, LastStatus = @LASTSTATUS, HIS = @HIS, " +
"CreatedBy = @CREATEDBY, ChangedBy = @CHANGEDBY, StatusInfo = @STATUSINFO, SendSuccess = @SENDSUCCESS, SentBy = @SENTBY, Flags = @FLAGS WHERE Id = @ID", this.Tablename); "CreatedBy = @CREATEDBY, ChangedBy = @CHANGEDBY, StatusInfo = @STATUSINFO, SendSuccess = @SENDSUCCESS, SentBy = @SENTBY, Flags = @FLAGS, FileNumSequence = @FILESEQNUM WHERE Id = @ID", this.Tablename);
} }
} }
@ -466,7 +476,7 @@ namespace bsmd.database
public override void PrepareLoadCommand(IDbCommand cmd, LoadFilter filter, params object[] criteria ) public override void PrepareLoadCommand(IDbCommand cmd, LoadFilter filter, params object[] criteria )
{ {
string query = string.Format("SELECT Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, " + string query = string.Format("SELECT Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, " +
"Reset, Cancel, Status, ReportingPartyId, BSMDStatus, LastStatus, HIS, Created, CreatedBy, ChangedBy, Changed, StatusInfo, SendSuccess, SentBy, Flags FROM {0} ", "Reset, Cancel, Status, ReportingPartyId, BSMDStatus, LastStatus, HIS, Created, CreatedBy, ChangedBy, Changed, StatusInfo, SendSuccess, SentBy, Flags, FileNumSequence FROM {0} ",
this.Tablename); this.Tablename);
switch (filter) switch (filter)
@ -520,6 +530,12 @@ namespace bsmd.database
((SqlCommand)cmd).Parameters.AddWithValue("@CLASS", criteria[1]); ((SqlCommand)cmd).Parameters.AddWithValue("@CLASS", criteria[1]);
break; break;
} }
case LoadFilter.BY_FILE_SEQ_NUM:
{
query += "WHERE FileNumSequence = @FILESEQNUM";
((SqlCommand)cmd).Parameters.AddWithValue("@FILESEQNUM", criteria[0]);
break;
}
case LoadFilter.ALL: case LoadFilter.ALL:
default: default:
break; break;
@ -557,6 +573,7 @@ namespace bsmd.database
if (!reader.IsDBNull(20)) msg.SendSuccess = reader.GetBoolean(20); if (!reader.IsDBNull(20)) msg.SendSuccess = reader.GetBoolean(20);
if (!reader.IsDBNull(21)) msg.SentBy = reader.GetString(21); if (!reader.IsDBNull(21)) msg.SentBy = reader.GetString(21);
if (!reader.IsDBNull(22)) msg.Flags = reader.GetInt32(22); if (!reader.IsDBNull(22)) msg.Flags = reader.GetInt32(22);
if (!reader.IsDBNull(23)) msg.FileSequenceNumber = reader.GetInt32(23);
result.Add(msg); result.Add(msg);
} }
reader.Close(); reader.Close();

View File

@ -212,8 +212,6 @@ namespace bsmd.database
{ {
get get
{ {
if ((int)_initialHIS > 3) // pre 7.0 declarations may have "Test-" HIS set
return _initialHIS - 3;
return _initialHIS; return _initialHIS;
} }
set set

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")] [assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")] [assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("7.7.0")] [assembly: AssemblyInformationalVersion("7.8.0")]
[assembly: AssemblyCopyright("Copyright © 2014-2022 schick Informatik")] [assembly: AssemblyCopyright("Copyright © 2014-2022 schick Informatik")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("7.7.0.*")] [assembly: AssemblyVersion("7.8.0.*")]

View File

@ -258,6 +258,16 @@ namespace bsmd.database
#endregion #endregion
#region Validation
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
if (this.TowageOnArrivalDraught_DMT.HasValue && ((this.TowageOnArrivalDraught_DMT.Value < 10) || (this.TowageOnArrivalDraught_DMT.Value > 200)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Check draught on arrival", null, this.Title, this.Identifier, this.Tablename));
}
#endregion
} }
} }

View File

@ -146,7 +146,7 @@ namespace bsmd.database
} }
else else
{ {
scmd.Parameters.AddWithValue(@"ID", this.Id); scmd.Parameters.AddWithValue("ID", this.Id);
scmd.CommandText = string.Format("UPDATE {0} SET TowageOnDepartureName = @P2, TowageOnDepartureFlag = @P3, " + scmd.CommandText = string.Format("UPDATE {0} SET TowageOnDepartureName = @P2, TowageOnDepartureFlag = @P3, " +
"TowageOnDepartureOperatorCompanyName = @P4, TowageOnDepartureOperatorStreetNameAndNumber = @P5, " + "TowageOnDepartureOperatorCompanyName = @P4, TowageOnDepartureOperatorStreetNameAndNumber = @P5, " +
"TowageOnDepartureOperatorPostalCode = @P6, TowageOnDepartureOperatorCity = @P7, TowageOnDepartureOperatorCountry = @P8, " + "TowageOnDepartureOperatorPostalCode = @P6, TowageOnDepartureOperatorCity = @P7, TowageOnDepartureOperatorCountry = @P8, " +
@ -241,6 +241,16 @@ namespace bsmd.database
#endregion #endregion
#region Validation
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
if (this.TowageOnDepartureDraught_DMT.HasValue && ((this.TowageOnDepartureDraught_DMT.Value < 10) || (this.TowageOnDepartureDraught_DMT.Value > 200)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Check draught on departure", null, this.Title, this.Identifier, this.Tablename));
}
#endregion
} }
} }

View File

@ -25,7 +25,7 @@ namespace bsmd.database
[ShowReport] [ShowReport]
[MaxLength(70)] [MaxLength(70)]
[ENI2Validation] [ENI2Validation]
[Validation(ValidationCode.STRING_MAXLEN, 70)] [Validation(ValidationCode.NOT_NULL_MAX_LEN, 70)]
public string TreatmentFacilityProviderName { get; set; } public string TreatmentFacilityProviderName { get; set; }
public string Identifier { get; set; } public string Identifier { get; set; }

View File

@ -0,0 +1,145 @@
// Copyright (c) 2020-present schick Informatik
// Description: Manager zum Senden/Empfangen von Daten mit dbh
using log4net;
using System;
using System.IO;
using bsmd.database;
namespace bsmd.dbh
{
public static class MessageController
{
private static readonly ILog _log = LogManager.GetLogger(typeof(MessageController));
private static int? _fileSequenceCounter = null;
public static bool SendMessage(MessageCore core, Message message)
{
bool result = true;
try
{
if (message == null) return false;
if (message.ReportingParty == null)
{
_log.ErrorFormat("Reporting party not set on message {0}", message.Id);
return false;
}
if ((message.MessageNotificationClass != Message.NotificationClass.VISIT) &&
(message.MessageNotificationClass != Message.NotificationClass.TRANSIT) &&
(message.Elements.Count == 0))
{
_log.ErrorFormat("trying to send message {0} class {1} but there are no depending record elements",
message.Id, message.MessageNotificationClass);
return false;
}
if (!_fileSequenceCounter.HasValue)
_fileSequenceCounter = DBManager.Instance.GetMessageFileMaxNum();
_fileSequenceCounter += 1;
message.FileSequenceNumber = _fileSequenceCounter;
string messageFile = RequestUtil.CreateMessageFile(core, message);
if (messageFile != null)
{
string onlyFileName = Path.GetFileName(messageFile);
string moveTarget = Path.Combine(Properties.Settings.Default.OutgoingFolder, onlyFileName);
// move file to output directory
File.Move(messageFile, moveTarget);
}
else
{
result = false;
}
}
catch (Exception ex)
{
_log.Error(ex.ToString());
result = false;
}
return result;
}
public static bool SendCancelCore(MessageCore core)
{
bool result = true;
Message cancelMessage = null;
foreach(Message aMessage in DBManager.Instance.GetMessagesForCore(core, DBManager.MessageLoad.ALL))
{
if(core.IsTransit && (aMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT))
{
cancelMessage = aMessage; break;
}
if(!core.IsTransit && (aMessage.MessageNotificationClass == Message.NotificationClass.VISIT))
{
cancelMessage = aMessage; break;
}
}
string messageFile = RequestUtil.CreateMessageFile(core, cancelMessage);
if (messageFile != null)
{
if (!_fileSequenceCounter.HasValue)
_fileSequenceCounter = DBManager.Instance.GetMessageFileMaxNum();
_fileSequenceCounter += 1;
cancelMessage.FileSequenceNumber = _fileSequenceCounter;
string onlyFileName = Path.GetFileName(messageFile);
string moveTarget = Path.Combine(Properties.Settings.Default.OutgoingFolder, onlyFileName);
// move file to output directory
File.Move(messageFile, moveTarget);
}
else
{
result = false;
}
return result;
}
public static void SendAndReceive()
{
// sent unsent messages in output folder
bsmd.dakosy.SFtp.TransmitAll(Properties.Settings.Default.RemoteIncomingFolder, Properties.Settings.Default.OutgoingFolder, dakosy.SFtp.Direction.OUTGOING, Properties.Settings.Default.SFTPSessionName);
// move files from output folder to archive folder
foreach(string sentFile in Directory.GetFiles(Properties.Settings.Default.OutgoingFolder))
{
_log.InfoFormat("sent {0}", sentFile);
string onlyFileName = Path.GetFileName(sentFile);
string moveTarget = Path.Combine(Properties.Settings.Default.OutgoingArchiveFolder, onlyFileName);
File.Move(sentFile, moveTarget);
}
// receive files from remote host
// SFTP verbindung öffnen und alle Dateien herunterladen
bsmd.dakosy.SFtp.TransmitAll(Properties.Settings.Default.RemoteOutgoingFolder, Properties.Settings.Default.IncomingFolder, dakosy.SFtp.Direction.INCOMING, Properties.Settings.Default.SFTPSessionName);
foreach (string inputFile in Directory.GetFiles(Properties.Settings.Default.IncomingFolder))
{
string justFilename = Path.GetFileName(inputFile);
// lokale Dateien verarbeiten
if (!ResponseUtil.Read(inputFile))
{
_log.ErrorFormat("Error reading input file {0}", justFilename);
string errorPath = Path.Combine(Properties.Settings.Default.IncomingErrorFolder, justFilename);
File.Move(inputFile, errorPath);
}
else
{
_log.InfoFormat("Incoming file {0} processed", justFilename);
string archivePath = Path.Combine(Properties.Settings.Default.IncomingArchiveFolder, justFilename);
File.Move(inputFile, archivePath);
}
// remote Dateien löschen
bsmd.dakosy.SFtp.RemoveProcessedFile(Properties.Settings.Default.RemoteOutgoingFolder, Path.GetFileName(inputFile), Properties.Settings.Default.SFTPSessionName);
}
}
}
}

View File

@ -23,28 +23,93 @@ namespace bsmd.dbh.Properties {
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
[global::System.Configuration.DefaultSettingValueAttribute("https://edi-gate.dbh.de/test/bsmd-soap")]
public string bsmd_dbh_DBHWebReference_Dbh_Osis_Answ_Ws {
get {
return ((string)(this["bsmd_dbh_DBHWebReference_Dbh_Osis_Answ_Ws"]));
}
set {
this["bsmd_dbh_DBHWebReference_Dbh_Osis_Answ_Ws"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("00003050")] [global::System.Configuration.DefaultSettingValueAttribute("00003050")]
public string Sender { public string Sender {
get { get {
return ((string)(this["Sender"])); return ((string)(this["Sender"]));
} }
set { }
this["Sender"] = value;
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dbh\\out")]
public string OutgoingFolder {
get {
return ((string)(this["OutgoingFolder"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dbh\\out_archive")]
public string OutgoingArchiveFolder {
get {
return ((string)(this["OutgoingArchiveFolder"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dbh\\in")]
public string IncomingFolder {
get {
return ((string)(this["IncomingFolder"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dbh\\in_archive")]
public string IncomingArchiveFolder {
get {
return ((string)(this["IncomingArchiveFolder"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("test/bsmd_2_dbh")]
public string RemoteIncomingFolder {
get {
return ((string)(this["RemoteIncomingFolder"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("test/dbh_2_bsmd")]
public string RemoteOutgoingFolder {
get {
return ((string)(this["RemoteOutgoingFolder"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("dbh")]
public string SFTPSessionName {
get {
return ((string)(this["SFTPSessionName"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string IncomingErrorFolder {
get {
return ((string)(this["IncomingErrorFolder"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("00006017")]
public string SenderMaersk {
get {
return ((string)(this["SenderMaersk"]));
} }
} }
} }

View File

@ -2,11 +2,35 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="bsmd.dbh.Properties" GeneratedClassName="Settings"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="bsmd.dbh.Properties" GeneratedClassName="Settings">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="bsmd_dbh_DBHWebReference_Dbh_Osis_Answ_Ws" Type="(Web Service URL)" Scope="User"> <Setting Name="Sender" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://edi-gate.dbh.de/test/bsmd-soap</Value>
</Setting>
<Setting Name="Sender" Type="System.String" Scope="User">
<Value Profile="(Default)">00003050</Value> <Value Profile="(Default)">00003050</Value>
</Setting> </Setting>
<Setting Name="OutgoingFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)">e:\temp\dbh\out</Value>
</Setting>
<Setting Name="OutgoingArchiveFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)">e:\temp\dbh\out_archive</Value>
</Setting>
<Setting Name="IncomingFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)">e:\temp\dbh\in</Value>
</Setting>
<Setting Name="IncomingArchiveFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)">e:\temp\dbh\in_archive</Value>
</Setting>
<Setting Name="RemoteIncomingFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)">test/bsmd_2_dbh</Value>
</Setting>
<Setting Name="RemoteOutgoingFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)">test/dbh_2_bsmd</Value>
</Setting>
<Setting Name="SFTPSessionName" Type="System.String" Scope="Application">
<Value Profile="(Default)">dbh</Value>
</Setting>
<Setting Name="IncomingErrorFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="SenderMaersk" Type="System.String" Scope="Application">
<Value Profile="(Default)">00006017</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -5,7 +5,7 @@
// Author: dani // Author: dani
// Created: 3/1/2015 8:05:05 PM // Created: 3/1/2015 8:05:05 PM
// //
// Copyright (c) 2015-2017 Informatikbüro Daniel Schick. All rights reserved. // Copyright (c) 2015-present Informatikbüro Daniel Schick. All rights reserved.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -17,9 +17,14 @@ using bsmd.dbh.DBHWebReference;
namespace bsmd.dbh namespace bsmd.dbh
{ {
public class Request /// <summary>
/// This class implements the "oldschool" approach of sending classes via the SOAP interface.
/// It has been superseded by a file-based approach that transmits classes via SFTP.
/// </summary>
[Obsolete]
public class RequestWeb
{ {
private static readonly ILog _log = LogManager.GetLogger(typeof(Request)); private static readonly ILog _log = LogManager.GetLogger(typeof(RequestWeb));
public static bool SendCancelCore(MessageCore core) public static bool SendCancelCore(MessageCore core)
{ {

1742
bsmd.dbh/RequestUtil.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@ using System.Xml.Serialization;
namespace bsmd.dbh namespace bsmd.dbh
{ {
public class Response public static class ResponseWeb
{ {
private static readonly ILog _log = LogManager.GetLogger("dbh Response"); private static readonly ILog _log = LogManager.GetLogger("dbh Response");

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// Dieser Code wurde von einem Tool generiert. // Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000 // Laufzeitversion:2.0.50727.9151
// //
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird. // der Code erneut generiert wird.
@ -11,14 +11,14 @@
using System.Xml.Serialization; using System.Xml.Serialization;
// //
// Dieser Quellcode wurde automatisch generiert von xsd, Version=4.7.3081.0. // This source code was auto-generated by xsd, Version=2.0.50727.312.
// //
namespace bsmd.dbh.response namespace bsmd.dbh.Response
{ {
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.3081.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()] [System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.DesignerCategoryAttribute("code")]
@ -27,7 +27,9 @@ namespace bsmd.dbh.response
public partial class Root public partial class Root
{ {
private string versionField; private RootVersion versionField;
private bool versionFieldSpecified;
private string messageIdField; private string messageIdField;
@ -53,10 +55,10 @@ namespace bsmd.dbh.response
private RootReportingClassesNoChanges reportingClassesNoChangesField; private RootReportingClassesNoChanges reportingClassesNoChangesField;
private Message[] messagesField; private RootMessage[] messagesField;
/// <remarks/> /// <remarks/>
public string Version public RootVersion Version
{ {
get get
{ {
@ -68,6 +70,20 @@ namespace bsmd.dbh.response
} }
} }
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool VersionSpecified
{
get
{
return this.versionFieldSpecified;
}
set
{
this.versionFieldSpecified = value;
}
}
/// <remarks/> /// <remarks/>
public string MessageId public string MessageId
{ {
@ -227,7 +243,7 @@ namespace bsmd.dbh.response
/// <remarks/> /// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("Message", IsNullable = false)] [System.Xml.Serialization.XmlArrayItemAttribute("Message", IsNullable = false)]
public Message[] Messages public RootMessage[] Messages
{ {
get get
{ {
@ -241,7 +257,19 @@ namespace bsmd.dbh.response
} }
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.3081.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public enum RootVersion
{
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("1.0")]
Item70,
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()] [System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public enum RootType public enum RootType
@ -264,7 +292,7 @@ namespace bsmd.dbh.response
} }
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.3081.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()] [System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.DesignerCategoryAttribute("code")]
@ -290,7 +318,7 @@ namespace bsmd.dbh.response
} }
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.3081.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()] [System.SerializableAttribute()]
public enum ReportingClassCode public enum ReportingClassCode
{ {
@ -352,6 +380,9 @@ namespace bsmd.dbh.response
/// <remarks/> /// <remarks/>
WAS, WAS,
/// <remarks/>
WAS_RCPT,
/// <remarks/> /// <remarks/>
CREW, CREW,
@ -375,7 +406,7 @@ namespace bsmd.dbh.response
} }
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.3081.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()] [System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.DesignerCategoryAttribute("code")]
@ -401,7 +432,7 @@ namespace bsmd.dbh.response
} }
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.3081.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()] [System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.DesignerCategoryAttribute("code")]
@ -427,7 +458,7 @@ namespace bsmd.dbh.response
} }
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.3081.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()] [System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.DesignerCategoryAttribute("code")]
@ -453,7 +484,7 @@ namespace bsmd.dbh.response
} }
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.3081.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()] [System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.DesignerCategoryAttribute("code")]
@ -479,12 +510,12 @@ namespace bsmd.dbh.response
} }
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.3081.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()] [System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class Message public partial class RootMessage
{ {
private string idField; private string idField;
@ -549,7 +580,7 @@ namespace bsmd.dbh.response
} }
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.3081.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.SerializableAttribute()] [System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public enum RootMessageType public enum RootMessageType
@ -566,6 +597,8 @@ namespace bsmd.dbh.response
/// <remarks/> /// <remarks/>
ERROR, ERROR,
}
/// <remarks/>
XSD_ERROR,
}
} }

203
bsmd.dbh/ResponseUtil.cs Normal file
View File

@ -0,0 +1,203 @@
// Copyright (c) 2020-present schick Informatik
// Description: Verarbeitung von empfangenen Rückmeldungen
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml.Serialization;
using log4net;
using bsmd.database;
namespace bsmd.dbh
{
internal static class ResponseUtil
{
private static readonly ILog _log = LogManager.GetLogger(typeof(ResponseUtil));
private static readonly Regex _regexFilename = new Regex(@".*NSW\.DBH\.BSMD(MAERSK)?\.(.*)\.xml");
internal static bool Read(string inputFile)
{
bool result = false;
if(!inputFile.EndsWith(".xml", StringComparison.OrdinalIgnoreCase))
{
_log.ErrorFormat("no xml file: {0}", inputFile);
return result;
}
Match m = _regexFilename.Match(inputFile);
if(!m.Success) {
_log.WarnFormat("returned file doesn't follow naming convention NSW.DBH.BSMD(MAERSK)?.*:{0}", inputFile);
return result;
}
// Achtung! Die laufende Nummer der rücklaufenden Datei ist _nicht_ dieselbe und kann zur Identifikation der Meldeklasse
// nicht verwendet werden
string fileSeqString = m.Groups[2].Value;
if(!Int32.TryParse(fileSeqString, out int fileSeqNum))
{
_log.ErrorFormat("matched file sequence number couldn't be parsed: {0}", fileSeqString);
return result;
}
bsmd.dbh.Response.Root root = null;
try
{
XmlSerializer serializer = new XmlSerializer(typeof(bsmd.dbh.Response.Root));
using (Stream s = new FileStream(inputFile, FileMode.Open))
{
root = (bsmd.dbh.Response.Root) serializer.Deserialize(s);
}
Message sentMessage = null;
MessageCore aCore = null;
if(Guid.TryParse(root.SenderReference, out Guid refGuid))
{
// load message(s?) by file seq string
sentMessage = DBManager.Instance.GetMessageById(refGuid) as Message;
if (sentMessage == null)
{
_log.ErrorFormat("cannot find a message for file sequence number {0}", fileSeqNum);
return result;
}
aCore = DBManager.Instance.GetMessageCoreById(sentMessage.MessageCoreId.Value);
if (aCore == null)
{
_log.ErrorFormat("There is no core with id {0}", sentMessage.MessageCoreId.Value);
return result;
}
}
else
{
_log.ErrorFormat("sender ref {0} is no guid", root.SenderReference);
return result;
}
switch(root.Type)
{
case Response.RootType.VISIT:
if (aCore.VisitId.IsNullOrEmpty() && !root.VisitId.IsNullOrEmpty())
{
aCore.VisitId = root.VisitId;
sentMessage.SendSuccess = true;
sentMessage.Status = Message.MessageStatus.ACCEPTED;
sentMessage.InternalStatus = Message.BSMDStatus.CONFIRMED;
_log.InfoFormat("Received Visit-Id {0} for core {1}", root.VisitId, aCore.Id);
}
break;
case Response.RootType.TRANSIT:
if (aCore.TransitId.IsNullOrEmpty() && !root.TransitId.IsNullOrEmpty())
{
aCore.TransitId = root.TransitId;
sentMessage.SendSuccess = true;
sentMessage.Status = Message.MessageStatus.ACCEPTED;
sentMessage.InternalStatus = Message.BSMDStatus.CONFIRMED;
_log.InfoFormat("Received Transit-Id {0} for core {1}", root.TransitId, aCore.Id);
}
break;
case Response.RootType.DATA:
if(root.ReportingClassesFull?.ReportingClass.Length > 0)
{
_log.InfoFormat("Message {0} confirmed (full), {1} messages", sentMessage.MessageNotificationClassDisplay, root.Messages?.Length);
sentMessage.SendSuccess = true;
sentMessage.Status = Message.MessageStatus.ACCEPTED;
sentMessage.InternalStatus = Message.BSMDStatus.CONFIRMED;
}
if (root.ReportingClassesPartial?.ReportingClass.Length > 0)
{
_log.WarnFormat("Message {0} confirmed (partial), {1} messages", sentMessage.MessageNotificationClassDisplay, root.Messages?.Length);
sentMessage.SendSuccess = true;
sentMessage.Status = Message.MessageStatus.ACCEPTED;
sentMessage.InternalStatus = Message.BSMDStatus.VIOLATION;
}
if (root.ReportingClassesError?.ReportingClass.Length > 0)
{
_log.ErrorFormat("Message {0} rejected, {1} messages", sentMessage.MessageNotificationClassDisplay, root.Messages?.Length);
sentMessage.SendSuccess = false;
sentMessage.Status = Message.MessageStatus.REJECTED;
sentMessage.InternalStatus = Message.BSMDStatus.ERROR;
sentMessage.StatusInfo = "Errors reported";
}
break;
case Response.RootType.RESET:
if(root.ReportingClassesResetted?.ReportingClass.Length > 0)
{
_log.InfoFormat("Message {0} RESET confirmed, {1} messages", sentMessage.MessageNotificationClassDisplay, root.Messages.Length); ;
sentMessage.SendSuccess = false; // bestätigter Reset setzt grünen Buppel zurück
sentMessage.Status = Message.MessageStatus.ACCEPTED;
sentMessage.InternalStatus = Message.BSMDStatus.CONFIRMED;
}
break;
case Response.RootType.CANCEL:
_log.InfoFormat("Core {0} CANCEL confirmed", aCore.DisplayId);
aCore.BSMDStatusInternal = MessageCore.BSMDStatus.RESPONDED;
break;
}
// "alte" Meldungen entfernen
foreach (MessageError existingError in sentMessage.ErrorList)
DBManager.Instance.Delete(existingError);
foreach (MessageViolation existingViolation in sentMessage.ViolationList)
DBManager.Instance.Delete(existingViolation);
if (root.Messages != null)
{
foreach (Response.RootMessage rootMessage in root.Messages)
{
_log.InfoFormat("Message[{0}]: {1} {2} {3}", rootMessage.ID, rootMessage.Type, rootMessage.Location, rootMessage.Text);
switch (rootMessage.Type)
{
case Response.RootMessageType.ERROR:
MessageError me = new MessageError();
me.MessageHeaderId = sentMessage.Id.Value;
me.MessageHeader = sentMessage;
me.ErrorText = rootMessage.Text;
DBManager.Instance.Save(me);
break;
case Response.RootMessageType.VIOLATION:
MessageViolation mv = new MessageViolation();
mv.MessageHeaderId = sentMessage.Id.Value;
mv.MessageHeader = sentMessage;
mv.ViolationText = rootMessage.Text;
DBManager.Instance.Save(mv);
break;
case Response.RootMessageType.XSD_ERROR:
// TODO
break;
case Response.RootMessageType.INFO:
// TODO
break;
case Response.RootMessageType.WARNING:
// TODO
break;
}
}
}
DBManager.Instance.Save(sentMessage);
if (!(aCore.Cancelled ?? false))
aCore.BSMDStatusInternal = MessageCore.BSMDStatus.RESPONDED;
DBManager.Instance.Save(aCore);
result = true;
}
catch(Exception ex)
{
_log.ErrorFormat("Failed to deserialize return message: {0}", ex.Message);
return result;
}
return result;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Results>
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="file:///E:/svnlager/bsmd/nsw/dbh/answ-osis-extern.wsdl" filename="answ-osis-extern.wsdl" />
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.SchemaReference" url="file:///E:/svnlager/bsmd/nsw/dbh/NSWRequest.xsd" filename="NSWRequest.xsd" />
</Results>
</DiscoveryClientResultsFile>

View File

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s0="http://www.openuri.org/" xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://www.openuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema xmlns:ope="http://www.openuri.org/" elementFormDefault="qualified" targetNamespace="http://www.openuri.org/">
<s:include schemaLocation="NSWRequest.xsd" />
<s:element name="submitResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" name="messageID" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="submitSoapIn">
<wsdl:part name="parameters" element="s0:Root" />
</wsdl:message>
<wsdl:message name="submitSoapOut">
<wsdl:part name="parameters" element="s0:submitResponse" />
</wsdl:message>
<wsdl:portType name="Dbh_Osis_Answ_Ws">
<wsdl:operation name="Root">
<wsdl:documentation>Submit a new NSW Request (only one NSWRequest per Submit!) to DBH ANSW OSIS, giving the senderID, messageID, messageType, the message. The method returns the OsisOrderNr (Unique message identifier generated by OSIS). </wsdl:documentation>
<wsdl:input message="s0:submitSoapIn" />
<wsdl:output message="s0:submitSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Dbh_Osis_Answ_Ws" type="s0:Dbh_Osis_Answ_Ws">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Root">
<soap:operation soapAction="http://www.openuri.org/submit" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Dbh_Osis_Answ_Ws">
<wsdl:documentation>Dbh_Osis_Answ_Ws is used to send Message to the DBH ANSW OSIS Application. Message format is XML.</wsdl:documentation>
<wsdl:port name="Dbh_Osis_Answ_Ws" binding="s0:Dbh_Osis_Answ_Ws">
<soap:address location="https://edi-gate.dbh.de/test/bsmd-soap" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@ -1,18 +1,42 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="bsmd.dbh.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> <section name="bsmd.dbh.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<userSettings> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup><applicationSettings>
<bsmd.dbh.Properties.Settings> <bsmd.dbh.Properties.Settings>
<setting name="bsmd_dbh_DBHWebReference_Dbh_Osis_Answ_Ws" serializeAs="String">
<value>https://edi-gate.dbh.de/test/bsmd-soap</value>
</setting>
<setting name="Sender" serializeAs="String"> <setting name="Sender" serializeAs="String">
<value>00003050</value> <value>00003050</value>
</setting> </setting>
<setting name="OutgoingFolder" serializeAs="String">
<value>e:\temp\dbh\out</value>
</setting>
<setting name="OutgoingArchiveFolder" serializeAs="String">
<value>e:\temp\dbh\out_archive</value>
</setting>
<setting name="IncomingFolder" serializeAs="String">
<value>e:\temp\dbh\in</value>
</setting>
<setting name="IncomingArchiveFolder" serializeAs="String">
<value>e:\temp\dbh\in_archive</value>
</setting>
<setting name="RemoteIncomingFolder" serializeAs="String">
<value>test/bsmd_2_dbh</value>
</setting>
<setting name="RemoteOutgoingFolder" serializeAs="String">
<value>test/dbh_2_bsmd</value>
</setting>
<setting name="SFTPSessionName" serializeAs="String">
<value>dbh</value>
</setting>
<setting name="IncomingErrorFolder" serializeAs="String">
<value />
</setting>
<setting name="SenderMaersk" serializeAs="String">
<value>00006017</value>
</setting>
</bsmd.dbh.Properties.Settings> </bsmd.dbh.Properties.Settings>
</userSettings> </applicationSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration> </configuration>

View File

@ -66,28 +66,32 @@
<Compile Include="..\bsmd.database\Properties\AssemblyProjectKeyInfo.cs"> <Compile Include="..\bsmd.database\Properties\AssemblyProjectKeyInfo.cs">
<Link>Properties\AssemblyProjectKeyInfo.cs</Link> <Link>Properties\AssemblyProjectKeyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="NSWResponse.cs" /> <Compile Include="MessageController.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs"> <Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
</Compile> </Compile>
<Compile Include="Request.cs" /> <Compile Include="RequestUtil.cs" />
<Compile Include="Response.cs" /> <Compile Include="Request\NSWRequest.cs" />
<Compile Include="Web References\DBHWebReference\Reference.cs"> <Compile Include="ResponseUtil.cs" />
<AutoGen>True</AutoGen> <Compile Include="Response\NSWResponse.cs" />
<DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\bsmd.dakosy\bsmd.dakosy.csproj">
<Project>{6255f8c4-b0b5-4e77-860e-10ebcd7b368f}</Project>
<Name>bsmd.dakosy</Name>
</ProjectReference>
<ProjectReference Include="..\bsmd.database\bsmd.database.csproj"> <ProjectReference Include="..\bsmd.database\bsmd.database.csproj">
<Project>{19945af2-379b-46a5-b27a-303b5ec1d557}</Project> <Project>{19945af2-379b-46a5-b27a-303b5ec1d557}</Project>
<Name>bsmd.database</Name> <Name>bsmd.database</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\bsmd.database\bsmd.database.licenseheader">
<Link>bsmd.database.licenseheader</Link>
</None>
<None Include="..\bsmdKey.snk" /> <None Include="..\bsmdKey.snk" />
<None Include="app.config" /> <None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
@ -95,37 +99,14 @@
<Generator>PublicSettingsSingleFileGenerator</Generator> <Generator>PublicSettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
<None Include="Web References\DBHWebReference\answ-osis-extern.wsdl" />
<None Include="Web References\DBHWebReference\NSWRequest.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Web References\DBHWebReference\Reference.map">
<Generator>MSDiscoCodeGenerator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<WCFMetadata Include="Service References\" /> <WCFMetadata Include="Service References\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<WebReferences Include="Web References\" />
</ItemGroup>
<ItemGroup>
<WebReferenceUrl Include="E:\svnlager\bsmd\nsw\dbh\answ-osis-extern.wsdl">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\DBHWebReference\</RelPath>
<UpdateFromURL>E:\svnlager\bsmd\nsw\dbh\answ-osis-extern.wsdl</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>bsmd_dbh_DBHWebReference_Dbh_Osis_Answ_Ws</CachedSettingsPropName>
</WebReferenceUrl>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="readme.txt" /> <Content Include="readme.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

26
bsmd.dbh/misc/sshkey.ppk Normal file
View File

@ -0,0 +1,26 @@
PuTTY-User-Key-File-2: ssh-rsa
Encryption: aes256-cbc
Comment: rsa-key-20221031 dbh
Public-Lines: 6
AAAAB3NzaC1yc2EAAAABJQAAAQEAujJ+P4nqiTRaPaorpEyBJvhjsU1DQ19GD4wN
XvbawZg2qHnIoEFt/0QItgHo5qij72cU//A2owCgEMrvaiXwPKk/ey1f1O3VlP3G
uK92aSYx+kwvqzjq4NKG2d/OVImcu5Y7KF7WaPNs44F7KvPI/yu5ZSJ7eL3+d9Tz
8Xtkw0Cca121+KrSmrEEot0PPjvl/ltrRc/MZwpdHBaahhfdNShAFYW9YI9/Jx8R
MNZ8PvN6KqE0GRvyYoNWQ839LJTmV4TDovc/Q30OaxvkpfV/JVzlSK34NZf4L2Av
V84PNSSMMmS1ZyPlIivol4iorsMFL4ExWCD5RFT1TJtnHAT7sQ==
Private-Lines: 14
mM+ucPZK+y4ZO6hmpxOzLGKsGtLQK0Z61x0KO9e68jq7gdyaj1uNRbE8k6hwgs+a
/3yh9BJRG70F/FR0xcwhxVbyd38JFKjhb5l563twAzql1iM3+rfeM+HB3pRGHr/a
glK2MVErCIaP+DxpwoAgMBP8PlpRkbwA9kJ7AxqfN/CtIbjPRVxONBIAcEWG2hY4
TCS7OVS4GMQA/hObytd8rGgFF/f6VSpMwHM2+ztXNgj6+oFHJh2/SrxkM2zVdj65
I63Z83oxM3fxW69oJ7od5jXGHq2qzd5PQoUz+W5WSwjWsDKDYH2T7xNc5oI0D0g6
cYtNnwHRmbj+oxVgyqORn9kVCM4MaRlqJVU5y9C29fEIUPl7x4Xc5b7SppSm3HOd
vrLtftP7OlYjAapm+G3hMMZ0V5kSOxllx9wSEPYQW9qxWIgEZ0ytladFrwHu2NGa
xTRNn4JjP6LkfadJLdTciVwRujTmteLGq7dqSrrv2GasoWPMMON8usgxCLokBapP
fz/4hPxrKxJNbjkcbbsVn3UhY2OfeUiAgW5R+ms1MKHw3hewI3+psDVfYuJeFsFp
A/J453Ypmi/89hqMkPOCpy7aBWO9SorRFakYgeE1Tq0dYChK8+nu60MpALBU1mQK
xXhj9fUYEF7voJcsWN0ZH3oAo+/840blQuV4o+DQZVFwcKzpOOm1wPzQZgvqcz4c
lTnLg/xUiMKNpVdzc8sJz3nIlXkDo6rrkIVMf40ergGz7So6nij9DIh/ZsUeQ6Yb
z23HtiG0s17O3iJLSOgoFcXrAh9sWkp0k/Vg8aVvLVzp2VBLC9cejRFBRG1z0lM2
qYv61RQLU2r3b8gpqQzBT1HLgy8N7I51AhfUUlBHs+UxdXy0NrYvS4eEiXksGK/5
Private-MAC: 91ed4f6f4074a6c4ebb5cacf53e39989e737774e

9
bsmd.dbh/misc/sshkey.pub Normal file
View File

@ -0,0 +1,9 @@
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20221031 dbh"
AAAAB3NzaC1yc2EAAAABJQAAAQEAujJ+P4nqiTRaPaorpEyBJvhjsU1DQ19GD4wN
XvbawZg2qHnIoEFt/0QItgHo5qij72cU//A2owCgEMrvaiXwPKk/ey1f1O3VlP3G
uK92aSYx+kwvqzjq4NKG2d/OVImcu5Y7KF7WaPNs44F7KvPI/yu5ZSJ7eL3+d9Tz
8Xtkw0Cca121+KrSmrEEot0PPjvl/ltrRc/MZwpdHBaahhfdNShAFYW9YI9/Jx8R
MNZ8PvN6KqE0GRvyYoNWQ839LJTmV4TDovc/Q30OaxvkpfV/JVzlSK34NZf4L2Av
V84PNSSMMmS1ZyPlIivol4iorsMFL4ExWCD5RFT1TJtnHAT7sQ==
---- END SSH2 PUBLIC KEY ----

View File

@ -0,0 +1,26 @@
PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: rsa-key-20221031 dbh
Public-Lines: 6
AAAAB3NzaC1yc2EAAAABJQAAAQEAujJ+P4nqiTRaPaorpEyBJvhjsU1DQ19GD4wN
XvbawZg2qHnIoEFt/0QItgHo5qij72cU//A2owCgEMrvaiXwPKk/ey1f1O3VlP3G
uK92aSYx+kwvqzjq4NKG2d/OVImcu5Y7KF7WaPNs44F7KvPI/yu5ZSJ7eL3+d9Tz
8Xtkw0Cca121+KrSmrEEot0PPjvl/ltrRc/MZwpdHBaahhfdNShAFYW9YI9/Jx8R
MNZ8PvN6KqE0GRvyYoNWQ839LJTmV4TDovc/Q30OaxvkpfV/JVzlSK34NZf4L2Av
V84PNSSMMmS1ZyPlIivol4iorsMFL4ExWCD5RFT1TJtnHAT7sQ==
Private-Lines: 14
AAABAEZz+GsRlwN7l8ROOgbQ1uwmokMWUM1iUdxegZmN1jtqBtf2up2AinxDQZD5
zb8PYJ/GI58cnw0+gcEqMRNoTRAIsDxyCJXBxm+5+Co0jas+4npiBDLy8RbMMwZU
ru+OA/Pzp65pEtuaYI1vQ1xcPjcJoBht6Yeh1egnEDHbqZX8H0bPflHjFwifKQjb
A4dDFR0MjhaRupoABPgFJrmMcRJc4OxgBCzsNdi7fPSQXB5NNc5Bcmt2nENGIwKl
DLfkNmfVLM6Dba9gLDlKY26120b6oyzGKW0c6QlKygIqgSuUlWE5QkQe1O3DgOma
ArQA4hJThI6lr298L6Vd5nIGS00AAACBAPSYGhlBWJO0h3kNcUYbSqW4YUbzo7Tr
Xi69mUXKK3yayx3oJvQ0s3cUZPs5ffEydzZvwL6t+REQNIPdE+v9R7zg3zoEq9Kj
ynPc7fFu0bqcPsVoc91rmvsGPZG9wzeP/uWhdvsjN2wm5+dUhndFSQlKI/eE1kUX
yR+iF3I5JzSNAAAAgQDC4UPO3ufLKs4M2XIbPXbRncaszWHO5KwhPLjcGrARMvn0
TvNQa/4MDMqU3rZzBYujPlgQKo37MsxRTXOUJLsr9oRuoRSmK6IlraA1koxKKPVw
oMCtTjCVR28+lFFdsfhk62ivtHZq0Ah1tQ+8jcDK/hLJNblkhegzLFTvR80ktQAA
AIBGxWBNRjWjJ6hUigx2VaFVyhD5BjXJMBOwQhT2TypVc2JpoMCHbGiUmodwgeLQ
Vw2OdjpkBIpFOnSJi5r2ZInLLhEXn7wTKm+oDifNdz7OBwb5MAtH7DIOxsg5OcJf
85k6/GSa1vnX0nqN7MhiEgVC7iBqcV9nsQ2Cu54K60Q+7g==
Private-MAC: 0b938b49cfacc9f022a41e09918c08757c5a853a

View File

@ -23,100 +23,76 @@ namespace bsmd.hisnord.Properties {
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1")] [global::System.Configuration.DefaultSettingValueAttribute("1")]
public int BatchTimeoutMins { public int BatchTimeoutMins {
get { get {
return ((int)(this["BatchTimeoutMins"])); return ((int)(this["BatchTimeoutMins"]));
} }
set {
this["BatchTimeoutMins"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\IMP")] [global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\IMP")]
public string OutputDir { public string OutputDir {
get { get {
return ((string)(this["OutputDir"])); return ((string)(this["OutputDir"]));
} }
set {
this["OutputDir"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\client.bat")] [global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\client.bat")]
public string Transmitter { public string Transmitter {
get { get {
return ((string)(this["Transmitter"])); return ((string)(this["Transmitter"]));
} }
set {
this["Transmitter"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\RESULTS")] [global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\RESULTS")]
public string ResultDir { public string ResultDir {
get { get {
return ((string)(this["ResultDir"])); return ((string)(this["ResultDir"]));
} }
set {
this["ResultDir"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\ANSWERS")] [global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\ANSWERS")]
public string AnswerDir { public string AnswerDir {
get { get {
return ((string)(this["AnswerDir"])); return ((string)(this["AnswerDir"]));
} }
set {
this["AnswerDir"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\ANSWERS_DONE")] [global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\ANSWERS_DONE")]
public string AnswerArchiveDir { public string AnswerArchiveDir {
get { get {
return ((string)(this["AnswerArchiveDir"])); return ((string)(this["AnswerArchiveDir"]));
} }
set {
this["AnswerArchiveDir"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\ANSWERS_CORRUPT")] [global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\Transmitter-Tool\\ANSWERS_CORRUPT")]
public string AnswerCorruptDir { public string AnswerCorruptDir {
get { get {
return ((string)(this["AnswerCorruptDir"])); return ((string)(this["AnswerCorruptDir"]));
} }
set {
this["AnswerCorruptDir"] = value;
}
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\")] [global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\")]
public string TransmitterRoot { public string TransmitterRoot {
get { get {
return ((string)(this["TransmitterRoot"])); return ((string)(this["TransmitterRoot"]));
} }
set {
this["TransmitterRoot"] = value;
}
} }
} }
} }

View File

@ -2,28 +2,28 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="bsmd.hisnord.Properties" GeneratedClassName="Settings"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="bsmd.hisnord.Properties" GeneratedClassName="Settings">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="BatchTimeoutMins" Type="System.Int32" Scope="User"> <Setting Name="BatchTimeoutMins" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">1</Value> <Value Profile="(Default)">1</Value>
</Setting> </Setting>
<Setting Name="OutputDir" Type="System.String" Scope="User"> <Setting Name="OutputDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\IMP</Value> <Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\IMP</Value>
</Setting> </Setting>
<Setting Name="Transmitter" Type="System.String" Scope="User"> <Setting Name="Transmitter" Type="System.String" Scope="Application">
<Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\client.bat</Value> <Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\client.bat</Value>
</Setting> </Setting>
<Setting Name="ResultDir" Type="System.String" Scope="User"> <Setting Name="ResultDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\RESULTS</Value> <Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\RESULTS</Value>
</Setting> </Setting>
<Setting Name="AnswerDir" Type="System.String" Scope="User"> <Setting Name="AnswerDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\ANSWERS</Value> <Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\ANSWERS</Value>
</Setting> </Setting>
<Setting Name="AnswerArchiveDir" Type="System.String" Scope="User"> <Setting Name="AnswerArchiveDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\ANSWERS_DONE</Value> <Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\ANSWERS_DONE</Value>
</Setting> </Setting>
<Setting Name="AnswerCorruptDir" Type="System.String" Scope="User"> <Setting Name="AnswerCorruptDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\ANSWERS_CORRUPT</Value> <Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\ANSWERS_CORRUPT</Value>
</Setting> </Setting>
<Setting Name="TransmitterRoot" Type="System.String" Scope="User"> <Setting Name="TransmitterRoot" Type="System.String" Scope="Application">
<Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\</Value> <Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\</Value>
</Setting> </Setting>
</Settings> </Settings>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="bsmd.hisnord.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> <section name="bsmd.hisnord.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<userSettings> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup><applicationSettings>
<bsmd.hisnord.Properties.Settings> <bsmd.hisnord.Properties.Settings>
<setting name="BatchTimeoutMins" serializeAs="String"> <setting name="BatchTimeoutMins" serializeAs="String">
<value>1</value> <value>1</value>
@ -32,5 +32,5 @@
<value>E:\svnlager\BSMD\nsw\HIS-NORD\</value> <value>E:\svnlager\BSMD\nsw\HIS-NORD\</value>
</setting> </setting>
</bsmd.hisnord.Properties.Settings> </bsmd.hisnord.Properties.Settings>
</userSettings> </applicationSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration> </configuration>

View File

@ -15,8 +15,8 @@ namespace bsmd.status
public class Status public class Status
{ {
private static ILog _log = LogManager.GetLogger(typeof(bsmd.status.Status)); private static readonly ILog _log = LogManager.GetLogger(typeof(bsmd.status.Status));
private MessageCore _queryCore; private readonly MessageCore _queryCore;
public Status(MessageCore core2Query) { _queryCore = core2Query; } public Status(MessageCore core2Query) { _queryCore = core2Query; }
@ -73,12 +73,12 @@ namespace bsmd.status
{ {
// three-way bool! // three-way bool!
if (result.NswResponse.Cancelled != null) if (result.NswResponse.Cancelled != null)
_queryCore.Cancelled = result.NswResponse.Equals("Y") ? true : false; _queryCore.Cancelled = result.NswResponse.Equals("Y");
else else
_queryCore.Cancelled = null; _queryCore.Cancelled = null;
if (result.NswResponse.VisitIdOrTransitIdCancellable != null) if (result.NswResponse.VisitIdOrTransitIdCancellable != null)
_queryCore.VisitIdOrTransitIdCancellable = result.NswResponse.VisitIdOrTransitIdCancellable.Equals("Y") ? true : false; _queryCore.VisitIdOrTransitIdCancellable = result.NswResponse.VisitIdOrTransitIdCancellable.Equals("Y");
else else
_queryCore.VisitIdOrTransitIdCancellable = null; _queryCore.VisitIdOrTransitIdCancellable = null;

View File

@ -12,7 +12,7 @@ namespace bsmd.status
[Serializable] [Serializable]
public class dataset public class dataset
{ {
private static ILog _log = LogManager.GetLogger(typeof(bsmd.status.dataset)); private static readonly ILog _log = LogManager.GetLogger(typeof(bsmd.status.dataset));
/// <summary> /// <summary>
/// this class needs a public empty constructor for deserialization /// this class needs a public empty constructor for deserialization