You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2 KiB

using DOCGEN;
using EDOKA_Database;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Model;
using System.Runtime.Serialization;
namespace EDOOKAAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class Dokumente : ControllerBase
{
[HttpGet("GetDoc{DocID}", Name = "GetDoc")]
public IActionResult GetDoc(string DocID)
{
DOCGEN.clsGetDoc gd = new DOCGEN.clsGetDoc(AppParams.connectionstring);
clsdok dok = new clsdok("", "", "");
dok = gd.GetDoc(DocID);
if (dok.doktype == "")
{
//dok.doktype = Get_FileType(dok.dokument);
}
gd = null;
return Ok(dok);
}
[HttpGet("GetDoc/PDF{DocID}", Name = "GetPDF")]
public IActionResult GetDocAsPDF(string DocID)
{
DOCGEN.clsGetDoc gd = new DOCGEN.clsGetDoc(AppParams.connectionstring);
clsdok dok = new clsdok("", "", "");
dok.dokument= gd.GetDocAsPDF(DocID);
dok.doktype = "P";
dok.extension = "pdf";
return Ok(dok);
}
}
}