viele Bugfixes nach Test der DBH Schnittstelle
This commit is contained in:
parent
133c2e6bcc
commit
7bfa85e96d
@ -84,7 +84,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManifestCertificateThumbprint>94D98790E3B6C4CC9F4B57C8FD305E3225894DF8</ManifestCertificateThumbprint>
|
<ManifestCertificateThumbprint>F2C2D0164244EC89955EF50201EE24C2A300FF0B</ManifestCertificateThumbprint>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SignManifests>true</SignManifests>
|
<SignManifests>true</SignManifests>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<UseIISExpress>true</UseIISExpress>
|
<UseIISExpress>true</UseIISExpress>
|
||||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||||
<Use64BitIISExpress />
|
<Use64BitIISExpress />
|
||||||
<IISExpressSSLPort />
|
<IISExpressSSLPort />
|
||||||
<IISExpressAnonymousAuthentication />
|
<IISExpressAnonymousAuthentication />
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace bsmd.dakosy
|
|||||||
string localDir = Properties.Settings.Default.SFTPInDir;
|
string localDir = Properties.Settings.Default.SFTPInDir;
|
||||||
string remoteDir = Properties.Settings.Default.RemoteOutgoingDir;
|
string remoteDir = Properties.Settings.Default.RemoteOutgoingDir;
|
||||||
|
|
||||||
SFtp.TransmitAll(remoteDir, localDir, SFtp.Direction.INCOMING);
|
SFtp.TransmitAll(remoteDir, localDir, SFtp.Direction.INCOMING, Properties.Settings.Default.SFTPSessionName);
|
||||||
|
|
||||||
// lokale Dateien verarbeiten
|
// lokale Dateien verarbeiten
|
||||||
foreach (string inputFile in Directory.GetFiles(localDir))
|
foreach (string inputFile in Directory.GetFiles(localDir))
|
||||||
|
|||||||
@ -101,7 +101,7 @@ namespace bsmd.dakosy
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TransmitAll(string remoteDir, string localDir, Direction direction)
|
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;
|
||||||
@ -109,13 +109,14 @@ 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 " + localDir);
|
winscp.StandardInput.WriteLine("lcd " + localDir);
|
||||||
// winscp.StandardInput.WriteLine("ls");
|
// winscp.StandardInput.WriteLine("ls");
|
||||||
if (remoteDir != null)
|
if (remoteDir != null)
|
||||||
@ -124,6 +125,9 @@ namespace bsmd.dakosy
|
|||||||
winscp.StandardInput.WriteLine("get *.xml");
|
winscp.StandardInput.WriteLine("get *.xml");
|
||||||
if(direction == Direction.OUTGOING)
|
if(direction == Direction.OUTGOING)
|
||||||
winscp.StandardInput.WriteLine("put *.xml");
|
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
|
// Collect all output
|
||||||
|
|||||||
@ -1620,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)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -48,8 +48,10 @@ namespace bsmd.dbh
|
|||||||
|
|
||||||
if (messageFile != null)
|
if (messageFile != null)
|
||||||
{
|
{
|
||||||
|
string onlyFileName = Path.GetFileName(messageFile);
|
||||||
|
string moveTarget = Path.Combine(Properties.Settings.Default.OutgoingFolder, onlyFileName);
|
||||||
// move file to output directory
|
// move file to output directory
|
||||||
File.Move(messageFile, Properties.Settings.Default.OutgoingFolder);
|
File.Move(messageFile, moveTarget);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -74,17 +76,19 @@ namespace bsmd.dbh
|
|||||||
public static void SendAndReceive()
|
public static void SendAndReceive()
|
||||||
{
|
{
|
||||||
// sent unsent messages in output folder
|
// sent unsent messages in output folder
|
||||||
bsmd.dakosy.SFtp.TransmitAll(Properties.Settings.Default.RemoteIncomingFolder, Properties.Settings.Default.OutgoingFolder, dakosy.SFtp.Direction.OUTGOING);
|
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
|
// move files from output folder to archive folder
|
||||||
foreach(string sentFile in Directory.GetFiles(Properties.Settings.Default.OutgoingFolder))
|
foreach(string sentFile in Directory.GetFiles(Properties.Settings.Default.OutgoingFolder))
|
||||||
{
|
{
|
||||||
_log.InfoFormat("sent {0}", sentFile);
|
_log.InfoFormat("sent {0}", sentFile);
|
||||||
File.Move(sentFile, Properties.Settings.Default.OutgoingArchiveFolder);
|
string onlyFileName = Path.GetFileName(sentFile);
|
||||||
|
string moveTarget = Path.Combine(Properties.Settings.Default.OutgoingArchiveFolder, onlyFileName);
|
||||||
|
File.Move(sentFile, moveTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
// receive files from remote host
|
// receive files from remote host
|
||||||
// SFTP verbindung öffnen und alle Dateien herunterladen
|
// SFTP verbindung öffnen und alle Dateien herunterladen
|
||||||
bsmd.dakosy.SFtp.TransmitAll(Properties.Settings.Default.RemoteOutgoingFolder, Properties.Settings.Default.IncomingFolder, dakosy.SFtp.Direction.INCOMING);
|
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))
|
foreach (string inputFile in Directory.GetFiles(Properties.Settings.Default.IncomingFolder))
|
||||||
{
|
{
|
||||||
|
|||||||
8
bsmd.dbh/Properties/Settings.Designer.cs
generated
8
bsmd.dbh/Properties/Settings.Designer.cs
generated
@ -34,7 +34,7 @@ namespace bsmd.dbh.Properties {
|
|||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dbh\\out")]
|
||||||
public string OutgoingFolder {
|
public string OutgoingFolder {
|
||||||
get {
|
get {
|
||||||
return ((string)(this["OutgoingFolder"]));
|
return ((string)(this["OutgoingFolder"]));
|
||||||
@ -43,7 +43,7 @@ namespace bsmd.dbh.Properties {
|
|||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dbh\\out_archive")]
|
||||||
public string OutgoingArchiveFolder {
|
public string OutgoingArchiveFolder {
|
||||||
get {
|
get {
|
||||||
return ((string)(this["OutgoingArchiveFolder"]));
|
return ((string)(this["OutgoingArchiveFolder"]));
|
||||||
@ -52,7 +52,7 @@ namespace bsmd.dbh.Properties {
|
|||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dbh\\in")]
|
||||||
public string IncomingFolder {
|
public string IncomingFolder {
|
||||||
get {
|
get {
|
||||||
return ((string)(this["IncomingFolder"]));
|
return ((string)(this["IncomingFolder"]));
|
||||||
@ -61,7 +61,7 @@ namespace bsmd.dbh.Properties {
|
|||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dbh\\in_archive")]
|
||||||
public string IncomingArchiveFolder {
|
public string IncomingArchiveFolder {
|
||||||
get {
|
get {
|
||||||
return ((string)(this["IncomingArchiveFolder"]));
|
return ((string)(this["IncomingArchiveFolder"]));
|
||||||
|
|||||||
@ -6,16 +6,16 @@
|
|||||||
<Value Profile="(Default)">00003050</Value>
|
<Value Profile="(Default)">00003050</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="OutgoingFolder" Type="System.String" Scope="Application">
|
<Setting Name="OutgoingFolder" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)" />
|
<Value Profile="(Default)">e:\temp\dbh\out</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="OutgoingArchiveFolder" Type="System.String" Scope="Application">
|
<Setting Name="OutgoingArchiveFolder" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)" />
|
<Value Profile="(Default)">e:\temp\dbh\out_archive</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="IncomingFolder" Type="System.String" Scope="Application">
|
<Setting Name="IncomingFolder" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)" />
|
<Value Profile="(Default)">e:\temp\dbh\in</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="IncomingArchiveFolder" Type="System.String" Scope="Application">
|
<Setting Name="IncomingArchiveFolder" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)" />
|
<Value Profile="(Default)">e:\temp\dbh\in_archive</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="RemoteIncomingFolder" Type="System.String" Scope="Application">
|
<Setting Name="RemoteIncomingFolder" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">test/bsmd_2_dbh</Value>
|
<Value Profile="(Default)">test/bsmd_2_dbh</Value>
|
||||||
|
|||||||
@ -1649,7 +1649,7 @@ namespace bsmd.dbh
|
|||||||
serializer.Serialize(tw, root);
|
serializer.Serialize(tw, root);
|
||||||
}
|
}
|
||||||
|
|
||||||
return filename;
|
return filePath;
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -11,16 +11,16 @@
|
|||||||
<value>00003050</value>
|
<value>00003050</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="OutgoingFolder" serializeAs="String">
|
<setting name="OutgoingFolder" serializeAs="String">
|
||||||
<value />
|
<value>e:\temp\dbh\out</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="OutgoingArchiveFolder" serializeAs="String">
|
<setting name="OutgoingArchiveFolder" serializeAs="String">
|
||||||
<value />
|
<value>e:\temp\dbh\out_archive</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="IncomingFolder" serializeAs="String">
|
<setting name="IncomingFolder" serializeAs="String">
|
||||||
<value />
|
<value>e:\temp\dbh\in</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="IncomingArchiveFolder" serializeAs="String">
|
<setting name="IncomingArchiveFolder" serializeAs="String">
|
||||||
<value />
|
<value>e:\temp\dbh\in_archive</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="RemoteIncomingFolder" serializeAs="String">
|
<setting name="RemoteIncomingFolder" serializeAs="String">
|
||||||
<value>test/bsmd_2_dbh</value>
|
<value>test/bsmd_2_dbh</value>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user