| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- @page "/fundvelo/conclusion_missing"
-
- @using cwebplusApp.Shared.Services;
- @using cwebplusApp.Shared.Models;
- @using cwebplusApp.Components;
-
- @inject NavigationManager NavigationManager;
- @inject IStringLocalizer<Resources> i18n;
- @inject PageHistoryManager PageHistoryManager;
- @inject ReportDataProvider ReportDataProvider;
- @inject IBicycleRestService IBicycleRestService;
- @inject Toaster Toaster;
- @inject AppState AppState;
-
- <div class="row px-3 h-100">
- <div class="row no-gutters align-items-start justify-content-center w-100">
- <MatHeadline4 Style="font-family:Ubuntu;padding-top:0.5em">@i18n["Info"]</MatHeadline4>
- </div>
- <div class="row no-gutters align-items-start justify-content-center w-100">
- @if (running) {
- <div style="width:48px;margin:0 auto;">
- <MatProgressCircle Indeterminate="true" Size="MatProgressCircleSize.Large" />
- </div>
- <div class="w-100" style="text-align:center;">
- <h6 style="font-style:italic;padding-bottom:1em">@i18n["Info.Report.Transmitting"]</h6>
- </div>
- } else {
- if (ResposeStatus.OK == responseStatus) {
- <MatHeadline5 Style="font-family:Ubuntu; text-align:center">@i18n["FinishedTextMissing"]</MatHeadline5>
- <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800">@i18n["FinishedTextMissing_Heading1"]</MatSubtitle1>
- <ul class="w-100">
- <li class="w-100" style="font-family: Ubuntu; text-align: left">@i18n["FinishedTextMissing_2"]</li>
- <li class="w-100" style="font-family: Ubuntu; text-align: left">@i18n["FinishedTextMissing_3"]</li>
- </ul>
- <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800;padding-top:20px">@i18n["FinishedTextMissing_Heading2"]</MatSubtitle1>
- <ul class="w-100">
- <li class="w-100" style="font-family: Ubuntu; text-align: left">@i18n["FinishedTextMissing_4"]</li>
- <li class="w-100" style="font-family: Ubuntu; text-align: left">@i18n["FinishedTextMissing_5"]</li>
- <li class="w-100" style="font-family: Ubuntu; text-align: left">@i18n["FinishedTextMissing_6"]</li>
- </ul>
- <MatHeadline5 Class="w-100" Style="font-family: Ubuntu; text-align: left;padding-top:20px">@i18n["FinishedTextMissing_Heading3"]</MatHeadline5>
- <div class="w-100">
- <MatIcon Style="padding-right:1rem">
- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
- <path d="M0 0h24v24H0V0z" fill="none" />
- <path d="M19 17.47c-.88-.07-1.75-.22-2.6-.45l-1.19 1.19c1.2.41 2.48.67 3.8.75v-1.49zM5.03 5c.09 1.32.35 2.59.75 3.8l1.2-1.2c-.23-.84-.38-1.71-.44-2.6H5.03z" opacity=".3" />
- <path d="M9.07 7.57C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02zm7.33 9.45c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19zM5.79 8.8c-.41-1.21-.67-2.48-.76-3.8h1.5c.07.89.22 1.76.46 2.59L5.79 8.8z" />
- </svg>
- </MatIcon>
- <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800;display:contents">@i18n["FinishedTextMissing_LostOffice_Phone"]</MatSubtitle1>
- </div>
- <div class="w-100">
- <MatIcon Style="padding-right:1rem">
- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
- <path d="M0 0h24v24H0V0z" fill="none" />
- <path d="M20 8l-8 5-8-5v10h16zm0-2H4l8 4.99z" opacity=".3" />
- <path d="M4 20h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2zM20 6l-8 4.99L4 6h16zM4 8l8 5 8-5v10H4V8z" />
- </svg>
- </MatIcon>
- <MatSubtitle1 Class="w-100" Style="font-family: Ubuntu;text-align:left; font-weight:800; display:contents">@i18n["FinishedTextMissing_LostOffice_Mail"]</MatSubtitle1>
- </div>
- <div class="w-100">
- <MatIcon Style="padding-right:1rem">
- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
- <path d="M0 0h24v24H0V0z" fill="none" />
- <path d="M12 4C9.24 4 7 6.24 7 9c0 2.85 2.92 7.21 5 9.88 2.11-2.69 5-7 5-9.88 0-2.76-2.24-5-5-5zm0 7.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" opacity=".3" />
- <path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z" />
- <circle cx="12" cy="9" r="2.5" />
- </svg>
- </MatIcon>
- <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800; display:contents">@i18n["FinishedTextMissing_LostOffice_Address"]</MatSubtitle1>
- </div>
- } else if (ResposeStatus.Error == responseStatus) {
- <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)">
- <FailureImage></FailureImage>
- </Animate>
- } else {
- <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)">
- <WarningImage></WarningImage>
- </Animate>
- }
- }
- </div>
- <div class="row no-gutters align-items-end justify-content-center w-100" style="padding-top: 2em; padding-bottom: 1em">
- <div class="col w-100 text-center">
- <MatButton Class="w-50" Raised="true" @onclick="Finished">@i18n["Finished"]</MatButton>
- </div>
- </div>
- </div>
-
-
- @code {
-
- enum ResposeStatus : ushort {
- OK = 1,
- Error = 10,
- NoConnection = 20
- }
-
- private ResposeStatus responseStatus = ResposeStatus.NoConnection;
- private bool running = true;
- ReportResponse response;
-
- protected async override void OnInitialized() {
- base.OnInitialized();
- PageHistoryManager.AddPageToHistory(NavigationManager.Uri);
- try {
- if (ReportDataProvider.ReportRepositoryItem != null) {
- response = await IBicycleRestService.SendMissingReport((MissingReportRepositoryItem)ReportDataProvider.ReportRepositoryItem);
- } else {
- response = await IBicycleRestService.SendMissingReport(ReportDataProvider.Report);
- }
- responseStatus = response == null ? ResposeStatus.NoConnection : System.Net.HttpStatusCode.OK == response.StatusCode ? ResposeStatus.OK : ResposeStatus.Error;
- } catch (HttpRequestException ex) {
- response = new(i18n.GetString("MissingBike"), new string[] { ex.Message });
- responseStatus = ResposeStatus.Error;
- }
- running = false;
-
- if (ResposeStatus.OK == responseStatus) {
- Toaster.ShowSuccess(i18n.GetString("MissingBike"), response.Message);
- PageHistoryManager.Reset();
- } else if (ResposeStatus.Error == responseStatus) {
- Toaster.ShowError(response.Message, response.GetDataAsFormattedList());
- } else {
- Toaster.ShowWarning(i18n.GetString("Warning.NoConnection.Title"), i18n.GetString("Warning.NoConnection.Msg"));
- PageHistoryManager.Reset();
- }
- StateHasChanged();
- AppState.NotifyChanged();
- }
-
- private void Finished() {
- NavigationManager.NavigateTo("caritas_services");
- }
-
- }
|