update 20241113

master
Stefan Hutter 1 year ago
parent 09bcee5a2a
commit 1682465067

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication /> <IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode /> <IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile /> <UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID> <Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common</Controller_SelectedScaffolderCategoryPath> <Controller_SelectedScaffolderCategoryPath>root/Common</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth> <WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>

@ -37,11 +37,15 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start Adresse GetAll", LogLevelType.Debug);
Database.DB db = new Database.DB(connectionstring); Database.DB db = new Database.DB(connectionstring);
string SQL = "Select * from Antwortadresse order by bezeichnung"; string SQL = "Select * from Antwortadresse order by bezeichnung";
if (OutFormat == "JSON") { SQL = SQL + " for json path"; } if (OutFormat == "JSON") { SQL = SQL + " for json path"; }
if (OutFormat == "XML") { SQL = SQL + " for xml path"; } if (OutFormat == "XML") { SQL = SQL + " for xml path"; }
db.Get_Tabledata(SQL, false, true); db.Get_Tabledata(SQL, false, true);
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetAll", LogLevelType.Debug);
return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString());
} }
catch (Exception e) catch (Exception e)
@ -69,12 +73,22 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start Adresse GetByID ID:"+ID, LogLevelType.Debug);
Database.DB db = new Database.DB(connectionstring); Database.DB db = new Database.DB(connectionstring);
string SQL = "Select * from Antwortadresse where id=" + ID; string SQL = "Select * from Antwortadresse where id=" + ID;
if (OutFormat == "JSON") { SQL = SQL + " for json path"; } if (OutFormat == "JSON") { SQL = SQL + " for json path"; }
if (OutFormat == "XML") { SQL = SQL + " for xml path"; } if (OutFormat == "XML") { SQL = SQL + " for xml path"; }
db.Get_Tabledata(SQL, false, true); db.Get_Tabledata(SQL, false, true);
if (db.dsdaten.Tables[0].Rows.Count == 0) { return Ok(); } else { return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); }; if (db.dsdaten.Tables[0].Rows.Count == 0) {
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetByID ID:" + ID, LogLevelType.Debug);
return Ok();
} else {
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetByID ID:" + ID, LogLevelType.Debug);
return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString());
};
} }
catch (Exception e) catch (Exception e)
{ {
@ -101,12 +115,22 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start Adresse GetAllMitarbeiterByTGNummer", LogLevelType.Debug);
Database.DB db = new Database.DB(connectionstring); Database.DB db = new Database.DB(connectionstring);
string SQL = "Select * from AntwortAdresse_Mitarbeiter where aktiv=1 and tgnummer='" + tgnummer + "' order by bezeichnung "; string SQL = "Select * from AntwortAdresse_Mitarbeiter where aktiv=1 and tgnummer='" + tgnummer + "' order by bezeichnung ";
if (OutFormat == "JSON") { SQL = SQL + " for json path"; } if (OutFormat == "JSON") { SQL = SQL + " for json path"; }
if (OutFormat == "XML") { SQL = SQL + " for xml path"; } if (OutFormat == "XML") { SQL = SQL + " for xml path"; }
db.Get_Tabledata(SQL, false, true); db.Get_Tabledata(SQL, false, true);
if (db.dsdaten.Tables[0].Rows.Count == 0) { return Ok(); } else { return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); }; if (db.dsdaten.Tables[0].Rows.Count == 0) {
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetAllMitarbeiterByTGNummer", LogLevelType.Debug);
return Ok();
} else {
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetAllMitarbeiterByTGNummer", LogLevelType.Debug);
return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString());
};
} }
catch (Exception e) catch (Exception e)
{ {
@ -132,12 +156,20 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start Adresse GetAllMitarbeiterByMitarbeiterNr Ma-Nr:"+Mitarbeiternr, LogLevelType.Debug);
Database.DB db = new Database.DB(connectionstring); Database.DB db = new Database.DB(connectionstring);
string SQL = "Select * from AntwortAdresse_Mitarbeiter where aktiv=1 and Mitarbeiternr='" + Mitarbeiternr + "' "; string SQL = "Select * from AntwortAdresse_Mitarbeiter where aktiv=1 and Mitarbeiternr='" + Mitarbeiternr + "' ";
if (OutFormat == "JSON") { SQL = SQL + " for json path"; } if (OutFormat == "JSON") { SQL = SQL + " for json path"; }
if (OutFormat == "XML") { SQL = SQL + " for xml path"; } if (OutFormat == "XML") { SQL = SQL + " for xml path"; }
db.Get_Tabledata(SQL, false, true); db.Get_Tabledata(SQL, false, true);
if (db.dsdaten.Tables[0].Rows.Count == 0) { return Ok(); } else { return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); }; if (db.dsdaten.Tables[0].Rows.Count == 0) {
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetAllMitarbeiterByMitarbeiterNr Ma-Nr:" + Mitarbeiternr, LogLevelType.Debug);
return Ok();
} else {
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetAllMitarbeiterByMitarbeiterNr Ma-Nr:" + Mitarbeiternr, LogLevelType.Debug);
return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString());
};
} }
catch (Exception e) catch (Exception e)
{ {
@ -166,12 +198,19 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start GetMitarbeiterByID ID: "+ID, LogLevelType.Debug);
Database.DB db = new Database.DB(connectionstring); Database.DB db = new Database.DB(connectionstring);
string SQL = "Select * from AntwortAdresse_Mitarbeiter where id=" + ID; string SQL = "Select * from AntwortAdresse_Mitarbeiter where id=" + ID;
if (OutFormat == "JSON") { SQL = SQL + " for json path"; } if (OutFormat == "JSON") { SQL = SQL + " for json path"; }
if (OutFormat == "XML") { SQL = SQL + " for xml path"; } if (OutFormat == "XML") { SQL = SQL + " for xml path"; }
db.Get_Tabledata(SQL, false, true); db.Get_Tabledata(SQL, false, true);
if (db.dsdaten.Tables[0].Rows.Count == 0) { return Ok(); } else { return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); }; if (db.dsdaten.Tables[0].Rows.Count == 0) {
APILogging.Log((HttpRequestMessage)Request, "Ende GetMitarbeiterByID ID: " + ID, LogLevelType.Debug);
return Ok();
} else {
APILogging.Log((HttpRequestMessage)Request, "Ende GetMitarbeiterByID ID: " + ID, LogLevelType.Debug);
return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); };
} }
catch (Exception e) catch (Exception e)
{ {
@ -197,6 +236,8 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start GetGASAdressen_Einzeilig TGNummer: " + TGNummer, LogLevelType.Debug);
Database.DB db = new Database.DB(connectionstring); Database.DB db = new Database.DB(connectionstring);
db.clear_parameter(); db.clear_parameter();
db.add_parameter("@tgnummer", TGNummer); db.add_parameter("@tgnummer", TGNummer);
@ -204,10 +245,12 @@ namespace API_NetFramework.Controllers
db.Get_Tabledata("sp_get_gas_einzeilig", true, false); db.Get_Tabledata("sp_get_gas_einzeilig", true, false);
if (db.dsdaten.Tables[0].Rows.Count == 0) if (db.dsdaten.Tables[0].Rows.Count == 0)
{ {
APILogging.Log((HttpRequestMessage)Request, "Ende GetGASAdressen_Einzeilig TGNummer: " + TGNummer, LogLevelType.Debug);
return Content(HttpStatusCode.NotFound, ""); return Content(HttpStatusCode.NotFound, "");
} }
else else
{ {
APILogging.Log((HttpRequestMessage)Request, "Ende GetGASAdressen_Einzeilig TGNummer: " + TGNummer, LogLevelType.Debug);
return Content(HttpStatusCode.OK, db.dsdaten.Tables[0].Rows[0][0].ToString()); return Content(HttpStatusCode.OK, db.dsdaten.Tables[0].Rows[0][0].ToString());
}; };
} }

@ -49,6 +49,8 @@ namespace API_NetFramework.Controllers
private void Update_IL_Log(ref ILResponse ilr, string dokumentid) private void Update_IL_Log(ref ILResponse ilr, string dokumentid)
{ {
APILogging.Log((HttpRequestMessage)Request, "Start Updaet IL_Log: DokumentID:" + dokumentid, LogLevelType.Debug);
DB dB = new DB(ConfigurationManager.ConnectionStrings["JournalConnectionstring"].ConnectionString); DB dB = new DB(ConfigurationManager.ConnectionStrings["JournalConnectionstring"].ConnectionString);
string sql = "Insert OnDoc_IL_Log (dokumentid, ilresponse,error, erstellt_am) values ('" + dokumentid + "',"; string sql = "Insert OnDoc_IL_Log (dokumentid, ilresponse,error, erstellt_am) values ('" + dokumentid + "',";
sql = sql + "'" + ilr.response.ToString() + "',"; sql = sql + "'" + ilr.response.ToString() + "',";
@ -56,6 +58,7 @@ namespace API_NetFramework.Controllers
sql = sql + "'" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "')"; sql = sql + "'" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "')";
dB.Exec_SQL(sql); dB.Exec_SQL(sql);
dB = null; dB = null;
APILogging.Log((HttpRequestMessage)Request, "Ende Updaet IL_Log: DokumentID:" + dokumentid, LogLevelType.Debug);
} }
private void update_dokumentstatus(string dokumentid) private void update_dokumentstatus(string dokumentid)
@ -85,6 +88,7 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start ArchiveDocFromDatabase: DokumentID:"+DokumentID, LogLevelType.Debug);
DB db = new DB(connectionstring); DB db = new DB(connectionstring);
db.clear_parameter(); db.clear_parameter();
db.add_parameter("@dokumentid", DokumentID); db.add_parameter("@dokumentid", DokumentID);
@ -128,7 +132,6 @@ namespace API_NetFramework.Controllers
string SendToFile = System.Configuration.ConfigurationManager.AppSettings["SendToFile"]; string SendToFile = System.Configuration.ConfigurationManager.AppSettings["SendToFile"];
string debugdir = System.Configuration.ConfigurationManager.AppSettings["DebugDir"]; string debugdir = System.Configuration.ConfigurationManager.AppSettings["DebugDir"];
string jsonstring = Newtonsoft.Json.JsonConvert.SerializeObject(onbasedoc); string jsonstring = Newtonsoft.Json.JsonConvert.SerializeObject(onbasedoc);
IHttpActionResult transferResult = null; IHttpActionResult transferResult = null;
if (SendToOnBase != "Yes") if (SendToOnBase != "Yes")
{ {
@ -139,9 +142,14 @@ namespace API_NetFramework.Controllers
{ {
debugfilename = debugfilename + DokumentID + ".json"; debugfilename = debugfilename + DokumentID + ".json";
System.IO.File.WriteAllText(debugfilename, jsonstring); System.IO.File.WriteAllText(debugfilename, jsonstring);
debugfilename = debugfilename + ".pdf";
Helper.clsFileHelper fh = new Helper.clsFileHelper();
fh.SaveBase64ToFile(onbasedoc.dokumentDatei, debugfilename);
fh = null;
} }
} }
} }
APILogging.Log((HttpRequestMessage)Request, "Ende ArchiveDocFromDatabase: DokumentID:" + DokumentID, LogLevelType.Debug);
//Log nachführen //Log nachführen
Update_IL_Log(ref ilr,DokumentID); Update_IL_Log(ref ilr,DokumentID);
@ -166,36 +174,36 @@ namespace API_NetFramework.Controllers
} }
[HttpGet] //[HttpGet]
[Route("API/ArchiveDocBase64")] //[Route("API/ArchiveDocBase64")]
/// <summary> ///// <summary>
/// Archiviert das als Base64String übergebene Dokument in OnBase ///// Archiviert das als Base64String übergebene Dokument in OnBase
/// </summary> ///// </summary>
/// <param name="DokumentID"></param> ///// <param name="DokumentID"></param>
/// <param name="Dokumenttyp"></param> ///// <param name="Dokumenttyp"></param>
/// <returns> ///// <returns>
/// Returncode: 200 (OK) ///// Returncode: 200 (OK)
/// Dokumenthandle aus OnBase ///// Dokumenthandle aus OnBase
/// </returns> ///// </returns>
/// <remarks></remarks> ///// <remarks></remarks>
// ////
public IHttpActionResult ArchivDocBase64(string DokumentID, string Dokumenttyp) //public IHttpActionResult ArchivDocBase64(string DokumentID, string Dokumenttyp)
{ //{
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false) // if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
{ // {
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key"); // return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
} // }
try // try
{ // {
return Ok(); // return Ok();
} // }
catch (Exception e) // catch (Exception e)
{ // {
APILogging.Log((HttpRequestMessage)Request, e.Message, LogLevelType.Error); // APILogging.Log((HttpRequestMessage)Request, e.Message, LogLevelType.Error);
return Content(HttpStatusCode.InternalServerError, e.Message); // return Content(HttpStatusCode.InternalServerError, e.Message);
} // }
} //}
/// <summary> /// <summary>
/// CheckDocID prüft auf eine vorhandene DokumentID in OnDoc (DokumentID OFFEDK... / Barcode-Klenber-Nr) /// CheckDocID prüft auf eine vorhandene DokumentID in OnDoc (DokumentID OFFEDK... / Barcode-Klenber-Nr)
/// </summary> /// </summary>
@ -215,6 +223,7 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start Check DokumentID: DokumentID:" + DokumentID, LogLevelType.Debug);
Database.DB db = new Database.DB(connectionstring); Database.DB db = new Database.DB(connectionstring);
db.Get_Tabledata("Select * from dokument where dokumentid = '" + DokumentID + "'", false, true); db.Get_Tabledata("Select * from dokument where dokumentid = '" + DokumentID + "'", false, true);
if (db.dsdaten.Tables[0].Rows.Count > 0) if (db.dsdaten.Tables[0].Rows.Count > 0)
@ -226,6 +235,8 @@ namespace API_NetFramework.Controllers
{ {
return Ok(DokumentID); return Ok(DokumentID);
} }
APILogging.Log((HttpRequestMessage)Request, "Ende Check DokumentID: DokumentID:" + DokumentID, LogLevelType.Debug);
return Content(HttpStatusCode.NotFound, DokumentID); return Content(HttpStatusCode.NotFound, DokumentID);
} }
catch (Exception e) catch (Exception e)
@ -248,6 +259,7 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start ArchivDocFromIRIS DokumentID: " + dokumentid, LogLevelType.Debug);
if (dokumentid.Substring(0, 6).ToUpper() == "ONDOC00") if (dokumentid.Substring(0, 6).ToUpper() == "ONDOC00")
{ {
return (ArchivDocFromDatabase(dokumentid)); return (ArchivDocFromDatabase(dokumentid));
@ -265,7 +277,7 @@ namespace API_NetFramework.Controllers
//return Content(HttpStatusCode.OK, ""); //return Content(HttpStatusCode.OK, "");
APILogging.Log((HttpRequestMessage)Request, dokumentid+" Archivierung ausgelöst", LogLevelType.Info); APILogging.Log((HttpRequestMessage)Request, "Ende ArchivDocFromIRIS DokumentID:" + dokumentid, LogLevelType.Debug);
return Ok(dokumentid); return Ok(dokumentid);
} }
catch (Exception e) catch (Exception e)
@ -277,12 +289,14 @@ namespace API_NetFramework.Controllers
[HttpPost] [HttpPost]
[Route("API/ArchivSBDoc")] [Route("API/ArchivSBDoc")]
public IHttpActionResult ArchivSBDoc(string sbnr, string intid, int partnernr ) public IHttpActionResult ArchivSBDoc(string sbnr, string intid, int partnernr, string dokumentid )
{ {
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false) if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
{ {
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key"); return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
} }
APILogging.Log((HttpRequestMessage)Request, "Start ArchivSBDoc DokumentID: DokumentID:" + dokumentid, LogLevelType.Debug);
string json = ""; string json = "";
if (HttpContext.Current.Request.InputStream.Length > 0) if (HttpContext.Current.Request.InputStream.Length > 0)
{ {
@ -316,6 +330,7 @@ namespace API_NetFramework.Controllers
//Log nachführen //Log nachführen
Update_IL_Log(ref ilr, "SB_" + sbnr.ToString() + "_" + intid.ToString()); Update_IL_Log(ref ilr, "SB_" + sbnr.ToString() + "_" + intid.ToString());
APILogging.Log((HttpRequestMessage)Request, "Ende ArchivSBDoc DokumentID: DokumentID:" + dokumentid, LogLevelType.Debug);
return transferResult; return transferResult;
//return Content(HttpStatusCode.OK, ""); //return Content(HttpStatusCode.OK, "");
} }
@ -325,8 +340,9 @@ namespace API_NetFramework.Controllers
//ILResponse ilr = new ILResponse(); //ILResponse ilr = new ILResponse();
string response; string response;
WebRequest request; WebRequest request;
APILogging.Log((HttpRequestMessage)Request, "Start Transfer to OnBase", LogLevelType.Debug);
string url=""; string url ="";
switch (utype){ switch (utype){
case uploadtype.fast: case uploadtype.fast:
url= System.Configuration.ConfigurationManager.AppSettings["ILFast"]; url= System.Configuration.ConfigurationManager.AppSettings["ILFast"];
@ -362,6 +378,7 @@ namespace API_NetFramework.Controllers
ilr.StatusCode = 0; ilr.StatusCode = 0;
ilr.senderror = 0; ilr.senderror = 0;
ilr.response=response; ilr.response=response;
APILogging.Log((HttpRequestMessage)Request, "Ende Transfer to OnBase", LogLevelType.Debug);
return Content(HttpStatusCode.OK, ilr); return Content(HttpStatusCode.OK, ilr);
} }
catch (Exception ex) catch (Exception ex)

@ -35,9 +35,13 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start GetDocument DokumentID:"+dokid, LogLevelType.Debug);
DOCGEN.DocGet gd = new DocGet(connectionstring); DOCGEN.DocGet gd = new DocGet(connectionstring);
clsdok dok = new clsdok("", "", ""); clsdok dok = new clsdok("", "", "");
dok = gd.GetDoc(dokid); dok = gd.GetDoc(dokid);
APILogging.Log((HttpRequestMessage)Request, "Ende GetDocument DokumentID:" + dokid, LogLevelType.Debug);
return Ok(dok); return Ok(dok);
} }
catch (Exception e) catch (Exception e)
@ -69,11 +73,15 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start GetDocumentPDF DokumentID:" + dokid, LogLevelType.Debug);
DOCGEN.DocGet gd = new DocGet(connectionstring); DOCGEN.DocGet gd = new DocGet(connectionstring);
clsdok dok = new clsdok("", "", ""); clsdok dok = new clsdok("", "", "");
dok = gd.GetDocAsPDF(dokid); dok = gd.GetDocAsPDF(dokid);
dok.extension = "pdf"; dok.extension = "pdf";
dok.doktype = "P"; dok.doktype = "P";
APILogging.Log((HttpRequestMessage)Request, "Ende GetDocument DokumentID:" + dokid, LogLevelType.Debug);
return Ok(dok); return Ok(dok);
} }
catch (Exception e) catch (Exception e)
@ -94,11 +102,14 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start SendToOnBase:" + dokid, LogLevelType.Debug);
DB db = new DB(connectionstring); DB db = new DB(connectionstring);
db.Get_Tabledata("Select * from dokument where dokumentid='" + dokid + "'", false, true); db.Get_Tabledata("Select * from dokument where dokumentid='" + dokid + "'", false, true);
if (db.dsdaten.Tables[0].Rows.Count < 1) if (db.dsdaten.Tables[0].Rows.Count < 1)
{ {
db = null; db = null;
APILogging.Log((HttpRequestMessage)Request, "Ende GetDocument DokumentID:" + dokid, LogLevelType.Debug);
return BadRequest("Dokument " + dokid + " not found"); return BadRequest("Dokument " + dokid + " not found");
} }
else else
@ -110,6 +121,8 @@ namespace API_NetFramework.Controllers
db.Exec_SQL("Update dokument set loeschgrund='Archiviert' where dokumentid='" + dokid + "'"); db.Exec_SQL("Update dokument set loeschgrund='Archiviert' where dokumentid='" + dokid + "'");
db = null; db = null;
APILogging.Log((HttpRequestMessage)Request, "Ende GetDocument DokumentID:" + dokid, LogLevelType.Debug);
return Ok("Archivierung ausgelöst"); return Ok("Archivierung ausgelöst");
} }
} }
@ -131,6 +144,8 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start GenDoc " , LogLevelType.Debug);
if (!(ParamCheck("partnernr", Partnernr))) { return BadRequest("Partnernr " + Partnernr + " ist ungültig"); } if (!(ParamCheck("partnernr", Partnernr))) { return BadRequest("Partnernr " + Partnernr + " ist ungültig"); }
if (!(ParamCheck("dokumenttyp", Dokumenttypnr))) { return BadRequest("Dokumenttyp " + Dokumenttypnr + " ist ungültig"); } if (!(ParamCheck("dokumenttyp", Dokumenttypnr))) { return BadRequest("Dokumenttyp " + Dokumenttypnr + " ist ungültig"); }
if (!(ParamCheck("tgcreator", TGCreator))) { return BadRequest("TGCreator " + TGCreator + " ist ungültig"); } if (!(ParamCheck("tgcreator", TGCreator))) { return BadRequest("TGCreator " + TGCreator + " ist ungültig"); }
@ -189,6 +204,8 @@ namespace API_NetFramework.Controllers
clsdok dok = new clsdok("", "", ""); clsdok dok = new clsdok("", "", "");
dok = Generator.Generate_Doc_EDOKA(dokumentid, ref dokdata); dok = Generator.Generate_Doc_EDOKA(dokumentid, ref dokdata);
db.Save_To_DB(dokumentid, "", dok.dokument); db.Save_To_DB(dokumentid, "", dok.dokument);
APILogging.Log((HttpRequestMessage)Request, "Ende GenDoc DokumentID:"+dokumentid, LogLevelType.Debug);
return Ok(dokumentid); return Ok(dokumentid);
} }
catch (Exception e) catch (Exception e)

@ -47,6 +47,7 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start GetUnterschriftAsBase64 TGNummer: " + TGNummer, LogLevelType.Debug);
string path = System.Configuration.ConfigurationManager.AppSettings["UnterschriftPath"]; string path = System.Configuration.ConfigurationManager.AppSettings["UnterschriftPath"];
string filename = path + TGNummer + ".pdf"; string filename = path + TGNummer + ".pdf";
if (!File.Exists(filename)) if (!File.Exists(filename))
@ -86,6 +87,7 @@ namespace API_NetFramework.Controllers
} }
try try
{ {
APILogging.Log((HttpRequestMessage)Request, "Start GetUnterschrift TGNummer: " + TGNummer, LogLevelType.Debug);
string path = System.Configuration.ConfigurationManager.AppSettings["UnterschriftPath"]; string path = System.Configuration.ConfigurationManager.AppSettings["UnterschriftPath"];
string filename = path + TGNummer + ".jpg"; string filename = path + TGNummer + ".jpg";
if (!File.Exists(filename)) if (!File.Exists(filename))
@ -98,6 +100,8 @@ namespace API_NetFramework.Controllers
byte[] b = File.ReadAllBytes(filename); byte[] b = File.ReadAllBytes(filename);
var dataStream = new MemoryStream(b); var dataStream = new MemoryStream(b);
string imageName = TGNummer + ".jpg"; string imageName = TGNummer + ".jpg";
APILogging.Log((HttpRequestMessage)Request, "Ende GetUnterschrift TGNummer: " + TGNummer, LogLevelType.Debug);
return new unterschriftResult(dataStream, Request, imageName); return new unterschriftResult(dataStream, Request, imageName);
} }
catch (Exception e) catch (Exception e)

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<_PublishTargetUrl>E:\Software-Projekte\OnDoc\PubServices\OnDoc</_PublishTargetUrl> <_PublishTargetUrl>E:\Software-Projekte\OnDoc\PubServices\OnDoc</_PublishTargetUrl>
<History>True|2024-11-11T12:42:23.6578245Z||;True|2024-11-09T12:11:00.0777236+01:00||;True|2024-11-09T11:54:51.8503924+01:00||;</History> <History>True|2024-11-13T16:47:13.0183160Z||;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 /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -82,16 +82,16 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>04/09/2024 19:25:14</publishTime> <publishTime>04/09/2024 19:25:14</publishTime>
</File> </File>
<File Include="bin/BarcodeLib.dll"> <File Include="bin/BarcodeLib.dll">
<publishTime>11/11/2024 09:13:16</publishTime> <publishTime>11/13/2024 07:13:56</publishTime>
</File> </File>
<File Include="bin/BarcodeLib.pdb"> <File Include="bin/BarcodeLib.pdb">
<publishTime>11/11/2024 09:13:16</publishTime> <publishTime>11/13/2024 07:13:56</publishTime>
</File> </File>
<File Include="bin/Database.dll"> <File Include="bin/Database.dll">
<publishTime>11/11/2024 13:42:22</publishTime> <publishTime>11/13/2024 17:46:34</publishTime>
</File> </File>
<File Include="bin/Database.pdb"> <File Include="bin/Database.pdb">
<publishTime>11/11/2024 13:42:22</publishTime> <publishTime>11/13/2024 17:46:34</publishTime>
</File> </File>
<File Include="bin/de/System.Net.Http.Formatting.resources.dll"> <File Include="bin/de/System.Net.Http.Formatting.resources.dll">
<publishTime>10/20/2023 22:35:02</publishTime> <publishTime>10/20/2023 22:35:02</publishTime>
@ -124,13 +124,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>10/20/2023 22:35:04</publishTime> <publishTime>10/20/2023 22:35:04</publishTime>
</File> </File>
<File Include="bin/DOCGEN.dll"> <File Include="bin/DOCGEN.dll">
<publishTime>11/11/2024 13:42:22</publishTime> <publishTime>11/13/2024 17:46:34</publishTime>
</File> </File>
<File Include="bin/DOCGEN.dll.config"> <File Include="bin/DOCGEN.dll.config">
<publishTime>08/30/2024 10:27:25</publishTime> <publishTime>08/30/2024 10:27:25</publishTime>
</File> </File>
<File Include="bin/DOCGEN.pdb"> <File Include="bin/DOCGEN.pdb">
<publishTime>11/11/2024 13:42:22</publishTime> <publishTime>11/13/2024 17:46:34</publishTime>
</File> </File>
<File Include="bin/FastReport.Bars.dll"> <File Include="bin/FastReport.Bars.dll">
<publishTime>11/27/2023 09:49:58</publishTime> <publishTime>11/27/2023 09:49:58</publishTime>
@ -208,10 +208,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>04/11/2022 19:09:46</publishTime> <publishTime>04/11/2022 19:09:46</publishTime>
</File> </File>
<File Include="bin/Model.dll"> <File Include="bin/Model.dll">
<publishTime>11/09/2024 11:54:46</publishTime> <publishTime>11/13/2024 17:46:34</publishTime>
</File> </File>
<File Include="bin/Model.pdb"> <File Include="bin/Model.pdb">
<publishTime>11/09/2024 11:54:46</publishTime> <publishTime>11/13/2024 17:46:34</publishTime>
</File> </File>
<File Include="bin/Newtonsoft.Json.Bson.dll"> <File Include="bin/Newtonsoft.Json.Bson.dll">
<publishTime>11/28/2018 00:10:18</publishTime> <publishTime>11/28/2018 00:10:18</publishTime>
@ -235,10 +235,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>10/10/2024 07:00:48</publishTime> <publishTime>10/10/2024 07:00:48</publishTime>
</File> </File>
<File Include="bin/OnDoc_NetFramework.dll"> <File Include="bin/OnDoc_NetFramework.dll">
<publishTime>11/11/2024 13:42:23</publishTime> <publishTime>11/13/2024 17:47:11</publishTime>
</File> </File>
<File Include="bin/OnDoc_NetFramework.pdb"> <File Include="bin/OnDoc_NetFramework.pdb">
<publishTime>11/11/2024 13:42:23</publishTime> <publishTime>11/13/2024 17:47:11</publishTime>
</File> </File>
<File Include="bin/Owin.dll"> <File Include="bin/Owin.dll">
<publishTime>11/13/2012 13:19:34</publishTime> <publishTime>11/13/2012 13:19:34</publishTime>
@ -616,7 +616,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>06/03/2024 08:11:55</publishTime> <publishTime>06/03/2024 08:11:55</publishTime>
</File> </File>
<File Include="Web.config"> <File Include="Web.config">
<publishTime>11/11/2024 13:42:23</publishTime> <publishTime>11/13/2024 17:46:35</publishTime>
</File> </File>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -12,10 +12,13 @@
<add key="UnterschriftPath" value="x:\docdemo\unterschriften\" /> <add key="UnterschriftPath" value="x:\docdemo\unterschriften\" />
<add key="JSONDebugPath" value="X:\\jsontemp\" /> <add key="JSONDebugPath" value="X:\\jsontemp\" />
<add key="Bearer" value="abc" /> <add key="Bearer" value="abc" />
<add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" /> <add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,
5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,
ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" />
<add key="APIUser" value="OnDoc,OnBase,Fivo"/>
<add key="AuthCheck" value="Yes" /> <add key="AuthCheck" value="Yes" />
<add key="SendToOnBase" value="No" /> <add key="SendToOnBase" value="No" />
<add key="SendToFile" value="Yes" /> <add key="SendToFile" value="YES" />
<add key="DebugDir" value="x:\jsontemp" /> <add key="DebugDir" value="x:\jsontemp" />
<add key="ILFast" value="https://localhost:44303/API/Fast" /> <add key="ILFast" value="https://localhost:44303/API/Fast" />
<add key="ILSlow" value="https://localhost:44303/API/Slow" /> <add key="ILSlow" value="https://localhost:44303/API/Slow" />

@ -132,6 +132,10 @@ namespace SecuringWebApiUsingApiKey.Middleware
if (GetValue("AuthCheck") == "Yes") if (GetValue("AuthCheck") == "Yes")
{ {
apikeys = GetValue("APIKeys").ToString().Split(','); apikeys = GetValue("APIKeys").ToString().Split(',');
for (int i = 0; i < apikeys.Length; i++)
{
apikeys[i] = apikeys[i].Replace(Environment.NewLine, "");
}
IEnumerable<KeyValuePair<string, string>> queryParams = request.GetQueryNameValuePairs(); IEnumerable<KeyValuePair<string, string>> queryParams = request.GetQueryNameValuePairs();
var key = queryParams.FirstOrDefault(x => x.Key == "api_key"); var key = queryParams.FirstOrDefault(x => x.Key == "api_key");
if (apikeys.Contains(key.Value) && checkfunction(key.Value,function)==true) { return true; } if (apikeys.Contains(key.Value) && checkfunction(key.Value,function)==true) { return 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.

@ -12,10 +12,13 @@
<add key="UnterschriftPath" value="x:\docdemo\unterschriften\" /> <add key="UnterschriftPath" value="x:\docdemo\unterschriften\" />
<add key="JSONDebugPath" value="X:\\jsontemp\" /> <add key="JSONDebugPath" value="X:\\jsontemp\" />
<add key="Bearer" value="abc" /> <add key="Bearer" value="abc" />
<add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" /> <add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,
5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,
ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" />
<add key="APIUser" value="OnDoc,OnBase,Fivo"/>
<add key="AuthCheck" value="Yes" /> <add key="AuthCheck" value="Yes" />
<add key="SendToOnBase" value="No" /> <add key="SendToOnBase" value="No" />
<add key="SendToFile" value="Yes" /> <add key="SendToFile" value="YES" />
<add key="DebugDir" value="x:\jsontemp" /> <add key="DebugDir" value="x:\jsontemp" />
<add key="ILFast" value="https://localhost:44303/API/Fast" /> <add key="ILFast" value="https://localhost:44303/API/Fast" />
<add key="ILSlow" value="https://localhost:44303/API/Slow" /> <add key="ILSlow" value="https://localhost:44303/API/Slow" />

@ -63,3 +63,51 @@
2024-11-11 09:31:56.0854|DEBUG|OnDoc| 2024-11-11 09:31:56.0854|DEBUG|OnDoc|
2024-11-11 09:32:01.0609|DEBUG|OnDoc| 2024-11-11 09:32:01.0609|DEBUG|OnDoc|
2024-11-11 09:32:01.2475|DEBUG|OnDoc| 2024-11-11 09:32:01.2475|DEBUG|OnDoc|
2024-11-12 15:08:10.3508|DEBUG|OnDoc|
2024-11-12 15:08:36.8714|DEBUG|OnDoc|
2024-11-12 15:08:36.9080|DEBUG|OnDoc|
2024-11-12 15:08:41.2455|DEBUG|OnDoc|
2024-11-12 15:08:45.7162|DEBUG|OnDoc|
2024-11-12 15:09:21.6197|DEBUG|OnDoc|
2024-11-12 15:09:35.3950|DEBUG|OnDoc|
2024-11-12 15:09:35.4390|DEBUG|OnDoc|
2024-11-12 15:09:40.6197|DEBUG|OnDoc|
2024-11-12 15:09:40.6769|DEBUG|OnDoc|
2024-11-12 15:14:03.8528|DEBUG|OnDoc|
2024-11-12 15:14:25.5539|DEBUG|OnDoc|
2024-11-12 15:14:25.6059|DEBUG|OnDoc|
2024-11-12 15:14:31.8184|DEBUG|OnDoc|
2024-11-12 15:14:31.8347|DEBUG|OnDoc|
2024-11-12 15:15:56.5269|DEBUG|OnDoc|
2024-11-12 15:15:56.5804|DEBUG|OnDoc|
2024-11-12 15:16:03.5964|DEBUG|OnDoc|
2024-11-12 15:16:03.6265|DEBUG|OnDoc|
2024-11-12 15:16:03.6490|DEBUG|OnDoc|
2024-11-12 15:16:03.6606|DEBUG|OnDoc|
2024-11-12 15:16:26.5044|DEBUG|OnDoc|
2024-11-12 15:16:26.5834|DEBUG|OnDoc|
2024-11-12 15:17:05.9655|DEBUG|OnDoc|
2024-11-12 15:17:22.5681|DEBUG|OnDoc|
2024-11-12 15:17:30.6552|DEBUG|OnDoc|
2024-11-12 15:17:38.8445|DEBUG|OnDoc|
2024-11-12 15:17:42.7437|DEBUG|OnDoc|
2024-11-12 19:27:44.4569|DEBUG|OnDoc|
2024-11-12 19:27:44.5229|DEBUG|OnDoc|
2024-11-12 19:28:15.5873|DEBUG|OnDoc|
2024-11-12 19:28:15.6013|DEBUG|OnDoc|
2024-11-12 19:28:15.6503|DEBUG|OnDoc|
2024-11-12 19:28:15.6663|DEBUG|OnDoc|
2024-11-12 19:28:18.2256|DEBUG|OnDoc|
2024-11-12 19:28:18.2396|DEBUG|OnDoc|
2024-11-13 13:40:02.8689|DEBUG|OnDoc|
2024-11-13 13:41:08.9490|DEBUG|OnDoc|
2024-11-13 13:41:50.5517|DEBUG|OnDoc|
2024-11-13 17:42:12.7810|ERROR|OnDoc|Unberechtigter Zugriff
2024-11-13 17:44:29.2873|DEBUG|OnDoc|Start GetDocument DokumentID:OFFEDK0002007001960501
2024-11-13 17:44:29.3575|DEBUG|OnDoc|
2024-11-13 17:44:29.3575|DEBUG|OnDoc|Ende GetDocument DokumentID:OFFEDK0002007001960501
2024-11-13 17:44:57.1819|ERROR|OnDoc|Unberechtigter Zugriff
2024-11-13 17:45:27.3722|ERROR|OnDoc|Unberechtigter Zugriff
2024-11-13 17:45:43.5209|DEBUG|OnDoc|Start Adresse GetAll
2024-11-13 17:45:43.5659|DEBUG|OnDoc|
2024-11-13 17:45:43.5659|DEBUG|OnDoc|Ende Adresse GetAll

@ -12,10 +12,11 @@
<add key="UnterschriftPath" value="x:\docdemo\unterschriften\" /> <add key="UnterschriftPath" value="x:\docdemo\unterschriften\" />
<add key="JSONDebugPath" value="X:\\jsontemp\" /> <add key="JSONDebugPath" value="X:\\jsontemp\" />
<add key="Bearer" value="abc" /> <add key="Bearer" value="abc" />
<add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" /> <add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,&#xD;&#xA;5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,&#xD;&#xA;ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" />
<add key="APIUser" value="OnDoc,OnBase,Fivo" />
<add key="AuthCheck" value="Yes" /> <add key="AuthCheck" value="Yes" />
<add key="SendToOnBase" value="No" /> <add key="SendToOnBase" value="No" />
<add key="SendToFile" value="Yes" /> <add key="SendToFile" value="YES" />
<add key="DebugDir" value="x:\jsontemp" /> <add key="DebugDir" value="x:\jsontemp" />
<add key="ILFast" value="https://localhost:44303/API/Fast" /> <add key="ILFast" value="https://localhost:44303/API/Fast" />
<add key="ILSlow" value="https://localhost:44303/API/Slow" /> <add key="ILSlow" value="https://localhost:44303/API/Slow" />

@ -12,10 +12,13 @@
<add key="UnterschriftPath" value="x:\docdemo\unterschriften\" /> <add key="UnterschriftPath" value="x:\docdemo\unterschriften\" />
<add key="JSONDebugPath" value="X:\\jsontemp\" /> <add key="JSONDebugPath" value="X:\\jsontemp\" />
<add key="Bearer" value="abc" /> <add key="Bearer" value="abc" />
<add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" /> <add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,
5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,
ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" />
<add key="APIUser" value="OnDoc,OnBase,Fivo"/>
<add key="AuthCheck" value="Yes" /> <add key="AuthCheck" value="Yes" />
<add key="SendToOnBase" value="No" /> <add key="SendToOnBase" value="No" />
<add key="SendToFile" value="Yes" /> <add key="SendToFile" value="YES" />
<add key="DebugDir" value="x:\jsontemp" /> <add key="DebugDir" value="x:\jsontemp" />
<add key="ILFast" value="https://localhost:44303/API/Fast" /> <add key="ILFast" value="https://localhost:44303/API/Fast" />
<add key="ILSlow" value="https://localhost:44303/API/Slow" /> <add key="ILSlow" value="https://localhost:44303/API/Slow" />

@ -12,10 +12,11 @@
<add key="UnterschriftPath" value="x:\docdemo\unterschriften\" /> <add key="UnterschriftPath" value="x:\docdemo\unterschriften\" />
<add key="JSONDebugPath" value="X:\\jsontemp\" /> <add key="JSONDebugPath" value="X:\\jsontemp\" />
<add key="Bearer" value="abc" /> <add key="Bearer" value="abc" />
<add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" /> <add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,&#xD;&#xA;5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,&#xD;&#xA;ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" />
<add key="APIUser" value="OnDoc,OnBase,Fivo" />
<add key="AuthCheck" value="Yes" /> <add key="AuthCheck" value="Yes" />
<add key="SendToOnBase" value="No" /> <add key="SendToOnBase" value="No" />
<add key="SendToFile" value="Yes" /> <add key="SendToFile" value="YES" />
<add key="DebugDir" value="x:\jsontemp" /> <add key="DebugDir" value="x:\jsontemp" />
<add key="ILFast" value="https://localhost:44303/API/Fast" /> <add key="ILFast" value="https://localhost:44303/API/Fast" />
<add key="ILSlow" value="https://localhost:44303/API/Slow" /> <add key="ILSlow" value="https://localhost:44303/API/Slow" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -76,7 +76,6 @@
this.ctxmenuEmpfaenger = new System.Windows.Forms.ContextMenuStrip(this.components); this.ctxmenuEmpfaenger = new System.Windows.Forms.ContextMenuStrip(this.components);
this.partnerHinzufügenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.partnerHinzufügenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.partnerLöschenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.partnerLöschenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ausListeLöschenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.erneutGenerierenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.erneutGenerierenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.treeViewAdv1 = new Syncfusion.Windows.Forms.Tools.TreeViewAdv(); this.treeViewAdv1 = new Syncfusion.Windows.Forms.Tools.TreeViewAdv();
this.GridEmpfänger = new Syncfusion.WinForms.DataGrid.SfDataGrid(); this.GridEmpfänger = new Syncfusion.WinForms.DataGrid.SfDataGrid();
@ -599,37 +598,29 @@
this.ctxmenuEmpfaenger.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ctxmenuEmpfaenger.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.partnerHinzufügenToolStripMenuItem, this.partnerHinzufügenToolStripMenuItem,
this.partnerLöschenToolStripMenuItem, this.partnerLöschenToolStripMenuItem,
this.ausListeLöschenToolStripMenuItem,
this.erneutGenerierenToolStripMenuItem}); this.erneutGenerierenToolStripMenuItem});
this.ctxmenuEmpfaenger.Name = "ctxmenuEmpfaenger"; this.ctxmenuEmpfaenger.Name = "ctxmenuEmpfaenger";
this.ctxmenuEmpfaenger.Size = new System.Drawing.Size(176, 92); this.ctxmenuEmpfaenger.Size = new System.Drawing.Size(211, 92);
// //
// partnerHinzufügenToolStripMenuItem // partnerHinzufügenToolStripMenuItem
// //
this.partnerHinzufügenToolStripMenuItem.Name = "partnerHinzufügenToolStripMenuItem"; this.partnerHinzufügenToolStripMenuItem.Name = "partnerHinzufügenToolStripMenuItem";
this.partnerHinzufügenToolStripMenuItem.Size = new System.Drawing.Size(175, 22); this.partnerHinzufügenToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.partnerHinzufügenToolStripMenuItem.Text = "Partner hinzufügen"; this.partnerHinzufügenToolStripMenuItem.Text = "Partner hinzufügen";
this.partnerHinzufügenToolStripMenuItem.Click += new System.EventHandler(this.partnerHinzufügenToolStripMenuItem_Click); this.partnerHinzufügenToolStripMenuItem.Click += new System.EventHandler(this.partnerHinzufügenToolStripMenuItem_Click);
// //
// partnerLöschenToolStripMenuItem // partnerLöschenToolStripMenuItem
// //
this.partnerLöschenToolStripMenuItem.Name = "partnerLöschenToolStripMenuItem"; this.partnerLöschenToolStripMenuItem.Name = "partnerLöschenToolStripMenuItem";
this.partnerLöschenToolStripMenuItem.Size = new System.Drawing.Size(175, 22); this.partnerLöschenToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.partnerLöschenToolStripMenuItem.Text = "Partner löschen"; this.partnerLöschenToolStripMenuItem.Text = "Partner löschen";
this.partnerLöschenToolStripMenuItem.Click += new System.EventHandler(this.partnerLöschenToolStripMenuItem_Click); this.partnerLöschenToolStripMenuItem.Click += new System.EventHandler(this.partnerLöschenToolStripMenuItem_Click);
// //
// ausListeLöschenToolStripMenuItem
//
this.ausListeLöschenToolStripMenuItem.Name = "ausListeLöschenToolStripMenuItem";
this.ausListeLöschenToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
this.ausListeLöschenToolStripMenuItem.Text = "Aus Liste löschen";
this.ausListeLöschenToolStripMenuItem.Click += new System.EventHandler(this.ausListeLöschenToolStripMenuItem_Click);
//
// erneutGenerierenToolStripMenuItem // erneutGenerierenToolStripMenuItem
// //
this.erneutGenerierenToolStripMenuItem.Name = "erneutGenerierenToolStripMenuItem"; this.erneutGenerierenToolStripMenuItem.Name = "erneutGenerierenToolStripMenuItem";
this.erneutGenerierenToolStripMenuItem.Size = new System.Drawing.Size(175, 22); this.erneutGenerierenToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.erneutGenerierenToolStripMenuItem.Text = "Erneut generieren"; this.erneutGenerierenToolStripMenuItem.Text = "Generierung zurücksetzen";
this.erneutGenerierenToolStripMenuItem.Click += new System.EventHandler(this.erneutGenerierenToolStripMenuItem_Click); this.erneutGenerierenToolStripMenuItem.Click += new System.EventHandler(this.erneutGenerierenToolStripMenuItem_Click);
// //
// treeViewAdv1 // treeViewAdv1
@ -964,7 +955,7 @@
this.pnlLoad.Controls.Add(this.btnsbloadcancel); this.pnlLoad.Controls.Add(this.btnsbloadcancel);
this.pnlLoad.Controls.Add(this.btnsbloadok); this.pnlLoad.Controls.Add(this.btnsbloadok);
this.pnlLoad.Controls.Add(this.panel1); this.pnlLoad.Controls.Add(this.panel1);
this.pnlLoad.Location = new System.Drawing.Point(216, 51); this.pnlLoad.Location = new System.Drawing.Point(1024, 72);
this.pnlLoad.Name = "pnlLoad"; this.pnlLoad.Name = "pnlLoad";
this.pnlLoad.Size = new System.Drawing.Size(493, 634); this.pnlLoad.Size = new System.Drawing.Size(493, 634);
this.pnlLoad.TabIndex = 4; this.pnlLoad.TabIndex = 4;
@ -1177,7 +1168,6 @@
private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button2;
private System.Windows.Forms.RibbonPanel ribbonPanel9; private System.Windows.Forms.RibbonPanel ribbonPanel9;
private System.Windows.Forms.RibbonButton RibbonButtonArchivierenUndAbschlessen; private System.Windows.Forms.RibbonButton RibbonButtonArchivierenUndAbschlessen;
private System.Windows.Forms.ToolStripMenuItem ausListeLöschenToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem erneutGenerierenToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem erneutGenerierenToolStripMenuItem;
} }
} }

@ -10,6 +10,7 @@ using System.Runtime.CompilerServices;
using System.Runtime.Remoting.Messaging; using System.Runtime.Remoting.Messaging;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web.Caching;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml.Linq; using System.Xml.Linq;
using Database; using Database;
@ -198,7 +199,8 @@ namespace OnDoc.UIControls
sfDataGridEmpfaenger.DataSource = dt; sfDataGridEmpfaenger.DataSource = dt;
update_zahlen(); update_zahlen();
} }
private void refresh_spalten() { private void refresh_spalten()
{
//sfDataGridEmpfaenger.Columns["STATUS"].Visible = false; //sfDataGridEmpfaenger.Columns["STATUS"].Visible = false;
//sfDataGridEmpfaenger.Columns["FEHLERCODE"].Visible = false; //sfDataGridEmpfaenger.Columns["FEHLERCODE"].Visible = false;
//sfDataGridEmpfaenger.Columns["BLKUNDE"].Visible = false; //sfDataGridEmpfaenger.Columns["BLKUNDE"].Visible = false;
@ -349,10 +351,10 @@ namespace OnDoc.UIControls
DB db = new DB(AppParams.connectionstring); DB db = new DB(AppParams.connectionstring);
if (newsb) if (newsb)
{ {
db.Get_Tabledata("Select bezeichnung,office_vorlagenr from dokumenttyp where dokumenttypnr=" + sb.dokumenttypnr.ToString(), false, true); db.Get_Tabledata("Select bezeichnung,office_vorlagenr, isnull(vertrag,0) as vertrag from dokumenttyp where dokumenttypnr=" + sb.dokumenttypnr.ToString(), false, true);
sb.bezeichnung = db.dsdaten.Tables[0].Rows[0][0].ToString(); sb.bezeichnung = db.dsdaten.Tables[0].Rows[0][0].ToString();
sb.officevorlagenr = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0][1]); sb.officevorlagenr = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0][1]);
sb.vertrag= Convert.ToInt32(db.dsdaten.Tables[0].Rows[0][2]);
} }
} }
@ -371,7 +373,7 @@ namespace OnDoc.UIControls
try { sb.unterschriftrechts = Convert.ToInt32(cbboxunterschriftrechts.SelectedValue.ToString()); } catch { sb.unterschriftrechts = 0; } try { sb.unterschriftrechts = Convert.ToInt32(cbboxunterschriftrechts.SelectedValue.ToString()); } catch { sb.unterschriftrechts = 0; }
try { sb.team = Convert.ToInt32(cbboxteam.SelectedValue.ToString()); } catch { sb.team = 0; } try { sb.team = Convert.ToInt32(cbboxteam.SelectedValue.ToString()); } catch { sb.team = 0; }
sb.archivdatum = Convert.ToDateTime(DateDokumentDatum.Value); sb.archivdatum = Convert.ToDateTime(DateDokumentDatum.Value);
sb.dokumentdatum= Convert.ToDateTime(DateDokumentDatum.Value); sb.dokumentdatum = Convert.ToDateTime(DateDokumentDatum.Value);
DB db = new DB(AppParams.connectionstring); DB db = new DB(AppParams.connectionstring);
sb.serienbriefnr = db.Save_Serienbrief(sb, AppParams.tempdir); sb.serienbriefnr = db.Save_Serienbrief(sb, AppParams.tempdir);
db.save_sb_vorlage_to_db(sb.filename, "", sb.serienbriefnr); db.save_sb_vorlage_to_db(sb.filename, "", sb.serienbriefnr);
@ -383,6 +385,7 @@ namespace OnDoc.UIControls
{ {
try try
{ {
int inbearbeitung = 0; int inbearbeitung = 0;
int fehlerhaft = 0; int fehlerhaft = 0;
int generiert = 0; int generiert = 0;
@ -410,16 +413,30 @@ namespace OnDoc.UIControls
RibbonButtonArchivierenUndAbschlessen.Enabled = false; RibbonButtonArchivierenUndAbschlessen.Enabled = false;
ribbonButtonDruckstapel.Enabled = false; ribbonButtonDruckstapel.Enabled = false;
if (inbearbeitung > 0) { RibbonButtonGenerateSB.Enabled = true; } if (inbearbeitung > 0) { RibbonButtonGenerateSB.Enabled = true; }
if (fehlerhaft == 0 && inbearbeitung == 0 && generiert > 0) { if (fehlerhaft == 0 && inbearbeitung == 0 && generiert > 0)
{
RibbonButtonArchivierenUndAbschlessen.Enabled = true; RibbonButtonArchivierenUndAbschlessen.Enabled = true;
ribbonButtonDruckstapel.Enabled = true; ribbonButtonDruckstapel.Enabled = true;
} }
enable_disable(true);
if (generiert > 0 || abgeschlossen > 0)
{
enable_disable(false);
}
} }
catch { } catch { }
} }
private void enable_disable(bool enabled)
{
groupBox5.Enabled = enabled;
groupBox6.Enabled = enabled;
groupBox7.Enabled = enabled;
groupBox8.Enabled = enabled;
ribbonButton1.Enabled = enabled;
}
private void Set_Functions(int type) private void Set_Functions(int type)
{ {
@ -429,18 +446,18 @@ namespace OnDoc.UIControls
ctxmenuEmpfaenger.Enabled = true; ctxmenuEmpfaenger.Enabled = true;
partnerHinzufügenToolStripMenuItem.Visible = true; partnerHinzufügenToolStripMenuItem.Visible = true;
partnerLöschenToolStripMenuItem.Visible = true; partnerLöschenToolStripMenuItem.Visible = true;
ausListeLöschenToolStripMenuItem.Visible = false;
erneutGenerierenToolStripMenuItem.Visible = false; erneutGenerierenToolStripMenuItem.Visible = false;
docPreview1.Visible = false; docPreview1.Visible = false;
} }
if (type == 3 || type==4) if (type == 3 || type == 4)
{ {
partnerHinzufügenToolStripMenuItem.Visible = false; partnerHinzufügenToolStripMenuItem.Visible = false;
partnerLöschenToolStripMenuItem.Visible = false; partnerLöschenToolStripMenuItem.Visible = false;
sfDataGridEmpfaenger.AllowEditing = false; sfDataGridEmpfaenger.AllowEditing = false;
ausListeLöschenToolStripMenuItem.Visible = true;
erneutGenerierenToolStripMenuItem.Visible = true; erneutGenerierenToolStripMenuItem.Visible = true;
docPreview1.clear_viewer(); docPreview1.clear_viewer();
docPreview1.Visible = true; docPreview1.Visible = true;
@ -454,41 +471,41 @@ namespace OnDoc.UIControls
update_grid(); update_grid();
} }
private void update_grid() private void update_grid()
{ {
string nodetext = treeViewAdv1.SelectedNode.Text; string nodetext = treeViewAdv1.SelectedNode.Text;
DataView dv = new DataView(sb.dsempfaenger.Tables[0]); DataView dv = new DataView(sb.dsempfaenger.Tables[0]);
switch (nodetext.Substring(0, 5)) switch (nodetext.Substring(0, 5))
{ {
case "In Be": case "In Be":
dv.RowFilter = "Status = 0"; dv.RowFilter = "Status = 0";
sfDataGridEmpfaenger.DataSource = null; sfDataGridEmpfaenger.DataSource = null;
sfDataGridEmpfaenger.DataSource = dv; sfDataGridEmpfaenger.DataSource = dv;
refresh_spalten(); refresh_spalten();
Set_Functions(1); Set_Functions(1);
break; break;
case "Fehle": case "Fehle":
dv.RowFilter = "Status=-1"; dv.RowFilter = "Status=-1";
sfDataGridEmpfaenger.DataSource = null; sfDataGridEmpfaenger.DataSource = null;
sfDataGridEmpfaenger.DataSource = dv; sfDataGridEmpfaenger.DataSource = dv;
refresh_spalten(); refresh_spalten();
Set_Functions(2); Set_Functions(2);
break; break;
case "Gener": case "Gener":
dv.RowFilter = "Status = 1"; dv.RowFilter = "Status = 1";
sfDataGridEmpfaenger.DataSource = null; sfDataGridEmpfaenger.DataSource = null;
sfDataGridEmpfaenger.DataSource = dv; sfDataGridEmpfaenger.DataSource = dv;
refresh_spalten(); Set_Functions(3); refresh_spalten(); Set_Functions(3);
break; break;
case "Abges": case "Abges":
dv.RowFilter = "Status = 2"; dv.RowFilter = "Status = 2";
sfDataGridEmpfaenger.DataSource = null; sfDataGridEmpfaenger.DataSource = null;
sfDataGridEmpfaenger.DataSource = dv; sfDataGridEmpfaenger.DataSource = dv;
refresh_spalten(); refresh_spalten();
Set_Functions(4); Set_Functions(4);
break; break;
}
} }
}
private void ribbonbuttonsave_Click(object sender, EventArgs e) private void ribbonbuttonsave_Click(object sender, EventArgs e)
@ -937,7 +954,8 @@ namespace OnDoc.UIControls
{ {
Insert_Value(vorlagendaten.Rows[i][i1].ToString(), vorlagendaten.Columns[i1].ColumnName); Insert_Value(vorlagendaten.Rows[i][i1].ToString(), vorlagendaten.Columns[i1].ColumnName);
} }
} catch { } }
catch { }
try try
{ {
if (vorlagendaten.Columns[i1].ColumnName.ToString().Substring(0, 5) == "I_09_") if (vorlagendaten.Columns[i1].ColumnName.ToString().Substring(0, 5) == "I_09_")
@ -957,24 +975,32 @@ namespace OnDoc.UIControls
// IntWert = RenCol(IntWert) // IntWert = RenCol(IntWert)
Insert_Value(vorlagendaten.Rows[i][IntWert].ToString(), Intbookmark); Insert_Value(vorlagendaten.Rows[i][IntWert].ToString(), Intbookmark);
} }
} catch { } }
catch { }
} }
string pdfdoc = dget.Convert_Word_To_PDF(dg.generate_serienbrief(sb.VorlageBase64, sb)); string pdfdoc = dget.Convert_Word_To_PDF(dg.generate_serienbrief(sb.VorlageBase64, sb));
Helper.FileHelper fh = new FileHelper(); Helper.FileHelper fh = new FileHelper();
DB db = new DB(AppParams.connectionstring); DB db = new DB(AppParams.connectionstring);
string filename = "SB_" + sb.serienbriefnr.ToString() + vorlagendaten.Rows[i]["intEintragnr"].ToString() + ".pdf"; System.Data.DataRow dr = sb.dsempfaenger.Tables[0].Select("intEintragnr = '" + vorlagendaten.Rows[i]["IntEintragnr"].ToString() + "'").FirstOrDefault();
string dokumentid = "";
if (dr != null)
{
dokumentid = dr["dokumentid"].ToString();
}
if (dokumentid == "") { dokumentid = db.get_dbkey("Dokument"); }
string filename = dokumentid + ".pdf";
//string filename = "SB_" + sb.serienbriefnr.ToString() + vorlagendaten.Rows[i]["intEintragnr"].ToString() + ".pdf";
fh.SaveBase64ToFile(pdfdoc, AppParams.tempdir + filename); fh.SaveBase64ToFile(pdfdoc, AppParams.tempdir + filename);
db.save_serienbrief_datei(sb.serienbriefnr, Convert.ToInt32(vorlagendaten.Rows[i]["IntEintragnr"]), AppParams.tempdir + filename); db.save_serienbrief_datei(sb.serienbriefnr, Convert.ToInt32(vorlagendaten.Rows[i]["IntEintragnr"]), AppParams.tempdir + filename, dokumentid);
System.IO.File.Delete(AppParams.tempdir + filename); System.IO.File.Delete(AppParams.tempdir + filename);
db = null; db = null;
System.Data.DataRow dr = sb.dsempfaenger.Tables[0].Select("intEintragnr = '" + vorlagendaten.Rows[i]["IntEintragnr"].ToString()+"'").FirstOrDefault();
if (dr != null) if (dr != null)
{ {
dr["STATUS"] = "1"; dr["STATUS"] = "1";
dr["Dokumentid"] = dokumentid;
} }
sb.DocValues.Clear(); sb.DocValues.Clear();
} }
@ -1251,7 +1277,7 @@ namespace OnDoc.UIControls
{ {
add_progress(); add_progress();
System.Data.DataRow dr = rowView.Row; System.Data.DataRow dr = rowView.Row;
db.Get_Tabledata("Select dbo.BinaryToBase64(dokument) from edex_sb_serienbrief_dokument where serienbriefnr=" + sb.serienbriefnr.ToString() + " and inteintragnr=" + dr["IntEintragNr"].ToString(), false, true); db.Get_Tabledata("Select dbo.BinaryToBase64(dokument) from edex_sb_serienbrief_dokument where dokumentid='" + dr["Dokumentid"].ToString()+"'", false, true);
var stream = new MemoryStream(Convert.FromBase64String(db.dsdaten.Tables[0].Rows[0][0].ToString())); var stream = new MemoryStream(Convert.FromBase64String(db.dsdaten.Tables[0].Rows[0][0].ToString()));
if (stream.Length > 0) if (stream.Length > 0)
{ {
@ -1262,7 +1288,7 @@ namespace OnDoc.UIControls
save_stapel(stapel, ref streams); save_stapel(stapel, ref streams);
i = 0; i = 0;
streams = new Stream[dv.Count-(stapel*stapelgroesse)]; streams = new Stream[dv.Count - (stapel * stapelgroesse)];
stapel++; stapel++;
} }
} }
@ -1298,7 +1324,7 @@ namespace OnDoc.UIControls
fs.Close(); fs.Close();
fs.Dispose(); fs.Dispose();
TreeNodeAdv tn = new TreeNodeAdv(); TreeNodeAdv tn = new TreeNodeAdv();
tn.Text = "Druckstapel " + stapelnr.ToString()+" ("+streams.Length.ToString()+")"; tn.Text = "Druckstapel " + stapelnr.ToString() + " (" + streams.Length.ToString() + ")";
tn.Tag = stapelnr.ToString(); tn.Tag = stapelnr.ToString();
tn.TagObject = filename; tn.TagObject = filename;
treeviewDruckstapel.Nodes.Add(tn); treeviewDruckstapel.Nodes.Add(tn);
@ -1458,9 +1484,9 @@ namespace OnDoc.UIControls
i = i + 1; i = i + 1;
} }
for (int i1 = 0; i1 < i; i1++) for (int i1 = 0; i1 < i; i1++)
{ {
System.Data.DataRow dr = sb.dsempfaenger.Tables[0].Select("inteintragnr='" + inteintraege[i1].ToString()+"'").FirstOrDefault(); // finds all rows with id==2 and selects first or null if haven't found any System.Data.DataRow dr = sb.dsempfaenger.Tables[0].Select("inteintragnr='" + inteintraege[i1].ToString() + "'").FirstOrDefault(); // finds all rows with id==2 and selects first or null if haven't found any
if (dr != null) if (dr != null)
{ {
dr["status"] = "0"; //changes the Product_name dr["status"] = "0"; //changes the Product_name
@ -1469,5 +1495,6 @@ namespace OnDoc.UIControls
refresh_empfaenger(sb.dsempfaenger.Tables[0]); refresh_empfaenger(sb.dsempfaenger.Tables[0]);
} }
} }
} }

@ -101,7 +101,7 @@ namespace OnDoc.UIControls
{ {
return dok; ; return dok; ;
} }
if (AppParams.RESTURI != "") if (AppParams.UseAPI == "YES")
{ {
string URL = AppParams.RESTURI + "api/GetDocument?dokid=" + dokumentid; string URL = AppParams.RESTURI + "api/GetDocument?dokid=" + dokumentid;
if (AsPDF == true) if (AsPDF == true)

@ -286,7 +286,7 @@ namespace OnDoc.UICintrols
{ {
return dok; ; return dok; ;
} }
if (AppParams.RESTURI != "") if (AppParams.UseAPI == "YES")
{ {
string URL = AppParams.RESTURI + "api/GetDocument?dokid=" + selected_dokumentid; string URL = AppParams.RESTURI + "api/GetDocument?dokid=" + selected_dokumentid;
if (AsPDF == true) if (AsPDF == true)
@ -557,6 +557,8 @@ namespace OnDoc.UICintrols
case 3: case 3:
break; break;
case 4: case 4:
archivedoc(frmnewdok.dokumentid);
break; break;
case 5: case 5:
break; break;
@ -824,6 +826,35 @@ namespace OnDoc.UICintrols
nv.Show(); nv.Show();
} }
private void archivedoc (string documentid)
{
string URL = AppParams.RESTURI + "api/ArchiveDocFromDatabase?dokumentid=" + documentid;
HttpWebRequest webRequest = HttpWebRequest.Create(URL) as HttpWebRequest;
webRequest.Method = WebRequestMethods.Http.Get;
webRequest.Headers["Authorization"] = "Bearer " + AppParams.apikey;
try
{
using (HttpWebResponse response = webRequest.GetResponse() as HttpWebResponse)
{
if (response.StatusCode == HttpStatusCode.OK)
{
StreamReader reader = new StreamReader(response.GetResponseStream());
string responseContent = reader.ReadToEnd();
Logging.DocLog.Info("Dokument archiviert", "OnDoc", documentid, "", "Dokument archiviert und abgeschlossen");
}
else
{
MessageBox.Show("Die Archivierung des Dokumentes " + documentid + " wurde abgebrochen." + Environment.NewLine + "Fehler: " + response.StatusDescription);
Logging.Logging.Error(URL + ": " + response.StatusCode.ToString() + " / " + response.StatusDescription, "Clinet - DokList GetDocument", "");
}
}
}
catch (Exception ex)
{
MessageBox.Show("Die Archivierung des Dokumentes " + documentid + " konnte nicht durchgeführt werden." + Environment.NewLine + "Fehler: " + ex.Message);
}
}
private void RibbonButtonArchivToOnBase_Click(object sender, EventArgs e) private void RibbonButtonArchivToOnBase_Click(object sender, EventArgs e)
{ {
var records = sfDataGrid1.View.GetSelectedRecords(); var records = sfDataGrid1.View.GetSelectedRecords();
@ -836,8 +867,9 @@ namespace OnDoc.UICintrols
var datarow = record as DataRowView; var datarow = record as DataRowView;
string documentid = datarow["dokumentid"].ToString(); string documentid = datarow["dokumentid"].ToString();
string URL = AppParams.RESTURI + "api/ArchiveDocFromDatabase?dokumentid=" + documentid;
archivedoc(documentid);
string URL = AppParams.RESTURI + "api/ArchiveDocFromDatabase?dokumentid=" + documentid;
HttpWebRequest webRequest = HttpWebRequest.Create(URL) as HttpWebRequest; HttpWebRequest webRequest = HttpWebRequest.Create(URL) as HttpWebRequest;
webRequest.Method = WebRequestMethods.Http.Get; webRequest.Method = WebRequestMethods.Http.Get;

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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -82,7 +82,9 @@ namespace DOCGEN
dd.Unterschrift_Rechts = sb.unterschriftrechts.ToString(); dd.Unterschrift_Rechts = sb.unterschriftrechts.ToString();
dd.DocValues = sb.DocValues; dd.DocValues = sb.DocValues;
dd.As_Faksimile = sb.faksimile_unterschrfit.ToString(); dd.As_Faksimile = sb.faksimile_unterschrfit.ToString();
dd.Barcode = sb.vertrag == 1;
dok.dokument = sfword.Generate_Word(vorlage,dd); dok.dokument = sfword.Generate_Word(vorlage,dd);
dok.doktype = "D"; dok.doktype = "D";
sfword = null; sfword = 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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -182,7 +182,7 @@ namespace Database
#endregion #endregion
public string generate_key(string dbkey) public string generate_key(string dbkey)
{ {
string skey = "ONDOC0000"; string skey = "OFFEDK000";
string s = ""; string s = "";
s = DateTime.Now.Year.ToString().Trim(); s = DateTime.Now.Year.ToString().Trim();
string dt = s; string dt = s;
@ -1373,10 +1373,11 @@ namespace Database
return true; return true;
} }
public string save_serienbrief_datei(int serienbriefnr, int eintragnr, string filename) public string save_serienbrief_datei(int serienbriefnr, int eintragnr, string filename, string dokumentid)
{ {
SqlConnection Connection = new SqlConnection(); SqlConnection Connection = new SqlConnection();
SqlDataAdapter DA = new SqlDataAdapter("select top 1 * from edex_sb_serienbrief_dokument where inteintragnr=" + eintragnr.ToString() + " and serienbriefnr=" + serienbriefnr.ToString(), Connection); SqlDataAdapter DA = new SqlDataAdapter("select top 1 * from edex_sb_serienbrief_dokument where dokumentid='"+dokumentid+"'", Connection);
//SqlDataAdapter DA = new SqlDataAdapter("select top 1 * from edex_sb_serienbrief_dokument where inteintragnr = " + eintragnr.ToString() + " and serienbriefnr = " + serienbriefnr.ToString(), Connection);
SqlCommandBuilder cb = new SqlCommandBuilder(DA); SqlCommandBuilder cb = new SqlCommandBuilder(DA);
DataSet ds = new DataSet(); DataSet ds = new DataSet();
FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
@ -1395,6 +1396,7 @@ namespace Database
myRow[1] = serienbriefnr.ToString(); myRow[1] = serienbriefnr.ToString();
myRow[2] = eintragnr.ToString(); myRow[2] = eintragnr.ToString();
myRow[3] = mydata; myRow[3] = mydata;
myRow[4] = dokumentid;
ds.Tables[0].Rows.Add(myRow); ds.Tables[0].Rows.Add(myRow);
DA.Update(ds, "sbdokument"); DA.Update(ds, "sbdokument");
} }

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

Loading…
Cancel
Save