Update 20250204

This commit is contained in:
Stefan Hutter
2025-02-04 22:36:20 +01:00
parent 293b615547
commit 00eae8a837
2881 changed files with 1570876 additions and 300 deletions

View File

@@ -54,6 +54,11 @@
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.GrpBoxMitarbeiter = new System.Windows.Forms.GroupBox();
this.GrpGetSignature = new System.Windows.Forms.GroupBox();
this.btnDeleteImage = new System.Windows.Forms.Button();
this.btnSaveSignature = new System.Windows.Forms.Button();
this.sign1 = new WinSign.Sign();
this.chkOndocMails = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button();
this.btnLoadImage = new System.Windows.Forms.Button();
this.label12 = new System.Windows.Forms.Label();
@@ -73,13 +78,17 @@
this.lblVorname = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.lblName = new System.Windows.Forms.Label();
this.chkOndocMails = new System.Windows.Forms.CheckBox();
this.button2 = new System.Windows.Forms.Button();
this.GetSignatureAbort = new System.Windows.Forms.Button();
this.label13 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.GrpBoxProfile.SuspendLayout();
this.GrpBoxDetails.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.cbboxTeam)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cbboxUnterschriftRechts)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cbboxUnterschriftLinks)).BeginInit();
this.GrpBoxMitarbeiter.SuspendLayout();
this.GrpGetSignature.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
@@ -332,6 +341,7 @@
//
// GrpBoxMitarbeiter
//
this.GrpBoxMitarbeiter.Controls.Add(this.button2);
this.GrpBoxMitarbeiter.Controls.Add(this.chkOndocMails);
this.GrpBoxMitarbeiter.Controls.Add(this.button1);
this.GrpBoxMitarbeiter.Controls.Add(this.btnLoadImage);
@@ -358,6 +368,67 @@
this.GrpBoxMitarbeiter.TabIndex = 3;
this.GrpBoxMitarbeiter.TabStop = false;
//
// GrpGetSignature
//
this.GrpGetSignature.BackColor = System.Drawing.Color.Gainsboro;
this.GrpGetSignature.Controls.Add(this.label14);
this.GrpGetSignature.Controls.Add(this.label13);
this.GrpGetSignature.Controls.Add(this.GetSignatureAbort);
this.GrpGetSignature.Controls.Add(this.btnDeleteImage);
this.GrpGetSignature.Controls.Add(this.btnSaveSignature);
this.GrpGetSignature.Controls.Add(this.sign1);
this.GrpGetSignature.Location = new System.Drawing.Point(101, 99);
this.GrpGetSignature.Name = "GrpGetSignature";
this.GrpGetSignature.Size = new System.Drawing.Size(644, 364);
this.GrpGetSignature.TabIndex = 21;
this.GrpGetSignature.TabStop = false;
this.GrpGetSignature.Text = "Unterschrift erfassen";
this.GrpGetSignature.Visible = false;
//
// btnDeleteImage
//
this.btnDeleteImage.Location = new System.Drawing.Point(11, 327);
this.btnDeleteImage.Name = "btnDeleteImage";
this.btnDeleteImage.Size = new System.Drawing.Size(103, 23);
this.btnDeleteImage.TabIndex = 22;
this.btnDeleteImage.Text = "Bild löschen";
this.btnDeleteImage.UseVisualStyleBackColor = true;
this.btnDeleteImage.Click += new System.EventHandler(this.btnDeleteImage_Click);
//
// btnSaveSignature
//
this.btnSaveSignature.Location = new System.Drawing.Point(498, 327);
this.btnSaveSignature.Name = "btnSaveSignature";
this.btnSaveSignature.Size = new System.Drawing.Size(129, 23);
this.btnSaveSignature.TabIndex = 21;
this.btnSaveSignature.Text = "Unterschrift speichern";
this.btnSaveSignature.UseVisualStyleBackColor = true;
this.btnSaveSignature.Click += new System.EventHandler(this.btnSaveSignature_Click);
//
// sign1
//
this.sign1.BackColor = System.Drawing.Color.White;
this.sign1.BackgroundImageBitmap = null;
this.sign1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.sign1.FileFormat = System.Drawing.Imaging.ImageFormat.Bmp;
this.sign1.Location = new System.Drawing.Point(11, 93);
this.sign1.Name = "sign1";
this.sign1.PenColor = System.Drawing.Color.Black;
this.sign1.PenWidth = 4;
this.sign1.RequiredPoints = 20;
this.sign1.Size = new System.Drawing.Size(616, 228);
this.sign1.TabIndex = 20;
//
// chkOndocMails
//
this.chkOndocMails.AutoSize = true;
this.chkOndocMails.Location = new System.Drawing.Point(29, 257);
this.chkOndocMails.Name = "chkOndocMails";
this.chkOndocMails.Size = new System.Drawing.Size(128, 17);
this.chkOndocMails.TabIndex = 19;
this.chkOndocMails.Text = "OnDoc-Mails erhalten";
this.chkOndocMails.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.Location = new System.Drawing.Point(628, 208);
@@ -520,21 +591,52 @@
this.lblName.TabIndex = 0;
this.lblName.Text = "Name";
//
// chkOndocMails
// button2
//
this.chkOndocMails.AutoSize = true;
this.chkOndocMails.Location = new System.Drawing.Point(29, 257);
this.chkOndocMails.Name = "chkOndocMails";
this.chkOndocMails.Size = new System.Drawing.Size(128, 17);
this.chkOndocMails.TabIndex = 19;
this.chkOndocMails.Text = "OnDoc-Mails erhalten";
this.chkOndocMails.UseVisualStyleBackColor = true;
this.button2.Location = new System.Drawing.Point(386, 208);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(147, 23);
this.button2.TabIndex = 22;
this.button2.Text = "Unterschrift erfassen";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// GetSignatureAbort
//
this.GetSignatureAbort.Location = new System.Drawing.Point(524, 19);
this.GetSignatureAbort.Name = "GetSignatureAbort";
this.GetSignatureAbort.Size = new System.Drawing.Size(103, 23);
this.GetSignatureAbort.TabIndex = 23;
this.GetSignatureAbort.Text = "Abbrechen";
this.GetSignatureAbort.UseVisualStyleBackColor = true;
this.GetSignatureAbort.Click += new System.EventHandler(this.button3_Click);
//
// label13
//
this.label13.AutoSize = true;
this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label13.Location = new System.Drawing.Point(11, 31);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(198, 17);
this.label13.TabIndex = 24;
this.label13.Text = "Unterschrift mit Stift erfassen. ";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label14.Location = new System.Drawing.Point(11, 53);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(400, 17);
this.label14.TabIndex = 25;
this.label14.Text = "Bitte möglichst den gesamten Paltz des Eingabefeldes nutzen.";
//
// MitarbeiterProfil
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 498);
this.Controls.Add(this.GrpGetSignature);
this.Controls.Add(this.GrpBoxMitarbeiter);
this.Controls.Add(this.GrpBoxDetails);
this.Controls.Add(this.GrpBoxProfile);
@@ -556,6 +658,8 @@
((System.ComponentModel.ISupportInitialize)(this.cbboxUnterschriftLinks)).EndInit();
this.GrpBoxMitarbeiter.ResumeLayout(false);
this.GrpBoxMitarbeiter.PerformLayout();
this.GrpGetSignature.ResumeLayout(false);
this.GrpGetSignature.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
@@ -608,5 +712,13 @@
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.CheckBox chkOndocMails;
private WinSign.Sign sign1;
private System.Windows.Forms.GroupBox GrpGetSignature;
private System.Windows.Forms.Button btnDeleteImage;
private System.Windows.Forms.Button btnSaveSignature;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button GetSignatureAbort;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label14;
}
}

View File

@@ -19,6 +19,13 @@ using System.Threading;
using static System.Net.Mime.MediaTypeNames;
using System.IO;
using System.Net;
using Windows.System.Update;
using Syncfusion.Windows.Forms;
using OnDoc.Helper;
using Windows.Phone.ApplicationModel;
using System.Net.Http;
using Syncfusion.Office;
using Newtonsoft.Json;
namespace OnDoc.Diverses
{
@@ -26,6 +33,8 @@ namespace OnDoc.Diverses
{
private int mitarbeiternr = 0;
private bool onLoad = true;
private string tgnummer = "";
public MitarbeiterProfil()
{
InitializeComponent();
@@ -197,8 +206,10 @@ namespace OnDoc.Diverses
db.Get_Tabledata("select * from mitarbeiter where mitarbeiternr=" + AppParams.CurrentMitarbeiter.ToString(), false, true);
if (db.dsdaten.Tables[0].Rows.Count > 0)
{
try {
string unterschrift = get_unterschrift(db.dsdaten.Tables[0].Rows[0]["tgnummer"].ToString());
try {
tgnummer = db.dsdaten.Tables[0].Rows[0]["tgnummer"].ToString();
string unterschrift = get_unterschrift(db.dsdaten.Tables[0].Rows[0]["tgnummer"].ToString());
string ss = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(unterschrift);
MemoryStream mssign = new MemoryStream(Convert.FromBase64String(ss));
System.Drawing.Image img = System.Drawing.Image.FromStream(mssign);
@@ -326,6 +337,110 @@ namespace OnDoc.Diverses
db.Exec_SQL("Update mitarbeiter set mailempfang=" + mailempfang.ToString() + " where mitarbeiternr = " + AppParams.CurrentMitarbeiter.ToString());
db = null;
}
private void btnDeleteImage_Click(object sender, EventArgs e)
{
sign1.ClearSignature();
}
private void btnSaveSignature_Click(object sender, EventArgs e)
{
if (sign1.IsValid)
{
string filename = AppParams.tempdir + AppParams.currenttgnummer + ".jpg";
if (System.IO.File.Exists(filename))
{
System.IO.File.Delete(filename);
}
if (MessageBox.Show("Unterschrif-Bild speichern ('"+AppParams.currenttgnummer+".jpg' ?","Unterschrift speichern", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
sign1.SignatureBitmap.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg);
//FileStream fs = new FileStream(filename, FileMode.Open);
// upload_img(fs, filename, AppParams.currenttgnummer);
FileHelper fh = new FileHelper();
string userimage = fh.Base64FromFile(filename);
upload_image(userimage, AppParams.currenttgnummer);
sign1.ClearSignature();
GrpGetSignature.Visible = false;
string unterschrift = get_unterschrift(this.tgnummer);
string ss = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(unterschrift);
MemoryStream mssign = new MemoryStream(Convert.FromBase64String(ss));
System.Drawing.Image img = System.Drawing.Image.FromStream(mssign);
pictureBox1.Image = img;
mssign.Close();
mssign.Dispose();
}
}
}
public class imageclass
{
public string tgnummer { get; set; }
public string b64 { get; set; }
}
private void upload_image(string unterschrift, string tgnummer)
{
Logging.Logging.Debug("Start Save Image", "OnDoc", "");
string URL = AppParams.RESTURI + "API/SaveSignature";
string response;
imageclass ic = new imageclass();
ic.tgnummer = tgnummer;
ic.b64= unterschrift;
string jsonstring = JsonConvert.SerializeObject(ic);
WebRequest request;
var data = Encoding.UTF8.GetBytes(jsonstring);
request = WebRequest.Create(URL);
request.ContentLength = data.Length;
request.ContentType = "application/json";
request.Method = "POST";
request.Headers["Authorization"] = "Bearer " + AppParams.apikey;
try
{
Logging.Logging.Debug("Upload Signature " + tgnummer, "OnDoc", "");
using (Stream requestStream = request.GetRequestStream())
{
requestStream.Write(data, 0, data.Length);
requestStream.Close();
using (Stream responseStream = request.GetResponse().GetResponseStream())
{
using (var reader = new StreamReader(responseStream))
{
response = reader.ReadToEnd();
}
}
}
return;
}
catch (Exception ex)
{
Logging.Logging.Debug("Upload Signature failed:" + ex.Message, "OnDoc", "");
return;
}
}
private void button3_Click(object sender, EventArgs e)
{
GrpGetSignature.Visible = false;
}
private void button2_Click(object sender, EventArgs e)
{
GrpGetSignature.Visible = true;
}
}
}

View File

@@ -121,7 +121,7 @@
<data name="RibbonButtonExit.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
vAAADrwBlbxySQAAABJJREFUOE9jYBgFo2AUjAIIAAAEEAABTLtGVQAAAABJRU5ErkJggg==
</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@@ -52,9 +52,9 @@
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(164, 304);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(134, 26);
this.label1.Size = new System.Drawing.Size(122, 26);
this.label1.TabIndex = 1;
this.label1.Text = "Version 0.95";
this.label1.Text = "Version 1.0";
//
// label2
//
@@ -62,9 +62,9 @@
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(144, 330);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(168, 26);
this.label2.Size = new System.Drawing.Size(165, 26);
this.label2.TabIndex = 2;
this.label2.Text = "30. Januar 2025";
this.label2.Text = "4. Februar 2025";
//
// SplashScreen
//