1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- @if (WebReport.EnableModalDialog)
- {
- @*CONTENT*@
- <div class="fr-webreport-popup" @onclick="CancelClick">
- <div class="fr-webreport-popup-content" @onclick="() => { }" @onclick:stopPropagation="true" @onclick:preventDefault="true">
- <ModalContainerContent WebReport="WebReport" ExportParameters="ExportParameters" />
- @*BUTTONS*@
- <div class="fr-webreport-popup-content-buttons">
- <button class="fr-webreport-popup-content-btn-submit fr-webreport-popup-content-btn-cancel" @onclick="CancelClick">@LocalizedCancel</button>
- <button class="fr-webreport-popup-content-btn-submit @OkButtonErrorClass" @onclick="async () => await OkClick()">OK</button>
- </div>
- </div>
- </div>
- }
- @if (NeedPopup)
- {
- <PopupNotification @ref="_popup" CssClass="@PopupCssClass"/>
- }
- @code {
- private string LocalizedCancel;
- private PopupNotification _popup;
- private const string PopupCssClass = "hide";
- #if !WASM
- private const bool NeedPopup = true;
- private string LocalizedFailure;
- private string LocalizedSuccess;
- private async Task ShowPopup(string message, string cssClass)
- {
- await _popup.ShowPopup(message, cssClass);
- }
- private async Task ShowPositivePopup()
- {
- await ShowPopup(LocalizedSuccess, "positive");
- }
- private async Task ShowNegativePopup()
- {
- await ShowPopup(LocalizedFailure, "negative");
- }
- #else
- private const bool NeedPopup = false;
- #endif
- [Parameter]
- public WebReport WebReport { get; set; }
- internal void Update()
- {
- StateHasChanged();
- }
- protected override void OnParametersSet()
- {
- var res = WebReport.Res;
- res.Root("Buttons");
- LocalizedCancel = res.Get("Cancel");
- #if !WASM
- res.Root("Export,Email");
- LocalizedFailure = res.Get("ErrorEmailSending");
- LocalizedSuccess = res.Get("SuccessfulEmailSending");
- #endif
- }
- }
|