Update 20250222
This commit is contained in:
@@ -93,6 +93,9 @@
|
||||
<Reference Include="Newtonsoft.Json.Bson, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.Bson.1.0.2\lib\net45\Newtonsoft.Json.Bson.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OfficeToPDFConverter">
|
||||
<HintPath>..\OfficeToPDFConverter\bin\Debug\OfficeToPDFConverter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -136,6 +136,13 @@ namespace API_NetFramework.Controllers
|
||||
{
|
||||
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
|
||||
}
|
||||
string ArchivAktiv;
|
||||
ArchivAktiv= System.Configuration.ConfigurationManager.AppSettings["ArchivierungAktiv"].ToString();
|
||||
if (ArchivAktiv != "True")
|
||||
{
|
||||
string message = ArchivAktiv = System.Configuration.ConfigurationManager.AppSettings["ArchivierungNoAktivMessage"].ToString();
|
||||
return Content(HttpStatusCode.InternalServerError, message);
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
@@ -147,6 +154,51 @@ namespace API_NetFramework.Controllers
|
||||
db.Get_Tabledata("Select dokumenttypnr, dokumentname from dokument where dokumentid='" + DokumentID + "'", false, true);
|
||||
extension = System.IO.Path.GetExtension(db.dsdaten.Tables[0].Rows[0]["dokumentname"].ToString());
|
||||
doktypnr = db.dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
db.Get_Tabledata("Select erstellunginoffice from dokumenttyp where dokumenttypnr="+doktypnr.ToString(), false, true);
|
||||
|
||||
if (Convert.ToBoolean(db.dsdaten.Tables[0].Rows[0]["Erstellunginoffice"]))
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, DokumentID + " ErstellungInOffec - EDKB02DMS", LogLevelType.Error);
|
||||
|
||||
db.clear_parameter();
|
||||
db.add_parameter("@dokumentid", DokumentID);
|
||||
if (DokumentID.Contains("OFFEDK008"))
|
||||
{
|
||||
db.add_parameter("@ondocdoc", "1");
|
||||
}
|
||||
db.Get_Tabledata("[OnDoc_IRIS_Archivierung]", true, false);
|
||||
string returnmessage = db.dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
switch (db.dsdaten.Tables[0].Rows[0][1].ToString())
|
||||
{
|
||||
case "1":
|
||||
APILogging.Log((HttpRequestMessage)Request, DokumentID + " Image des Dokuments nicht vorhanden", LogLevelType.Error);
|
||||
return Content(HttpStatusCode.NotFound, DokumentID);
|
||||
break;
|
||||
case "2":
|
||||
APILogging.Log((HttpRequestMessage)Request, DokumentID + " nicht vorhanden", LogLevelType.Error);
|
||||
return Content(HttpStatusCode.NotFound, DokumentID);
|
||||
break;
|
||||
case "3":
|
||||
APILogging.Log((HttpRequestMessage)Request, db.dsdaten.Tables[0].Rows[0][0].ToString() + DokumentID, LogLevelType.Debug);
|
||||
return Content(HttpStatusCode.OK, returnmessage);
|
||||
case "0":
|
||||
return (ArchivDocFromDatabase(DokumentID));
|
||||
case "4":
|
||||
APILogging.Log((HttpRequestMessage)Request, "Dokumentarchivierung via EDKB02_DMS ausgelöst" + DokumentID, LogLevelType.Info);
|
||||
break;
|
||||
case "5":
|
||||
APILogging.Log((HttpRequestMessage)Request, "Dokument bereit zur Ausgangsarchivierung" + DokumentID, LogLevelType.Info);
|
||||
break;
|
||||
case "6":
|
||||
APILogging.Log((HttpRequestMessage)Request, "Dokument in EDOKA abgeschlossen" + DokumentID, LogLevelType.Info);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
};
|
||||
return Content(HttpStatusCode.OK, DokumentID + " archiviert");
|
||||
}
|
||||
|
||||
db.clear_parameter();
|
||||
db.add_parameter("@dokumentid", DokumentID);
|
||||
db.Get_Tabledata("[sp_Get_OnDoc_Parameters]", true, false);
|
||||
@@ -293,6 +345,13 @@ namespace API_NetFramework.Controllers
|
||||
{
|
||||
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
|
||||
}
|
||||
string ArchivAktiv;
|
||||
ArchivAktiv = System.Configuration.ConfigurationManager.AppSettings["ArchivierungAktiv"].ToString();
|
||||
if (ArchivAktiv != "True")
|
||||
{
|
||||
string message = ArchivAktiv = System.Configuration.ConfigurationManager.AppSettings["ArchivierungNoAktivMessage"].ToString();
|
||||
return Content(HttpStatusCode.InternalServerError, message);
|
||||
}
|
||||
try
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start ArchivDocFromIRIS DokumentID: " + dokumentid, LogLevelType.Debug);
|
||||
@@ -306,6 +365,7 @@ namespace API_NetFramework.Controllers
|
||||
DB db = new DB(connectionstring);
|
||||
db.clear_parameter();
|
||||
db.add_parameter("@dokumentid", dokumentid);
|
||||
|
||||
db.Get_Tabledata("[OnDoc_IRIS_Archivierung]", true, false);
|
||||
string returnmessage = db.dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
switch (db.dsdaten.Tables[0].Rows[0][1].ToString())
|
||||
@@ -358,6 +418,13 @@ namespace API_NetFramework.Controllers
|
||||
{
|
||||
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
|
||||
}
|
||||
string ArchivAktiv;
|
||||
ArchivAktiv = System.Configuration.ConfigurationManager.AppSettings["ArchivierungAktiv"].ToString();
|
||||
if (ArchivAktiv != "True")
|
||||
{
|
||||
string message = ArchivAktiv = System.Configuration.ConfigurationManager.AppSettings["ArchivierungNoAktivMessage"].ToString();
|
||||
return Content(HttpStatusCode.InternalServerError, message);
|
||||
}
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start ArchivSBDoc DokumentID: DokumentID:" + dokumentid, LogLevelType.Debug);
|
||||
|
||||
string json = "";
|
||||
|
||||
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<_PublishTargetUrl>E:\Software-Projekte\OnDoc\PubServices\OnDoc</_PublishTargetUrl>
|
||||
<History>True|2025-02-12T11:49:01.5618262Z||;True|2025-02-09T14:47:25.8660147+01:00||;True|2025-02-09T12:40:23.8730229+01:00||;True|2025-02-05T14:41:27.6196364+01:00||;True|2025-02-04T22:19:44.0470841+01:00||;True|2025-02-04T21:33:03.4165210+01:00||;True|2025-02-02T20:06:51.6815543+01:00||;True|2025-01-20T10:17:24.5425008+01:00||;True|2025-01-19T16:20:16.1036874+01:00||;True|2025-01-19T16:19:11.5720999+01:00||;True|2025-01-12T14:24:46.2550852+01:00||;True|2025-01-12T14:00:23.9205001+01:00||;True|2025-01-07T15:08:24.2722613+01:00||;True|2025-01-06T09:25:16.5522864+01:00||;True|2024-12-22T16:49:54.0855447+01:00||;True|2024-12-08T09:59:39.7127943+01:00||;True|2024-12-08T09:26:52.1924006+01:00||;True|2024-12-02T09:50:13.5426444+01:00||;True|2024-12-01T18:53:55.8128003+01:00||;True|2024-11-26T19:32:44.7379810+01:00||;True|2024-11-25T16:02:25.7013060+01:00||;True|2024-11-24T18:56:32.4321643+01:00||;True|2024-11-24T18:48:11.3494435+01:00||;True|2024-11-24T17:50:10.7679996+01:00||;True|2024-11-22T08:35:58.1296657+01:00||;True|2024-11-13T17:47:13.0183160+01:00||;True|2024-11-13T17:46:36.5183689+01:00||;True|2024-11-11T13:42:23.6578245+01:00||;True|2024-11-09T12:11:00.0777236+01:00||;True|2024-11-09T11:54:51.8503924+01:00||;</History>
|
||||
<History>True|2025-02-21T09:28:09.2279895Z||;True|2025-02-21T09:59:33.3258979+01:00||;True|2025-02-12T12:49:01.5618262+01:00||;True|2025-02-09T14:47:25.8660147+01:00||;True|2025-02-09T12:40:23.8730229+01:00||;True|2025-02-05T14:41:27.6196364+01:00||;True|2025-02-04T22:19:44.0470841+01:00||;True|2025-02-04T21:33:03.4165210+01:00||;True|2025-02-02T20:06:51.6815543+01:00||;True|2025-01-20T10:17:24.5425008+01:00||;True|2025-01-19T16:20:16.1036874+01:00||;True|2025-01-19T16:19:11.5720999+01:00||;True|2025-01-12T14:24:46.2550852+01:00||;True|2025-01-12T14:00:23.9205001+01:00||;True|2025-01-07T15:08:24.2722613+01:00||;True|2025-01-06T09:25:16.5522864+01:00||;True|2024-12-22T16:49:54.0855447+01:00||;True|2024-12-08T09:59:39.7127943+01:00||;True|2024-12-08T09:26:52.1924006+01:00||;True|2024-12-02T09:50:13.5426444+01:00||;True|2024-12-01T18:53:55.8128003+01:00||;True|2024-11-26T19:32:44.7379810+01:00||;True|2024-11-25T16:02:25.7013060+01:00||;True|2024-11-24T18:56:32.4321643+01:00||;True|2024-11-24T18:48:11.3494435+01:00||;True|2024-11-24T17:50:10.7679996+01:00||;True|2024-11-22T08:35:58.1296657+01:00||;True|2024-11-13T17:47:13.0183160+01:00||;True|2024-11-13T17:46:36.5183689+01:00||;True|2024-11-11T13:42:23.6578245+01:00||;True|2024-11-09T12:11:00.0777236+01:00||;True|2024-11-09T11:54:51.8503924+01:00||;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
@@ -82,10 +82,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<publishTime>04/09/2024 19:25:14</publishTime>
|
||||
</File>
|
||||
<File Include="bin/BarcodeLib.dll">
|
||||
<publishTime>02/09/2025 17:54:19</publishTime>
|
||||
<publishTime>02/19/2025 15:44:36</publishTime>
|
||||
</File>
|
||||
<File Include="bin/BarcodeLib.pdb">
|
||||
<publishTime>02/09/2025 17:54:19</publishTime>
|
||||
<publishTime>02/19/2025 15:44:36</publishTime>
|
||||
</File>
|
||||
<File Include="bin/CSVNET.dll">
|
||||
<publishTime>12/26/2024 14:12:09</publishTime>
|
||||
@@ -94,10 +94,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<publishTime>12/26/2024 14:12:09</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Database.dll">
|
||||
<publishTime>02/09/2025 12:40:08</publishTime>
|
||||
<publishTime>02/19/2025 10:54:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Database.pdb">
|
||||
<publishTime>02/09/2025 12:40:08</publishTime>
|
||||
<publishTime>02/19/2025 10:54:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/de/System.Net.Http.Formatting.resources.dll">
|
||||
<publishTime>10/20/2023 22:35:02</publishTime>
|
||||
@@ -130,13 +130,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<publishTime>10/20/2023 22:35:04</publishTime>
|
||||
</File>
|
||||
<File Include="bin/DOCGEN.dll">
|
||||
<publishTime>02/12/2025 07:57:46</publishTime>
|
||||
<publishTime>02/21/2025 06:51:17</publishTime>
|
||||
</File>
|
||||
<File Include="bin/DOCGEN.dll.config">
|
||||
<publishTime>12/23/2024 22:17:43</publishTime>
|
||||
</File>
|
||||
<File Include="bin/DOCGEN.pdb">
|
||||
<publishTime>02/12/2025 07:57:46</publishTime>
|
||||
<publishTime>02/21/2025 06:51:17</publishTime>
|
||||
</File>
|
||||
<File Include="bin/FastReport.Bars.dll">
|
||||
<publishTime>11/27/2023 09:49:58</publishTime>
|
||||
@@ -154,10 +154,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<publishTime>11/27/2023 09:50:04</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Helper.dll">
|
||||
<publishTime>12/30/2024 08:48:57</publishTime>
|
||||
<publishTime>02/19/2025 10:54:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Helper.pdb">
|
||||
<publishTime>12/30/2024 08:48:57</publishTime>
|
||||
<publishTime>02/19/2025 10:54:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/libSkiaSharp.dylib">
|
||||
<publishTime>04/09/2024 18:58:02</publishTime>
|
||||
@@ -243,17 +243,23 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<File Include="bin/OfficePrinter.pdb">
|
||||
<publishTime>01/28/2025 08:37:54</publishTime>
|
||||
</File>
|
||||
<File Include="bin/OfficeToPDFConverter.dll">
|
||||
<publishTime>02/21/2025 06:22:11</publishTime>
|
||||
</File>
|
||||
<File Include="bin/OfficeToPDFConverter.pdb">
|
||||
<publishTime>02/21/2025 06:22:11</publishTime>
|
||||
</File>
|
||||
<File Include="bin/OnDocOffice.dll">
|
||||
<publishTime>02/12/2025 07:57:43</publishTime>
|
||||
<publishTime>02/21/2025 06:51:12</publishTime>
|
||||
</File>
|
||||
<File Include="bin/OnDocOffice.pdb">
|
||||
<publishTime>02/12/2025 07:57:43</publishTime>
|
||||
<publishTime>02/21/2025 06:51:12</publishTime>
|
||||
</File>
|
||||
<File Include="bin/OnDoc_NetFramework.dll">
|
||||
<publishTime>02/12/2025 11:31:47</publishTime>
|
||||
<publishTime>02/21/2025 10:28:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/OnDoc_NetFramework.pdb">
|
||||
<publishTime>02/12/2025 11:31:47</publishTime>
|
||||
<publishTime>02/21/2025 10:28:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Owin.dll">
|
||||
<publishTime>11/13/2012 13:19:34</publishTime>
|
||||
@@ -652,7 +658,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<publishTime>06/03/2024 08:11:55</publishTime>
|
||||
</File>
|
||||
<File Include="Web.config">
|
||||
<publishTime>02/04/2025 21:33:02</publishTime>
|
||||
<publishTime>02/21/2025 10:28:09</publishTime>
|
||||
</File>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -32,6 +32,8 @@
|
||||
<add key="ExcelDokType" value="2421" />
|
||||
<add key="MailParam" value="Send-MailMessage -from "OnDoc@tkb.ch" -to "$$empfaenger$$" -Subject "$$betreff$$" -Body "$$body$$" -smtpServer smtp.tgcorp.ch" />
|
||||
<add key="URI" value="http://" />
|
||||
<add key="ArchivierungAktiv" value="True" />
|
||||
<add key="ArchivierungNoAktivMessage" value="Aufgrund von technischen Umstellung ist die Archivierung aktuell nicht aktiv." />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="EDOKAConnectionstring" connectionString="Po7oIigu4hOz6zXOpaSnrhveCQyfGgFeskvEQsvm3CEgxjJMEYYDEbnWlt9Qr9vGTkzqm5hvURTLA1hKVU++/ozcvT5qIVTpDLBTKd4AM/4YgN3+L9cx3mxMoWmv1JMjqxZVbR6GYiuSo1xuD05sl3IGoUenfugP6hBP/IC7MjUjisDUE6msFpWiraJr53gcfDvIrc2CUBTVUS+f94kewhlKxjtEohtCM71PN2zpoMiPyBIuXDyrYlYyokUOg6uV" />
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
API_NetFramework/bin/OfficeToPDFConverter.dll
Normal file
BIN
API_NetFramework/bin/OfficeToPDFConverter.dll
Normal file
Binary file not shown.
BIN
API_NetFramework/bin/OfficeToPDFConverter.pdb
Normal file
BIN
API_NetFramework/bin/OfficeToPDFConverter.pdb
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -32,6 +32,8 @@
|
||||
<add key="ExcelDokType" value="2421" />
|
||||
<add key="MailParam" value="Send-MailMessage -from "OnDoc@tkb.ch" -to "$$empfaenger$$" -Subject "$$betreff$$" -Body "$$body$$" -smtpServer smtp.tgcorp.ch" />
|
||||
<add key="URI" value="http://" />
|
||||
<add key="ArchivierungAktiv" value="True" />
|
||||
<add key="ArchivierungNoAktivMessage" value="Aufgrund von technischen Umstellung ist die Archivierung aktuell nicht aktiv." />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="EDOKAConnectionstring" connectionString="Po7oIigu4hOz6zXOpaSnrhveCQyfGgFeskvEQsvm3CEgxjJMEYYDEbnWlt9Qr9vGTkzqm5hvURTLA1hKVU++/ozcvT5qIVTpDLBTKd4AM/4YgN3+L9cx3mxMoWmv1JMjqxZVbR6GYiuSo1xuD05sl3IGoUenfugP6hBP/IC7MjUjisDUE6msFpWiraJr53gcfDvIrc2CUBTVUS+f94kewhlKxjtEohtCM71PN2zpoMiPyBIuXDyrYlYyokUOg6uV" />
|
||||
|
||||
Binary file not shown.
@@ -5454,3 +5454,43 @@ Mit folgendem Link kann OnDoc direkt gestartet werden<br>
|
||||
2025-02-19 15:50:20.3672|DEBUG|OnDoc|
|
||||
2025-02-19 15:50:20.3672|DEBUG|OnDoc|
|
||||
2025-02-19 15:50:21.8605|DEBUG|OnDoc|Ende GetDocument DokumentID:OFFEDK0082025002489614
|
||||
2025-02-21 09:47:06.5367|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:1234234
|
||||
2025-02-21 09:47:06.5900|DEBUG|OnDoc|
|
||||
2025-02-21 09:47:06.5990|DEBUG|OnDoc|
|
||||
2025-02-21 09:47:06.6575|ERROR|OnDoc|An der Position 0 befindet sich keine Zeile.
|
||||
2025-02-21 10:15:06.0987|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0082025002490021
|
||||
2025-02-21 10:15:07.3428|DEBUG|OnDoc|
|
||||
2025-02-21 10:15:07.3837|ERROR|OnDoc|Ungültiger Spaltenname "erstellunginoffice".
|
||||
2025-02-21 10:15:19.4539|ERROR|OnDoc|Die Tabelle 0 kann nicht gefunden werden.
|
||||
2025-02-21 10:18:08.1065|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0082025002490021
|
||||
2025-02-21 10:18:10.6928|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:10.6928|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:19.1993|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:19.2360|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:23.5497|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0082025002490021
|
||||
2025-02-21 10:18:28.1930|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0082025002490021
|
||||
2025-02-21 10:18:29.2192|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:29.2286|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:34.4191|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:34.4554|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:37.1760|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0082025002490021
|
||||
2025-02-21 10:18:47.3054|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0082025002490021
|
||||
2025-02-21 10:18:49.3299|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:49.3395|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:52.1279|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:52.1369|DEBUG|OnDoc|
|
||||
2025-02-21 10:18:53.8270|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0082025002490021
|
||||
2025-02-21 10:19:04.0222|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0082025002490021
|
||||
2025-02-21 10:19:04.6409|DEBUG|OnDoc|
|
||||
2025-02-21 10:19:04.6500|DEBUG|OnDoc|
|
||||
2025-02-21 10:19:05.7059|DEBUG|OnDoc|
|
||||
2025-02-21 10:19:05.7157|DEBUG|OnDoc|
|
||||
2025-02-21 10:27:01.6372|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0082025002490021
|
||||
2025-02-21 10:27:02.6617|DEBUG|OnDoc|
|
||||
2025-02-21 10:27:02.6617|DEBUG|OnDoc|
|
||||
2025-02-21 10:27:05.6965|DEBUG|OnDoc|
|
||||
2025-02-21 10:27:05.6965|DEBUG|OnDoc|
|
||||
2025-02-21 10:27:08.4111|ERROR|OnDoc|OFFEDK0082025002490021 ErstellungInOffec - EDKB02DMS
|
||||
2025-02-21 10:27:15.8300|DEBUG|OnDoc|
|
||||
2025-02-21 10:27:15.8923|DEBUG|OnDoc|
|
||||
2025-02-21 10:27:41.1719|INFO|OnDoc|Dokumentarchivierung via EDKB02_DMS ausgelöstOFFEDK0082025002490021
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
1d5e7777976b1fcf427b978fd296839fb79b70f6485f6c476d89469696b7e7f2
|
||||
7f8c9856cb98bb8499b1ef573fed1bb3d0f9d701201fd94c6f47441aba795d03
|
||||
|
||||
@@ -313,3 +313,5 @@ E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\Syncfusion.OfficeChart.Bas
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\VBOffice.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\VBOffice.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\VBOffice.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\OfficeToPDFConverter.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\OfficeToPDFConverter.pdb
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -32,6 +32,8 @@
|
||||
<add key="ExcelDokType" value="2421" />
|
||||
<add key="MailParam" value="Send-MailMessage -from "OnDoc@tkb.ch" -to "$$empfaenger$$" -Subject "$$betreff$$" -Body "$$body$$" -smtpServer smtp.tgcorp.ch" />
|
||||
<add key="URI" value="http://" />
|
||||
<add key="ArchivierungAktiv" value="True" />
|
||||
<add key="ArchivierungNoAktivMessage" value="Aufgrund von technischen Umstellung ist die Archivierung aktuell nicht aktiv." />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="EDOKAConnectionstring" connectionString="Po7oIigu4hOz6zXOpaSnrhveCQyfGgFeskvEQsvm3CEgxjJMEYYDEbnWlt9Qr9vGTkzqm5hvURTLA1hKVU++/ozcvT5qIVTpDLBTKd4AM/4YgN3+L9cx3mxMoWmv1JMjqxZVbR6GYiuSo1xuD05sl3IGoUenfugP6hBP/IC7MjUjisDUE6msFpWiraJr53gcfDvIrc2CUBTVUS+f94kewhlKxjtEohtCM71PN2zpoMiPyBIuXDyrYlYyokUOg6uV" />
|
||||
|
||||
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.
@@ -32,6 +32,8 @@
|
||||
<add key="ExcelDokType" value="2421" />
|
||||
<add key="MailParam" value="Send-MailMessage -from "OnDoc@tkb.ch" -to "$$empfaenger$$" -Subject "$$betreff$$" -Body "$$body$$" -smtpServer smtp.tgcorp.ch" />
|
||||
<add key="URI" value="http://" />
|
||||
<add key="ArchivierungAktiv" value="True" />
|
||||
<add key="ArchivierungNoAktivMessage" value="Aufgrund von technischen Umstellung ist die Archivierung aktuell nicht aktiv." />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="EDOKAConnectionstring" connectionString="Po7oIigu4hOz6zXOpaSnrhveCQyfGgFeskvEQsvm3CEgxjJMEYYDEbnWlt9Qr9vGTkzqm5hvURTLA1hKVU++/ozcvT5qIVTpDLBTKd4AM/4YgN3+L9cx3mxMoWmv1JMjqxZVbR6GYiuSo1xuD05sl3IGoUenfugP6hBP/IC7MjUjisDUE6msFpWiraJr53gcfDvIrc2CUBTVUS+f94kewhlKxjtEohtCM71PN2zpoMiPyBIuXDyrYlYyokUOg6uV" />
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
<add key="ExcelDokType" value="2421" />
|
||||
<add key="MailParam" value="Send-MailMessage -from "OnDoc@tkb.ch" -to "$$empfaenger$$" -Subject "$$betreff$$" -Body "$$body$$" -smtpServer smtp.tgcorp.ch" />
|
||||
<add key="URI" value="http://" />
|
||||
<add key="ArchivierungAktiv" value="True" />
|
||||
<add key="ArchivierungNoAktivMessage" value="Aufgrund von technischen Umstellung ist die Archivierung aktuell nicht aktiv." />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="EDOKAConnectionstring" connectionString="Po7oIigu4hOz6zXOpaSnrhveCQyfGgFeskvEQsvm3CEgxjJMEYYDEbnWlt9Qr9vGTkzqm5hvURTLA1hKVU++/ozcvT5qIVTpDLBTKd4AM/4YgN3+L9cx3mxMoWmv1JMjqxZVbR6GYiuSo1xuD05sl3IGoUenfugP6hBP/IC7MjUjisDUE6msFpWiraJr53gcfDvIrc2CUBTVUS+f94kewhlKxjtEohtCM71PN2zpoMiPyBIuXDyrYlYyokUOg6uV" />
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
Client/Diverses/SplashScreen.Designer.cs
generated
2
Client/Diverses/SplashScreen.Designer.cs
generated
@@ -64,7 +64,7 @@
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(177, 26);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "19. Februar 2025";
|
||||
this.label2.Text = "20. Februar 2025";
|
||||
//
|
||||
// SplashScreen
|
||||
//
|
||||
|
||||
@@ -56,8 +56,10 @@ namespace OnDoc.Klassen
|
||||
bool excel = false;
|
||||
bool pdf = false;
|
||||
bool found = false;
|
||||
watchtimer.Enabled = false;
|
||||
found= false;
|
||||
//watchtimer.Enabled = false;
|
||||
found = false;
|
||||
Logging.Logging.Debug("Start Watch_Process:"+ DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), "OnDoc.Processwatch","" );
|
||||
|
||||
foreach (FileToCheck fc in FilestoCheck)
|
||||
{
|
||||
if (fc.filedatetime < DateTime.Now.AddSeconds(-5))
|
||||
@@ -76,31 +78,34 @@ namespace OnDoc.Klassen
|
||||
{
|
||||
Thread.Sleep(200);
|
||||
Process[] localByName = Process.GetProcessesByName("WINWORD");
|
||||
|
||||
foreach (Process p in localByName)
|
||||
{
|
||||
|
||||
foreach (Process p in localByName)
|
||||
{
|
||||
Logging.Logging.Debug(fc.dokumentid + "/" + p.MainWindowTitle, "", "");
|
||||
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1)
|
||||
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1 || p.MainWindowTitle.Trim() == "")
|
||||
|
||||
{
|
||||
found = true;
|
||||
save_to_db(fc);
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (p.MainWindowTitle.Trim() != "") { fc.Lastfound = DateTime.Now; }
|
||||
found = true;
|
||||
save_to_db(fc);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (excel)
|
||||
{
|
||||
Process[] localByName = Process.GetProcessesByName("EXCEL");
|
||||
foreach (Process p in localByName)
|
||||
{
|
||||
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1) {
|
||||
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1 || p.MainWindowTitle.Trim() == "")
|
||||
{
|
||||
found = true;
|
||||
save_to_db(fc);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
@@ -127,7 +132,7 @@ namespace OnDoc.Klassen
|
||||
}
|
||||
|
||||
}
|
||||
watchtimer.Enabled = true;
|
||||
//watchtimer.Enabled = true;
|
||||
|
||||
}
|
||||
private static void Remove_Dok_in_Bearbeitung(string dokumentid)
|
||||
@@ -146,7 +151,7 @@ namespace OnDoc.Klassen
|
||||
private static void Remove_Approvals(string dokumentid)
|
||||
{
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Exec_SQL("Update dokument_bewilligung set aktiv=0, mutiert_am=getdate(), mutierer="+AppParams.CurrentMitarbeiter.ToString()+" where dokumentid='" + dokumentid + "'");
|
||||
db.Exec_SQL("Update dokument_bewilligung set aktiv=0, mutiert_am=getdate(), mutierer=" + AppParams.CurrentMitarbeiter.ToString() + " where dokumentid='" + dokumentid + "'");
|
||||
db = null;
|
||||
|
||||
}
|
||||
@@ -161,12 +166,12 @@ namespace OnDoc.Klassen
|
||||
Save_File(fc.dokumentid, fc.filename + ".tmp");
|
||||
fc.filedatetime = DateTime.Now;
|
||||
System.IO.File.Delete(fc.filename + ".tmp");
|
||||
Logging.Logging.Debug(fc.application + " / save_to_db " + fc.filename + " / " + fc.filedatetime.ToString("yyyy-MM-dd hh:mm:ss") + "/"+DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), "OnDoc.Processwatch", fc.dokumentid);
|
||||
Logging.Logging.Debug(fc.application + " / save_to_db " + fc.filename + " / " + fc.filedatetime.ToString("yyyy-MM-dd hh:mm:ss") + "/" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), "OnDoc.Processwatch", fc.dokumentid);
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
Logging.Logging.Debug(fc.application + " / save_to_db faild " + fc.filename + " / " + fc.filedatetime.ToString("yyyy-MM-dd hh:mm:ss") +"/"+ DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), "OnDoc.Processwatch", fc.dokumentid);
|
||||
Logging.Logging.Debug(fc.application + " / save_to_db faild " + fc.filename + " / " + fc.filedatetime.ToString("yyyy-MM-dd hh:mm:ss") + "/" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), "OnDoc.Processwatch", fc.dokumentid);
|
||||
|
||||
}
|
||||
|
||||
@@ -176,10 +181,10 @@ namespace OnDoc.Klassen
|
||||
{
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Get_Tabledata("Select * from dokument where dokumentid='" + dokumentid + "'", false, true);
|
||||
|
||||
|
||||
db.Save_To_DB(dokumentid, filename);
|
||||
db.set_approvalstate(dokumentid, false);
|
||||
db.Exec_SQL("Update dokument set mutiertam = getdate(), mutierer="+AppParams.CurrentMitarbeiter+" where dokumentid='"+dokumentid+"'");
|
||||
db.Exec_SQL("Update dokument set mutiertam = getdate(), mutierer=" + AppParams.CurrentMitarbeiter + " where dokumentid='" + dokumentid + "'");
|
||||
Logging.DocLog.Info("Dokument gespeichert", "Processwatch", dokumentid, "", filename);
|
||||
db = null;
|
||||
}
|
||||
@@ -191,7 +196,7 @@ namespace OnDoc.Klassen
|
||||
Logging.Logging.Debug("Prozesswatch - Check Modified: " + lwt.ToString() + "," + fc.filedatetime.ToString(), "OnDoc", fc.dokumentid);
|
||||
//Logging.DocLog.Debug("Prozesswatch - Check Modified: " + lwt.ToString() + "," + fc.filedatetime.ToString(), "Processwatch", fc.dokumentid, "", fc.filename);
|
||||
//if ((lwt- fc.filedatetime).Seconds > 2)
|
||||
if (secdiff > 2)
|
||||
if (secdiff > 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -213,6 +218,9 @@ namespace OnDoc.Klassen
|
||||
public string filename { get; set; }
|
||||
public string application { get; set; }
|
||||
|
||||
public int counter { get; set; } = 0;
|
||||
public DateTime Lastfound { get; set; } = DateTime.Now;
|
||||
|
||||
public DateTime filedatetime { get; set; }
|
||||
|
||||
public FileToCheck(string dokumentid, string filename, string application)
|
||||
@@ -222,7 +230,7 @@ namespace OnDoc.Klassen
|
||||
this.application = application;
|
||||
this.filedatetime = DateTime.Now;
|
||||
//Logging.DocLog.Debug("Add Processwatch: " + DateTime.Now.ToString(), "New FileToCheck", dokumentid, "", "Add Processwatch");
|
||||
Logging.Logging.Debug("Add Processwatch: " + DateTime.Now.ToString(),"OnDoc",this.dokumentid);
|
||||
Logging.Logging.Debug("Add Processwatch: " + DateTime.Now.ToString(), "OnDoc", this.dokumentid);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ using Syncfusion.WinForms.DataGrid.Serialization;
|
||||
using NLog.LayoutRenderers;
|
||||
using Syncfusion.Windows.Forms.PivotAnalysis;
|
||||
using System.Xml.Linq;
|
||||
using Syncfusion.Windows.Forms.Chart;
|
||||
|
||||
|
||||
|
||||
@@ -491,12 +492,26 @@ namespace OnDoc.UICintrols
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
try
|
||||
{
|
||||
if (db.Dok_in_Bearbeitung(3, selected_dokumentid, AppParams.CurrentMitarbeiter) == false)
|
||||
int res = db.Dok_in_Bearbeitung(3, selected_dokumentid, AppParams.CurrentMitarbeiter);
|
||||
switch (res)
|
||||
{
|
||||
MessageBox.Show("Das Dokument wird aktuell bearbeitet.", "Dokumentbearbeitung", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
if (MessageBox.Show("Das Dokument wird aktuell bearbeitet."+Environment.NewLine+ Environment.NewLine + "Sperrung aufheben?" +Environment.NewLine+Environment.NewLine+"Bitte vorgängig prüfen, ob das Dokument nicht mehr in Word/Excel geöffnet ist!","Dokumentsperrung aufheben",MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
clsProcessWatch.RemoveFromList(dokid);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
MessageBox.Show("Das Dokument wird aktuell bearbeitet.", "Dokumentbearbeitung", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
db.Get_Tabledata("Select * from dokument_trefferliste where dokumentid='" + dokid + "'", false, true);
|
||||
if (Convert.ToInt32(db.dsdaten.Tables[0].Rows[0]["Status_Bezeichnungnr"]) == -2)
|
||||
{
|
||||
|
||||
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -102,7 +102,7 @@ namespace DOCGEN.Generator
|
||||
string filename = tempdir + dokumentid + ".tmp";
|
||||
fh.SaveBase64ToFile(dt.Rows[0][0].ToString(), filename);
|
||||
|
||||
word_signature ws = new word_signature();
|
||||
word_signature ws = new word_signature(this.connectionstring);
|
||||
ws.remove_unterschriften_synfusion(filename);
|
||||
dt.Rows[0][0] = fh.Base64FromFile(filename);
|
||||
ws = null;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -131,7 +131,8 @@ namespace DOCGEN
|
||||
string unterschriftrechts = db1.dsdaten.Tables[0].Rows[0]["unterschriftrechts"].ToString();
|
||||
|
||||
OnDocOffice.clsWordEdit we = new OnDocOffice.clsWordEdit(connectionstring, "", "", resturi, apikey);
|
||||
if (we.insert_signature(dokumentid, unterschriftlinks, unterschriftrechts, tempdir))
|
||||
//gaga
|
||||
if (we.insert_signature(dokumentid, unterschriftlinks, unterschriftrechts, tempdir,""))
|
||||
{
|
||||
return true;
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -958,7 +958,7 @@ namespace Database
|
||||
}
|
||||
}
|
||||
|
||||
public bool Dok_in_Bearbeitung(int typ, string dokumentid, int mitarbeiter)
|
||||
public int Dok_in_Bearbeitung(int typ, string dokumentid, int mitarbeiter)
|
||||
{
|
||||
switch (typ)
|
||||
{
|
||||
@@ -966,26 +966,42 @@ namespace Database
|
||||
string sql = "Insert DokInBearbeitung (dokumentid, mitarbeiternr,datum,erstellung,dokumentname,stationsname) ";
|
||||
sql = sql + " values('" + dokumentid + "'," + mitarbeiter.ToString() + ",getdate(),'','','')";
|
||||
Exec_SQL(sql);
|
||||
return true;
|
||||
return 1;
|
||||
case 2:
|
||||
Exec_SQL("Delete from dokinbearbeitung where dokumentid='" + dokumentid + "'");
|
||||
return true;
|
||||
return 1;
|
||||
case 3:
|
||||
Get_Tabledata("Select count(*) from dokinbearbeitung where dokumentid='" + dokumentid + "'", false, true);
|
||||
if (Convert.ToInt32(dsdaten.Tables[0].Rows[0][0]) > 0) return false; else return true;
|
||||
//Get_Tabledata("Select count(*) from dokinbearbeitung where dokumentid='" + dokumentid + "'", false, true);
|
||||
//if (Convert.ToInt32(dsdaten.Tables[0].Rows[0][0]) > 0) return false; else return true;
|
||||
//Get_Tabledata("Select count(*) from dokinbearbeitung where dokumentid='" + dokumentid + "'", false, true);
|
||||
Get_Tabledata("Select * from dokinbearbeitung where dokumentid='" + dokumentid + "'", false, true);
|
||||
if (dsdaten.Tables[0].Rows.Count == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (Convert.ToInt32(dsdaten.Tables[0].Rows[0]["mitarbeiternr"]) == mitarbeiter)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
//if (Convert.ToInt32(dsdaten.Tables[0].Rows[0][0]) > 0) return false; else return true;
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
if (typ == 2)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
string sql = "Insert DokInBearbeitung (dokumentid, mitarbeiternr,datum,erstellung,dokumentname,stationsname) ";
|
||||
sql = sql + " values('" + dokumentid + "'," + mitarbeiter.ToString() + ",getdate(),'','','')";
|
||||
Exec_SQL(sql);
|
||||
return true;
|
||||
return 1;
|
||||
}
|
||||
//if (typ == 2)
|
||||
//{
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// string sql = "Insert DokInBearbeitung (dokumentid, mitarbeiternr,datum,erstellung,dokumentname,stationsname) ";
|
||||
// sql = sql + " values('" + dokumentid + "'," + mitarbeiter.ToString() + ",getdate(),'','','')";
|
||||
// Exec_SQL(sql);
|
||||
// return true;
|
||||
//}
|
||||
|
||||
}
|
||||
public Boolean save_vorlage_to_db(string filename, string office_vorlage_nr)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
89
OfficeToPDFConverter/Class1.cs
Normal file
89
OfficeToPDFConverter/Class1.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Office.Interop.Word;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace OfficeToPDFConverter
|
||||
{
|
||||
public class Converter
|
||||
{
|
||||
public string Convert_Word(string B64Word,string path)
|
||||
{
|
||||
Microsoft.Office.Interop.Word.Application w = new Microsoft.Office.Interop.Word.Application();
|
||||
|
||||
try
|
||||
{
|
||||
Helper.clsFileHelper_Converter fh = new Helper.clsFileHelper_Converter();
|
||||
string outputfile = "";
|
||||
string inputfile = "";
|
||||
string tmpfilename = DateTime.Now.ToString("yyyyMMddhhmmss");
|
||||
outputfile = tmpfilename + ".pdf";
|
||||
inputfile = tmpfilename + ".tmp";
|
||||
inputfile = path + @"\" + inputfile;
|
||||
outputfile = path + @"\" + outputfile;
|
||||
|
||||
fh.SaveBase64ToFile(B64Word, path);
|
||||
w.Documents.Open(FileName: inputfile.ToString(), ReadOnly: true);
|
||||
object oMissing = System.Reflection.Missing.Value;
|
||||
w.ActiveDocument.ExportAsFixedFormat(outputfile.ToString(), Microsoft.Office.Interop.Word.WdExportFormat.wdExportFormatPDF, false, Microsoft.Office.Interop.Word.WdExportOptimizeFor.wdExportOptimizeForPrint, Microsoft.Office.Interop.Word.WdExportRange.wdExportAllDocument, 0, 0, Microsoft.Office.Interop.Word.WdExportItem.wdExportDocumentContent, true, true, Microsoft.Office.Interop.Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks, true, false, false);
|
||||
w.ActiveDocument.Saved = true;
|
||||
w.ActiveDocument.Close(SaveChanges: false);
|
||||
|
||||
w.Quit(false);
|
||||
w = null;
|
||||
string b64 = fh.Base64FromFile(outputfile);
|
||||
System.IO.File.Delete(outputfile);
|
||||
return b64;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
finally
|
||||
{
|
||||
try { w.Quit(false); } catch { }
|
||||
w = null;
|
||||
}
|
||||
|
||||
}
|
||||
public string Convert_Excel(string B64Word, string path)
|
||||
{
|
||||
Microsoft.Office.Interop.Excel.Application x = new Microsoft.Office.Interop.Excel.Application();
|
||||
try
|
||||
{
|
||||
Helper.clsFileHelper_Converter fh = new Helper.clsFileHelper_Converter();
|
||||
string outputfile = "";
|
||||
string inputfile = "";
|
||||
string tmpfilename = DateTime.Now.ToString("yyyyMMddhhmmss");
|
||||
outputfile = tmpfilename + ".pdf";
|
||||
inputfile = tmpfilename + ".tmp";
|
||||
inputfile = path + @"\" + inputfile;
|
||||
outputfile = path + @"\" + outputfile;
|
||||
|
||||
fh.SaveBase64ToFile(B64Word, path);
|
||||
x.Workbooks.Open(inputfile);
|
||||
x.ActiveWorkbook.ExportAsFixedFormat(Microsoft.Office.Interop.Excel.XlFixedFormatType.xlTypePDF, outputfile.ToString(), Microsoft.Office.Interop.Excel.XlFixedFormatQuality.xlQualityStandard);
|
||||
x.ActiveWorkbook.Close(SaveChanges: false);
|
||||
x.Quit();
|
||||
x = null;
|
||||
string b64 = fh.Base64FromFile(outputfile);
|
||||
System.IO.File.Delete(outputfile);
|
||||
return b64;
|
||||
}
|
||||
catch { return ""; }
|
||||
finally { try { x.Quit(); } catch { } x = null; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
64
OfficeToPDFConverter/OfficeToPDFConverter.csproj
Normal file
64
OfficeToPDFConverter/OfficeToPDFConverter.csproj
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{17CA2501-B872-41CC-8029-8FF4CAD425FB}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OfficeToPDFConverter</RootNamespace>
|
||||
<AssemblyName>OfficeToPDFConverter</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
<HintPath>..\Client\bin\Debug\Microsoft.Office.Interop.Excel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Office.Interop.Word, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
<HintPath>..\Client\bin\Debug\Microsoft.Office.Interop.Word.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
<HintPath>..\Client\bin\Debug\Office.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="clsFileHelper.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
36
OfficeToPDFConverter/Properties/AssemblyInfo.cs
Normal file
36
OfficeToPDFConverter/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die einer Assembly zugeordnet sind.
|
||||
[assembly: AssemblyTitle("OfficeToPDFConverter")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("HP Inc.")]
|
||||
[assembly: AssemblyProduct("OfficeToPDFConverter")]
|
||||
[assembly: AssemblyCopyright("Copyright © HP Inc. 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("17ca2501-b872-41cc-8029-8ff4cad425fb")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// 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.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
BIN
OfficeToPDFConverter/bin/Debug/OfficeToPDFConverter.dll
Normal file
BIN
OfficeToPDFConverter/bin/Debug/OfficeToPDFConverter.dll
Normal file
Binary file not shown.
BIN
OfficeToPDFConverter/bin/Debug/OfficeToPDFConverter.pdb
Normal file
BIN
OfficeToPDFConverter/bin/Debug/OfficeToPDFConverter.pdb
Normal file
Binary file not shown.
62
OfficeToPDFConverter/clsFileHelper.cs
Normal file
62
OfficeToPDFConverter/clsFileHelper.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Helper
|
||||
{
|
||||
public class clsFileHelper_Converter
|
||||
{
|
||||
public string save_temp_file(string data, string dokumentid, string temppath, string extension)
|
||||
{
|
||||
string filename = "";
|
||||
filename = temppath + DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + dokumentid + "." + extension;
|
||||
|
||||
//if (docfilename != "")
|
||||
//{
|
||||
// filename = temppath + DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + docfilename;
|
||||
//}
|
||||
try
|
||||
{
|
||||
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(data));
|
||||
return filename;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public bool SaveBase64ToFile(string Base64String, string filename)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(Base64String));
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
public Stream GenerateStreamFromString(string s)
|
||||
{
|
||||
var stream = new MemoryStream();
|
||||
var writer = new StreamWriter(stream);
|
||||
writer.Write(s);
|
||||
writer.Flush();
|
||||
stream.Position = 0;
|
||||
return stream;
|
||||
}
|
||||
|
||||
public String Base64FromFile(string filename)
|
||||
{
|
||||
Byte[] bytes = File.ReadAllBytes(filename);
|
||||
return Convert.ToBase64String(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
26adcd250e91980369d40f64bc7feb6761a6219081acfe8442ae185c2c016d76
|
||||
@@ -0,0 +1,6 @@
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficeToPDFConverter\obj\Debug\OfficeToPDFConverter.csproj.AssemblyReference.cache
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficeToPDFConverter\obj\Debug\OfficeToPDFConverter.csproj.CoreCompileInputs.cache
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficeToPDFConverter\bin\Debug\OfficeToPDFConverter.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficeToPDFConverter\bin\Debug\OfficeToPDFConverter.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficeToPDFConverter\obj\Debug\OfficeToPDFConverter.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficeToPDFConverter\obj\Debug\OfficeToPDFConverter.pdb
|
||||
BIN
OfficeToPDFConverter/obj/Debug/OfficeToPDFConverter.dll
Normal file
BIN
OfficeToPDFConverter/obj/Debug/OfficeToPDFConverter.dll
Normal file
Binary file not shown.
BIN
OfficeToPDFConverter/obj/Debug/OfficeToPDFConverter.pdb
Normal file
BIN
OfficeToPDFConverter/obj/Debug/OfficeToPDFConverter.pdb
Normal file
Binary file not shown.
@@ -69,6 +69,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinSign", "WinSign\WinSign.
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools_Base64Decoder", "Tools_Base64Decoder\Tools_Base64Decoder.csproj", "{F482EAB7-EAD5-42FA-A123-C9AF71D24B41}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OfficeToPDFConverter", "OfficeToPDFConverter\OfficeToPDFConverter.csproj", "{17CA2501-B872-41CC-8029-8FF4CAD425FB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -195,6 +197,10 @@ Global
|
||||
{F482EAB7-EAD5-42FA-A123-C9AF71D24B41}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F482EAB7-EAD5-42FA-A123-C9AF71D24B41}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F482EAB7-EAD5-42FA-A123-C9AF71D24B41}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{17CA2501-B872-41CC-8029-8FF4CAD425FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{17CA2501-B872-41CC-8029-8FF4CAD425FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{17CA2501-B872-41CC-8029-8FF4CAD425FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{17CA2501-B872-41CC-8029-8FF4CAD425FB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -28,6 +28,7 @@ using System.Runtime.InteropServices.ComTypes;
|
||||
using Syncfusion.CompoundFile.DocIO;
|
||||
using Helper;
|
||||
using Microsoft.VisualBasic.Logging;
|
||||
using System.Data.Common;
|
||||
|
||||
|
||||
namespace OnDocOffice
|
||||
@@ -668,7 +669,7 @@ namespace OnDocOffice
|
||||
{ }
|
||||
if (docdata.remove_signature)
|
||||
{
|
||||
word_signature ws = new word_signature();
|
||||
word_signature ws = new word_signature(this.connectstring);
|
||||
ws.remove_unterschriften(ref word, dokumentid);
|
||||
ws = null;
|
||||
}
|
||||
@@ -699,8 +700,8 @@ namespace OnDocOffice
|
||||
path_unterschriftrechts = tempdir + dokumentid + "UR.png";
|
||||
clsFileHelper.SaveBase64ToFile(unterschriftrechts,path_unterschriftrechts);
|
||||
}
|
||||
word_signature word_Signature = new word_signature();
|
||||
word_Signature.sign_doc(ref word, path_unterschriftlinks, path_unterschriftrechts, dokumentid);
|
||||
word_signature word_Signature = new word_signature(connectionstring);
|
||||
word_Signature.sign_doc(ref word, path_unterschriftlinks, path_unterschriftrechts, dokumentid, docdata.DokumenttypNr);
|
||||
if (System.IO.File.Exists(path_unterschriftlinks)){ System.IO.File.Delete(tempdir + dokumentid + "UL.png"); };
|
||||
if (System.IO.File.Exists(path_unterschriftrechts)){ System.IO.File.Delete(tempdir + dokumentid + "UR.png"); }
|
||||
|
||||
@@ -1537,7 +1538,7 @@ namespace OnDocOffice
|
||||
return;
|
||||
|
||||
}
|
||||
public bool insert_signature(string dokumentid, string unterschriftlinks, string unterschriftrechts, string tempdir)
|
||||
public bool insert_signature(string dokumentid, string unterschriftlinks, string unterschriftrechts, string tempdir, string dokumenttypnr )
|
||||
{
|
||||
DB db = new DB(this.connectstring);
|
||||
System.Data.DataTable dt = new System.Data.DataTable();
|
||||
@@ -1582,8 +1583,8 @@ namespace OnDocOffice
|
||||
path_unterschriftrechts = tempdir + dokumentid + "UR.png";
|
||||
clsFileHelper.SaveBase64ToFile(unterschriftrechts, path_unterschriftrechts);
|
||||
}
|
||||
word_signature word_Signature = new word_signature();
|
||||
word_Signature.sign_doc(ref word, path_unterschriftlinks, path_unterschriftrechts, dokumentid);
|
||||
word_signature word_Signature = new word_signature(this.connectstring);
|
||||
word_Signature.sign_doc(ref word, path_unterschriftlinks, path_unterschriftrechts, dokumentid,dokumenttypnr);
|
||||
if (System.IO.File.Exists(path_unterschriftlinks)) { System.IO.File.Delete(tempdir + dokumentid + "UL.png"); };
|
||||
if (System.IO.File.Exists(path_unterschriftrechts)) { System.IO.File.Delete(tempdir + dokumentid + "UR.png"); }
|
||||
|
||||
@@ -1606,13 +1607,24 @@ namespace OnDocOffice
|
||||
|
||||
public class word_signature
|
||||
{
|
||||
|
||||
private string ConnectionString = "";
|
||||
|
||||
public word_signature(string connectionstring)
|
||||
{
|
||||
ConnectionString = connectionstring.Trim();
|
||||
}
|
||||
bool is_protected = false;
|
||||
Microsoft.Office.Interop.Word.Document docWord;
|
||||
public bool sign_doc(ref Microsoft.Office.Interop.Word.Application word, string imagepath_ul, string imagepath_ur, string dokumentid)
|
||||
public bool sign_doc(ref Microsoft.Office.Interop.Word.Application word, string imagepath_ul, string imagepath_ur, string dokumentid, string dokumenttypnr)
|
||||
{
|
||||
Logging.Logging.Debug("Sign_Doc", "OnDoc", dokumentid);
|
||||
docWord = word.ActiveDocument;
|
||||
|
||||
|
||||
DB db = new DB(this.ConnectionString);
|
||||
db.Get_Tabledata("Select * from OnDocSignaturePosition where dokumenttypnr=1089");
|
||||
System.Data.DataTable position = db.dsdaten.Tables[0];
|
||||
db = null;
|
||||
Thread.Sleep(1000);
|
||||
if (word.ActiveDocument.ProtectionType != Microsoft.Office.Interop.Word.WdProtectionType.wdNoProtection)
|
||||
{
|
||||
@@ -1620,18 +1632,41 @@ namespace OnDocOffice
|
||||
is_protected = true;
|
||||
}
|
||||
|
||||
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
int l = 0;
|
||||
int t = 0;
|
||||
try
|
||||
{
|
||||
foreach (Microsoft.Office.Interop.Word.Bookmark bm in docWord.Bookmarks)
|
||||
{
|
||||
if (bm.Name.Contains("VornameNameLinks") || bm.Name.Contains("UnterschriftLinks"))
|
||||
{
|
||||
insert_unterschrift(bm.Name, imagepath_ul);
|
||||
foreach (System.Data.DataRow dr in position.Rows)
|
||||
{
|
||||
if (bm.Name.ToUpper() == dr["bookmark"].ToString().ToUpper())
|
||||
{
|
||||
l = Convert.ToInt32("posleft");
|
||||
t = Convert.ToInt32("postop");
|
||||
w = Convert.ToInt32("width");
|
||||
h = Convert.ToInt32("height");
|
||||
}
|
||||
}
|
||||
insert_unterschrift(bm.Name, imagepath_ul,l,t,w,h);
|
||||
}
|
||||
if (bm.Name.Contains("VornameNameRechts") || bm.Name.Contains("UnterschriftRechts"))
|
||||
{
|
||||
insert_unterschrift(bm.Name, imagepath_ur);
|
||||
foreach (System.Data.DataRow dr in position.Rows)
|
||||
{
|
||||
if (bm.Name.ToUpper() == dr["bookmark"].ToString().ToUpper())
|
||||
{
|
||||
l = Convert.ToInt32("posleft");
|
||||
t = Convert.ToInt32("postop");
|
||||
w = Convert.ToInt32("width");
|
||||
h = Convert.ToInt32("height");
|
||||
}
|
||||
}
|
||||
insert_unterschrift(bm.Name, imagepath_ur,l,t,w,h);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1656,7 +1691,7 @@ namespace OnDocOffice
|
||||
}
|
||||
}
|
||||
|
||||
public void insert_unterschrift(string bookmark, string imagepath)
|
||||
public void insert_unterschrift(string bookmark, string imagepath, int l, int t, int w, int h)
|
||||
{
|
||||
if (imagepath == "") return;
|
||||
|
||||
@@ -1668,11 +1703,13 @@ namespace OnDocOffice
|
||||
|
||||
///
|
||||
Microsoft.Office.Interop.Word.Bookmark bm = docWord.Bookmarks[bookmark];
|
||||
bm.Select();
|
||||
bm.Range.GoTo();
|
||||
bm.Select();
|
||||
|
||||
Microsoft.Office.Interop.Word.Shape myShape1 = docWord.Shapes.AddPicture(imagepath, false, true, 0, 0, 120, 50, missing);
|
||||
myShape1.Top = myShape1.Top - myShape1.Height;
|
||||
//myShape1.Top = myShape1.Top - myShape1.Height;
|
||||
myShape1.WrapFormat.Type = Microsoft.Office.Interop.Word.WdWrapType.wdWrapBehind;
|
||||
|
||||
return;
|
||||
///
|
||||
|
||||
|
||||
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
Reference in New Issue
Block a user