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

@@ -36,7 +36,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Service"> <Reference Include="Service">
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath> <HintPath>..\..\Dlls\Service.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>

View File

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

View File

@@ -11,5 +11,6 @@
}, },
"Fixedvalues": { "Fixedvalues": {
"Jwt_Lifetime_Minutes": "144000" "Jwt_Lifetime_Minutes": "144000"
} },
"CreateReportFileName": "E:\\CreateReport\\CreateReport.exe"
} }

View File

@@ -0,0 +1,16 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"Base": "Data Source=.;Initial Catalog=TaxPayer020713;User ID=sa;Password=M439610m@;TrustServerCertificate=True"
},
"Fixedvalues": {
"Jwt_Lifetime_Minutes": "144000"
},
"CreateReportFileName": "E:\\CreateReport\\CreateReport.exe"
}

View File

@@ -6,4 +6,13 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Reference Include="Stimulsoft.Base">
<HintPath>..\..\Dlls\stimull\Stimulsoft.Base.dll</HintPath>
</Reference>
<Reference Include="Stimulsoft.Report">
<HintPath>..\..\Dlls\stimull\Stimulsoft.Report.dll</HintPath>
</Reference>
</ItemGroup>
</Project> </Project>

View File

@@ -3,6 +3,7 @@
@inject HttpClientController hc; @inject HttpClientController hc;
<Preload LoadingText="در حال بارگذاری..." /> <Preload LoadingText="در حال بارگذاری..." />
<Toasts class="p-3" Messages="messages" Placement="ToastsPlacement.MiddleCenter" /> <Toasts class="p-3" Messages="messages" Placement="ToastsPlacement.MiddleCenter" />
@layout EmptyLayout
@page "/InvoiceReport/{ExternalAccessCode}" @page "/InvoiceReport/{ExternalAccessCode}"
@using Front.Services @using Front.Services
@@ -13,7 +14,7 @@
protected async override Task OnParametersSetAsync() protected async override Task OnParametersSetAsync()
{ {
if (!string.IsNullOrEmpty(ExternalAccessCode)) if (!string.IsNullOrEmpty(ExternalAccessCode))
ShowReport(); await ShowReport();
await base.OnParametersSetAsync(); await base.OnParametersSetAsync();
} }

View File

@@ -16,7 +16,8 @@
<Modal @ref="Codemodal" title="لینک برای دانلود" IsVerticallyCentered="true"> <Modal @ref="Codemodal" title="لینک برای دانلود" IsVerticallyCentered="true">
<BodyTemplate> <BodyTemplate>
@ExUrl <h5>با لینک زیر دیگران میتوانند به این صورتحساب دسترسی داشته باشند</h5>
<NavLink href="@ExUrl">@ExUrl</NavLink>
</BodyTemplate> </BodyTemplate>
<FooterTemplate> <FooterTemplate>
<Button Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button> <Button Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button>
@@ -342,7 +343,7 @@
<Button class="mt-3" Color="ButtonColor.Primary" @onclick="ShowReport" Type="ButtonType.Button"> <Button class="mt-3" Color="ButtonColor.Primary" @onclick="ShowReport" Type="ButtonType.Button">
pdf pdf
</Button> </Button>
<Button class="mt-3" Color="ButtonColor.Secondary" @onclick="onClickExternalAccessCode" Type="ButtonType.Button"> <Button class="mt-3" Color="ButtonColor.Info" @onclick="onClickExternalAccessCode" Type="ButtonType.Button">
لینک لینک
</Button> </Button>
} }

View File

@@ -37,10 +37,10 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") }); //builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
//Home //Home
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") }); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
//farzan //farzan
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") }); //builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir"); CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");