Update 20250618

This commit is contained in:
Stefan Hutter
2025-06-18 23:11:00 +02:00
parent 85ff87dc62
commit f45b683545
173 changed files with 1728 additions and 320 deletions

View File

@@ -44,6 +44,7 @@ namespace API_NetFramework.Controllers
public int senderror { get; set; } = 0;
public string response { get; set; } = "";
}
public enum uploadtype
{
@@ -59,7 +60,6 @@ namespace API_NetFramework.Controllers
// GET: OnBase
string tokenfunction = "Archiv";
string connectionstring = StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
private void Update_IL_Log(ref ILResponse ilr, string dokumentid)
{
APILogging.Log((HttpRequestMessage)Request, "Start Update IL_Log: DokumentID:" + dokumentid, LogLevelType.Debug);
@@ -611,7 +611,7 @@ namespace API_NetFramework.Controllers
}
}
private string archiv_sb_doc(string dokumentid, string partnernr, string serienbriefnr, string dokument, string inteintragnr)
{
OnBaseDocUpload.OnBaseDokument onbasedoc = new OnBaseDocUpload.OnBaseDokument();
@@ -654,6 +654,7 @@ namespace API_NetFramework.Controllers
return ilr.response;
}
[HttpPost]
[Route("API/Send_Versandstrasse")]
@@ -757,6 +758,19 @@ namespace API_NetFramework.Controllers
string result = "";
inthandle = archiv_sb_doc(vd.DokumentID, vd.Partnernr, versandpaket.sb.serienbriefnr.ToString(), vd.dokument, vd.inteintragnr.ToString());
int test;
bool isnumeric = int.TryParse(inthandle, out test);
if (!isnumeric || inthandle == "")
{
ILResponse ilr1 = new ILResponse();
ilr1.response = "Dokument IntEIntrag="+vd.inteintragnr.ToString()+" nicht archiviert";
ilr1.senderror = 1;
DB db = new DB(connectionstring);
db.Exec_SQL("Update OnDoc_Versandstrasse_paket set fehler=1, fehlerdatum=getdate(), fehlerbeschreibung='"+ ilr1.response+"' where id=" + paketid);
return Content(HttpStatusCode.InternalServerError, ilr1.response);
}
oba.DocumentHandle = inthandle.ToString();
DOCGEN.DocGen dg = new DOCGEN.DocGen();
versandpaket.finaldoc = dg.geneate_dummy_pdf("VS Serienbrief: Handle "+oba.DocumentHandle.ToString() +" "+ DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss"));
@@ -768,15 +782,38 @@ namespace API_NetFramework.Controllers
db.clear_parameter();
db.add_parameter("@dokumentid", vd.DokumentID);
db.Get_Tabledata("sp_get_handle", true, false);
if (db.dsdaten.Tables[0].Rows.Count > 0)
{
inthandle = db.dsdaten.Tables[0].Rows[0][0].ToString();
int test;
bool isnumeric = int.TryParse(inthandle, out test);
if (!isnumeric || inthandle=="")
{
ILResponse ilr1 = new ILResponse();
ilr1.response = "Dokument ID:'"+ vd.DokumentID+"' nicht archiviert";
ilr1.senderror = 1;
db.Exec_SQL("Update OnDoc_Versandstrasse_paket set fehler=1, fehlerdatum=getdate(), fehlerbeschreibung='" + ilr1.response + "' where id=" + paketid);
return Content(HttpStatusCode.InternalServerError, ilr1.response);
}
oba.DocumentHandle = inthandle;
DOCGEN.DocGen dg = new DOCGEN.DocGen();
versandpaket.finaldoc=dg.geneate_dummy_pdf("Versandstrasse - DummyDokument - " + DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss"));
//versandpaket.finaldoc = "";
dg = null;
}
else
{
ILResponse ilr1 = new ILResponse();
ilr1.response = "Dokument ID:'" + vd.DokumentID + "' nicht archiviert";
ilr1.senderror = 1;
db.Exec_SQL("Update OnDoc_Versandstrasse_paket set fehler=1, fehlerdatum=getdate(), fehlerbeschreibung='" + ilr1.response + "' where id=" + paketid);
return Content(HttpStatusCode.InternalServerError, ilr1.response);
}
db = null;
}
}