Update vor Import Gitea

This commit is contained in:
2021-12-23 09:13:44 +01:00
parent 56bd02798f
commit 609bd2b3f6
72 changed files with 1687 additions and 700 deletions

View File

@@ -38,6 +38,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />

View File

@@ -25,6 +25,18 @@
<setting name="WaitAfterStart" serializeAs="String">
<value>1000</value>
</setting>
<setting name="LogonTry" serializeAs="String">
<value>3</value>
</setting>
<setting name="DDESleep" serializeAs="String">
<value>200</value>
</setting>
<setting name="UseShellExecute" serializeAs="String">
<value>false</value>
</setting>
<setting name="DDETimeout" serializeAs="String">
<value>1500</value>
</setting>
</ARSDDE.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.VisualBasic;
using NDde.Client;
@@ -27,11 +28,12 @@ namespace ARSDDE
static string ARS_AuftragNr;
static string ARS_Belegart;
static DdeClient Client;
static string DebugFilename;
// static DdeClient Client = new DdeClient("ARS", "ARS");
static void Main(string[] args)
{
DebugFilename = @"h:\arsdebug_" + DateTime.Now.ToString("yyyyddMMhhmmsshs") + ".txt";
Debug = Properties.Settings.Default.Debug;
Debug =Debug.ToLower();
@@ -53,34 +55,53 @@ namespace ARSDDE
Debug_Print(String.Format("ARS_Belegart: {0}", ARS_Belegart));
}
Debug_Print("Start");
Call_OnDemand("Start");
Client = new DdeClient(Properties.Settings.Default.OnDemandClinetString, Properties.Settings.Default.OnDemandClinetString);
Client.Connect();
try
{
Debug_Print("Start");
Call_OnDemand("Start");
Client = new DdeClient(Properties.Settings.Default.OnDemandClinetString, Properties.Settings.Default.OnDemandClinetString);
try
{
Client.Connect();
if (Client.IsConnected==false)
{
MessageBox.Show("Client konnte nicht verbunden werden");
}
}
catch (NDde.DdeException e)
{
MessageBox.Show(e.Message);
};
if (Client == null)
{
MessageBox.Show("Client konnte nicht alloziert werden");
}
Debug_Print("Logon");
Call_OnDemand("Logon");
Debug_Print("Open_Folder");
Call_OnDemand("Open_Folder");
Debug_Print("Set_FieldData");
Call_OnDemand("Set_FieldData");
Debug_Print("Search_Folder");
Call_OnDemand("Search_Folder");
Debug_Print("Show_Doc");
Call_OnDemand("Show_Doc");
Debug_Print("Logoff");
Call_OnDemand("Logoff");
if (Debug == "true") { Console.ReadLine(); }
}
Call_OnDemand("Logon");
Call_OnDemand("Open_Folder");
Call_OnDemand("Set_FieldData");
Call_OnDemand("Search_Folder");
Call_OnDemand("Show_Doc");
Call_OnDemand("Logoff");
if (Debug == "true") { Console.ReadLine(); }
}
catch (Exception mainex)
{
MessageBox.Show("Fehler: " + mainex.Message);
}
}
static void Debug_Print(string s)
{
if (Debug == "true")
{
using (StreamWriter w = File.AppendText(@"h:\arsddedebug.txt"))
//string filename;
using (StreamWriter w = File.AppendText(DebugFilename))
{
w.WriteLine(s);
w.Close();
}
};
if (Debug=="true")
@@ -102,89 +123,69 @@ namespace ARSDDE
psi.WorkingDirectory = Path.GetDirectoryName(ARS_Application);
psi.Arguments= "/1 " + ARS_Language + " /S " + ARS_System + " /U " + ARS_User + " /P " + ARS_Password + " /I /B /V /T EDOKA COLD-Dokumentanzeige " + " /Z /Q /Y /O 1 /X";
psi.Arguments = "/1 " + ARS_Language + " /S " + ARS_System + " /I /B /V /T EDOKA COLD-Dokumentanzeige " + " /Z /Q /Y /O 1 /X";
Debug_Print(ARS_Application + " /1 " + ARS_Language + " /S " + ARS_System + " /U " + ARS_User + " /P " + ARS_Password + " /I /B /V /T EDOKA COLD-Dokumentanzeige " + " /Z /Q /Y /O 1 /X ");
psi.WindowStyle = ProcessWindowStyle.Maximized;
psi.UseShellExecute = true;
psi.UseShellExecute = false;
if (Properties.Settings.Default.UseShellExecute.ToLower()== "true")
{
psi.UseShellExecute = true;
}
Process.Start(psi);
// Process.Start(""+ARS_Application+"" + " /1 " + ARS_Language + " /S " + ARS_System + " /U " + ARS_User + " /P " + ARS_Password + " /I /B /V /T EDOKA COLD-Dokumentanzeige " + " /Z /Q /Y /O 1 /X /W N");
System.Threading.Thread.Sleep(Convert.ToInt32(Properties.Settings.Default.WaitAfterStart));
}
break;
case "Logon":
Debug_Print(String.Format("LOGON /S {0} /U {1} /P {2}", ARS_System,ARS_User, ARS_Password));
//Client.Execute(string.Format("LOGON /S Test_System_NOVA /U {0} /P {1}", ARS_User, ARS_Password), 3000);
Client.ExecuteCommand(string.Format("LOGON /S {0} /U {1} /P {2}", ARS_System, ARS_User, ARS_Password));
int logontry;
logontry = 0;
try
{
ExecARS(string.Format("LOGON /S {0} /U {1} /P {2}", ARS_System, ARS_User, ARS_Password));
}
catch (Exception e)
{
logontry = logontry + 1;
if (logontry >= 3) {
throw new System.ArgumentException("3 Loginversuche sind fehlgeschlagen.Bitte erneut versuchen.", "LoginFehler");
}
}
System.Threading.Thread.Sleep(Convert.ToInt32(Properties.Settings.Default.DDESleep));
break;
case "Open_Folder":
// 20201019 - Erweiterung /S /C /R /D -> Buttons ausblenden
Debug_Print(string.Format("OPEN_FOLDER /F {0} /S /C /R /D", ARS_Foler));
//Client.Execute(string.Format("OPEN_FOLDER / F {0})", ARS_Foler), 3000);
Client.ExecuteCommand(string.Format("OPEN_FOLDER /F {0} /S /C /R /D", ARS_Foler));
ExecARS(string.Format("OPEN_FOLDER /F {0} /S /C /R /D", ARS_Foler));
break;
case "Search_Folder":
Debug_Print("SEARCH_FOLDER");
//Client.Execute("SEARCH_FOLDER", 3000);
Client.ExecuteCommand("SEARCH_FOLDER");
ExecARS("SEARCH_FOLDER");
break;
case "Show_Doc":
Client.ExecuteCommand("OPEN_DOC /N 0");
//Client.ExecuteCommand("SHOW_WINDOW /W 0,0,75,100");
ExecARS("OPEN_DOC /N 0");
break;
case "Set_FieldData":
switch (ARS_Foler)
{
case "TGKB Kundenoutput AGI-OMS für EDOKA User":
Debug_Print("TGKB Kundenoutput AGI-OMS für EDOKA User");
Debug_Print(string.Format("SET_FIELD_DATA /F Dokument-Id /1 {0}", ARS_DocID));
//Client.Execute(string.Format("SET_FIELD_DATA /F Dokument-Id /1 {0})", ARS_DocID), 3000);
Client.ExecuteCommand(string.Format("SET_FIELD_DATA /F Dokument-Id /1 {0}", ARS_DocID));
Debug_Print(string.Format("SET_FIELD_DATA /F Erstellung od. Valuta Datum /1 {0} /2 {1} ", FormatDate(ARS_Datum), FormatDate(ARS_Datum)));
//Client.Execute(string.Format("SET_FIELD_DATA / F Erstellung od. Valuta Datum /1 {0} /2 {1} ", FormatDate(ARS_Datum), FormatDate(ARS_Datum)), 3000);
Client.ExecuteCommand(string.Format("SET_FIELD_DATA /F Erstellung od. Valuta Datum /1 {0} /2 {1} ", FormatDate(ARS_Datum), FormatDate(ARS_Datum)));
ExecARS(string.Format("SET_FIELD_DATA /F Dokument-Id /1 {0}", ARS_DocID),0);
ExecARS(string.Format("SET_FIELD_DATA /F Erstellung od. Valuta Datum /1 {0} /2 {1} ", FormatDate(ARS_Datum), FormatDate(ARS_Datum)),0);
ExecARS(string.Format("SET_FIELD_DATA /F Erstellung od. Valuta Datum /1 {0} /2 {1} ", FormatDate(ARS_Datum), FormatDate(ARS_Datum)),0);
break;
case "TGKB Kundenoutput ab 01.08.2008":
Debug_Print("TGKB Kundenoutput ab 01.08.2008");
Debug_Print(string.Format("SET_FIELD_DATA /F Dokumenten-Id /1 {0}", ARS_DocID));
//Client.Execute(string.Format("SET_FIELD_DATA /F Dokument-Id /1 {0})", ARS_DocID), 3000);
Client.ExecuteCommand(string.Format("SET_FIELD_DATA /F Dokumenten-Id /1 {0}", ARS_DocID));
Debug_Print(string.Format("SET_FIELD_DATA /F Erstellung od. Valuta Datum /1 {0} /2 {1} ", FormatDate(ARS_Datum), FormatDate(ARS_Datum)));
Client.ExecuteCommand(string.Format("SET_FIELD_DATA /F Erstellung od. Valuta Datum /1 {0} /2 {1} ", FormatDate(ARS_Datum), FormatDate(ARS_Datum)));
ExecARS(string.Format("SET_FIELD_DATA /F Dokumenten-Id /1 {0}", ARS_DocID),0);
ExecARS(string.Format("SET_FIELD_DATA /F Erstellung od. Valuta Datum /1 {0} /2 {1} ", FormatDate(ARS_Datum), FormatDate(ARS_Datum)),0);
break;
case "TGKB ZV-Scanning Belege (erweiterte Suche)":
Debug_Print(string.Format("SET_FIELD_DATA /F Dokumenttyp /1 {0}", ARS_Doctype));
//Client.Execute(string.Format("SET_FIELD_DATA /F Dokumenttyp /1 {0})", ARS_Doctype), 3000);
Client.ExecuteCommand(string.Format("SET_FIELD_DATA /F Dokumenttyp /1 {0}", ARS_Doctype));
Debug_Print(string.Format("SET_FIELD_DATA /F Auftrag-Nr. /1 {0}", ARS_AuftragNr));
//Client.Execute(string.Format("SET_FIELD_DATA /F Auftrag-Nr. /1 {0})", ARS_AuftragNr), 3000);
Client.ExecuteCommand(string.Format("SET_FIELD_DATA /F Auftrag-Nr. /1 {0}", ARS_AuftragNr));
Debug_Print(string.Format("SET_FIELD_DATA /F Paginator /1 {0}", ARS_DocID));
//Client.Execute(string.Format("SET_FIELD_DATA /F Paginator /1 {0})", ARS_DocID), 3000);
Client.ExecuteCommand(string.Format("SET_FIELD_DATA /F Paginator /1 {0}", ARS_DocID));
Client.ExecuteCommand(string.Format("SET_FIELD_DATA /F Valuta od. Archiv Datum /1 {0} /2 {1}", "",""));
ExecARS(string.Format("SET_FIELD_DATA /F Dokumenttyp /1 {0}", ARS_Doctype),0);
ExecARS(string.Format("SET_FIELD_DATA /F Auftrag-Nr. /1 {0}", ARS_AuftragNr),0);
ExecARS(string.Format("SET_FIELD_DATA /F Paginator /1 {0}", ARS_DocID),0);
ExecARS(string.Format("SET_FIELD_DATA /F Valuta od. Archiv Datum /1 {0} /2 {1}", "",""),0);
break;
default:
Debug_Print(string.Format("SET_FIELD_DATA /F Dokument-Id /1 {0}", ARS_DocID));
//Client.Execute(string.Format("SET_FIELD_DATA /F Dokument-Id /1 {0})", ARS_DocID), 3000);
Client.ExecuteCommand(string.Format("SET_FIELD_DATA /F Dokument-Id /1 {0}", ARS_DocID));
ExecARS(string.Format("SET_FIELD_DATA /F Dokument-Id /1 {0}", ARS_DocID),0);
break;
}
break;
case "Logoff":
//ExecARS("Logoff");
//Client.Execute("LOGOFF",3000);
//Client.ExecuteCommand("LOGOFF");
break;
@@ -193,6 +194,19 @@ namespace ARSDDE
}
}
static void ExecARS(string Params, int DoTimeout=1)
{
Debug_Print(Params);
Client.ExecuteCommand(Params);
//int i;
//i=Client.TryExecute(Params, Convert.ToInt32(Properties.Settings.Default.DDETimeout));
//MessageBox.Show(Convert.ToString(i));
if (DoTimeout==1)
{
System.Threading.Thread.Sleep(Convert.ToInt32(Properties.Settings.Default.DDESleep));
}
}
static string FormatDate(string datum)
{
string dd;

View File

@@ -12,7 +12,7 @@ namespace ARSDDE.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -82,5 +82,53 @@ namespace ARSDDE.Properties {
this["WaitAfterStart"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("3")]
public string LogonTry {
get {
return ((string)(this["LogonTry"]));
}
set {
this["LogonTry"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("200")]
public string DDESleep {
get {
return ((string)(this["DDESleep"]));
}
set {
this["DDESleep"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("false")]
public string UseShellExecute {
get {
return ((string)(this["UseShellExecute"]));
}
set {
this["UseShellExecute"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1500")]
public string DDETimeout {
get {
return ((string)(this["DDETimeout"]));
}
set {
this["DDETimeout"] = value;
}
}
}
}

View File

@@ -17,5 +17,17 @@
<Setting Name="WaitAfterStart" Type="System.String" Scope="User">
<Value Profile="(Default)">1000</Value>
</Setting>
<Setting Name="LogonTry" Type="System.String" Scope="User">
<Value Profile="(Default)">3</Value>
</Setting>
<Setting Name="DDESleep" Type="System.String" Scope="User">
<Value Profile="(Default)">200</Value>
</Setting>
<Setting Name="UseShellExecute" Type="System.String" Scope="User">
<Value Profile="(Default)">false</Value>
</Setting>
<Setting Name="DDETimeout" Type="System.String" Scope="User">
<Value Profile="(Default)">1500</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -25,6 +25,18 @@
<setting name="WaitAfterStart" serializeAs="String">
<value>1000</value>
</setting>
<setting name="LogonTry" serializeAs="String">
<value>3</value>
</setting>
<setting name="DDESleep" serializeAs="String">
<value>200</value>
</setting>
<setting name="UseShellExecute" serializeAs="String">
<value>false</value>
</setting>
<setting name="DDETimeout" serializeAs="String">
<value>1500</value>
</setting>
</ARSDDE.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -1 +1 @@
44b08d7bf43be774c311a044a1c686ff613aa9da
04e3427731c69fd65ebee69d452207c09cd73b17

View File

@@ -7,3 +7,12 @@ E:\Software-Projekte\_Demos\DDE\OnDemandDDE\ARSDDE\obj\Debug\ARSDDE.csproj.CopyC
E:\Software-Projekte\_Demos\DDE\OnDemandDDE\ARSDDE\obj\Debug\ARSDDE.exe
E:\Software-Projekte\_Demos\DDE\OnDemandDDE\ARSDDE\obj\Debug\ARSDDE.pdb
E:\Software-Projekte\_Demos\DDE\OnDemandDDE\ARSDDE\obj\Debug\ARSDDE.csprojAssemblyReference.cache
E:\Software-Projekte\EDOKA\tools\OnDemandDDE\ARSDDE\obj\Debug\ARSDDE.csproj.CoreCompileInputs.cache
E:\Software-Projekte\EDOKA\tools\OnDemandDDE\ARSDDE\obj\Debug\ARSDDE.exe
E:\Software-Projekte\EDOKA\tools\OnDemandDDE\ARSDDE\obj\Debug\ARSDDE.pdb
E:\Software-Projekte\EDOKA\tools\OnDemandDDE\ARSDDE\bin\Debug\ARSDDE.exe.config
E:\Software-Projekte\EDOKA\tools\OnDemandDDE\ARSDDE\bin\Debug\ARSDDE.exe
E:\Software-Projekte\EDOKA\tools\OnDemandDDE\ARSDDE\bin\Debug\ARSDDE.pdb
E:\Software-Projekte\EDOKA\tools\OnDemandDDE\ARSDDE\bin\Debug\NDde.dll
E:\Software-Projekte\EDOKA\tools\OnDemandDDE\ARSDDE\obj\Debug\ARSDDE.csproj.CopyComplete
E:\Software-Projekte\EDOKA\tools\OnDemandDDE\ARSDDE\obj\Debug\ARSDDE.csprojAssemblyReference.cache