Update 20260109

This commit is contained in:
Stefan Hutter
2026-01-09 08:37:07 +01:00
parent e377f08ccd
commit 49155d898f
229 changed files with 28984 additions and 39486 deletions

View File

@@ -159,6 +159,9 @@
<Reference Include="System.Web.Http, Version=5.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.3.0\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.Tracing, Version=5.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Tracing.5.3.0\lib\net45\System.Web.Http.Tracing.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.3.0\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</Reference>

View File

@@ -32,6 +32,9 @@ using System.Web.UI.WebControls;
using System.Drawing.Text;
using System.Runtime.InteropServices.ComTypes;
using System.Reflection;
using Newtonsoft.Json.Linq;
using System.Runtime.Serialization.Json;
using System.Web.Http.Results;
namespace API_NetFramework.Controllers
@@ -107,14 +110,29 @@ namespace API_NetFramework.Controllers
{
APIErrorSimple apireturn = new APIErrorSimple();
APIOK apiok = new APIOK();
try
{
guid = Guid.NewGuid().ToString();
Logging.APIDocLog.Info("CreateDoks Start", "CreateDoks", guid, "");
bool hasattachment = false;
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
{
apireturn.code = "ONDOC-ERR-CreateDoks-01";
apireturn.status = "401";
apireturn.message = "Invalid Token or API-Key";
apireturn.traceid = "";
apireturn.field = "";
try
{
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
catch
{
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
}
finally { apireturn = null; apiok = null; };
//return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
}
HttpRequestMessage rmsg = (HttpRequestMessage)Request;
string OwnHost = System.Configuration.ConfigurationManager.AppSettings["OwnHost"].ToString();
@@ -141,8 +159,13 @@ namespace API_NetFramework.Controllers
apireturn.traceid = "";
apireturn.field = "";
paket = null;
try
{
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
catch { return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn)); }
finally { apireturn = null; apiok = null; };
}
try
{
@@ -162,9 +185,12 @@ namespace API_NetFramework.Controllers
DocCreate doccreate = new DocCreate();
OnDocAPI_NetFramework.Helper.Helper.CopyProperties(dokdata, docgendata);
OnDocAPI_NetFramework.Helper.Helper.CopyProperties(dokument, doccreate);
dokument.DokumentID = gendoc(ref doccreate, ref dokdata, ref docgendata, key.ToString());
dokument.DokumentID = dokdata.Dokumentid;
dokdata = null;
docgendata = null;
doccreate = null;
Logging.APIDocLog.Info("Dok erstellt", "CreateDoks", guid, dokument.DokumentID);
}
@@ -179,9 +205,20 @@ namespace API_NetFramework.Controllers
apireturn.message = ex.Message;
apireturn.traceid = "";
apireturn.field = "";
paket = null;
try
{
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
catch
{
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
finally { apireturn = null; apiok = null; };
}
if (paket.ResultSender == "true")
{
List<APIDokumentResult> Dokumente = new List<APIDokumentResult>();
@@ -220,7 +257,23 @@ namespace API_NetFramework.Controllers
Dokumente = null;
string json = System.Text.Json.JsonSerializer.Serialize(Dokumente);
paket = null;
apiok.code = "200";
apiok.status = "200";
apiok.message = "";
apiok.documentid = "";
apiok.file = json;
try
{
return Ok(Newtonsoft.Json.JsonConvert.SerializeObject(apiok));
}
catch (Exception e)
{
return Content(HttpStatusCode.InternalServerError, e.Message);
}
finally
{
apiok = null;
}
return Ok(json);
}
@@ -275,6 +328,7 @@ namespace API_NetFramework.Controllers
vp.GASSize = paket.GASCouvert;
vp.Versandoption = paket.VersandOption;
vp.Dokument = vdoc;
vp.finaldoc = stapel;
if (vp.Dokument.Count > 1) { vp.send_onbase_doc = false; } else { vp.send_onbase_doc = true; }
vp.verified = true;
@@ -299,9 +353,7 @@ namespace API_NetFramework.Controllers
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
}
Logging.APIDocLog.Info("Dokumentpaket abgeschlossen", "CreateDoks", guid, "");
apireturn.code = "OK";
apireturn.status = "200";
@@ -310,18 +362,47 @@ namespace API_NetFramework.Controllers
apireturn.field = "GUID=" + guid;
return Ok(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
catch (Exception ex)
{
Logging.APIDocLog.Error("ONDOC-ERR-CreatePaketDoc", "CreateDoks", guid, ex.Message);
apireturn.code = "ONDOC-ERR-CreatePaketDoc";
apireturn.status = "400";
apireturn.message = ex.Message;
apireturn.traceid = "";
apireturn.field = "";
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
finally { apireturn = null; apiok = null; };
}
[HttpPost]
[Route("API/CreateDok")]
public IHttpActionResult CreateDok()
{
APIErrorSimple apireturn = new APIErrorSimple();
APIOK apiok = new APIOK();
try
{
string guid = Guid.NewGuid().ToString();
Logging.APIDocLog.Info("Start CreateDoc", "CreateDoc", guid, "");
APIErrorSimple apireturn = new APIErrorSimple();
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
{
apireturn.code = "ONDOC-ERR-CreateDok-01";
apireturn.status = "401";
apireturn.message = "Invalid Token or API-Key";
apireturn.traceid = "";
apireturn.field = "";
try
{
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
catch
{
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
}
finally { apireturn = null; apiok = null; };
}
HttpRequestMessage rmsg = (HttpRequestMessage)Request;
string OwnHost = System.Configuration.ConfigurationManager.AppSettings["OwnHost"].ToString();
string imagepath = System.Configuration.ConfigurationManager.AppSettings["VSImagePath"].ToString();
@@ -382,9 +463,7 @@ namespace API_NetFramework.Controllers
doccreate = null;
dokdata = null;
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
}
if (doccreate.ConfirmationMail == "true")
{
@@ -412,13 +491,159 @@ namespace API_NetFramework.Controllers
apireturn.field = "GUID=" + guid;
return Ok(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
catch (Exception ex)
{
Logging.APIDocLog.Error("ONDOC-ERR-CreatePaketDoc", "CreateDoks", guid, ex.Message);
apireturn.code = "ONDOC-ERR-CreatePaketDoc";
apireturn.status = "400";
apireturn.message = ex.Message;
apireturn.traceid = "";
apireturn.field = "";
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
finally { apireturn = null; apiok = null; };
}
[HttpPost]
[Route("API/CreateCLM")]
public IHttpActionResult CreateCLM()
{
APIErrorSimple apireturn = new APIErrorSimple();
APIOK apiok = new APIOK();
List<CLMDocItem>clmdocitemlist = new List<CLMDocItem>();
dynamic dataj = null;
try
{
string guid = Guid.NewGuid().ToString();
Logging.APIDocLog.Info("Start CreateCLM", "CreateESS", guid, "");
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
{
apireturn.code = "ONDOC-ERR-CreateCLM-01";
apireturn.status = "401";
apireturn.message = "Invalid Token or API-Key";
apireturn.traceid = "";
apireturn.field = "";
try
{
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
catch
{
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
}
finally { apireturn = null; apiok = null;clmdocitemlist = null;dataj = null; };
}
HttpRequestMessage rmsg = (HttpRequestMessage)Request;
string OwnHost = System.Configuration.ConfigurationManager.AppSettings["OwnHost"].ToString();
string imagepath = System.Configuration.ConfigurationManager.AppSettings["VSImagePath"].ToString();
var key = rmsg.Headers.Authorization.Parameter.ToString();
string result = Request.Content.ReadAsStringAsync().Result;
dataj = JsonConvert.DeserializeObject(result);
Logging.APIDocLog.Info("Input JSON", "CreateCLM", guid, result);
var jo = JObject.Parse(Request.Content.ReadAsStringAsync().Result);
var valueTuples = GetNodes(jo).ToList();
foreach (var valueTuple in valueTuples)
{
CLMDocItem d = new CLMDocItem();
d.itemname = valueTuple.Item1;
d.itemtag = valueTuple.Item2;
d.itemvalue = valueTuple.Item3;
d.doclinkname = "";
clmdocitemlist.Add(d);
}
Database.DB db = new Database.DB(connectionstring);
db.Get_Tabledata("Select * from vorlagenfeld where dokumenttypnr=" + dataj.Dokumenttyp.ToString() + " and aktiv=1 and ess_field_class_id<>0", false, true);
foreach (DataRow dr in db.dsdaten.Tables[0].Rows)
{
foreach (CLMDocItem di in clmdocitemlist)
{
if ("$." + di.itemname == dr["ess_feldname"].ToString())
{
di.bmstart = dr["beginntextmarke"].ToString();
di.bmend = dr["endetextmarke"].ToString();
di.field = dr["feldname"].ToString();
di.top = dr["ess_img_top"].ToString();
di.left = dr["ess_img_left"].ToString();
di.width = dr["ess_img_width"].ToString();
di.height = dr["ess_img_height"].ToString();
di.type = dr["ess_field_class_id"].ToString();
}
}
}
string CheckResult = "";
CheckResult = CLM_Verify(ref clmdocitemlist, ref result);
if (CheckResult != "")
{
Logging.APIDocLog.Error("Error Verify ", "CreateDoks", guid, CheckResult);
apireturn.code = "ONDOC-ERR-CreateCLM";
apireturn.status = "400";
apireturn.message = CheckResult;
apireturn.traceid = "";
apireturn.field = "";
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
clsdok dok = new clsdok("", "", "", "");
gendocCLM(ref clmdocitemlist,ref dataj, ref dok,key);
Logging.APIDocLog.Info("Dokument abgeschlossen", "CreateDok", guid, "");
apiok.code = "200";
apiok.status = "200";
apiok.message = "";
apiok.documentid = dataj.Id.ToString();
apiok.file = dok.dokument;
return Ok(Newtonsoft.Json.JsonConvert.SerializeObject(apiok));
}
catch (Exception ex)
{
Logging.APIDocLog.Error("ONDOC-ERR-CreateCLM", "CreateCLM", guid, ex.Message);
apireturn.code = "ONDOC-ERR-CreatePaketDoc";
apireturn.status = "400";
apireturn.message = ex.Message;
apireturn.traceid = "";
apireturn.field = "";
return BadRequest(Newtonsoft.Json.JsonConvert.SerializeObject(apireturn));
}
finally { apireturn = null; apiok = null; clmdocitemlist = null; dataj = null; };
}
#region Helper
private IEnumerable<(string path, string key, string value)> GetNodes(JToken token)
{
foreach (var jt in token.Children())
{
if (!jt.Children().Any())
{
yield return (
path: jt.Path,
key: jt.Path.Split('.').Last(),
value: jt.ToString()
);
}
foreach (var (path, key, value) in GetNodes(jt))
{
yield return (path, key, value);
}
}
}
private string CreatePaket_Verify(ref DokumentCreate paket, ref APIErrorSimple apireturn)
{
try
@@ -503,6 +728,7 @@ namespace API_NetFramework.Controllers
catch (Exception ex) { return ex.Message; }
}
private string CreateDoc_Verify(ref DocCreate doccreate)
{
try
@@ -552,6 +778,18 @@ namespace API_NetFramework.Controllers
}
catch (Exception ex) { return ex.Message; }
}
private string CLM_Verify(ref List<CLMDocItem> clmdocitemlist,ref string json)
{
try
{
dynamic dataj = JsonConvert.DeserializeObject(json);
if (!ParamCheck("dokumenttyp",dataj.Dokumenttyp.ToString())) { return "Vorlagentyp " + dataj.Dokumenttyp.ToString() + " ist ungültig"; }
if (dataj.Id.ToString()=="") { return "ID fehlt" ; }
return "";
}
catch (Exception ex) { return ex.Message; }
}
private bool ParamCheck(string ParamType, string ParamValue)
{
DB db = new DB(connectionstring);
@@ -802,6 +1040,173 @@ namespace API_NetFramework.Controllers
return "";
}
private void gendocCLM(ref List<CLMDocItem> clmdocitemlist, ref dynamic dataj, ref clsdok dok, string key)
{
string OwnHost = System.Configuration.ConfigurationManager.AppSettings["OwnHost"].ToString();
string imagepath = System.Configuration.ConfigurationManager.AppSettings["VSImagePath"].ToString();
clsDocData dokdata = new clsDocData();
string dokumentid = "";
string bezeichnung = "";
;
Database.DB db = new DB(connectionstring);
db.Get_Tabledata("Select * from dokumenttyp where dokumenttypnr=" + dataj.Dokumenttyp.ToString(), false, true);
System.Data.DataRow dr = db.dsdaten.Tables[0].Rows[0];
bezeichnung = db.dsdaten.Tables[0].Rows[0]["Bezeichnung"].ToString();
dokdata.Barcode = Convert.ToBoolean(dr["Vertrag"]) == true;
db.Get_Tabledata("Select beschreibung from physischesarchiv where physischesarchivnr = " + dr["physisches_archiv"].ToString(), false, true);
dokdata.barcode_zusatz = db.dsdaten.Tables[0].Rows[0][0].ToString();
if (dokdata.barcode_zusatz != "") { dokdata.barcode_zusatz = " " + dokdata.barcode_zusatz; }
db.Get_Tabledata("Select office_vorlagenr,kopfzeile_generieren, bcpt,bcpl, bcw, bch, bchorizontal, barcodetype, datamatrixcontent from office_vorlage where office_vorlagenr=" + dr["office_vorlagenr"].ToString(), false, true);
dokdata.VorlageNr = Convert.ToInt32(dr["office_vorlagenr"]).ToString(); ;
try
{
dokdata.Kopfzeile_generieren = false;
if (Convert.ToBoolean(db.dsdaten.Tables[0].Rows[0][1]) == true) { dokdata.Kopfzeile_generieren = true; }
}
catch { }
if (dokdata.Barcode)
{
dokdata.barcode_left = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["bcpl"]);
dokdata.barcode_top = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["bcpt"]);
dokdata.barcode_width = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["bcw"]);
dokdata.barcode_height = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["bch"]);
dokdata.barcode_horizontal = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["bchorizontal"]);
dokdata.barcode_type = db.dsdaten.Tables[0].Rows[0]["BarcodeType"].ToString();
dokdata.barcode_content = db.dsdaten.Tables[0].Rows[0]["DatamatrixContent"].ToString();
string sql = "";
sql = "select bcpt, bcpl, bcw, bch, bchorizontal from OnDocBarcodeMpping ";
sql = sql + "where orig_bcpt = " + dokdata.barcode_top.ToString() + " and orig_bcpl=" + dokdata.barcode_left.ToString() + " ";
sql = sql + "and orig_bcw=" + dokdata.barcode_width.ToString() + " and orig_bch=" + dokdata.barcode_height.ToString();
db.Get_Tabledata(sql, false, true);
if (db.dsdaten.Tables[0].Rows.Count > 0)
{
dokdata.barcode_left = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["bcpl"]);
dokdata.barcode_top = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["bcpt"]);
dokdata.barcode_width = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["bcw"]);
dokdata.barcode_height = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["bch"]);
}
if (dokdata.barcode_type == "1")
{
DB dB = new DB(connectionstring);
dB.clear_parameter();
dB.add_parameter("@dokumentid", dokumentid);
dB.add_parameter("@DokumentidBR", "");
dB.add_parameter("@BARCODEFONTNAME", "");
dB.add_parameter("@BARCODEFONTSIZE", "");
dB.add_parameter("@BarcodeKantenlaenge", "");
dB.Get_Tabledata("sp_get_OnDoc_barcodetype_and_value", true, false);
dokdata.barcode_content = dB.dsdaten.Tables[0].Rows[0][1].ToString();
dokdata.barcode_formatn = dB.dsdaten.Tables[0].Rows[0][3].ToString();
dokdata.barcode_text = dB.dsdaten.Tables[0].Rows[0][4].ToString();
dokdata.barcode_kantenlaenge = dB.dsdaten.Tables[0].Rows[0][5].ToString();
dokdata.Zusatz_Font = dB.dsdaten.Tables[0].Rows[0][6].ToString();
dokdata.Zusatz_FontSize = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0][7]);
dokdata.barcode_width = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0][8]);
dokdata.barcode_height = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0][9]);
//dokdata.barcode_type= dB.dsdaten.Tables[0].Rows[0][3].ToString();
sql = "select bcpt, bcpl, bcw, bch, bchorizontal from OnDocBarcodeMpping ";
sql = sql + "where orig_bcpt = " + dokdata.barcode_top.ToString() + " and orig_bcpl=" + dokdata.barcode_left.ToString() + " ";
sql = sql + "and orig_bcw=" + dokdata.barcode_width.ToString() + " and orig_bch=" + dokdata.barcode_height.ToString();
dB.Get_Tabledata(sql, false, true);
if (dB.dsdaten.Tables[0].Rows.Count > 0)
{
Logging.Logging.Debug("Barcode-Übersteuerung" + dokdata.DokumenttypNr.ToString(), "Dokumenterstellung", "");
dokdata.barcode_left = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0]["bcpl"]);
dokdata.barcode_top = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0]["bcpt"]);
dokdata.barcode_width = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0]["bcw"]);
dokdata.barcode_height = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0]["bch"]);
}
}
db.Get_Tabledata("Select * from ondoc_appparams", false, true);
dokdata.barcode_font = db.dsdaten.Tables[0].Rows[0]["barcodefont"].ToString();
dokdata.barcode_fontsize = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["barcodefontsize"].ToString());
dokdata.Zusatz_Font = db.dsdaten.Tables[0].Rows[0]["Zusatzfont"].ToString();
dokdata.Zusatz_FontSize = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["ZusatzfontSize"].ToString());
dokdata.barcode_textposition = db.dsdaten.Tables[0].Rows[0]["barcodetextposition"].ToString(); ;
}
clsdocgendata docgendata = new clsdocgendata();
docgendata.partnernr = dataj.Bp.Partnernummer.ToString().Replace(".","");
docgendata.inhaberadresse = "";
docgendata.zustelladresse = "";
docgendata.dokumenttypnr = dataj.Dokumenttyp.ToString();
docgendata.unterschriftLinks = System.Configuration.ConfigurationManager.AppSettings["CLMUnterschriftlinks"].ToString();
docgendata.unterschriftRehts = System.Configuration.ConfigurationManager.AppSettings["CLMUnterschriftrechts"].ToString();
docgendata.verantwortlich = System.Configuration.ConfigurationManager.AppSettings["CLMVerantwortung"].ToString();
docgendata.ersteller = System.Configuration.ConfigurationManager.AppSettings["CLMVerantwortung"].ToString();
docgendata.team = System.Configuration.ConfigurationManager.AppSettings["CLMTeam"].ToString();
docgendata.digitaleunterschrift = false;
docgendata.frormularOhneUnterschrift = false;
docgendata.zustaendigkube = System.Configuration.ConfigurationManager.AppSettings["CLMKube"].ToString(); ;
docgendata.status = "-1";
docgendata.dokumentdatum = DateTime.Now.ToString("dd.MM.yyyy");
docgendata.dokumentdatum = DateTime.Now.ToString();
docgendata.bezeichnung = bezeichnung;
dokdata.PartnerNr = docgendata.partnernr;
dokdata.UseEDOKA_Values = "True";
dokdata.DokumenttypNr = docgendata.dokumenttypnr;
dokdata.Unterschrift_Links = docgendata.unterschriftLinks;
if (dokdata.Unterschrift_Links == "0") { dokdata.Unterschrift_Links = "-1"; }
dokdata.Unterschrift_Rechts = docgendata.unterschriftRehts;
if (dokdata.Unterschrift_Rechts == "0") { dokdata.Unterschrift_Rechts = "-1"; }
dokdata.Verantwortlich = docgendata.verantwortlich;
dokdata.Team = docgendata.team;
dokdata.Zustaendig = docgendata.zustaendigkube;
dokdata.Zustaendig = docgendata.zustaendigkube;
dokdata.Status = docgendata.status;
dokdata.Ersteller = docgendata.ersteller;
dokdata.DokumentDatum = docgendata.dokumentdatum;
dokdata.Termin = "01.01.1900";
dokdata.Bezeichnung = docgendata.bezeichnung;
dokdata.dokumentwerte = docgendata.dokumentwerte;
List<CLMDocItem> deflist = new List<CLMDocItem>();
foreach (CLMDocItem item in clmdocitemlist)
{
if (item.type == null || item.type == String.Empty || item.type=="")
{
}else
{
deflist.Add(item);
}
}
dokdata.CLMDocItems = deflist;
//Unterschriftenprüfung
dokdata.Form_ohne_Unterschrift = docgendata.frormularOhneUnterschrift.ToString();
dokdata.approval1 = 0;
dokdata.approval2 = 0;
dokdata.approved = 0;
if (dokdata.Form_ohne_Unterschrift == "True")
{
dokdata.Unterschrift_Links = "-1";
dokdata.Unterschrift_Rechts = "-1";
}
if (docgendata.erstellungsart == Erstellungsart.DokumentAlsPDF) { dokdata.Result_as_PDF = "True"; } else { dokdata.Result_as_PDF = "False"; }
if (docgendata.digitaleunterschrift == true) { dokdata.As_Faksimile = "True"; } else { dokdata.As_Faksimile = "False"; }
// dokdata.dokumentwerte = ToDataTable<CLMDocItem>
dokumentid = db.Create_EDOKA_Doc(dokdata, false, "");
dokdata.Dokumentid = dokumentid;
DOCGEN.Generator.DocGenerator_from_EDOKA Generator = new DOCGEN.Generator.DocGenerator_from_EDOKA(this.connectionstring, OwnHost, key.ToString());
dok = Generator.Generate_Doc_EDOKA(dokumentid, ref dokdata, false, 0, false, false);
db.Save_To_DB(dokumentid, "", dok.dokument);
deflist.Clear();
clmdocitemlist.Clear();
APILogging.Log((HttpRequestMessage)Request, "Ende GenDoc DokumentID:" + dokumentid, LogLevelType.Debug);
APILogging.DocLog((HttpRequestMessage)Request, docgendata.partnernr.ToString(), "Dokument über API erstellt", dokumentid, LogLevelType.Info);
}
private void send_vs(ref Versandpaket vp, string mitarbeiternr, bool direktversenden, string url, string key, string dokumentid, string partnernr, DokumentCreate doccreate, ref APIErrorSimple apireturn)
{
string jsonstring = JsonConvert.SerializeObject(vp);
@@ -956,8 +1361,36 @@ namespace API_NetFramework.Controllers
}
#endregion
}
public static class DataTableHelper
{
public static DataTable ToDataTable<T>(List<T> items)
{
DataTable table = new DataTable(typeof(T).Name);
// Properties der Klasse holen
PropertyInfo[] properties = typeof(T).GetProperties();
// Spalten anlegen
foreach (PropertyInfo prop in properties)
{
table.Columns.Add(prop.Name, Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType);
}
// Zeilen füllen
foreach (T item in items)
{
DataRow row = table.NewRow();
foreach (PropertyInfo prop in properties)
{
row[prop.Name] = prop.GetValue(item) ?? DBNull.Value;
}
table.Rows.Add(row);
}
return table;
}
}
}

View File

@@ -22,6 +22,7 @@ using Helper;
using System.Web.WebPages;
using System.Text;
using Microsoft.Ajax.Utilities;
using System.Web.Http.Tracing;
@@ -143,6 +144,7 @@ namespace API_NetFramework.Controllers
public IHttpActionResult GetUnterschriftAsBase64New(string TGNummer, int ImageWidth = 0, int ImageHeight = 0)
{
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
{
//return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");

View File

@@ -19,6 +19,7 @@ namespace OnDocAPI_NetFramework
}
}

View File

@@ -39,6 +39,12 @@
<add key="VSImagePath" value="E:\Software-Projekte\OnDoc\" />
<add key="Mailempfaenger" value="stefan.hutter@tkb.ch" />
<add key="GASSize" value="True" />
<add key="CLMVerantwortung" value="3793"/>
<add key="CLMTeam" value="146"/>
<add key="CLMZustaendig" value="3793"/>
<add key="CLMUnterschriftlinks" value="0"/>
<add key="CLMUnterschriftrechts" value="0"/>
<add key="CLMKube" value="0"/>
</appSettings>
<connectionStrings>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -39,6 +39,12 @@
<add key="VSImagePath" value="E:\Software-Projekte\OnDoc\" />
<add key="Mailempfaenger" value="stefan.hutter@tkb.ch" />
<add key="GASSize" value="True" />
<add key="CLMVerantwortung" value="3793"/>
<add key="CLMTeam" value="146"/>
<add key="CLMZustaendig" value="3793"/>
<add key="CLMUnterschriftlinks" value="0"/>
<add key="CLMUnterschriftrechts" value="0"/>
<add key="CLMKube" value="0"/>
</appSettings>
<connectionStrings>

Binary file not shown.

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly>
<name>System.Web.Http.Tracing</name>
</assembly>
<members>
<member name="T:System.Web.Http.HttpConfigurationTracingExtensions">
<summary>This static class contains helper methods related to the registration of <see cref="T:System.Web.Http.Tracing.ITraceWriter" /> instances.</summary>
</member>
<member name="M:System.Web.Http.HttpConfigurationTracingExtensions.EnableSystemDiagnosticsTracing(System.Web.Http.HttpConfiguration)">
<summary>Creates and registers an <see cref="T:System.Web.Http.Tracing.ITraceWriter" /> implementation to use for this application.</summary>
<returns>The <see cref="T:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter" /> which was created and registered.</returns>
<param name="configuration">The <see cref="T:System.Web.Http.HttpConfiguration" /> for which to register the created trace writer.</param>
</member>
<member name="T:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter">
<summary>Implementation of <see cref="T:System.Web.Http.Tracing.ITraceWriter" /> that traces to <see cref="T:System.Diagnostics.Trace" /></summary>
</member>
<member name="M:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.#ctor"></member>
<member name="M:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.Format(System.Web.Http.Tracing.TraceRecord)">
<summary>Formats the contents of the given <see cref="T:System.Web.Http.Tracing.TraceRecord" /> into a single string containing comma-separated name-value pairs for each <see cref="T:System.Web.Http.Tracing.TraceRecord" /> property.</summary>
<returns>A string containing comma-separated name-value pairs.</returns>
<param name="traceRecord">The <see cref="T:System.Web.Http.Tracing.TraceRecord" /> from which to produce the result.</param>
</member>
<member name="M:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.FormatDateTime(System.DateTime)">
<summary>Formats a <see cref="T:System.DateTime" /> for the trace.</summary>
<returns>The <see cref="T:System.DateTime" /> formatted as a string</returns>
<param name="dateTime">The <see cref="T:System.DateTime" /></param>
</member>
<member name="M:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.FormatRequestEnvelope(System.Web.Http.Tracing.TraceRecord)">
<summary>Formats the given <see cref="T:System.Web.Http.Tracing.TraceRecord" /> into a string describing either the initial receipt of the incoming request or the final send of the response, depending on <see cref="T:System.Web.Http.Tracing.TraceKind" />.</summary>
<returns>A string containing comma-separated name-value pairs.</returns>
<param name="traceRecord">The <see cref="T:System.Web.Http.Tracing.TraceRecord" /> from which to produce the result.</param>
</member>
<member name="P:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.IsVerbose">
<summary>Gets or sets a value indicating whether the formatted message should be the verbose format, meaning it displays all fields of the <see cref="T:System.Web.Http.Tracing.TraceRecord" />.</summary>
<returns>true means all <see cref="T:System.Web.Http.Tracing.TraceRecord" /> fields will be traced, false means only minimal information will be traced. The default value is false.</returns>
</member>
<member name="P:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.MinimumLevel">
<summary>Gets or sets the minimum trace level.</summary>
<returns>Any <see cref="T:System.Web.Http.Tracing.TraceLevel" /> below this level will be ignored. The default for this property is <see cref="F:System.Web.Http.Tracing.TraceLevel.Info" />.</returns>
</member>
<member name="M:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.Trace(System.Net.Http.HttpRequestMessage,System.String,System.Web.Http.Tracing.TraceLevel,System.Action{System.Web.Http.Tracing.TraceRecord})">
<summary>Writes a trace to <see cref="T:System.Diagnostics.Trace" /> if the <paramref name="level" /> is greater than or equal <see cref="P:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.MinimumLevel" />.</summary>
<param name="request">The <see cref="T:System.Net.Http.HttpRequestMessage" /> associated with this trace. It may be null but the resulting trace will contain no correlation ID.</param>
<param name="category">The category for the trace. This can be any user-defined value. It is not interpreted by this implementation but is written to the trace.</param>
<param name="level">The <see cref="T:System.Web.Http.Tracing.TraceLevel" /> of this trace. If it is less than <see cref="P:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.MinimumLevel" />, this trace request will be ignored.</param>
<param name="traceAction">The user callback to invoke to fill in a <see cref="T:System.Web.Http.Tracing.TraceRecord" /> with additional information to add to the trace.</param>
</member>
<member name="P:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.TraceSource">
<summary>Gets or sets the <see cref="P:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.TraceSource" /> to which the traces will be sent.</summary>
<returns>This property allows a custom <see cref="P:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.TraceSource" /> to be used when writing the traces. This allows an application to configure and use its own <see cref="P:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.TraceSource" /> other than the default <see cref="T:System.Diagnostics.Trace" />. If the value is null, this trace writer will send traces to <see cref="T:System.Diagnostics.Trace" />.</returns>
</member>
<member name="M:System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.TranslateHttpResponseException(System.Web.Http.Tracing.TraceRecord)">
<summary>Examines the given <see cref="T:System.Web.Http.Tracing.TraceRecord" /> to determine whether it contains an <see cref="T:System.Web.Http.HttpResponseException" /> and if so, modifies the <see cref="T:System.Web.Http.Tracing.TraceRecord" /> to capture more detailed information.</summary>
<param name="traceRecord">The <see cref="T:System.Web.Http.Tracing.TraceRecord" /> to examine and modify.</param>
</member>
</members>
</doc>

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
f4edd25b59965f3aba1dd0fe3be0134c23fa88f0d01526b0e52d3378a785bf89
912e2514d1f2ddb24b54769f68c94a4776c9e4de5dc37cfb43da8300c2e75df3

View File

@@ -323,3 +323,5 @@ E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\DOCGEN.pdb
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\DOCGEN.dll.config
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\OfficePrinter.pdb
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\Database.dll.config
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\System.Web.Http.Tracing.dll
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\System.Web.Http.Tracing.xml

View File

@@ -16,6 +16,7 @@
<package id="Microsoft.AspNet.WebApi.Core" version="5.3.0" targetFramework="net481" />
<package id="Microsoft.AspNet.WebApi.Core.de" version="5.3.0" targetFramework="net481" />
<package id="Microsoft.AspNet.WebApi.HelpPage" version="5.3.0" targetFramework="net481" />
<package id="Microsoft.AspNet.WebApi.Tracing" version="5.3.0" targetFramework="net481" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.3.0" targetFramework="net481" />
<package id="Microsoft.AspNet.WebApi.WebHost.de" version="5.3.0" targetFramework="net481" />
<package id="Microsoft.AspNet.WebPages" version="3.3.0" targetFramework="net481" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -30,8 +30,8 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MitarbeiterProfil));
Syncfusion.Windows.Forms.Tools.TreeNodeAdvStyleInfo treeNodeAdvStyleInfo3 = new Syncfusion.Windows.Forms.Tools.TreeNodeAdvStyleInfo();
Syncfusion.Windows.Forms.Tools.TreeNodeAdvStyleInfo treeNodeAdvStyleInfo1 = new Syncfusion.Windows.Forms.Tools.TreeNodeAdvStyleInfo();
Syncfusion.Windows.Forms.Tools.TreeNodeAdvStyleInfo treeNodeAdvStyleInfo2 = new Syncfusion.Windows.Forms.Tools.TreeNodeAdvStyleInfo();
this.ribbon1 = new System.Windows.Forms.Ribbon();
this.ribbonTab1 = new System.Windows.Forms.RibbonTab();
this.RibbonPanelExit = new System.Windows.Forms.RibbonPanel();
@@ -165,7 +165,7 @@
this.ribbon1.OrbStyle = System.Windows.Forms.RibbonOrbStyle.Office_2013;
this.ribbon1.OrbVisible = false;
this.ribbon1.RibbonTabFont = new System.Drawing.Font("Trebuchet MS", 9F);
this.ribbon1.Size = new System.Drawing.Size(802, 121);
this.ribbon1.Size = new System.Drawing.Size(742, 121);
this.ribbon1.TabIndex = 0;
this.ribbon1.Tabs.Add(this.ribbonTab1);
this.ribbon1.Tabs.Add(this.ribbonTab2);
@@ -533,8 +533,9 @@
// txtfunktion
//
this.txtfunktion.Location = new System.Drawing.Point(138, 174);
this.txtfunktion.Multiline = true;
this.txtfunktion.Name = "txtfunktion";
this.txtfunktion.Size = new System.Drawing.Size(147, 20);
this.txtfunktion.Size = new System.Drawing.Size(219, 56);
this.txtfunktion.TabIndex = 13;
//
// label10
@@ -657,7 +658,7 @@
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(89, 79);
this.GrpGetSignature.Location = new System.Drawing.Point(32, 19);
this.GrpGetSignature.Name = "GrpGetSignature";
this.GrpGetSignature.Size = new System.Drawing.Size(651, 394);
this.GrpGetSignature.TabIndex = 21;
@@ -787,6 +788,7 @@
//
this.GrpGAS.Controls.Add(this.panelpersadresse);
this.GrpGAS.Controls.Add(this.label30);
this.GrpGAS.Controls.Add(this.GrpGetSignature);
this.GrpGAS.Controls.Add(this.label31);
this.GrpGAS.Controls.Add(this.label32);
this.GrpGAS.Controls.Add(this.label29);
@@ -797,9 +799,9 @@
this.GrpGAS.Controls.Add(this.TreeViewADVPersadresse);
this.GrpGAS.Controls.Add(this.label19);
this.GrpGAS.Controls.Add(this.treeViewAdvAdresse);
this.GrpGAS.Location = new System.Drawing.Point(14, 30);
this.GrpGAS.Location = new System.Drawing.Point(8, 30);
this.GrpGAS.Name = "GrpGAS";
this.GrpGAS.Size = new System.Drawing.Size(696, 509);
this.GrpGAS.Size = new System.Drawing.Size(733, 461);
this.GrpGAS.TabIndex = 22;
this.GrpGAS.TabStop = false;
this.GrpGAS.Text = "Rückantwort-Adressen";
@@ -1065,15 +1067,15 @@
// TreeViewADVPersadresse
//
this.TreeViewADVPersadresse.BackgroundColor = new Syncfusion.Drawing.BrushInfo(System.Drawing.SystemColors.Window);
treeNodeAdvStyleInfo1.CheckBoxTickThickness = 1;
treeNodeAdvStyleInfo1.CheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo1.EnsureDefaultOptionedChild = true;
treeNodeAdvStyleInfo1.IntermediateCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo1.OptionButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo1.SelectedOptionButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(210)))), ((int)(((byte)(210)))));
treeNodeAdvStyleInfo1.TextColor = System.Drawing.Color.Black;
treeNodeAdvStyleInfo3.CheckBoxTickThickness = 1;
treeNodeAdvStyleInfo3.CheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo3.EnsureDefaultOptionedChild = true;
treeNodeAdvStyleInfo3.IntermediateCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo3.OptionButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo3.SelectedOptionButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(210)))), ((int)(((byte)(210)))));
treeNodeAdvStyleInfo3.TextColor = System.Drawing.Color.Black;
this.TreeViewADVPersadresse.BaseStylePairs.AddRange(new Syncfusion.Windows.Forms.Tools.StyleNamePair[] {
new Syncfusion.Windows.Forms.Tools.StyleNamePair("Standard", treeNodeAdvStyleInfo1)});
new Syncfusion.Windows.Forms.Tools.StyleNamePair("Standard", treeNodeAdvStyleInfo3)});
this.TreeViewADVPersadresse.ContextMenuStrip = this.contextMenuStrip1;
//
//
@@ -1142,15 +1144,15 @@
// treeViewAdvAdresse
//
this.treeViewAdvAdresse.BackgroundColor = new Syncfusion.Drawing.BrushInfo(System.Drawing.SystemColors.Window);
treeNodeAdvStyleInfo2.CheckBoxTickThickness = 1;
treeNodeAdvStyleInfo2.CheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo2.EnsureDefaultOptionedChild = true;
treeNodeAdvStyleInfo2.IntermediateCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo2.OptionButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo2.SelectedOptionButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(210)))), ((int)(((byte)(210)))));
treeNodeAdvStyleInfo2.TextColor = System.Drawing.Color.Black;
treeNodeAdvStyleInfo1.CheckBoxTickThickness = 1;
treeNodeAdvStyleInfo1.CheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo1.EnsureDefaultOptionedChild = true;
treeNodeAdvStyleInfo1.IntermediateCheckColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo1.OptionButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
treeNodeAdvStyleInfo1.SelectedOptionButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(210)))), ((int)(((byte)(210)))));
treeNodeAdvStyleInfo1.TextColor = System.Drawing.Color.Black;
this.treeViewAdvAdresse.BaseStylePairs.AddRange(new Syncfusion.Windows.Forms.Tools.StyleNamePair[] {
new Syncfusion.Windows.Forms.Tools.StyleNamePair("Standard", treeNodeAdvStyleInfo2)});
new Syncfusion.Windows.Forms.Tools.StyleNamePair("Standard", treeNodeAdvStyleInfo1)});
this.treeViewAdvAdresse.ContextMenuStrip = this.contextMenuStrip2;
//
//
@@ -1203,8 +1205,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(806, 496);
this.Controls.Add(this.GrpGetSignature);
this.ClientSize = new System.Drawing.Size(746, 496);
this.Controls.Add(this.GrpGAS);
this.Controls.Add(this.GrpBoxMitarbeiter);
this.Controls.Add(this.GrpBoxDetails);

View File

@@ -65,7 +65,7 @@
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(472, 26);
this.label2.TabIndex = 2;
this.label2.Text = "28. Dezember 2025";
this.label2.Text = "9. Januar 2026";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label2.Click += new System.EventHandler(this.label2_Click);
//

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Management;
using System.Runtime.InteropServices;
using System.Security.AccessControl;
using System.Text;
using System.Threading;
@@ -10,13 +11,72 @@ using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms;
using Database;
using Microsoft.Office.Interop.Word;
using OnDoc.UICintrols;
using Syncfusion.Olap.MDXQueryParser;
using Syncfusion.Windows.Forms.Tools;
using Syncfusion.WinForms.Input.Enums;
using static Syncfusion.Windows.Forms.Tools.ColorDlgAdv;
using Word = Microsoft.Office.Interop.Word;
namespace OnDoc.Klassen
{
public static class clsProcessWatch
{
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
private static extern int GetWindowText(IntPtr hWnd, StringBuilder strText, int maxCount);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
private static extern int GetWindowTextLength(IntPtr hWnd);
[DllImport("user32.dll")]
private static extern bool EnumWindows(EnumWindowsProc enumProc, IntPtr lParam);
// Delegate to filter which windows to include
public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
/// <summary> Get the text for the window pointed to by hWnd </summary>
public static string GetWindowText(IntPtr hWnd)
{
int size = GetWindowTextLength(hWnd);
if (size > 0)
{
var builder = new StringBuilder(size + 1);
GetWindowText(hWnd, builder, builder.Capacity);
return builder.ToString();
}
return String.Empty;
}
public static IEnumerable<IntPtr> FindWindows(EnumWindowsProc filter)
{
IntPtr found = IntPtr.Zero;
List<IntPtr> windows = new List<IntPtr>();
EnumWindows(delegate (IntPtr wnd, IntPtr param)
{
if (filter(wnd, param))
{
// only add the windows that pass the filter
windows.Add(wnd);
}
// but return true here so that we iterate all windows
return true;
}, IntPtr.Zero);
return windows;
}
public static IEnumerable<IntPtr> FindWindowsWithText(string titleText)
{
return FindWindows(delegate (IntPtr wnd, IntPtr param)
{
return GetWindowText(wnd).Contains(titleText);
});
}
public static System.Timers.Timer watchtimer = new System.Timers.Timer(Convert.ToInt32(Properties.Settings.Default.OfficeWatchTimerIntervall));
@@ -72,7 +132,7 @@ namespace OnDoc.Klassen
return "NO OWNER";
}
private static void WatchProcesses(object source, ElapsedEventArgs e)
private static void WatchProcesses1(object source, ElapsedEventArgs e)
{
bool word = false;
bool excel = false;
@@ -87,6 +147,7 @@ namespace OnDoc.Klassen
{
if (fc.filedatetime < DateTime.Now.AddSeconds(-3))
{
found = false;
word = false;
excel = false;
@@ -101,12 +162,18 @@ namespace OnDoc.Klassen
{
Thread.Sleep(200);
Process[] localByName = Process.GetProcessesByName("WINWORD");
Logging.Logging.Debug("Get Processe", "", "");
foreach (Process p in localByName)
{
Logging.Logging.Debug(localByName.Count().ToString(), "", "");
string owner = GetProcessOwner(p.Id);
owner = owner.ToUpper();
Logging.Logging.Debug(AppParams.systemtgnummer + "/" + AppParams.currenttgnummer + "/" + owner + "/" + fc.dokumentid + "/" + p.MainWindowTitle, "", "");
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1 ||
(p.MainWindowTitle.Trim() == "" && owner.Contains(AppParams.systemtgnummer.ToUpper())))
{
@@ -197,6 +264,68 @@ namespace OnDoc.Klassen
watchtimer.Enabled = true;
}
}
private static void WatchProcesses(object source, ElapsedEventArgs e)
{
bool word = false;
bool excel = false;
bool pdf = false;
bool found = false;
watchtimer.Enabled = false;
found = false;
Logging.Logging.Debug("Start Watch_Process:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), "OnDoc.Processwatch", "");
try
{
foreach (FileToCheck fc in FilestoCheck)
{
if (fc.filedatetime < DateTime.Now.AddSeconds(-3))
{
found = false;
var windows = FindWindowsWithText(fc.dokumentid);
if (windows.Count() > 0)
{
found = true;
save_to_db(fc);
}
windows = null;
if (!found)
{
Logging.Logging.Debug("Not Found " + fc.filename + " / " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), "OnDoc.Processwatch", fc.dokumentid);
if (Check_Modified(fc) == true)
{
Save_File(fc.dokumentid, fc.filename);
Logging.DocLog.Info("Dokument gespeichert und geschlossen", "Processwatch", fc.dokumentid, "", fc.filename);
RemoveFromList(fc.dokumentid);
Remove_Dok_in_Bearbeitung(fc.dokumentid);
Remove_Dokumentbearbeitung_Zwingend(fc.dokumentid);
Remove_Approvals(fc.dokumentid);
return;
}
else
{
Logging.DocLog.Info("Dokument ohne speichern geschlossen", "Processwatch", fc.dokumentid, "", fc.filename);
RemoveFromList(fc.dokumentid);
Remove_Dok_in_Bearbeitung(fc.dokumentid);
return;
};
}
}
}
watchtimer.Enabled = true;
}
catch (Exception ex)
{
Logging.Logging.Debug("Error Processwatch", "OnDoc", ex.Message);
}
finally
{
watchtimer.Enabled = true;
}
}
private static void Remove_Dok_in_Bearbeitung(string dokumentid)
{
DB db = new DB(AppParams.connectionstring);

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.11.03")]
[assembly: AssemblyFileVersion("1.7.11.03")]
[assembly: AssemblyVersion("1.7.11.05")]
[assembly: AssemblyFileVersion("1.7.11.05")]

View File

@@ -51,6 +51,7 @@ namespace OnDoc.UIControls
}
private void treeViewAdv1_NodeMouseClick(object sender, Syncfusion.Windows.Forms.Tools.TreeViewAdvMouseClickEventArgs e)
{
treeViewAdv1.SelectedNode = e.Node;
if (treeViewAdv1.SelectedNode.Level == 1)
{
this.ribbonButtonApproved.Enabled = false;

View File

@@ -1436,7 +1436,7 @@ namespace OnDoc.Versandstrasse
DB db = new DB(AppParams.connectionstring);
DB db2 = new DB(AppParams.connectionstring);
//STH
//db.Get_Tabledata("Select * from ondoc_versandstrasse_paket where isnull(signed,1)=1 and aktiv=1 and ersteller=" + AppParams.CurrentMitarbeiter + " and versendet=0", false, true);
db.Get_Tabledata("Select * from ondoc_versandstrasse_paket where aktiv=1 and ersteller=" + AppParams.CurrentMitarbeiter + " and versendet=0", false, true);
treeViewAdvCouverts.Nodes.Clear();

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -627,6 +627,51 @@ namespace DOCGEN.Klassen
}
}
catch { }
try
{
foreach (CLMDocItem item in docdata.CLMDocItems)
{
if (item.itemvalue.ToString() != "" && item.type != null)
{
foreach (WSection section in document.Sections)
//Iterates through section child elements
foreach (WTextBody textBody in section.ChildEntities)
{
//Iterates through form fields
foreach (WFormField formField in textBody.FormFields)
{
if (formField.Name == item.field.ToString())
{
switch (item.type.ToString())
{
case "4": //Text and CheckBox
string type = formField.FieldType.ToString();
if (type == "FieldFormCheckBox")
{
WCheckBox cb = (WCheckBox)formField;
if (item.itemvalue.ToString().ToUpper() == "X")
{
cb.Checked = true;
}
}
else
{
formField.Text = item.itemvalue.ToString();
}
break;
case "5": //Image
break;
}
}
}
}
}
}
}
catch { }
//gaga
//if (docdata.As_Faksimile == "True" && serienbrief==true)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -593,6 +593,8 @@ namespace Database
edoka_conn.CloseConnection(true);
}
//DokumentInfoWert
try
{
foreach (DataRow dr in DocData.dokumentwerte.Rows)
{
if (dr["cold_indexfeld"].ToString() == "") { dr["cold_indexfeld"] = 0; }
@@ -624,6 +626,8 @@ namespace Database
}
}
}
}
catch { }
db.Get_Tabledata("Select * from dokumenttyp where dokumenttypnr=" + dok.iDokumenttypnr.ToString(), false, true);
int toapprove = DocData.toapprove;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -68,3 +68,5 @@ E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\bin\Debug\vbBarcodes.xml
E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\bin\Debug\MW6.SDK.dll
E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\bin\Debug\CSVNET.dll
E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\bin\Debug\CSVNET.pdb
E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\obj\Debug\Excel_Test.csproj.SuggestedBindingRedirects.cache
E:\Software-Projekte\OnDoc\OnDoc\Excel_Test\obj\Debug\Excel_Test.exe.config

View File

@@ -0,0 +1 @@
6d76e7a2caa84cc541daed57fe5afac7bb9484f5c33350578418a0d84207e06f

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog.Database" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -120,5 +120,24 @@ namespace Model
public string dokument { get; set; }
}
public class CLMDocItem
{
public string itemname;
public string itemtag;
public string itemvalue;
public string doclinkname;
public string type;
public string field;
public string bmstart;
public string bmend;
public string top;
public string left;
public string width;
public string height;
}
//public class CLMDocItems
//{
// public List<docitem> CLMDocItem { get; set; }
//}
}

Binary file not shown.

Binary file not shown.

View File

@@ -98,6 +98,7 @@ namespace Model
public List<attribute> APIValues { get; set; }
public List<textreplace> TextToReplace { get; set; }
public List<CLMDocItem> CLMDocItems { get; set; }
}

Binary file not shown.

Binary file not shown.

View File

@@ -62,3 +62,5 @@ E:\Software-Projekte\OnDoc\OnDoc\NativVorlagen\bin\Debug\Syncfusion.Grid.Windows
E:\Software-Projekte\OnDoc\OnDoc\NativVorlagen\obj\Debug\NativVor.29F51F95.Up2Date
E:\Software-Projekte\OnDoc\OnDoc\NativVorlagen\obj\Debug\NativVorlagen.exe
E:\Software-Projekte\OnDoc\OnDoc\NativVorlagen\obj\Debug\NativVorlagen.pdb
E:\Software-Projekte\OnDoc\OnDoc\NativVorlagen\obj\Debug\NativVorlagen.csproj.SuggestedBindingRedirects.cache
E:\Software-Projekte\OnDoc\OnDoc\NativVorlagen\obj\Debug\NativVorlagen.exe.config

View File

@@ -0,0 +1 @@
6d76e7a2caa84cc541daed57fe5afac7bb9484f5c33350578418a0d84207e06f

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="NativVorlagen.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<userSettings>
<NativVorlagen.Properties.Settings>
<setting name="Vorlagen" serializeAs="String">
<value>E:\Software-Projekte\OnDoc\Nativ\</value>
</setting>
<setting name="UserDir" serializeAs="String">
<value>h:\edoka_work\</value>
</setting>
</NativVorlagen.Properties.Settings>
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog.Database" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -1 +1 @@
26adcd250e91980369d40f64bc7feb6761a6219081acfe8442ae185c2c016d76
0eb5325e2c488e3781593515455a28c9bde0a1fe084c091e983a29e386437fea

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More