Update API-Token
This commit is contained in:
@@ -35,6 +35,11 @@ namespace API_NetFramework.Controllers
|
||||
|
||||
public IHttpActionResult ArchivDoc_From_Database(string DokumentID)
|
||||
{
|
||||
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request) == false)
|
||||
{
|
||||
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
@@ -52,6 +57,11 @@ namespace API_NetFramework.Controllers
|
||||
/// <remarks></remarks>
|
||||
public IHttpActionResult ArchivDocBase64(string Dokument, string Dokumenttyp)
|
||||
{
|
||||
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request) == false)
|
||||
{
|
||||
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
/// <summary>
|
||||
@@ -67,18 +77,26 @@ namespace API_NetFramework.Controllers
|
||||
|
||||
public IHttpActionResult CheckDocID(string DokumentID)
|
||||
{
|
||||
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)
|
||||
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request) == false)
|
||||
{
|
||||
return Ok(DokumentID);
|
||||
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
|
||||
}
|
||||
db.Get_Tabledata("Select barcodenr from barcodeetikette where dokumentid='" + DokumentID + "'", false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count > 0)
|
||||
try
|
||||
{
|
||||
return Ok(DokumentID);
|
||||
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);
|
||||
}
|
||||
return Content(HttpStatusCode.NotFound, DokumentID);
|
||||
}
|
||||
return Content(HttpStatusCode.NotFound, DokumentID);
|
||||
catch (Exception e) { return Content(HttpStatusCode.InternalServerError, e.Message); }
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
||||
Reference in New Issue
Block a user