This commit is contained in:
mmrbnjd
2024-07-04 17:18:59 +03:30
parent 3d389b602d
commit 73fe6a0992
8 changed files with 44 additions and 11 deletions

View File

@@ -17,15 +17,19 @@ namespace Back.Controllers
[ApiController]
public class InvoiceController : ControllerBase
{
private readonly IConfiguration _configuration;
private readonly servInvoice _servInvoice;
private readonly servUser _servUser;
private readonly AddOrUpdateInvoiceValidation _validationInvoice;
private readonly servTaxPayer _servTaxPayer;
public InvoiceController(servInvoice servInvoice, servUser servUser, AddOrUpdateInvoiceValidation validationInvoice, servTaxPayer servTaxPayer)
public InvoiceController(servInvoice servInvoice, servUser servUser
, AddOrUpdateInvoiceValidation validationInvoice
, servTaxPayer servTaxPayer, IConfiguration configuration)
{
_servInvoice = servInvoice;
_servUser = servUser;
_validationInvoice = validationInvoice;
_configuration=configuration;
_servTaxPayer = servTaxPayer;
}
@@ -454,17 +458,18 @@ namespace Back.Controllers
if (!await _servInvoice.ExistInvoiceByInvoiceID(CompanyID.Value, InvoiceID))
return NotFound();
// Start the child process.
Process p = new Process();
// Redirect the output stream of the child process.
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "C:\\CreateReport\\CreateReport.exe";
p.StartInfo.FileName = _configuration["CreateReportFileName"].ToString();
p.StartInfo.Arguments = $"{CompanyID} {InvoiceID}";
p.Start();
output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
output =await p.StandardOutput.ReadToEndAsync();
await p.WaitForExitAsync();
return Ok(output);
}
[HttpPut("SetExternalAccessCode/{InvoiceID}")]