update 20250727

This commit is contained in:
Stefan Hutter
2025-07-27 13:24:50 +02:00
parent cb8acfea57
commit 2237be483d
192 changed files with 23435 additions and 107 deletions

View File

@@ -64,7 +64,7 @@
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(135, 26);
this.label2.TabIndex = 2;
this.label2.Text = "17. Juli 2025";
this.label2.Text = "27. Juli 2025";
this.label2.Click += new System.EventHandler(this.label2_Click);
//
// SplashScreen

183
Client/Diverses/frmMail.Designer.cs generated Normal file
View File

@@ -0,0 +1,183 @@
namespace OnDoc.Diverses
{
partial class frmMail
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txtbetreff = new System.Windows.Forms.TextBox();
this.cbboxEmpfaenger = new Syncfusion.WinForms.ListView.SfComboBox();
this.btncancel = new System.Windows.Forms.Button();
this.btnsend = new System.Windows.Forms.Button();
this.miniHTMLTextBox1 = new DG.MiniHTMLTextBox.MiniHTMLTextBox();
this.label4 = new System.Windows.Forms.Label();
this.txtemail = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.cbboxEmpfaenger)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 33);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(58, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Empfänger";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(16, 72);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(38, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Betreff";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(16, 111);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(33, 13);
this.label3.TabIndex = 2;
this.label3.Text = "Inhalt";
//
// txtbetreff
//
this.txtbetreff.Location = new System.Drawing.Point(97, 72);
this.txtbetreff.Name = "txtbetreff";
this.txtbetreff.Size = new System.Drawing.Size(806, 20);
this.txtbetreff.TabIndex = 3;
//
// cbboxEmpfaenger
//
this.cbboxEmpfaenger.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
this.cbboxEmpfaenger.DropDownPosition = Syncfusion.WinForms.Core.Enums.PopupRelativeAlignment.Center;
this.cbboxEmpfaenger.Location = new System.Drawing.Point(97, 33);
this.cbboxEmpfaenger.Name = "cbboxEmpfaenger";
this.cbboxEmpfaenger.Size = new System.Drawing.Size(287, 19);
this.cbboxEmpfaenger.Style.DropDownStyle.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100)))));
this.cbboxEmpfaenger.Style.TokenStyle.CloseButtonBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.cbboxEmpfaenger.TabIndex = 12;
this.cbboxEmpfaenger.TabStop = false;
this.cbboxEmpfaenger.SelectedIndexChanged += new System.EventHandler(this.cbboxEmpfaenger_SelectedIndexChanged);
//
// btncancel
//
this.btncancel.Location = new System.Drawing.Point(12, 378);
this.btncancel.Name = "btncancel";
this.btncancel.Size = new System.Drawing.Size(171, 23);
this.btncancel.TabIndex = 21;
this.btncancel.Text = "Abbrechen";
this.btncancel.UseVisualStyleBackColor = true;
this.btncancel.Click += new System.EventHandler(this.btncancel_Click);
//
// btnsend
//
this.btnsend.Enabled = false;
this.btnsend.Location = new System.Drawing.Point(732, 378);
this.btnsend.Name = "btnsend";
this.btnsend.Size = new System.Drawing.Size(171, 23);
this.btnsend.TabIndex = 20;
this.btnsend.Text = "Senden";
this.btnsend.UseVisualStyleBackColor = true;
this.btnsend.Click += new System.EventHandler(this.btntoapproval_Click);
//
// miniHTMLTextBox1
//
this.miniHTMLTextBox1.IllegalPatterns = new string[] {
"<script.*?>",
"<\\w+\\s+.*?(j|java|vb|ecma)script:.*?>",
"<\\w+(\\s+|\\s+.*?\\s+)on\\w+\\s*=.+?>",
"</?input.*?>"};
this.miniHTMLTextBox1.Location = new System.Drawing.Point(97, 122);
this.miniHTMLTextBox1.Name = "miniHTMLTextBox1";
this.miniHTMLTextBox1.Padding = new System.Windows.Forms.Padding(1);
this.miniHTMLTextBox1.ShowToolbar = true;
this.miniHTMLTextBox1.Size = new System.Drawing.Size(806, 226);
this.miniHTMLTextBox1.TabIndex = 22;
this.miniHTMLTextBox1.Text = "miniHTMLTextBox1";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(407, 35);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(39, 13);
this.label4.TabIndex = 23;
this.label4.Text = "E-Mail:";
//
// txtemail
//
this.txtemail.Location = new System.Drawing.Point(452, 33);
this.txtemail.Name = "txtemail";
this.txtemail.Size = new System.Drawing.Size(451, 20);
this.txtemail.TabIndex = 24;
this.txtemail.Leave += new System.EventHandler(this.txtemail_Leave);
//
// frmMail
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(931, 416);
this.Controls.Add(this.txtemail);
this.Controls.Add(this.label4);
this.Controls.Add(this.miniHTMLTextBox1);
this.Controls.Add(this.btncancel);
this.Controls.Add(this.btnsend);
this.Controls.Add(this.cbboxEmpfaenger);
this.Controls.Add(this.txtbetreff);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "frmMail";
this.Style.MdiChild.IconHorizontalAlignment = System.Windows.Forms.HorizontalAlignment.Center;
this.Style.MdiChild.IconVerticalAlignment = System.Windows.Forms.VisualStyles.VerticalAlignment.Center;
this.Text = "Mail-Versand";
this.Load += new System.EventHandler(this.frmMail_Load);
((System.ComponentModel.ISupportInitialize)(this.cbboxEmpfaenger)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtbetreff;
private Syncfusion.WinForms.ListView.SfComboBox cbboxEmpfaenger;
private System.Windows.Forms.Button btncancel;
private System.Windows.Forms.Button btnsend;
private DG.MiniHTMLTextBox.MiniHTMLTextBox miniHTMLTextBox1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtemail;
}
}

174
Client/Diverses/frmMail.cs Normal file
View File

@@ -0,0 +1,174 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.RightsManagement;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using Database;
using Microsoft.Office.Interop.Excel;
using Microsoft.Office.Interop.Word;
using Model;
using OnDoc.Klassen;
using OnDoc.UICintrols;
using Syncfusion.DocIO.DLS;
using Syncfusion.Windows.Forms;
using Syncfusion.Windows.Forms.Tools;
using Syncfusion.WinForms.Controls;
namespace OnDoc.Diverses
{
public partial class frmMail : SfForm
{
public string doclist { get; set; }
public frmMail()
{
InitializeComponent();
if (multipledocuments()) { this.txtbetreff.Text = "Link auf OnDoc-Dokumente"; } else { this.txtbetreff.Text = "Link auf OnDoc-Dokument"; }
}
public frmMail(string doclist)
{
InitializeComponent();
this.doclist=doclist;
if (multipledocuments()) { this.txtbetreff.Text = "Links auf OnDoc-Dokumente"; } else { this.txtbetreff.Text = "Link auf OnDoc-Dokument"; }
update_html();
}
private void frmMail_Load(object sender, EventArgs e)
{
DB db = new DB(AppParams.connectionstring);
db.clear_parameter();
db.Get_Tabledata("SP_Dokumentbearbeitung_Mitarbeiter", true, false);
cbboxEmpfaenger.DataSource = db.dsdaten.Tables[0];
cbboxEmpfaenger.DataSource = db.dsdaten.Tables[0];
cbboxEmpfaenger.DisplayMember = "name";
cbboxEmpfaenger.ValueMember = "mitarbeiternr";
db = null;
}
public void update_fields(string mailtext)
{
miniHTMLTextBox1.Text = mailtext;
miniHTMLTextBox1.ShowToolbar = false;
}
public void update_html()
{
DB db = new DB(AppParams.connectionstring);
db.Get_Tabledata("Select name,vorname,tgnummer, email from mitarbeiter where mitarbeiternr=" + AppParams.CurrentMitarbeiter.ToString(), false, true);
string absender = "";
try
{
absender = db.dsdaten.Tables[0].Rows[0]["Name"].ToString() + " " + db.dsdaten.Tables[0].Rows[0]["Vorname"].ToString() + ", " + db.dsdaten.Tables[0].Rows[0]["tgnummer"].ToString();
}
catch
{
absender = "";
}
string endabsatz = "<br><br>--------------------------------------------------------------------------<br>OnDoc / " + absender;
//endabsatz = "";
string empfaenger = "";
try
{
db.Get_Tabledata("Select vorname,email from mitarbeiter where mitarbeiternr=" + cbboxEmpfaenger.SelectedValue.ToString(), false, true);
empfaenger = db.dsdaten.Tables[0].Rows[0][0].ToString();
txtemail.Text = db.dsdaten.Tables[0].Rows[0][1].ToString();
if (!checkemail())
{
MessageBox.Show("E-Mail-Adresse ist ungültig!","E-Mail",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
catch
{
empfaenger = "";
}
string text = "";
string starthtml = "<html>";
string endhtml = "</html>";
string startabsatz = "Guten Tag "+empfaenger+"<br>" + "<br>";
if (!multipledocuments()) { startabsatz = startabsatz + "<br>" + "Link zum Dokument:<br>"; } else { startabsatz = startabsatz + "<br>" + "Links zum Dokumenten:<br>"; }
text = text + starthtml;
text = text + startabsatz;
text = text + this.doclist;
text = text + endabsatz;
text = text + endhtml;
miniHTMLTextBox1.Text = text;
miniHTMLTextBox1.ShowToolbar = false;
db = null;
}
private bool checkemail()
{
if (Regex.IsMatch(txtemail.Text, @"^\d+$") == false && !txtemail.Text.ToUpper().Contains("@TKB.CH")) { this.btnsend.Enabled = false; return false; } else { this.btnsend.Enabled = true; return true; }
}
private bool multipledocuments()
{
if (doclist.Contains("ul"))
{
return true;
}
else
{ return false; }
}
private void cbboxEmpfaenger_SelectedIndexChanged(object sender, EventArgs e)
{
update_html();
}
private void btntoapproval_Click(object sender, EventArgs e)
{
Model.EMail email = new Model.EMail();
email.empfaenger = this.txtemail.Text;
email.betreff = txtbetreff.Text;
email.message = miniHTMLTextBox1.Text;
clsMailer mailer = new clsMailer();
if (mailer.SendHTMLMail(email))
{
this.Close();
}
else
{
MessageBox.Show("Mail konnte nicht versendet werden", "E-Mail", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
;
mailer = null;
email = null;
}
private void txtemail_TextChanged(object sender, EventArgs e)
{
}
private void txtemail_Leave(object sender, EventArgs e)
{
if (!checkemail())
{
MessageBox.Show("E-Mail-Adresse ist ungültig!", "E-Mail", MessageBoxButtons.OK, MessageBoxIcon.Error);
txtemail.Focus();
}
}
private void btncancel_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>