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

@@ -24,6 +24,8 @@ using Windows.UI;
using edoka_dms;
using Syncfusion.Windows.Forms.Tools.XPMenus;
using Windows.Graphics.Printing3D;
using System.IO;
using System.Net;
namespace OnDoc.UIControls
@@ -136,6 +138,14 @@ namespace OnDoc.UIControls
this.cbboxunterschriftrechts.Enabled = Convert.ToBoolean(dr["unterschrift_rechts"]) == true;
this.cbformularohneunterschrfit.Enabled = Convert.ToBoolean(dr["unterschrift_ohne"]) == true;
if (cbboxunterschriftlinks.Enabled == false) {
cbboxunterschriftlinks.Visible = false;
lblUnterschriftlinks.Visible = false;
}
if (cbboxunterschriftrechts.Enabled == false) {
cbboxunterschriftrechts.Visible = false;
lblUnterschriftrechts.Visible = false;
}
this.cbfaksimile.Enabled = Convert.ToBoolean(dr["unterschrift_faksimile"]) == true;
if (this.cbfaksimile.Enabled == true) { this.cbfaksimile.Checked=true; }
this.cbformularohneunterschrfit.Checked = false;
@@ -575,12 +585,32 @@ namespace OnDoc.UIControls
try
{
ur = Convert.ToInt32(cbboxunterschriftrechts.SelectedValue);
}
catch { }
if (cbboxunterschriftlinks.Text == "") { ul = 0; }
if (cbboxunterschriftrechts.Text == "") { ur = 0; }
if (cbfaksimile.Checked) {
if (ul != 0)
{
if (!Check_Signature(ul))
{
if (check_error != "") { check_error = check_error + Environment.NewLine; }
check_error = check_error + "- Unterschriftenbild "+cbboxunterschriftlinks.Text + " fehlt";
}
}
if (ur != 0)
{
if (!Check_Signature(ur))
{
if (check_error != "") { check_error = check_error + Environment.NewLine; }
check_error = check_error + "- Unterschriftenbild " + cbboxunterschriftrechts.Text + " fehlt";
}
}
}
//20250121 - ausblenden
//if (ul==0 || ur == 0)
@@ -589,7 +619,7 @@ namespace OnDoc.UIControls
// check_error = check_error + "- " + "Bitte Unterschrift links und rechts auswählen";
//}
}
if (check_error == "") { return true; } else { return false; }
@@ -597,6 +627,51 @@ namespace OnDoc.UIControls
return true;
}
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; }
}
public void Update_DocGenData()
{
@@ -1046,6 +1121,7 @@ namespace OnDoc.UIControls
this.DateDokumentDatum.Value = Convert.ToDateTime(dr["erstellungsdatum"]);
this.DateTerminText.Text = Convert.ToDateTime(dr["termin"]).ToString();
this.signiert = Convert.ToBoolean(dr["signiert"]) == true;
this.cbfaksimile.Checked = Convert.ToBoolean(dr["faksimile"])==true;
if (dr["zustelladresse"].ToString() != "") this.txtPartnerZusteller.Text = dr["zustelladresse"].ToString();