| @@ -14,11 +14,14 @@ | |||
| <div class="row px-3 h-100"> | |||
| <div class="row no-gutters align-items-center justify-content-center w-100" style="padding-top:1em"> | |||
| <h2>@I18n["MyData"]</h2> | |||
| </div> | |||
| <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"> | |||
| <div class="col-12"> | |||
| <MatSelect Class="w-100 required" Label="@I18n["Salutation"]" Outlined="true" @bind-Value="@Account.Salutation" Style="margin-bottom: 0.5rem" Required="true" | |||
| @onkeydown="InputCursorHandler.OnKeyDownHandlerAsync"> | |||
| <MatSelect Class="w-100 required" Label="@I18n["Salutation"]" Outlined="true" @bind-Value="@Account.Salutation" Style="margin-bottom: 0.5rem" Required="true" | |||
| @onkeydown="InputCursorHandler.OnKeyDownHandlerAsync"> | |||
| <MatOptionString Value="M">@I18n["Male"]</MatOptionString> | |||
| <MatOptionString Value="F">@I18n["Female"]</MatOptionString> | |||
| </MatSelect> | |||
| @@ -27,39 +30,45 @@ | |||
| <div class="row no-gutters w-100"> | |||
| <div class="col-6" style="padding-right:0.5em"> | |||
| <MatStringField Class="w-100" Label="@I18n["Firstname"]" Outlined="true" type="text" @bind-Value="@Account.Firstname" Required="true" | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| </div> | |||
| <div class="col-6" style="padding-left:0.5em"> | |||
| <MatStringField Class="w-100" Label="@I18n["Lastname"]" Outlined="true" type="text" @bind-Value="@Account.Lastname" Required="true" | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| </div> | |||
| </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" | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></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" | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></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" | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| </div> | |||
| </div> | |||
| <div class="row no-gutters align-items-center w-100"> | |||
| <div class="col-12"> | |||
| <MatStringField Class="w-100" Label="@I18n["Phone"]" Outlined="true" type="text" @bind-Value="@Account.Phone" Required="true" | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| </div> | |||
| </div> | |||
| <div class="row no-gutters align-items-center w-100"> | |||
| <div class="col-12"> | |||
| <MatStringField Class="w-100" Label="@I18n["Mobile"]" Outlined="true" type="text" @bind-Value="@Account.Mobile" | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| </div> | |||
| </div> | |||
| <div class="row no-gutters align-items-center w-100"> | |||
| <div class="col-12"> | |||
| <MatStringField Class="w-100" Label="@I18n["Mail"]" Outlined="true" type="text" @bind-Value="@Account.Email" | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| OnKeyDown="@InputCursorHandler.OnKeyDownHandlerAsync"></MatStringField> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -4,8 +4,9 @@ | |||
| public string Anrede { get; set; } // required | |||
| public string Vorname { get; set; } // required | |||
| public string Nachname { get; set; } // required | |||
| public string Mobil { get; set; } | |||
| public string Mobile { get; set; } | |||
| public string Telefon { get; set; } | |||
| public string Email { get; set; } | |||
| public int? TypId { get; set; } // required | |||
| public int? MarkeId { get; set; } // required | |||
| public int? FarbeId { get; set; } // required | |||
| @@ -0,0 +1,20 @@ | |||
| namespace cwebplusApp.Shared.Models { | |||
| public class ZipCity { | |||
| public string Zip { get; set; } | |||
| public string City { get; set; } | |||
| public string Zip_City { get; set; } | |||
| public ZipCity() { | |||
| } | |||
| public ZipCity(string zipCity) { | |||
| Zip_City = zipCity; | |||
| Zip = zipCity.Split(' ')[0]; | |||
| City = zipCity.Replace(Zip + " ", ""); | |||
| } | |||
| } | |||
| } | |||
| @@ -8,6 +8,7 @@ | |||
| private string zip; | |||
| private string city; | |||
| private string phone; | |||
| private string mobile; | |||
| private string email; | |||
| public string Salutation { get => salutation; set { salutation = value; } } | |||
| @@ -17,6 +18,7 @@ | |||
| public string Zip { get => zip; set { zip = value; } } | |||
| public string City { get => city; set { city = value; } } | |||
| public string Phone { get => phone; set { phone = value; } } | |||
| public string Mobile { get => mobile; set { mobile = value; } } | |||
| public string Email { get => email; set { email = value; } } | |||
| } | |||
| } | |||
| @@ -456,6 +456,9 @@ Die KulturLegi wirkt dem entgegen indem sie Kultur-, Bildungs- und Sportangebote | |||
| <data name="Mobile" xml:space="preserve"> | |||
| <value>Mobile</value> | |||
| </data> | |||
| <data name="MyData" xml:space="preserve"> | |||
| <value>Meine Angaben</value> | |||
| </data> | |||
| <data name="No" xml:space="preserve"> | |||
| <value>Nein</value> | |||
| </data> | |||
| @@ -456,6 +456,9 @@ La KulturLegi s'attaque à ce problème en rendant les activités culturelles, | |||
| <data name="Mobile" xml:space="preserve"> | |||
| <value>Mobile</value> | |||
| </data> | |||
| <data name="MyData" xml:space="preserve"> | |||
| <value>Mes données</value> | |||
| </data> | |||
| <data name="No" xml:space="preserve"> | |||
| <value>Non</value> | |||
| </data> | |||
| @@ -456,6 +456,9 @@ La KulturLegi si oppone a questo rendendo le attività culturali, educative e sp | |||
| <data name="Mobile" xml:space="preserve"> | |||
| <value>Cellulare</value> | |||
| </data> | |||
| <data name="MyData" xml:space="preserve"> | |||
| <value>I miei dati</value> | |||
| </data> | |||
| <data name="No" xml:space="preserve"> | |||
| <value>No</value> | |||
| </data> | |||
| @@ -456,6 +456,9 @@ The KulturLegi counteracts this by making cultural, educational and sporting act | |||
| <data name="Mobile" xml:space="preserve"> | |||
| <value>Mobile</value> | |||
| </data> | |||
| <data name="MyData" xml:space="preserve"> | |||
| <value>My Data</value> | |||
| </data> | |||
| <data name="No" xml:space="preserve"> | |||
| <value>No</value> | |||
| </data> | |||
| @@ -99,6 +99,29 @@ namespace cwebplusApp.Shared.Services { | |||
| throw new HttpRequestException("HTTP client not initialized!"); | |||
| } | |||
| public async Task<List<ZipCity>> GetZipCities() { | |||
| if (httpClient != null) { | |||
| string subResourceUrl = configuration.GetValue<string>("subresource_url_zipcities"); | |||
| if (!String.IsNullOrEmpty(subResourceUrl)) { | |||
| HttpResponseMessage httpResult = await httpClient.GetAsync(string.Format(subResourceUrl, VERSION, CultureInfo.CurrentCulture.TwoLetterISOLanguageName)); | |||
| if (httpResult.StatusCode == System.Net.HttpStatusCode.OK) { | |||
| string[] zipCitiesStr = JsonConvert.DeserializeObject<string[]>(await httpResult.Content.ReadAsStringAsync()); | |||
| List<ZipCity> zipCities = new (); | |||
| for (int i = 0; i < zipCitiesStr.Length; i++) { | |||
| zipCities.Add(new ZipCity(zipCitiesStr[i])); | |||
| } | |||
| return zipCities; | |||
| } | |||
| throw new HttpRequestException("HTTP error " + httpResult.StatusCode); | |||
| } | |||
| } | |||
| throw new HttpRequestException("HTTP client not initialized!"); | |||
| } | |||
| public async Task<ReportResponse> SendFoundReport(Report report) { | |||
| string subResourceUrl = configuration.GetValue<string>("subresource_url_foundreport"); | |||
| return await SendReport(report, subResourceUrl, new FoundReportRepositoryItem((FoundReport)report, 0)); | |||
| @@ -16,6 +16,8 @@ namespace cwebplusApp.Shared.Services { | |||
| Task<List<SearchService>> GetSearchServices(); | |||
| Task<List<ZipCity>> GetZipCities(); | |||
| Task<ReportResponse> SendFoundReport(Report report); | |||
| Task<ReportResponse> SendFoundReport(FoundReportRepositoryItem reportRepositoryItem); | |||
| @@ -18,6 +18,7 @@ namespace cwebplusApp.Shared.Services { | |||
| private const string KeyNameBcTypes = "bicycleTypes"; | |||
| private const string KeyNameBrands = "brands"; | |||
| private const string KeyNameSearchservices = "searchServices"; | |||
| private const string KeyNameZipCities = "zipCities"; | |||
| private bool initializedColors; | |||
| private bool initializedBcTypes; | |||
| @@ -27,6 +28,7 @@ namespace cwebplusApp.Shared.Services { | |||
| private BicycleType[] bicycleTypes; | |||
| private Brand[] brands; | |||
| private SearchService[] searchServices; | |||
| private ZipCity[] zipCities; | |||
| public ColorItem[] Colors { | |||
| get => this.colors; | |||
| @@ -63,6 +65,7 @@ namespace cwebplusApp.Shared.Services { | |||
| await SynchronizeBcTypes(); | |||
| await SynchronizeBrands(); | |||
| await SynchronizeSearchServices(); | |||
| await SynchronizeZipCities(); | |||
| } else { | |||
| throw new Exception("No internet connection available!"); | |||
| } | |||
| @@ -100,6 +103,14 @@ namespace cwebplusApp.Shared.Services { | |||
| } | |||
| } | |||
| public async Task SynchronizeZipCities() { | |||
| ZipCity[] _zipCities = (await bicycleRestService.GetZipCities()).ToArray(); | |||
| if (_zipCities != null && _zipCities.Length > 0) { | |||
| this.zipCities = _zipCities; | |||
| await SaveZipCitiesToStorage(this.zipCities); | |||
| } | |||
| } | |||
| public async Task<ColorItem[]> GetColors() { | |||
| ColorItem[] _colors = await GetColorsFromStorage(); | |||
| if (_colors != null && _colors.Length > 0) { | |||
| @@ -261,6 +272,11 @@ namespace cwebplusApp.Shared.Services { | |||
| await jsRuntime.InvokeVoidAsync("BlazorSetLocalStorage", KeyNameSearchservices, json); | |||
| } | |||
| private async Task SaveZipCitiesToStorage(ZipCity[] zipCities) { | |||
| var json = JsonConvert.SerializeObject(zipCities); | |||
| await jsRuntime.InvokeVoidAsync("BlazorSetLocalStorage", KeyNameZipCities, json); | |||
| } | |||
| private static List<ColorItem> SortColors(List<ColorItem> colors) { | |||
| colors.Sort(delegate (ColorItem c1, ColorItem c2) { return c1.Id == 0 ? -1 : c2.Id == 0 ? 1 : c1.Bezeichnung.CompareTo(c2.Bezeichnung); }); | |||
| return colors; | |||
| @@ -59,6 +59,8 @@ namespace cwebplusApp.Shared.Services { | |||
| userData.Firstname = report.Vorname; | |||
| userData.Lastname = report.Nachname; | |||
| userData.Phone = report.Telefon; | |||
| userData.Mobile = report.Mobile; | |||
| userData.Email = report.Email; | |||
| } | |||
| public static void MapReport(Report report, UserData userData) { | |||
| @@ -66,6 +68,8 @@ namespace cwebplusApp.Shared.Services { | |||
| report.Vorname = userData.Firstname; | |||
| report.Nachname = userData.Lastname; | |||
| report.Telefon = userData.Phone; | |||
| report.Mobile = userData.Mobile; | |||
| report.Email = userData.Email; | |||
| } | |||
| public static void MapReport(Report report, char Salutation, string Firstname, string Lastname, string Phone) { | |||
| @@ -83,7 +87,7 @@ namespace cwebplusApp.Shared.Services { | |||
| report.PersonOrt = userData.City; | |||
| report.PersonPLZ = userData.Zip; | |||
| report.PersonStrasse = userData.Address; | |||
| report.Mobil = userData.Phone; | |||
| report.Mobile = userData.Phone; | |||
| report.Mail = userData.Email; | |||
| } | |||
| @@ -4,6 +4,7 @@ | |||
| "subresource_url_colors": "api/{0}/{1}/fundvelo/colors", | |||
| "subresource_url_brands": "api/{0}/{1}/fundvelo/brands", | |||
| "subresource_url_types": "api/{0}/{1}/fundvelo/types", | |||
| "subresource_url_zipcities": "api/{0}/{1}/fundvelo/zipcities", | |||
| "subresource_url_searchservices": "api/{0}/{1}/fundvelo/searchservices", | |||
| "subresource_url_foundreport": "api/{0}/{1}/fundvelo/fundmeldung", | |||
| "subresource_url_missingreport": "api/{0}/{1}/fundvelo/suchauftrag" | |||
| @@ -260,10 +260,12 @@ div.mat-select.required span#outlined-select-label.mdc-floating-label::after { | |||
| width: 100%; | |||
| justify-content: center; | |||
| padding: 0 40px; | |||
| position: absolute; | |||
| z-index: -1; | |||
| } | |||
| #snackbarDiv.show { | |||
| position: absolute; | |||
| z-index: 1; | |||
| } | |||
| #snackbar { | |||
| @@ -273,13 +275,14 @@ div.mat-select.required span#outlined-select-label.mdc-floating-label::after { | |||
| text-align: center; | |||
| border-radius: 10px; | |||
| padding: 16px; | |||
| z-index: 1; | |||
| z-index: -1; | |||
| } | |||
| #snackbar.show { | |||
| visibility: visible; | |||
| -webkit-animation: fadein 1s; | |||
| animation: fadein 1s; | |||
| z-index: 1; | |||
| } | |||
| @-webkit-keyframes fadein { | |||