update 20250111

This commit is contained in:
Stefan Hutter
2025-01-11 18:28:18 +01:00
parent bd4598e4a8
commit 11b4f840f0
150 changed files with 3091 additions and 390 deletions

View File

@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
@@ -47,10 +48,10 @@ namespace OnDoc.Klassen
public string name { get; set; }
public string value { get; set; }
public EDK_Dokumentwerte (string name, string value)
public EDK_Dokumentwerte(string name, string value)
{
this.name=name;
this.value=value;
this.name = name;
this.value = value;
}
}
@@ -64,13 +65,13 @@ namespace OnDoc.Klassen
public static bool toexecute { get; set; }
public static string verantwortlich { get; set; }
public static string unterschrift_links { get; set; }
public static string unterschrift_rechts{get;set;}
public static string unterschrift_rechts { get; set; }
public static string AnzeigePartnernr { get; set; }
public static List<EDK_Parameters> parameters { get; set; }
public static List<EDK_Dokumentwerte> dokumentwerte { get; set; }
public static void Load_EDK_File(string filename)
@@ -103,52 +104,66 @@ namespace OnDoc.Klassen
break;
case EDK_ActionType.DokumentErstellung:
creatortg = doc.SelectSingleNode("action/creatorTg").InnerText;
source = doc.SelectSingleNode("action/sourceApplication").InnerText;
verantwortlich = doc.SelectSingleNode("action/Verantwortlich").InnerText;
unterschrift_links = doc.SelectSingleNode("action/uslinks").InnerText;
unterschrift_rechts = doc.SelectSingleNode("action/usrechts").InnerText;
XmlElement RootNode = doc.DocumentElement;
XmlNodeList nodeList = RootNode.ChildNodes;
XmlNodeList dokwerte = RootNode.LastChild.ChildNodes;
List<EDK_Parameters> Params = new List<EDK_Parameters>();
List<EDK_Dokumentwerte> Dokwerte = new List<EDK_Dokumentwerte>();
if (nodeList.Count > 0)
{
string value;
string name;
var loopTo = nodeList.Count - 1;
for (int i = 0; i < nodeList.Count - 1; i++)
creatortg = doc.SelectSingleNode("action/creatorTg").InnerText;
source = doc.SelectSingleNode("action/sourceApplication").InnerText;
verantwortlich = "";
try
{
value = nodeList.Item(i).InnerText;
name = nodeList.Item(i).LocalName;
Params.Add(new EDK_Parameters(name, value));
verantwortlich = doc.SelectSingleNode("action/Verantwortlich").InnerText;
}
}
parameters = Params;
catch { }
unterschrift_links = "";
unterschrift_rechts = "";
try { unterschrift_links = doc.SelectSingleNode("action/uslinks").InnerText; } catch { }
try { unterschrift_rechts = doc.SelectSingleNode("action/usrechts").InnerText; } catch { }
if (dokwerte.Count > 0)
{
for (int i = 0; i < dokwerte.Count - 1; i++)
XmlElement RootNode = doc.DocumentElement;
XmlNodeList nodeList = RootNode.ChildNodes;
XmlNodeList dokwerte = RootNode.LastChild.ChildNodes;
List<EDK_Parameters> Params = new List<EDK_Parameters>();
List<EDK_Dokumentwerte> Dokwerte = new List<EDK_Dokumentwerte>();
if (nodeList.Count > 0)
{
XmlNodeList XNode = dokwerte[i].ChildNodes;
string value;
string name;
try { value = XNode[1].InnerText; } catch { value = ""; }
try { name = XNode[0].InnerText; } catch { name = ""; }
Dokwerte.Add(new EDK_Dokumentwerte(name, value));
var loopTo = nodeList.Count - 1;
for (int i = 0; i < nodeList.Count - 1; i++)
{
value = nodeList.Item(i).InnerText;
name = nodeList.Item(i).LocalName;
Params.Add(new EDK_Parameters(name, value));
}
}
dokumentwerte = Dokwerte;
parameters = Params;
if (parameters.Count > 0)
if (dokwerte.Count > 0)
{
executed = false;
toexecute = true;
}
for (int i = 0; i < dokwerte.Count - 1; i++)
{
XmlNodeList XNode = dokwerte[i].ChildNodes;
string value;
string name;
try { value = XNode[1].InnerText; } catch { value = ""; }
try { name = XNode[0].InnerText; } catch { name = ""; }
Dokwerte.Add(new EDK_Dokumentwerte(name, value));
}
dokumentwerte = Dokwerte;
}
if (parameters.Count > 0)
{
executed = false;
toexecute = true;
} else
{
executed = false;
toexecute = true;
}
}
executed = false;
toexecute = true;
break;
default:
System.IO.File.Delete(filename);
@@ -159,20 +174,25 @@ namespace OnDoc.Klassen
public static string GetAVQ_Value(string name, string techname)
{
for (int i = 0; i < dokumentwerte.Count; i++)
try
{
EDK_Dokumentwerte d = dokumentwerte[i];
if (dokumentwerte[i].name == name || dokumentwerte[i].name == techname)
for (int i = 0; i < dokumentwerte.Count; i++)
{
return dokumentwerte[i].value;
EDK_Dokumentwerte d = dokumentwerte[i];
if (dokumentwerte[i].name == name || dokumentwerte[i].name == techname)
{
return dokumentwerte[i].value;
}
}
return "";
}
return "";
catch { return ""; }
}
public static string GetAVQ_Parameter(string name)
{
for (int i = 0; i < parameters.Count; i++) {
for (int i = 0; i < parameters.Count; i++)
{
if (parameters[i].name.ToUpper() == name.ToUpper())
{
return parameters[i].value;

468
Client/Klassen/inputBox.cs Normal file
View File

@@ -0,0 +1,468 @@
/*
* Author: Tony Brix, http://tonybrix.info
* License: MIT
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
public enum InputBoxButtons
{
OK,
OKCancel,
YesNo,
YesNoCancel,
Save,
SaveCancel
}
public enum InputBoxResult
{
Cancel,
OK,
Yes,
No,
Save
}
public struct InputBoxItem
{
public string Label;
public string Text;
public bool IsPassword;
public InputBoxItem(string label)
{
Label = label;
Text = "";
IsPassword = false;
}
public InputBoxItem(string label, string text)
{
Label = label;
Text = text;
IsPassword = false;
}
public InputBoxItem(string label, bool isPassword)
{
Label = label;
Text = "";
IsPassword = isPassword;
}
public InputBoxItem(string label, string text, bool isPassword)
{
Label = label;
Text = text;
IsPassword = isPassword;
}
}
//public struct InputBoxOptions
//{
// public bool ShowCloseButton = true;
//}
public class InputBox
{
private Dictionary<string, string> items;
private InputBoxResult result;
private InputBox(dialogForm dialog)
{
result = dialog.InputResult;
items = new Dictionary<string, string>();
for (int i = 0; i < dialog.label.Length; i++)
{
items.Add(dialog.label[i].Text, dialog.textBox[i].Text);
}
}
public static InputBox Show(string title, string label)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { new InputBoxItem(label) }, InputBoxButtons.OK);
dialog.ShowDialog();
return new InputBox(dialog);
}
public static InputBox Show(string title, string label, InputBoxButtons buttons)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { new InputBoxItem(label) }, buttons);
dialog.ShowDialog();
return new InputBox(dialog);
}
public static InputBox Show(string title, string label, string text)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { new InputBoxItem(label, text) }, InputBoxButtons.OK);
dialog.ShowDialog();
return new InputBox(dialog);
}
public static InputBox Show(string title, string label, string text, InputBoxButtons buttons)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { new InputBoxItem(label, text) }, buttons);
dialog.ShowDialog();
return new InputBox(dialog);
}
public static InputBox Show(string title, string[] labels)
{
InputBoxItem[] items = new InputBoxItem[labels.Length];
for (int i = 0; i < labels.Length; i++)
{
items[i] = new InputBoxItem(labels[i]);
}
dialogForm dialog = new dialogForm(title, items, InputBoxButtons.OK);
dialog.ShowDialog();
return new InputBox(dialog);
}
public static InputBox Show(string title, string[] labels, InputBoxButtons buttons)
{
InputBoxItem[] items = new InputBoxItem[labels.Length];
for (int i = 0; i < labels.Length; i++)
{
items[i] = new InputBoxItem(labels[i]);
}
dialogForm dialog = new dialogForm(title, items, buttons);
dialog.ShowDialog();
return new InputBox(dialog);
}
public static InputBox Show(string title, InputBoxItem item)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { item }, InputBoxButtons.OK);
dialog.ShowDialog();
return new InputBox(dialog);
}
public static InputBox Show(string title, InputBoxItem item, InputBoxButtons buttons)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { item }, buttons);
dialog.ShowDialog();
return new InputBox(dialog);
}
public static InputBox Show(string title, InputBoxItem[] items)
{
dialogForm dialog = new dialogForm(title, items, InputBoxButtons.OK);
dialog.ShowDialog();
return new InputBox(dialog);
}
public static InputBox Show(string title, InputBoxItem[] items, InputBoxButtons buttons)
{
dialogForm dialog = new dialogForm(title, items, buttons);
dialog.ShowDialog();
return new InputBox(dialog);
}
public static InputBox Show(IWin32Window window, string title, string label)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { new InputBoxItem(label) }, InputBoxButtons.OK);
dialog.ShowDialog(window);
return new InputBox(dialog);
}
public static InputBox Show(IWin32Window window, string title, string label, InputBoxButtons buttons)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { new InputBoxItem(label) }, buttons);
dialog.ShowDialog(window);
return new InputBox(dialog);
}
public static InputBox Show(IWin32Window window, string title, string label, string text)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { new InputBoxItem(label, text) }, InputBoxButtons.OK);
dialog.ShowDialog(window);
return new InputBox(dialog);
}
public static InputBox Show(IWin32Window window, string title, string label, string text, InputBoxButtons buttons)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { new InputBoxItem(label, text) }, buttons);
dialog.ShowDialog(window);
return new InputBox(dialog);
}
public static InputBox Show(IWin32Window window, string title, string[] labels)
{
InputBoxItem[] items = new InputBoxItem[labels.Length];
for (int i = 0; i < labels.Length; i++)
{
items[i] = new InputBoxItem(labels[i]);
}
dialogForm dialog = new dialogForm(title, items, InputBoxButtons.OK);
dialog.ShowDialog(window);
return new InputBox(dialog);
}
public static InputBox Show(IWin32Window window, string title, string[] labels, InputBoxButtons buttons)
{
InputBoxItem[] items = new InputBoxItem[labels.Length];
for (int i = 0; i < labels.Length; i++)
{
items[i] = new InputBoxItem(labels[i]);
}
dialogForm dialog = new dialogForm(title, items, buttons);
dialog.ShowDialog(window);
return new InputBox(dialog);
}
public static InputBox Show(IWin32Window window, string title, InputBoxItem item)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { item }, InputBoxButtons.OK);
dialog.ShowDialog(window);
return new InputBox(dialog);
}
public static InputBox Show(IWin32Window window, string title, InputBoxItem item, InputBoxButtons buttons)
{
dialogForm dialog = new dialogForm(title, new InputBoxItem[] { item }, buttons);
dialog.ShowDialog(window);
return new InputBox(dialog);
}
public static InputBox Show(IWin32Window window, string title, InputBoxItem[] items)
{
dialogForm dialog = new dialogForm(title, items, InputBoxButtons.OK);
dialog.ShowDialog(window);
return new InputBox(dialog);
}
public static InputBox Show(IWin32Window window, string title, InputBoxItem[] items, InputBoxButtons buttons)
{
dialogForm dialog = new dialogForm(title, items, buttons);
dialog.ShowDialog(window);
return new InputBox(dialog);
}
public Dictionary<string, string> Items
{
get { return items; }
}
public InputBoxResult Result
{
get { return result; }
}
private class dialogForm : Form
{
private InputBoxResult inputResult = InputBoxResult.Cancel;
public TextBox[] textBox;
public Label[] label;
private Button button1;
private Button button2;
private Button button3;
public InputBoxResult InputResult
{
get { return inputResult; }
}
public dialogForm(string title, InputBoxItem[] items, InputBoxButtons buttons)
{
int minWidth = 312;
label = new Label[items.Length];
for (int i = 0; i < label.Length; i++)
{
label[i] = new Label();
}
textBox = new TextBox[items.Length];
for (int i = 0; i < textBox.Length; i++)
{
textBox[i] = new TextBox();
}
button2 = new Button();
button3 = new Button();
button1 = new Button();
SuspendLayout();
//
// label
//
for (int i = 0; i < items.Length; i++)
{
label[i].AutoSize = true;
label[i].Location = new Point(12, 9 + (i * 39));
label[i].Name = "label[" + i + "]";
label[i].Text = items[i].Label;
if (label[i].Width > minWidth)
{
minWidth = label[i].Width;
}
}
//
// textBox
//
for (int i = 0; i < items.Length; i++)
{
textBox[i].Anchor = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
textBox[i].Location = new Point(12, 25 + (i * 39));
textBox[i].Name = "textBox[" + i + "]";
textBox[i].Size = new Size(288, 20);
textBox[i].TabIndex = i;
textBox[i].Text = items[i].Text;
if (items[i].IsPassword)
{
textBox[i].UseSystemPasswordChar = true;
}
}
//
// button1
//
button1.Anchor = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Right);
button1.Location = new Point(208, 15 + (39 * label.Length));
button1.Name = "button1";
button1.Size = new Size(92, 23);
button1.TabIndex = items.Length + 2;
button1.Text = "button1";
button1.UseVisualStyleBackColor = true;
//
// button2
//
button2.Anchor = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Right);
button2.Location = new Point(110, 15 + (39 * label.Length));
button2.Name = "button2";
button2.Size = new Size(92, 23);
button2.TabIndex = items.Length + 1;
button2.Text = "button2";
button2.UseVisualStyleBackColor = true;
//
// button3
//
button3.Anchor = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Right);
button3.Location = new Point(12, 15 + (39 * label.Length));
button3.Name = "button3";
button3.Size = new Size(92, 23);
button3.TabIndex = items.Length;
button3.Text = "button3";
button3.UseVisualStyleBackColor = true;
//
// Evaluate MessageBoxButtons
//
switch (buttons)
{
case InputBoxButtons.OK:
button1.Text = "OK";
button1.Click += OK_Click;
button2.Visible = false;
button3.Visible = false;
AcceptButton = button1;
break;
case InputBoxButtons.OKCancel:
button1.Text = "Cancel";
button1.Click += Cancel_Click;
button2.Text = "OK";
button2.Click += OK_Click;
button3.Visible = false;
AcceptButton = button2;
break;
case InputBoxButtons.YesNo:
button1.Text = "No";
button1.Click += No_Click;
button2.Text = "Yes";
button2.Click += Yes_Click;
button3.Visible = false;
AcceptButton = button2;
break;
case InputBoxButtons.YesNoCancel:
button1.Text = "Cancel";
button1.Click += Cancel_Click;
button2.Text = "No";
button2.Click += No_Click;
button3.Text = "Yes";
button3.Click += Yes_Click;
AcceptButton = button3;
break;
case InputBoxButtons.Save:
button1.Text = "Save";
button1.Click += Save_Click;
button2.Visible = false;
button3.Visible = false;
AcceptButton = button1;
break;
case InputBoxButtons.SaveCancel:
button1.Text = "Cancel";
button1.Click += Cancel_Click;
button2.Text = "Save";
button2.Click += Save_Click;
button3.Visible = false;
AcceptButton = button2;
break;
default:
throw new Exception("Invalid InputBoxButton Value");
}
//
// dialogForm
//
AutoScaleDimensions = new SizeF(6F, 13F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(312, 47 + (39 * items.Length));
for (int i = 0; i < label.Length; i++)
{
Controls.Add(label[i]);
}
for (int i = 0; i < textBox.Length; i++)
{
Controls.Add(textBox[i]);
}
Controls.Add(button1);
Controls.Add(button2);
Controls.Add(button3);
MaximizeBox = false;
MinimizeBox = false;
MaximumSize = new Size(99999, 85 + (39 * items.Length));
Name = "dialogForm";
ShowIcon = false;
ShowInTaskbar = false;
Text = title;
ResumeLayout(false);
PerformLayout();
foreach (Label l in label)
{
if (l.Width > minWidth)
{
minWidth = l.Width;
}
}
ClientSize = new Size(minWidth + 24, 47 + (39 * items.Length));
MinimumSize = new Size(minWidth + 40, 85 + (39 * items.Length));
}
private void OK_Click(object sender, EventArgs e)
{
inputResult = InputBoxResult.OK;
Close();
}
private void Cancel_Click(object sender, EventArgs e)
{
inputResult = InputBoxResult.Cancel;
Close();
}
private void Yes_Click(object sender, EventArgs e)
{
inputResult = InputBoxResult.Yes;
Close();
}
private void No_Click(object sender, EventArgs e)
{
inputResult = InputBoxResult.No;
Close();
}
private void Save_Click(object sender, EventArgs e)
{
inputResult = InputBoxResult.Save;
Close();
}
}
}