Initial Comit
This commit is contained in:
35
EDOOKAAPI/Controllers/Dokumente.cs
Normal file
35
EDOOKAAPI/Controllers/Dokumente.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EDOOKAAPI.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class Dokumente : ControllerBase
|
||||
{
|
||||
[HttpGet("GetDoc/{DocID}")]
|
||||
public IActionResult GetDoc(string Docid)
|
||||
{
|
||||
{
|
||||
EDOKA_Database.EDOKA_DB db = new EDOKA_Database.EDOKA_DB();
|
||||
string sql = "Select dbo.BinaryToBase64(dokument) as Data from doks ";
|
||||
sql = sql + "WHERE dbo.doks.dokumentid = '" + Docid + "' ";
|
||||
db.Get_Tabledata(sql, false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
return Ok(db.dsdaten.Tables[0].Rows[0][0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return BadRequest("Dokument nicht vorhanden.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult GetDocAsPDF(string Docid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user