50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using System.Drawing.Drawing2D;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Lux.UI.Components.Compo.Common
|
|
{
|
|
public partial class PrintModal
|
|
{
|
|
[Parameter]
|
|
public string url { get; set; } = "";
|
|
[Parameter]
|
|
public int currId { get; set; }
|
|
[Parameter]
|
|
public string repType { get; set; } = "";
|
|
|
|
[Parameter]
|
|
public EventCallback<bool> EC_Close { get; set; }
|
|
|
|
[Inject]
|
|
private IFileService FService { get; set; } = null!;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
LoadFileList();
|
|
//base.OnInitialized();
|
|
}
|
|
|
|
private List<string> ListRepFiles = new List<string>();
|
|
private bool selectOptPrint = false;
|
|
|
|
private string DoPrint(string SelFile)
|
|
{
|
|
return $"{url}/download?ReqId={currId}&RepType={repType}&SelFile={SelFile}";
|
|
}
|
|
private Task DoCloseModal()
|
|
{
|
|
return EC_Close.InvokeAsync(false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// recupero elenco file per tipo di report
|
|
/// </summary>
|
|
private void LoadFileList()
|
|
{
|
|
string repPath = Path.Combine("reports", repType);
|
|
var rawList = FService.ListFile(repPath, "*.repx", true);
|
|
ListRepFiles = rawList.Select(x => Path.GetFileName(x)).ToList();
|
|
var SelFile = ListRepFiles.FirstOrDefault();
|
|
}
|
|
}
|
|
} |