| @@ -9,6 +9,7 @@ | |||
| @inject IStringLocalizer<Resources> I18n | |||
| @inject PageHistoryManager PageHistoryManager | |||
| @inject ReportDataProvider ReportDataProvider | |||
| @inject Toaster Toaster | |||
| <div class="row px-3 h-100"> | |||
| @@ -31,15 +32,15 @@ | |||
| </div> | |||
| <div class="row no-gutters align-items-center w-100"> | |||
| <div class="col-12"> | |||
| <MatStringField Class="w-100" Label="@I18n["Address"]" Outlined="true" type="text" @bind-Value="@Account.Address" Required="true"></MatStringField> | |||
| <MatStringField Class="w-100" Label="@I18n["Address"]" Outlined="true" type="text" @bind-Value="@Account.Address" ></MatStringField> | |||
| </div> | |||
| </div> | |||
| <div class="row no-gutters align-items-center w-100"> | |||
| <div class="col-4" style="padding-right:0.5em"> | |||
| <MatStringField Class="w-100" Label="@I18n["Zip"]" Outlined="true" type="text" @bind-Value="@Account.Zip" Required="true"></MatStringField> | |||
| <MatStringField Class="w-100" Label="@I18n["Zip"]" Outlined="true" type="text" @bind-Value="@Account.Zip"></MatStringField> | |||
| </div> | |||
| <div class="col-8" style="padding-left:0.5em"> | |||
| <MatStringField Class="w-100" Label="@I18n["City"]" Outlined="true" type="text" @bind-Value="@Account.City" Required="true"></MatStringField> | |||
| <MatStringField Class="w-100" Label="@I18n["City"]" Outlined="true" type="text" @bind-Value="@Account.City"></MatStringField> | |||
| </div> | |||
| </div> | |||
| <div class="row no-gutters align-items-center w-100"> | |||
| @@ -125,12 +126,18 @@ | |||
| private void Next() { | |||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||
| if ("Found".Equals(FromRoute)) { | |||
| UserDataProvider.MapReport(ReportDataProvider.Report, Account); | |||
| NavigationManager.NavigateTo("fundvelo/conclusion_found"); | |||
| } else { | |||
| UserDataProvider.MapMissingReport(ReportDataProvider.GetMissingReport(), Account); | |||
| NavigationManager.NavigateTo("fundvelo/conclusion_missing"); | |||
| try { | |||
| if ("Found".Equals(FromRoute)) { | |||
| UserDataProvider.MapReport(ReportDataProvider.Report, Account); | |||
| Validator.ValidateContact(ReportDataProvider.Report); | |||
| NavigationManager.NavigateTo("fundvelo/conclusion_found"); | |||
| } else { | |||
| UserDataProvider.MapMissingReport(ReportDataProvider.GetMissingReport(), Account); | |||
| Validator.ValidateContact(ReportDataProvider.Report); | |||
| NavigationManager.NavigateTo("fundvelo/conclusion_missing"); | |||
| } | |||
| } catch (ArgumentException ex) { | |||
| Toaster.ShowWarning(I18n.GetString("Warning.MandatoryFields.Title"), I18n.GetString("Warning.MandatoryFields.Msg")); | |||
| } | |||
| } | |||
| @@ -8,6 +8,7 @@ | |||
| @inject IStringLocalizer<Resources> I18n | |||
| @inject PageHistoryManager PageHistoryManager | |||
| @inject ReportDataProvider ReportDataProvider | |||
| @inject Toaster Toaster | |||
| <div class="row px-3 h-100"> | |||
| @@ -103,7 +104,12 @@ | |||
| private void Next() { | |||
| updateDtoFromGUI(); | |||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||
| NavigationManager.NavigateTo("fundvelo/account/Found"); | |||
| try { | |||
| Validator.ValidateAlternatePickContact(ReportDataProvider.GetFoundReport()); | |||
| NavigationManager.NavigateTo("fundvelo/account/Found"); | |||
| } catch (ArgumentException ex) { | |||
| Toaster.ShowWarning(I18n.GetString("Warning.MandatoryFields.Title"), I18n.GetString("Warning.MandatoryFields.Msg")); | |||
| } | |||
| } | |||
| private void Cancel() { | |||
| @@ -114,9 +120,9 @@ | |||
| FoundReport report = ReportDataProvider.GetFoundReport(); | |||
| pucSalutation = report.AbholAnrede; | |||
| pucFirstname = report.AbholVorname; | |||
| pucLastname = report.AbholNachname ; | |||
| pucAddress = report.AbholStrasse ; | |||
| pucZip = report.AbholPLZ ; | |||
| pucLastname = report.AbholNachname; | |||
| pucAddress = report.AbholStrasse; | |||
| pucZip = report.AbholPLZ; | |||
| pucCity = report.AbholOrt; | |||
| pucMobile = report.AbholMobil; | |||
| pucPhone = report.AbholTelefon; | |||
| @@ -275,10 +275,15 @@ | |||
| private void Next() { | |||
| updateDtoFromGUI(); | |||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||
| if (abholadresseIsNotContact) { | |||
| NavigationManager.NavigateTo("fundvelo/alternate_pickup"); | |||
| } else { | |||
| NavigationManager.NavigateTo("fundvelo/account/Found"); | |||
| try { | |||
| Validator.ValidateFoundReportKeyData(ReportDataProvider.GetFoundReport()); | |||
| if (abholadresseIsNotContact) { | |||
| NavigationManager.NavigateTo("fundvelo/alternate_pickup"); | |||
| } else { | |||
| NavigationManager.NavigateTo("fundvelo/account/Found"); | |||
| } | |||
| } catch (ArgumentException ex) { | |||
| Toaster.ShowWarning(I18n.GetString("Warning.MandatoryFields.Title"), I18n.GetString("Warning.MandatoryFields.Msg")); | |||
| } | |||
| } | |||
| @@ -351,6 +356,7 @@ | |||
| if (SelectedBrand != null) { | |||
| if (SelectedBrand.Id == -999) { | |||
| report.NeueMarke = SelectedBrand.Bezeichnung; | |||
| report.MarkeId = null; | |||
| } else { | |||
| report.MarkeId = SelectedBrand.Id; | |||
| } | |||
| @@ -534,6 +534,12 @@ Die KulturLegi wirkt dem entgegen indem sie Kultur-, Bildungs- und Sportangebote | |||
| <data name="Username" xml:space="preserve"> | |||
| <value>Benutzername oder E-Mail</value> | |||
| </data> | |||
| <data name="Warning.MandatoryFields.Msg" xml:space="preserve"> | |||
| <value>Einige Pflichtfelder (*) sind leer! Bitte definieren Sie diese und versuchen Sie es erneut.</value> | |||
| </data> | |||
| <data name="Warning.MandatoryFields.Title" xml:space="preserve"> | |||
| <value>Leere Pflichtfelder!</value> | |||
| </data> | |||
| <data name="Warning.Masterdata.Msg" xml:space="preserve"> | |||
| <value>Die Stammdaten konnten nicht abgerufen werden. Es werden stattdessen die Standardwerte verwendet!</value> | |||
| </data> | |||
| @@ -534,6 +534,12 @@ La KulturLegi s'attaque à ce problème en rendant les activités culturelles, | |||
| <data name="Username" xml:space="preserve"> | |||
| <value>Nom d'utilisateur ou courriel</value> | |||
| </data> | |||
| <data name="Warning.MandatoryFields.Msg" xml:space="preserve"> | |||
| <value>Certains champs obligatoires (*) sont vides ! Veuillez les définir et réessayer.</value> | |||
| </data> | |||
| <data name="Warning.MandatoryFields.Title" xml:space="preserve"> | |||
| <value>Champs obligatoires manquants !</value> | |||
| </data> | |||
| <data name="Warning.Masterdata.Msg" xml:space="preserve"> | |||
| <value>Les données de base n'ont pas pu être récupérées. Les valeurs par défaut sont utilisées à la place !</value> | |||
| </data> | |||
| @@ -534,6 +534,12 @@ La KulturLegi si oppone a questo rendendo le attività culturali, educative e sp | |||
| <data name="Username" xml:space="preserve"> | |||
| <value>Nome d'utente o e-mail</value> | |||
| </data> | |||
| <data name="Warning.MandatoryFields.Msg" xml:space="preserve"> | |||
| <value>Alcuni campi obbligatori (*) sono vuoti! Per favore, definiscili e prova di nuovo.</value> | |||
| </data> | |||
| <data name="Warning.MandatoryFields.Title" xml:space="preserve"> | |||
| <value>Campi obbligatori vuoti!</value> | |||
| </data> | |||
| <data name="Warning.Masterdata.Msg" xml:space="preserve"> | |||
| <value>Non è stato possibile recuperare i dati anagrafici. Vengono invece utilizzati i valori di default!</value> | |||
| </data> | |||
| @@ -534,6 +534,12 @@ The KulturLegi counteracts this by making cultural, educational and sporting act | |||
| <data name="Username" xml:space="preserve"> | |||
| <value>Username or E-Mail</value> | |||
| </data> | |||
| <data name="Warning.MandatoryFields.Msg" xml:space="preserve"> | |||
| <value>Some mandatory fields (*) are empty! Pleas define them and try again.</value> | |||
| </data> | |||
| <data name="Warning.MandatoryFields.Title" xml:space="preserve"> | |||
| <value>Mandatory fields missing!</value> | |||
| </data> | |||
| <data name="Warning.Masterdata.Msg" xml:space="preserve"> | |||
| <value>The master data could not be retrieved. The default values are used instead!</value> | |||
| </data> | |||
| @@ -0,0 +1,51 @@ | |||
| using cwebplusApp.Shared.Models; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| namespace cwebplusApp.Shared.Services { | |||
| public class Validator { | |||
| public static void ValidateFoundReportKeyData(FoundReport report) { | |||
| int notValid = 0; | |||
| notValid += String.IsNullOrEmpty(report.GeographicInfo.Address) ? 1 : 0; | |||
| notValid += String.IsNullOrEmpty(report.GeographicInfo.Town) ? 1 : 0; | |||
| notValid += String.IsNullOrEmpty(report.GeographicInfo.Postcode) ? 1 : 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) { | |||
| if (!report.AbholadresseIstKontakt) { | |||
| int notValid = 0; | |||
| notValid += String.IsNullOrEmpty(report.AbholAnrede) ? 1 : 0; | |||
| notValid += String.IsNullOrEmpty(report.AbholVorname) ? 1 : 0; | |||
| notValid += String.IsNullOrEmpty(report.AbholNachname) ? 1 : 0; | |||
| notValid += String.IsNullOrEmpty(report.AbholStrasse) ? 1 : 0; | |||
| notValid += String.IsNullOrEmpty(report.AbholPLZ) ? 1 : 0; | |||
| notValid += String.IsNullOrEmpty(report.AbholOrt) ? 1 : 0; | |||
| if (notValid > 0) { | |||
| throw new ArgumentException("ValidationException"); | |||
| } | |||
| } | |||
| } | |||
| public static void ValidateContact(Report report) { | |||
| int notValid = 0; | |||
| notValid += String.IsNullOrEmpty(report.Anrede) ? 1 : 0; | |||
| notValid += String.IsNullOrEmpty(report.Vorname) ? 1 : 0; | |||
| notValid += String.IsNullOrEmpty(report.Nachname) ? 1 : 0; | |||
| notValid += String.IsNullOrEmpty(report.Telefon) ? 1 : 0; | |||
| if (notValid > 0) { | |||
| throw new ArgumentException("ValidationException"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -38,7 +38,7 @@ | |||
| if ('serviceWorker' in navigator) { | |||
| navigator.serviceWorker.register('service-worker.js') | |||
| .then((reg) => console.log('Service worker registered.', reg)) | |||
| .catch((err) => console.log('Failed to registe Service worker.', err)); | |||
| .catch((err) => console.log('Failed to register Service worker.', err)); | |||
| } | |||
| </script> | |||
| <script> | |||