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

@@ -1328,6 +1328,51 @@ namespace OnDoc.UIControls
if (!Partnerliste_Pruefen()) { return; }
Generate();
}
private bool Check_Signature(int mitarbeiternr)
{
DB db = new DB(AppParams.connectionstring);
try
{
db.Get_Tabledata("Select tgnummer from mitarbeiter where mitarbeiternr=" + mitarbeiternr.ToString(), false, true);
if (db.dsdaten.Tables[0].Rows[0][0].ToString() == "")
{
return false;
}
string URL = AppParams.RESTURI + "API/CheckSignature?TGNummer=" + db.dsdaten.Tables[0].Rows[0][0].ToString();
HttpWebRequest webRequest = HttpWebRequest.Create(URL) as HttpWebRequest;
webRequest.Method = WebRequestMethods.Http.Get;
webRequest.Headers["Authorization"] = "Bearer " + AppParams.apikey;
try
{
using (HttpWebResponse response = webRequest.GetResponse() as HttpWebResponse)
{
if (response.StatusCode == HttpStatusCode.OK)
{
StreamReader reader = new StreamReader(response.GetResponseStream());
string responseContent = reader.ReadToEnd();
return true;
}
else
{
Logging.Logging.Error(URL + ": " + response.StatusCode.ToString() + " / " + response.StatusDescription, "Clinet - DokList GetDocument", "");
return false;
}
}
}
catch (Exception ex)
{
return false;
}
}
catch
{
return false;
}
finally { db = null; }
}
private void Generate(int vorschauid = -1)
{
@@ -1374,6 +1419,29 @@ namespace OnDoc.UIControls
if (cbboxunterschriftlinks.Text.Trim() == "") { sb.unterschriftlinks = 0; }
if (cbboxunterschriftrechts.Text.Trim() == "") { sb.unterschriftrechts = 0; };
bool error = false;
if (cbdigitaleunterschrfiten.Checked)
{
if (sb.unterschriftlinks != 0)
{
if (!Check_Signature(sb.unterschriftlinks))
{
MessageBox.Show("Unterschrift von " + cbboxunterschriftlinks.Text + " fehlt", "Unterschriftenprüfung", MessageBoxButtons.OK, MessageBoxIcon.Error);
error = true;
};
}
if (sb.unterschriftrechts != 0)
{
if (!Check_Signature(sb.unterschriftrechts))
{
MessageBox.Show("Unterschrift von " + cbboxunterschriftrechts.Text + " fehlt", "Unterschriftenprüfung", MessageBoxButtons.OK, MessageBoxIcon.Error);
error = true;
}
}
if (error) { return; }
}
imghelper = null;