update 20241202
This commit is contained in:
@@ -71,6 +71,50 @@ namespace API_NetFramework.Controllers
|
||||
db = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CheckDocID prüft auf eine vorhandene DokumentID in OnDoc (DokumentID OFFEDK... / Barcode-Klenber-Nr)
|
||||
/// </summary>
|
||||
/// <param name="DokumentID"></param>
|
||||
/// <returns>
|
||||
/// 200: OK
|
||||
/// </returns>
|
||||
/// <remarks></remarks>
|
||||
[HttpGet]
|
||||
[Route("API/CheckDocID")]
|
||||
|
||||
public IHttpActionResult CheckDocID(string DokumentID)
|
||||
{
|
||||
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
|
||||
{
|
||||
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
|
||||
}
|
||||
try
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start Check DokumentID: DokumentID:" + DokumentID, LogLevelType.Debug);
|
||||
Database.DB db = new Database.DB(connectionstring);
|
||||
db.Get_Tabledata("Select * from dokument where dokumentid = '" + DokumentID + "'", false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
return Ok(DokumentID);
|
||||
}
|
||||
db.Get_Tabledata("Select barcodenr from barcodeetikette where dokumentid='" + DokumentID + "'", false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
return Ok(DokumentID);
|
||||
}
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Check DokumentID: DokumentID:" + DokumentID, LogLevelType.Debug);
|
||||
|
||||
return Content(HttpStatusCode.NotFound, DokumentID);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, e.Message, LogLevelType.Error);
|
||||
return Content(HttpStatusCode.InternalServerError, e.Message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Archiviert das Dokument aus OnDoc in OnBase
|
||||
/// </summary>
|
||||
@@ -80,7 +124,7 @@ namespace API_NetFramework.Controllers
|
||||
/// Dokumenthandle aus OnBase
|
||||
/// </returns>
|
||||
/// <remarks></remarks>
|
||||
[HttpGet]
|
||||
[HttpPost]
|
||||
[Route("API/ArchiveDocFromDatabase")]
|
||||
|
||||
public IHttpActionResult ArchivDocFromDatabase(string DokumentID)
|
||||
@@ -190,50 +234,7 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CheckDocID prüft auf eine vorhandene DokumentID in OnDoc (DokumentID OFFEDK... / Barcode-Klenber-Nr)
|
||||
/// </summary>
|
||||
/// <param name="DokumentID"></param>
|
||||
/// <returns>
|
||||
/// 200: OK
|
||||
/// </returns>
|
||||
/// <remarks></remarks>
|
||||
[HttpGet]
|
||||
[Route("API/CheckDocID")]
|
||||
|
||||
public IHttpActionResult CheckDocID(string DokumentID)
|
||||
{
|
||||
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
|
||||
{
|
||||
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
|
||||
}
|
||||
try
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start Check DokumentID: DokumentID:" + DokumentID, LogLevelType.Debug);
|
||||
Database.DB db = new Database.DB(connectionstring);
|
||||
db.Get_Tabledata("Select * from dokument where dokumentid = '" + DokumentID + "'", false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
return Ok(DokumentID);
|
||||
}
|
||||
db.Get_Tabledata("Select barcodenr from barcodeetikette where dokumentid='" + DokumentID + "'", false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
return Ok(DokumentID);
|
||||
}
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Check DokumentID: DokumentID:" + DokumentID, LogLevelType.Debug);
|
||||
|
||||
return Content(HttpStatusCode.NotFound, DokumentID);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, e.Message, LogLevelType.Error);
|
||||
return Content(HttpStatusCode.InternalServerError, e.Message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
[Route("API/ArchivDocFromIRIS")]
|
||||
@@ -332,7 +333,7 @@ namespace API_NetFramework.Controllers
|
||||
//return Content(HttpStatusCode.OK, "");
|
||||
}
|
||||
|
||||
public IHttpActionResult Transfer_OnBase(uploadtype utype, ref string jsonstring, ref ILResponse ilr)
|
||||
private IHttpActionResult Transfer_OnBase(uploadtype utype, ref string jsonstring, ref ILResponse ilr)
|
||||
{
|
||||
//ILResponse ilr = new ILResponse();
|
||||
string response;
|
||||
|
||||
Reference in New Issue
Block a user