update 20241107

This commit is contained in:
Stefan Hutter
2024-11-07 22:35:24 +01:00
parent 86be28ec33
commit 23a308ad73
65 changed files with 759 additions and 55 deletions

View File

@@ -10,6 +10,9 @@ using Model;
using Database;
using Newtonsoft.Json;
using API_NetFramework.Models;
using System.Runtime.Remoting.Messaging;
using System.IO;
using System.Web;
namespace API_NetFramework.Controllers
{
@@ -51,6 +54,7 @@ namespace API_NetFramework.Controllers
}
}
[HttpGet]
[Route("API/ArchiveDocBase64")]
/// <summary>
@@ -63,6 +67,7 @@ namespace API_NetFramework.Controllers
/// Dokumenthandle aus OnBase
/// </returns>
/// <remarks></remarks>
//
public IHttpActionResult ArchivDocBase64(string Dokument, string Dokumenttyp)
{
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
@@ -139,8 +144,36 @@ namespace API_NetFramework.Controllers
return Content(HttpStatusCode.InternalServerError, e.Message);
}
}
[HttpPost]
[Route("API/ArchivSBDoc")]
public IHttpActionResult ArchivSBDoc(string sbnr, string intid, int partnernr )
{
string json = "";
if (HttpContext.Current.Request.InputStream.Length > 0)
{
using (var inputStream = new StreamReader(HttpContext.Current.Request.InputStream))
{
json = inputStream.ReadToEnd();
}
}
string debugfilename = @"X:\\jsontemp\" + sbnr.ToString() + "_" + intid.ToString() + "_"+partnernr.ToString()+".json";
string SendToOnBase = System.Configuration.ConfigurationManager.AppSettings["SendToOnBase"];
string SendToFile = System.Configuration.ConfigurationManager.AppSettings["SendToFile"];
string debugdir = System.Configuration.ConfigurationManager.AppSettings["DebugDir"];
string jsonstring = json;
//jsonstring = Newtonsoft.Json.JsonConvert.SerializeObject(od);
if (SendToOnBase != "Yes")
{
if (SendToFile == "Yes")
{
System.IO.File.WriteAllText(debugfilename, jsonstring);
}
}
return Content(HttpStatusCode.OK, "");
}
}
}