| <div class="row no-gutters align-items-start w-100"> | <div class="row no-gutters align-items-start w-100"> | ||||
| <div class="row no-gutters align-items-center w-100" style="padding-top:2em"> | <div class="row no-gutters align-items-center w-100" style="padding-top:2em"> | ||||
| <div class="col-12"> | <div class="col-12"> | ||||
| <MatSelect Class="w-100" Label="@i18n["Salutation"]" Outlined="true" @bind-Value="@Account.Salutation" Style="margin-bottom: 0.5rem" Required="true"> | |||||
| <MatOptionString Value="sir">@i18n["Man"]</MatOptionString> | |||||
| <MatOptionString Value="madam">@i18n["Woman"]</MatOptionString> | |||||
| <MatSelect Class="w-100 required" Label="@i18n["Salutation"]" Outlined="true" @bind-Value="@Account.Salutation" Style="margin-bottom: 0.5rem" Required="true"> | |||||
| <MatOptionString Value="M">@i18n["Male"]</MatOptionString> | |||||
| <MatOptionString Value="F">@i18n["Female"]</MatOptionString> | |||||
| </MatSelect> | </MatSelect> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @code { | @code { | ||||
| [Parameter] | |||||
| public string FromRoute { get; set; } | |||||
| [Parameter] | |||||
| public string FromRoute { get; set; } | |||||
| private UserData Account = new(); | private UserData Account = new(); | ||||
| protected async override void OnInitialized() { | protected async override void OnInitialized() { | ||||
| base.OnInitialized(); | |||||
| PageHistoryManager.OnBeforeNavigateBack = new EventCallback(this, (Action)OnBeforeNavigateBack); | PageHistoryManager.OnBeforeNavigateBack = new EventCallback(this, (Action)OnBeforeNavigateBack); | ||||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | ||||
| Account = await GetUserData(); | Account = await GetUserData(); | ||||
| UserDataProvider.mapUserData(Account, ReportDataProvider.Report); | |||||
| base.OnInitialized(); | |||||
| if (ReportDataProvider.Report != null) { | |||||
| UserDataProvider.mapUserData(Account, ReportDataProvider.Report); | |||||
| } | |||||
| StateHasChanged(); | StateHasChanged(); | ||||
| } | } | ||||
| private void OnBeforeNavigateBack() { | private void OnBeforeNavigateBack() { | ||||
| UserDataProvider.mapReport(ReportDataProvider.Report, Account); | |||||
| if (ReportDataProvider.Report != null) { | |||||
| UserDataProvider.mapReport(ReportDataProvider.Report, Account); | |||||
| } | |||||
| } | } | ||||
| private async void SaveUserData() { | private async void SaveUserData() { |
| <div class="row no-gutters align-items-start w-100"> | <div class="row no-gutters align-items-start w-100"> | ||||
| <div class="row no-gutters w-100"> | <div class="row no-gutters w-100"> | ||||
| <div class="col-12"> | <div class="col-12"> | ||||
| <MatSelect Class="w-100" Label="@i18n["Salutation"]" Outlined="true" @bind-Value="pucSalutation" Required="true" Style="margin-bottom: 0.5rem"> | |||||
| <MatSelect Class="w-100 required" Label="@i18n["Salutation"]" Outlined="true" @bind-Value="pucSalutation" Required="true" Style="margin-bottom: 0.5rem"> | |||||
| <MatOptionString Value="sir">@i18n["Man"]</MatOptionString> | <MatOptionString Value="sir">@i18n["Man"]</MatOptionString> | ||||
| <MatOptionString Value="madam">@i18n["Woman"]</MatOptionString> | <MatOptionString Value="madam">@i18n["Woman"]</MatOptionString> | ||||
| </MatSelect> | </MatSelect> | ||||
| private string pucEmail; | private string pucEmail; | ||||
| protected async override void OnInitialized() { | protected async override void OnInitialized() { | ||||
| base.OnInitialized(); | |||||
| PageHistoryManager.OnBeforeNavigateBack = new EventCallback(this, (Action)OnBeforeNavigateBack); | |||||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | ||||
| refreshGUIFromDto(); | refreshGUIFromDto(); | ||||
| base.OnInitialized(); | |||||
| StateHasChanged(); | StateHasChanged(); | ||||
| } | } | ||||
| private void OnBeforeNavigateBack() { | |||||
| updateDtoFromGUI(); | |||||
| } | |||||
| private void Next() { | private void Next() { | ||||
| updateDtoFromGUI(); | updateDtoFromGUI(); | ||||
| NavigationManager.NavigateTo("fundvelo/account/Found"); | NavigationManager.NavigateTo("fundvelo/account/Found"); |
| @page "/fundvelo/conclusion_found" | @page "/fundvelo/conclusion_found" | ||||
| @using cwebplusApp.Shared.Services; | @using cwebplusApp.Shared.Services; | ||||
| @using cwebplusApp.Shared.Models; | |||||
| @inject NavigationManager NavigationManager | |||||
| @inject IStringLocalizer<Resources> i18n | |||||
| @inject PageHistoryManager PageHistoryManager | |||||
| @inject ReportDataProvider ReportDataProvider | |||||
| @inject NavigationManager NavigationManager; | |||||
| @inject IStringLocalizer<Resources> i18n; | |||||
| @inject PageHistoryManager PageHistoryManager; | |||||
| @inject ReportDataProvider ReportDataProvider; | |||||
| @inject ILFBicycleRest ILFBicycleRest; | |||||
| @inject Toaster Toaster; | |||||
| <div class="row px-3 h-100"> | <div class="row px-3 h-100"> | ||||
| <div class="row no-gutters align-items-start justify-content-center w-100"> | <div class="row no-gutters align-items-start justify-content-center w-100"> | ||||
| <MatHeadline6 Style="font-family:Ubuntu">@i18n["FinishedTextFound"]</MatHeadline6> | <MatHeadline6 Style="font-family:Ubuntu">@i18n["FinishedTextFound"]</MatHeadline6> | ||||
| </div> | </div> | ||||
| <div class="row no-gutters align-items-start justify-content-center w-100"> | <div class="row no-gutters align-items-start justify-content-center w-100"> | ||||
| <Animate Animation="Animations.ZoomIn" Delay="TimeSpan.FromSeconds(0.5)" Duration="TimeSpan.FromSeconds(2.5)"> | |||||
| <Animate Animation="Animations.FadeIn" Delay="TimeSpan.FromSeconds(0.5)" Duration="TimeSpan.FromSeconds(2.5)"> | |||||
| <DoneImage></DoneImage> | |||||
| </Animate> | |||||
| </Animate> | |||||
| @if (!running) { | |||||
| if (responseOk) { | |||||
| <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)"> | |||||
| <DoneImage></DoneImage> | |||||
| </Animate> | |||||
| } else { | |||||
| <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)"> | |||||
| <FailureImage></FailureImage> | |||||
| </Animate> | |||||
| } | |||||
| } | |||||
| </div> | </div> | ||||
| <div class="row no-gutters align-items-end justify-content-center w-100" style="padding-bottom:2em;padding-top:2em"> | <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"> | <div class="col w-100 text-center"> | ||||
| @code { | @code { | ||||
| protected override void OnInitialized() { | |||||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||||
| private Animate doneAnimZoom; | |||||
| private bool responseOk = false; | |||||
| private bool running = true; | |||||
| protected async override void OnInitialized() { | |||||
| base.OnInitialized(); | base.OnInitialized(); | ||||
| } | |||||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||||
| ReportResponse response = await ILFBicycleRest.SendFoundReport(ReportDataProvider.GetFoundReport()); | |||||
| responseOk = System.Net.HttpStatusCode.OK == response.StatusCode ? true : false; | |||||
| running = false; | |||||
| StateHasChanged(); | |||||
| if(responseOk) { | |||||
| Toaster.ShowSuccess(i18n.GetString("FoundBike"), response.Message); | |||||
| } else { | |||||
| Toaster.ShowError(response.Message, response.GetDataAsFormattedList()); | |||||
| } | |||||
| } | |||||
| private void Finished() { | private void Finished() { | ||||
| NavigationManager.NavigateTo("caritas_services"); | NavigationManager.NavigateTo("caritas_services"); |
| <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-8-tablet mat-layout-grid-cell-span-12-desktop"> | <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-8-tablet mat-layout-grid-cell-span-12-desktop"> | ||||
| <div class="mat-layout-grid-inner"> | <div class="mat-layout-grid-inner"> | ||||
| <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-4-desktop"> | <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-4-desktop"> | ||||
| <MatSelectValue FullWidth="true" Outlined="true" Label="@i18n["Color"]" Required="true" @bind-Value="selectedColor" Items="@Colors" ValueSelector="@(i=>i)"> | |||||
| <MatSelectValue Class="required" FullWidth="true" Outlined="true" Label="@i18n["Color"]" @bind-Value="selectedColor" Items="@Colors" ValueSelector="@(i=>i)"> | |||||
| <ItemTemplate> | <ItemTemplate> | ||||
| <div> | <div> | ||||
| <span class="btn-sm" style="background-color:@context.Code; | <span class="btn-sm" style="background-color:@context.Code; | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-4-desktop"> | <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-4-desktop"> | ||||
| <MatSelectValue FullWidth="true" Outlined="true" Label="@i18n["Type"]" Required="true" @bind-Value="selectedBcType" Items="@BicycleTypes" ValueSelector="@(i=>i)"> | |||||
| <MatSelectValue Class="required" FullWidth="true" Outlined="true" Label="@i18n["Type"]" @bind-Value="selectedBcType" Items="@BicycleTypes" ValueSelector="@(i=>i)"> | |||||
| <ItemTemplate> | <ItemTemplate> | ||||
| <div> | <div> | ||||
| <span>@context?.Bezeichnung</span> | <span>@context?.Bezeichnung</span> | ||||
| report.GeographicInfo.Latitude = bicycleGeoPosition.Latitude; | report.GeographicInfo.Latitude = bicycleGeoPosition.Latitude; | ||||
| report.GeographicInfo.Longitude = bicycleGeoPosition.Longitude; | report.GeographicInfo.Longitude = bicycleGeoPosition.Longitude; | ||||
| report.FotoString = imgUrl; | report.FotoString = imgUrl; | ||||
| report.FarbeId = selectedColor != null ? selectedColor.Id : 0; | |||||
| report.TypId = selectedBcType != null ? selectedBcType.Id : 0; | |||||
| report.FarbeId = selectedColor != null ? selectedColor.Id : -1; | |||||
| report.TypId = selectedBcType != null ? selectedBcType.Id : -1; | |||||
| if (SelectedBrand != null) { | if (SelectedBrand != null) { | ||||
| if (SelectedBrand.Id == -999) { | if (SelectedBrand.Id == -999) { | ||||
| report.NeueMarke = SelectedBrand.Bezeichnung; | report.NeueMarke = SelectedBrand.Bezeichnung; |
| await this.mapRef.SetView(geoPosition); | await this.mapRef.SetView(geoPosition); | ||||
| } | } | ||||
| } | } | ||||
| private static string GetFormattedAddressZipAndTown(NominatimReverseAddress addressDto) { | private static string GetFormattedAddressZipAndTown(NominatimReverseAddress addressDto) { | ||||
| string country_code = addressDto.address.country_code; | string country_code = addressDto.address.country_code; | ||||
| string zip = addressDto.address.postcode.Split("-", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)[0]; | |||||
| string zip = SplitAndGetFirstPostcode(addressDto.address.postcode); | |||||
| string town = addressDto.address.village ?? addressDto.address.town ?? addressDto.address.city; | string town = addressDto.address.village ?? addressDto.address.town ?? addressDto.address.city; | ||||
| return !String.IsNullOrEmpty(country_code) ? country_code.ToUpper() + "-" + zip + " " + town : zip + " " + town; | return !String.IsNullOrEmpty(country_code) ? country_code.ToUpper() + "-" + zip + " " + town : zip + " " + town; | ||||
| } | } | ||||
| private static string SplitAndGetFirstPostcode(string postcode) { | |||||
| return postcode.Split("-", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)[0]; | |||||
| } | |||||
| private async Task OnMouseMapClicked(MouseEvent mouseEvent) { | private async Task OnMouseMapClicked(MouseEvent mouseEvent) { | ||||
| await AddBicycleMarkerOnClickPosition(mouseEvent); | await AddBicycleMarkerOnClickPosition(mouseEvent); | ||||
| if (addressDto != null) { | if (addressDto != null) { | ||||
| this.bicycleGeoPosition.Address = GetFormattedAddressStreet(addressDto); | this.bicycleGeoPosition.Address = GetFormattedAddressStreet(addressDto); | ||||
| this.bicycleGeoPosition.City = addressDto.address.village ?? addressDto.address.town ?? addressDto.address.city; | this.bicycleGeoPosition.City = addressDto.address.village ?? addressDto.address.town ?? addressDto.address.city; | ||||
| this.bicycleGeoPosition.Zip = addressDto.address.postcode; | |||||
| this.bicycleGeoPosition.Zip = SplitAndGetFirstPostcode(addressDto.address.postcode); | |||||
| this.bicycleGeoPosition.DisplayCity = GetFormattedAddressZipAndTown(addressDto); | this.bicycleGeoPosition.DisplayCity = GetFormattedAddressZipAndTown(addressDto); | ||||
| } else { | } else { | ||||
| Toaster.ShowWarning(I18n.GetString("Warning.Nominatim.Title"), I18n.GetString("Warning.Nominatim.Msg")); | Toaster.ShowWarning(I18n.GetString("Warning.Nominatim.Title"), I18n.GetString("Warning.Nominatim.Msg")); |
| @using cwebplusApp.Shared.Services; | @using cwebplusApp.Shared.Services; | ||||
| @inject NavigationManager NavigationManager | |||||
| @inject IStringLocalizer<Resources> i18n | |||||
| @inject PageHistoryManager PageHistoryManager | |||||
| @inject NavigationManager NavigationManager; | |||||
| @inject IStringLocalizer<Resources> i18n; | |||||
| @inject PageHistoryManager PageHistoryManager; | |||||
| @inject ReportDataProvider ReportDataProvider; | |||||
| @inject ILFBicycleRest ILFBicycleRest; | |||||
| <div class="row px-3 h-100"> | <div class="row px-3 h-100"> | ||||
| <div class="row no-gutters align-items-start justify-content-center w-100"> | <div class="row no-gutters align-items-start justify-content-center w-100"> | ||||
| @code { | @code { | ||||
| protected override void OnInitialized() { | protected override void OnInitialized() { | ||||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||||
| base.OnInitialized(); | base.OnInitialized(); | ||||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||||
| ILFBicycleRest.SendMissingReport(ReportDataProvider.GetMissingReport()); | |||||
| } | } | ||||
| private void Finished() { | private void Finished() { |
| <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-4-desktop"> | <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-4-desktop"> | ||||
| <div class="mat-layout-grid-inner"> | <div class="mat-layout-grid-inner"> | ||||
| <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-8-tablet mat-layout-grid-cell-span-12-desktop"> | <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-8-tablet mat-layout-grid-cell-span-12-desktop"> | ||||
| <MatSelectValue FullWidth="true" Outlined="true" Label="@i18n["Color"]" @bind-Value="selectedColor" Items="@Colors" ValueSelector="@(i=>i)" Required="true"> | |||||
| <MatSelectValue Class="required" FullWidth="true" Outlined="true" Label="@i18n["Color"]" @bind-Value="selectedColor" Items="@Colors" ValueSelector="@(i=>i)"> | |||||
| <ItemTemplate> | <ItemTemplate> | ||||
| <div> | <div> | ||||
| <span class="btn-sm" style="background-color:@context.Code; | <span class="btn-sm" style="background-color:@context.Code; | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-8-tablet mat-layout-grid-cell-span-12-desktop"> | <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-8-tablet mat-layout-grid-cell-span-12-desktop"> | ||||
| <MatSelectValue FullWidth="true" Outlined="true" Label="@i18n["Type"]" @bind-Value="selectedBcType" Items="@BicycleTypes" ValueSelector="@(i=>i)" Required="true"> | |||||
| <MatSelectValue Class="required" FullWidth="true" Outlined="true" Label="@i18n["Type"]" @bind-Value="selectedBcType" Items="@BicycleTypes" ValueSelector="@(i=>i)"> | |||||
| <ItemTemplate> | <ItemTemplate> | ||||
| <div> | <div> | ||||
| <span>@context?.Bezeichnung</span> | <span>@context?.Bezeichnung</span> |
| @page "/failureimage" | |||||
| <div class="text-center"> | |||||
| <img src="./images/failure.png" class="w-50" alt="Failure!" /> | |||||
| </div> | |||||
| @code { | |||||
| } |
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| <td class="text-center"> | <td class="text-center"> | ||||
| <MatCaption Style="font-family:Ubuntu">Version: 0.0.1</MatCaption> | |||||
| <MatCaption Style="font-family:Ubuntu">Version: 0.1.0</MatCaption> | |||||
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| </table> | </table> |
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Net; | |||||
| using System.Threading.Tasks; | |||||
| namespace cwebplusApp.Shared.Models { | |||||
| public class ReportResponse { | |||||
| public HttpStatusCode StatusCode { get; set; } | |||||
| public string Message { get; set; } | |||||
| public string[] Data { get; set; } | |||||
| public string GetDataAsFormattedList() { | |||||
| string result = ""; | |||||
| foreach(string s in Data) { | |||||
| result += s + "\r\n"; | |||||
| } | |||||
| return result; | |||||
| } | |||||
| } | |||||
| } |
| <data name="Error.PhotoOrPictureToBig.Title" xml:space="preserve"> | <data name="Error.PhotoOrPictureToBig.Title" xml:space="preserve"> | ||||
| <value>Bilddatei zu gross!</value> | <value>Bilddatei zu gross!</value> | ||||
| </data> | </data> | ||||
| <data name="Female" xml:space="preserve"> | |||||
| <value>Frau</value> | |||||
| </data> | |||||
| <data name="Finished" xml:space="preserve"> | <data name="Finished" xml:space="preserve"> | ||||
| <value>Fertig</value> | <value>Fertig</value> | ||||
| </data> | </data> | ||||
| <data name="Mail" xml:space="preserve"> | <data name="Mail" xml:space="preserve"> | ||||
| <value>E-Mail</value> | <value>E-Mail</value> | ||||
| </data> | </data> | ||||
| <data name="Man" xml:space="preserve"> | |||||
| <data name="Male" xml:space="preserve"> | |||||
| <value>Herr</value> | <value>Herr</value> | ||||
| </data> | </data> | ||||
| <data name="MissingBike" xml:space="preserve"> | <data name="MissingBike" xml:space="preserve"> | ||||
| <data name="Welcome" xml:space="preserve"> | <data name="Welcome" xml:space="preserve"> | ||||
| <value>Willkommen bei Caritas!</value> | <value>Willkommen bei Caritas!</value> | ||||
| </data> | </data> | ||||
| <data name="Woman" xml:space="preserve"> | |||||
| <value>Frau</value> | |||||
| </data> | |||||
| <data name="Zip" xml:space="preserve"> | <data name="Zip" xml:space="preserve"> | ||||
| <value>PLZ</value> | <value>PLZ</value> | ||||
| </data> | </data> |
| <data name="Error.PhotoOrPictureToBig.Title" xml:space="preserve"> | <data name="Error.PhotoOrPictureToBig.Title" xml:space="preserve"> | ||||
| <value>La taille de la photo est trop grande!</value> | <value>La taille de la photo est trop grande!</value> | ||||
| </data> | </data> | ||||
| <data name="Female" xml:space="preserve"> | |||||
| <value>Madame</value> | |||||
| </data> | |||||
| <data name="Finished" xml:space="preserve"> | <data name="Finished" xml:space="preserve"> | ||||
| <value>Terminé</value> | <value>Terminé</value> | ||||
| </data> | </data> | ||||
| <data name="Mail" xml:space="preserve"> | <data name="Mail" xml:space="preserve"> | ||||
| <value>Courrier</value> | <value>Courrier</value> | ||||
| </data> | </data> | ||||
| <data name="Man" xml:space="preserve"> | |||||
| <data name="Male" xml:space="preserve"> | |||||
| <value>Monsieur</value> | <value>Monsieur</value> | ||||
| </data> | </data> | ||||
| <data name="MissingBike" xml:space="preserve"> | <data name="MissingBike" xml:space="preserve"> | ||||
| <data name="Welcome" xml:space="preserve"> | <data name="Welcome" xml:space="preserve"> | ||||
| <value>Bienvenue chez Caritas!</value> | <value>Bienvenue chez Caritas!</value> | ||||
| </data> | </data> | ||||
| <data name="Woman" xml:space="preserve"> | |||||
| <value>Madame</value> | |||||
| </data> | |||||
| <data name="Zip" xml:space="preserve"> | <data name="Zip" xml:space="preserve"> | ||||
| <value>Code postal</value> | <value>Code postal</value> | ||||
| </data> | </data> |
| <data name="Error.PhotoOrPictureToBig.Title" xml:space="preserve"> | <data name="Error.PhotoOrPictureToBig.Title" xml:space="preserve"> | ||||
| <value>Dimensione dell'immagine troppo grande!</value> | <value>Dimensione dell'immagine troppo grande!</value> | ||||
| </data> | </data> | ||||
| <data name="Female" xml:space="preserve"> | |||||
| <value>Signora</value> | |||||
| </data> | |||||
| <data name="Finished" xml:space="preserve"> | <data name="Finished" xml:space="preserve"> | ||||
| <value>Termina</value> | <value>Termina</value> | ||||
| </data> | </data> | ||||
| <data name="Mail" xml:space="preserve"> | <data name="Mail" xml:space="preserve"> | ||||
| <value>E-Mail</value> | <value>E-Mail</value> | ||||
| </data> | </data> | ||||
| <data name="Man" xml:space="preserve"> | |||||
| <data name="Male" xml:space="preserve"> | |||||
| <value>Signore</value> | <value>Signore</value> | ||||
| </data> | </data> | ||||
| <data name="MissingBike" xml:space="preserve"> | <data name="MissingBike" xml:space="preserve"> | ||||
| <data name="Welcome" xml:space="preserve"> | <data name="Welcome" xml:space="preserve"> | ||||
| <value>Benvenuti alla Caritas!</value> | <value>Benvenuti alla Caritas!</value> | ||||
| </data> | </data> | ||||
| <data name="Woman" xml:space="preserve"> | |||||
| <value>Signora</value> | |||||
| </data> | |||||
| <data name="Zip" xml:space="preserve"> | <data name="Zip" xml:space="preserve"> | ||||
| <value>CAP</value> | <value>CAP</value> | ||||
| </data> | </data> |
| <data name="Error.PhotoOrPictureToBig.Title" xml:space="preserve"> | <data name="Error.PhotoOrPictureToBig.Title" xml:space="preserve"> | ||||
| <value>Size of picture to big!</value> | <value>Size of picture to big!</value> | ||||
| </data> | </data> | ||||
| <data name="Female" xml:space="preserve"> | |||||
| <value>Madam</value> | |||||
| </data> | |||||
| <data name="Finished" xml:space="preserve"> | <data name="Finished" xml:space="preserve"> | ||||
| <value>Finished</value> | <value>Finished</value> | ||||
| </data> | </data> | ||||
| <data name="Mail" xml:space="preserve"> | <data name="Mail" xml:space="preserve"> | ||||
| <value>E-Mail</value> | <value>E-Mail</value> | ||||
| </data> | </data> | ||||
| <data name="Man" xml:space="preserve"> | |||||
| <data name="Male" xml:space="preserve"> | |||||
| <value>Sir</value> | <value>Sir</value> | ||||
| </data> | </data> | ||||
| <data name="MissingBike" xml:space="preserve"> | <data name="MissingBike" xml:space="preserve"> | ||||
| <data name="Welcome" xml:space="preserve"> | <data name="Welcome" xml:space="preserve"> | ||||
| <value>Welcome to Caritas!</value> | <value>Welcome to Caritas!</value> | ||||
| </data> | </data> | ||||
| <data name="Woman" xml:space="preserve"> | |||||
| <value>Madam</value> | |||||
| </data> | |||||
| <data name="Zip" xml:space="preserve"> | <data name="Zip" xml:space="preserve"> | ||||
| <value>Zip</value> | <value>Zip</value> | ||||
| </data> | </data> |
| Task<List<BicycleType>> GetBicycleTypes(); | Task<List<BicycleType>> GetBicycleTypes(); | ||||
| Task<List<Brand>> GetBrands(); | Task<List<Brand>> GetBrands(); | ||||
| Task<ReportResponse> SendFoundReport(FoundReport report); | |||||
| Task<ReportResponse> SendMissingReport(MissingReport report); | |||||
| } | } | ||||
| } | } |
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| using System.Globalization; | using System.Globalization; | ||||
| using System.Net.Http; | using System.Net.Http; | ||||
| using System.Text; | |||||
| using System.Threading; | |||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
| namespace cwebplusApp.Shared.Services { | namespace cwebplusApp.Shared.Services { | ||||
| throw new HttpRequestException("HTTP client not initialized!"); | throw new HttpRequestException("HTTP client not initialized!"); | ||||
| } | } | ||||
| public async Task<ReportResponse> SendFoundReport(FoundReport report) { | |||||
| if (httpClient != null) { | |||||
| string subResourceUrl = Configuration.GetValue<string>("subresource_url_foundreport"); | |||||
| if (!String.IsNullOrEmpty(subResourceUrl)) { | |||||
| string reportJson = JsonNet.Serialize(report); | |||||
| HttpContent content = new StringContent(reportJson, Encoding.UTF8, "application/json"); | |||||
| HttpResponseMessage httpResult = await httpClient.PostAsync(string.Format(subResourceUrl, VERSION, CultureInfo.CurrentCulture.TwoLetterISOLanguageName), content); | |||||
| string msg = await httpResult.Content.ReadAsStringAsync(); | |||||
| ReportResponse response = JsonNet.Deserialize<ReportResponse>(msg); | |||||
| response.StatusCode = httpResult.StatusCode; | |||||
| //ReportResponse response = new(); | |||||
| //response.StatusCode = System.Net.HttpStatusCode.OK; | |||||
| //Thread.Sleep(2000); | |||||
| return response; | |||||
| } | |||||
| } | |||||
| throw new HttpRequestException("HTTP client not initialized!"); | |||||
| } | |||||
| public async Task<ReportResponse> SendMissingReport(MissingReport report) { | |||||
| if (httpClient != null) { | |||||
| string subResourceUrl = Configuration.GetValue<string>("subresource_url_missingreport"); | |||||
| if (!String.IsNullOrEmpty(subResourceUrl)) { | |||||
| string reportJson = JsonNet.Serialize(report); | |||||
| HttpContent content = new StringContent(reportJson, Encoding.UTF8, "application/json"); | |||||
| HttpResponseMessage httpResult = await httpClient.PostAsync(string.Format(subResourceUrl, VERSION, CultureInfo.CurrentCulture.TwoLetterISOLanguageName), content); | |||||
| if (httpResult.StatusCode == System.Net.HttpStatusCode.OK) { | |||||
| ReportResponse reponse = JsonNet.Deserialize<ReportResponse>(await httpResult.Content.ReadAsStringAsync()); | |||||
| return reponse; | |||||
| } | |||||
| throw new HttpRequestException("HTTP error " + httpResult.StatusCode); | |||||
| } | |||||
| } | |||||
| throw new HttpRequestException("HTTP client not initialized!"); | |||||
| } | |||||
| } | } | ||||
| } | } |
| this.matToaster = toaster; | this.matToaster = toaster; | ||||
| } | } | ||||
| public void ShowSuccess(string title, string message, string icon = "") { | |||||
| matToaster.Add(message, MatBlazor.MatToastType.Success, title, icon); | |||||
| } | |||||
| public void ShowInfo(string title, string message, string icon = "") { | public void ShowInfo(string title, string message, string icon = "") { | ||||
| matToaster.Add(message, MatBlazor.MatToastType.Info, title, icon); | matToaster.Add(message, MatBlazor.MatToastType.Info, title, icon); | ||||
| } | } | ||||
| public void ShowWarning(string title, string message, string icon = "") { | public void ShowWarning(string title, string message, string icon = "") { | ||||
| matToaster.Add(message, MatBlazor.MatToastType.Warning, title, icon); | matToaster.Add(message, MatBlazor.MatToastType.Warning, title, icon); | ||||
| } | } | ||||
| public void ShowError(string title, string message, string icon = "") { | public void ShowError(string title, string message, string icon = "") { | ||||
| matToaster.Add(message, MatBlazor.MatToastType.Danger, title, icon); | matToaster.Add(message, MatBlazor.MatToastType.Danger, title, icon); | ||||
| } | } | ||||
| } | } | ||||
| public static void mapUserData(UserData userData, Report report) { | public static void mapUserData(UserData userData, Report report) { | ||||
| userData.Salutation = report.Anrede; | userData.Salutation = report.Anrede; | ||||
| userData.Firstname = report.Vorname; | userData.Firstname = report.Vorname; | ||||
| userData.Lastname = report.Nachname; ; | |||||
| userData.Lastname = report.Nachname; | |||||
| userData.Phone = report.Telefon; | userData.Phone = report.Telefon; | ||||
| } | } | ||||
| report.Nachname = userData.Lastname; | report.Nachname = userData.Lastname; | ||||
| report.Telefon = userData.Phone; | report.Telefon = userData.Phone; | ||||
| } | } | ||||
| public static void mapReport(Report report, char Salutation, string Firstname, string Lastname, string Phone) { | |||||
| report.Anrede = new string(Salutation, 1); | |||||
| report.Vorname = Firstname; | |||||
| report.Nachname = Lastname; | |||||
| report.Telefon = Phone; | |||||
| } | |||||
| } | } | ||||
| } | } |
| <ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" /> | <ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" /> | ||||
| </ItemGroup> | </ItemGroup> | ||||
| <ProjectExtensions><VisualStudio><UserProperties wwwroot_4appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions> | |||||
| </Project> | </Project> |
| "host_base_url": "https://integrate.dynalias.net:9443/Fundvelo/", | "host_base_url": "https://integrate.dynalias.net:9443/Fundvelo/", | ||||
| "subresource_url_colors": "api/{0}/{1}/fundvelo/colors", | "subresource_url_colors": "api/{0}/{1}/fundvelo/colors", | ||||
| "subresource_url_brands": "api/{0}/{1}/fundvelo/brands", | "subresource_url_brands": "api/{0}/{1}/fundvelo/brands", | ||||
| "subresource_url_types": "api/{0}/{1}/fundvelo/types" | |||||
| "subresource_url_types": "api/{0}/{1}/fundvelo/types", | |||||
| "subresource_url_foundreport": "api/{0}/{1}/fundvelo/fundmeldung", | |||||
| "subresource_url_missingreport": "api/{0}/{1}/fundvelo/suchauftrag" | |||||
| } | } |
| div.mdc-checkbox { | div.mdc-checkbox { | ||||
| margin-left: -11px; | margin-left: -11px; | ||||
| } | |||||
| div.mat-select.required span#outlined-select-label.mdc-floating-label::after { | |||||
| content: "*"; | |||||
| } | |||||
| .mat-toast-container.mat-toast-bottom-center > div { | |||||
| width: 95%; | |||||
| } | } |
| '/conclusion_found', | '/conclusion_found', | ||||
| '/conclusion_missing', | '/conclusion_missing', | ||||
| '/doneimage', | '/doneimage', | ||||
| '/failureimage', | |||||
| 'favicon.ico', | 'favicon.ico', | ||||
| 'images/batch_found.png', | 'images/batch_found.png', | ||||
| 'images/batch_fundvelo.png', | 'images/batch_fundvelo.png', |