- Back navigation on conclusion errormaster
| </div> | </div> | ||||
| </div> | </div> | ||||
| } | } | ||||
| <div class="row no-gutters align-items-start justify-content-center w-100" style="height:fit-content"> | |||||
| @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 (ResponseStatus.OK == responseStatus) { | |||||
| <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)"> | |||||
| <DoneImage></DoneImage> | |||||
| </Animate> | |||||
| } else if (ResponseStatus.Error == responseStatus) { | |||||
| <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)"> | |||||
| <FailureImage></FailureImage> | |||||
| </Animate> | |||||
| <div class="row no-gutters align-items-start justify-content-center w-100" style="height:fit-content"> | |||||
| @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 { | } else { | ||||
| <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)"> | |||||
| <WarningImage></WarningImage> | |||||
| </Animate> | |||||
| if (ResponseStatus.OK == responseStatus) { | |||||
| <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)"> | |||||
| <DoneImage></DoneImage> | |||||
| </Animate> | |||||
| } else if (ResponseStatus.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-bottom:2em;padding-top:2em"> | |||||
| <div class="col w-100 text-center"> | |||||
| <MatButton Class="w-50" Raised="true" @onclick="Finished">@I18n["Finished"]</MatButton> | |||||
| </div> | |||||
| </div> | </div> | ||||
| @if (!running) { | |||||
| if (ResponseStatus.Error == responseStatus) { | |||||
| <div class="row no-gutters align-items-end justify-content-center w-100" style="padding-bottom:2em;padding-top:2em"> | |||||
| <div class="col" style="padding-right:0.5em"> | |||||
| <MatButton Class="w-100" Outlined="true" @onclick="EditData">@I18n["EditData"]</MatButton> | |||||
| </div> | |||||
| <div class="col" style="padding-left:0.5em"> | |||||
| <MatButton Class="w-100" Raised="true" @onclick="Cancel">@I18n["Cancel"]</MatButton> | |||||
| </div> | |||||
| </div> | |||||
| } else { | |||||
| <div class="row no-gutters align-items-end justify-content-center w-100" style="padding-bottom:2em;padding-top:2em"> | |||||
| <div class="col w-100 text-center"> | |||||
| <MatButton Class="w-50" Raised="true" @onclick="Finished">@I18n["Finished"]</MatButton> | |||||
| </div> | |||||
| </div> | |||||
| } | |||||
| } | |||||
| </div> | </div> | ||||
| } else { | } else { | ||||
| response = await IBicycleRestService.SendFoundReport(ReportDataProvider.Report); | response = await IBicycleRestService.SendFoundReport(ReportDataProvider.Report); | ||||
| } | } | ||||
| responseStatus = response==null ? ResponseStatus.NoConnection : System.Net.HttpStatusCode.OK == response.StatusCode ? ResponseStatus.OK : ResponseStatus.Error; | |||||
| responseStatus = response == null ? ResponseStatus.NoConnection : System.Net.HttpStatusCode.OK == response.StatusCode ? ResponseStatus.OK : ResponseStatus.Error; | |||||
| } catch (HttpRequestException ex) { | } catch (HttpRequestException ex) { | ||||
| response = new(I18n.GetString("FoundBike"), new string[] { ex.Message }); | response = new(I18n.GetString("FoundBike"), new string[] { ex.Message }); | ||||
| responseStatus = ResponseStatus.Error; | responseStatus = ResponseStatus.Error; | ||||
| NavigationManager.NavigateTo("caritas_services"); | NavigationManager.NavigateTo("caritas_services"); | ||||
| } | } | ||||
| private void Cancel() { | |||||
| NavigationManager.NavigateTo("caritas_services"); | |||||
| } | |||||
| private void EditData() { | |||||
| NavigationManager.NavigateTo("/fundvelo/keydata/Found"); | |||||
| } | |||||
| } | } |
| <h6 style="font-style:italic;padding-bottom:1em">@I18n["Info.Report.Transmitting"]</h6> | <h6 style="font-style:italic;padding-bottom:1em">@I18n["Info.Report.Transmitting"]</h6> | ||||
| </div> | </div> | ||||
| } else { | } else { | ||||
| if (ResposeStatus.OK == responseStatus) { | |||||
| if (ResponseStatus.OK == responseStatus) { | |||||
| <MatHeadline5 Style="font-family:Ubuntu; text-align:center">@I18n["FinishedTextMissing"]</MatHeadline5> | <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> | <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800">@I18n["FinishedTextMissing_Heading1"]</MatSubtitle1> | ||||
| <ul class="w-100"> | <ul class="w-100"> | ||||
| </MatIcon> | </MatIcon> | ||||
| <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800; display:contents">@I18n["FinishedTextMissing_LostOffice_Address"]</MatSubtitle1> | <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800; display:contents">@I18n["FinishedTextMissing_LostOffice_Address"]</MatSubtitle1> | ||||
| </div> | </div> | ||||
| } else if (ResposeStatus.Error == responseStatus) { | |||||
| } else if (ResponseStatus.Error == responseStatus) { | |||||
| <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)"> | <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)"> | ||||
| <FailureImage></FailureImage> | <FailureImage></FailureImage> | ||||
| </Animate> | </Animate> | ||||
| } | } | ||||
| } | } | ||||
| </div> | </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> | |||||
| @if (!running) { | |||||
| if (ResponseStatus.Error == responseStatus) { | |||||
| <div class="row no-gutters align-items-end justify-content-center w-100" style="padding-bottom:2em;padding-top:2em"> | |||||
| <div class="col" style="padding-right:0.5em"> | |||||
| <MatButton Class="w-100" Outlined="true" @onclick="EditData">@I18n["EditData"]</MatButton> | |||||
| </div> | |||||
| <div class="col" style="padding-left:0.5em"> | |||||
| <MatButton Class="w-100" Raised="true" @onclick="Cancel">@I18n["Cancel"]</MatButton> | |||||
| </div> | |||||
| </div> | |||||
| } else { | |||||
| <div class="row no-gutters align-items-end justify-content-center w-100" style="padding-bottom:2em;padding-top:2em"> | |||||
| <div class="col w-100 text-center"> | |||||
| <MatButton Class="w-50" Raised="true" @onclick="Finished">@I18n["Finished"]</MatButton> | |||||
| </div> | |||||
| </div> | |||||
| } | |||||
| } | |||||
| </div> | </div> | ||||
| @code { | @code { | ||||
| private enum ResposeStatus : ushort { | |||||
| enum ResponseStatus : ushort { | |||||
| OK = 1, | OK = 1, | ||||
| Error = 10, | Error = 10, | ||||
| NoConnection = 20 | NoConnection = 20 | ||||
| } | } | ||||
| private ResposeStatus responseStatus = ResposeStatus.NoConnection; | |||||
| private ResponseStatus responseStatus = ResponseStatus.NoConnection; | |||||
| private bool running = true; | private bool running = true; | ||||
| private ReportResponse response; | private ReportResponse response; | ||||
| } else { | } else { | ||||
| response = await IBicycleRestService.SendMissingReport(ReportDataProvider.Report); | response = await IBicycleRestService.SendMissingReport(ReportDataProvider.Report); | ||||
| } | } | ||||
| responseStatus = response == null ? ResposeStatus.NoConnection : System.Net.HttpStatusCode.OK == response.StatusCode ? ResposeStatus.OK : ResposeStatus.Error; | |||||
| responseStatus = response == null ? ResponseStatus.NoConnection : System.Net.HttpStatusCode.OK == response.StatusCode ? ResponseStatus.OK : ResponseStatus.Error; | |||||
| } catch (HttpRequestException ex) { | } catch (HttpRequestException ex) { | ||||
| response = new(I18n.GetString("MissingBike"), new string[] { ex.Message }); | response = new(I18n.GetString("MissingBike"), new string[] { ex.Message }); | ||||
| responseStatus = ResposeStatus.Error; | |||||
| responseStatus = ResponseStatus.Error; | |||||
| } | } | ||||
| running = false; | running = false; | ||||
| if (ResposeStatus.OK == responseStatus) { | |||||
| if (ResponseStatus.OK == responseStatus) { | |||||
| Toaster.ShowSuccess(I18n.GetString("MissingBike"), response.Message); | Toaster.ShowSuccess(I18n.GetString("MissingBike"), response.Message); | ||||
| PageHistoryManager.Reset(); | PageHistoryManager.Reset(); | ||||
| } else if (ResposeStatus.Error == responseStatus) { | |||||
| } else if (ResponseStatus.Error == responseStatus) { | |||||
| Toaster.ShowError(response.Message, response.GetDataAsFormattedList()); | Toaster.ShowError(response.Message, response.GetDataAsFormattedList()); | ||||
| } else { | } else { | ||||
| Toaster.ShowWarning(I18n.GetString("Warning.NoConnection.Title"), I18n.GetString("Warning.NoConnection.Msg")); | Toaster.ShowWarning(I18n.GetString("Warning.NoConnection.Title"), I18n.GetString("Warning.NoConnection.Msg")); | ||||
| NavigationManager.NavigateTo("caritas_services"); | NavigationManager.NavigateTo("caritas_services"); | ||||
| } | } | ||||
| private void Cancel() { | |||||
| NavigationManager.NavigateTo("caritas_services"); | |||||
| } | |||||
| private void EditData() { | |||||
| NavigationManager.NavigateTo("/fundvelo/keydata/Missing"); | |||||
| } | |||||
| } | } |
| private void Next() { | private void Next() { | ||||
| updateDtoFromGUI(); | updateDtoFromGUI(); | ||||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | ||||
| NavigationManager.NavigateTo("fundvelo/account/Missing"); | |||||
| try { | |||||
| Validator.ValidateMissingReportKeyData(ReportDataProvider.GetMissingReport()); | |||||
| NavigationManager.NavigateTo("fundvelo/account/Missing"); | |||||
| } catch (ArgumentException ex) { | |||||
| Toaster.ShowWarning(I18n.GetString("Warning.MandatoryFields.Title"), I18n.GetString("Warning.MandatoryFields.Msg")); | |||||
| } | |||||
| } | } | ||||
| private void Cancel() { | private void Cancel() { |
| <data name="DevelopedBy" xml:space="preserve"> | <data name="DevelopedBy" xml:space="preserve"> | ||||
| <value>Entwickelt durch</value> | <value>Entwickelt durch</value> | ||||
| </data> | </data> | ||||
| <data name="EditData" xml:space="preserve"> | |||||
| <value>Daten ändern</value> | |||||
| </data> | |||||
| <data name="Error.DeleteReport.Msg" xml:space="preserve"> | <data name="Error.DeleteReport.Msg" xml:space="preserve"> | ||||
| <value>Die Meldung mit der ID {0:d} konnte nicht gelöscht werden!</value> | <value>Die Meldung mit der ID {0:d} konnte nicht gelöscht werden!</value> | ||||
| </data> | </data> |
| <data name="DevelopedBy" xml:space="preserve"> | <data name="DevelopedBy" xml:space="preserve"> | ||||
| <value>Développé par</value> | <value>Développé par</value> | ||||
| </data> | </data> | ||||
| <data name="EditData" xml:space="preserve"> | |||||
| <value>Changez data</value> | |||||
| </data> | |||||
| <data name="Error.DeleteReport.Msg" xml:space="preserve"> | <data name="Error.DeleteReport.Msg" xml:space="preserve"> | ||||
| <value>Le rapport avec l'ID {0:d} n'a pas pu être supprimé !</value> | <value>Le rapport avec l'ID {0:d} n'a pas pu être supprimé !</value> | ||||
| </data> | </data> |
| <data name="DevelopedBy" xml:space="preserve"> | <data name="DevelopedBy" xml:space="preserve"> | ||||
| <value>Sviluppata da</value> | <value>Sviluppata da</value> | ||||
| </data> | </data> | ||||
| <data name="EditData" xml:space="preserve"> | |||||
| <value>Modifica dati</value> | |||||
| </data> | |||||
| <data name="Error.DeleteReport.Msg" xml:space="preserve"> | <data name="Error.DeleteReport.Msg" xml:space="preserve"> | ||||
| <value>Il rapporto con ID {0:d} non può essere cancellato!</value> | <value>Il rapporto con ID {0:d} non può essere cancellato!</value> | ||||
| </data> | </data> |
| <data name="DevelopedBy" xml:space="preserve"> | <data name="DevelopedBy" xml:space="preserve"> | ||||
| <value>Developed by</value> | <value>Developed by</value> | ||||
| </data> | </data> | ||||
| <data name="EditData" xml:space="preserve"> | |||||
| <value>Edit data</value> | |||||
| </data> | |||||
| <data name="Error.DeleteReport.Msg" xml:space="preserve"> | <data name="Error.DeleteReport.Msg" xml:space="preserve"> | ||||
| <value>The Report with ID {0:d} could not be deleted!</value> | <value>The Report with ID {0:d} could not be deleted!</value> | ||||
| </data> | </data> |
| using cwebplusApp.Shared.Models; | using cwebplusApp.Shared.Models; | ||||
| using System; | using System; | ||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Threading.Tasks; | |||||
| namespace cwebplusApp.Shared.Services { | namespace cwebplusApp.Shared.Services { | ||||
| public class Validator { | public class Validator { | ||||
| public static void ValidateFoundReportKeyData(FoundReport report) { | public static void ValidateFoundReportKeyData(FoundReport report) { | ||||
| } | } | ||||
| } | } | ||||
| public static void ValidateMissingReportKeyData(MissingReport report) { | |||||
| int notValid = 0; | |||||
| notValid += (report.FarbeId == null) ? 1 : 0; | |||||
| notValid += (report.MarkeId == null && String.IsNullOrEmpty(report.NeueMarke)) ? 1 : 0; | |||||
| notValid += (report.TypId == null) ? 1 : 0; | |||||
| if (notValid > 0) { | |||||
| throw new ArgumentException("ValidationException"); | |||||
| } | |||||
| } | |||||
| public static void ValidateAlternatePickContact(FoundReport report) { | public static void ValidateAlternatePickContact(FoundReport report) { | ||||
| if (!report.AbholadresseIstKontakt) { | if (!report.AbholadresseIstKontakt) { | ||||
| int notValid = 0; | int notValid = 0; |
| // activate event | // activate event | ||||
| self.addEventListener('activate', event => { | self.addEventListener('activate', event => { | ||||
| //delete any caches that aren't in expectedCaches | //delete any caches that aren't in expectedCaches | ||||
| //which will get rid of site-static-v<n-1> | |||||
| //which will get rid of site-static-v<old-version> | |||||
| event.waitUntil( | event.waitUntil( | ||||
| caches.keys().then(keys => Promise.all( | caches.keys().then(keys => Promise.all( | ||||
| keys.map(key => { | keys.map(key => { |