| @@ -76,7 +76,11 @@ | |||
| base.OnInitialized(); | |||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||
| try { | |||
| response = await IBicycleRestService.SendFoundReport(ReportDataProvider.Report); | |||
| if (ReportDataProvider.ReportRepositoryItem != null) { | |||
| response = await IBicycleRestService.SendFoundReport((FoundReportRepositoryItem)ReportDataProvider.ReportRepositoryItem); | |||
| } else { | |||
| response = await IBicycleRestService.SendFoundReport(ReportDataProvider.Report); | |||
| } | |||
| responseStatus = response==null ? ResponseStatus.NoConnection : System.Net.HttpStatusCode.OK == response.StatusCode ? ResponseStatus.OK : ResponseStatus.Error; | |||
| } catch (HttpRequestException ex) { | |||
| response = new(i18n.GetString("FoundBike"), new string[] { ex.Message }); | |||
| @@ -105,7 +105,11 @@ | |||
| base.OnInitialized(); | |||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||
| try { | |||
| response = await IBicycleRestService.SendMissingReport(ReportDataProvider.Report); | |||
| 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 }); | |||
| @@ -253,8 +253,8 @@ | |||
| private void updateDtoFromGUI() { | |||
| MissingReport report = ReportDataProvider.GetMissingReport(); | |||
| report.FotoString = imgUrl; | |||
| report.FarbeId = selectedColor != null ? selectedColor.Id : 0; | |||
| report.TypId = selectedBcType != null ? selectedBcType.Id : 0; | |||
| report.FarbeId = selectedColor != null ? selectedColor.Id : null; | |||
| report.TypId = selectedBcType != null ? selectedBcType.Id : null; | |||
| if (SelectedBrand != null) { | |||
| if (SelectedBrand.Id == -999) { | |||
| report.NeueMarke = SelectedBrand.Bezeichnung; | |||
| @@ -91,7 +91,7 @@ namespace cwebplusApp.Shared.Services { | |||
| return await SendReport(report, subResourceUrl, new FoundReportRepositoryItem((FoundReport)report, ReportRepositoryService.GetCurrentTimeInMillis())); | |||
| } | |||
| private async Task<ReportResponse> SendFoundReport(FoundReportRepositoryItem reportRepositoryItem) { | |||
| public async Task<ReportResponse> SendFoundReport(FoundReportRepositoryItem reportRepositoryItem) { | |||
| string subResourceUrl = configuration.GetValue<string>("subresource_url_foundreport"); | |||
| return await SendReport(reportRepositoryItem.Report, subResourceUrl, reportRepositoryItem); | |||
| } | |||
| @@ -171,5 +171,7 @@ namespace cwebplusApp.Shared.Services { | |||
| await reportRepositoryService.SaveReport(reportRepositoryItem); | |||
| return response; | |||
| } | |||
| } | |||
| } | |||
| @@ -16,8 +16,12 @@ namespace cwebplusApp.Shared.Services { | |||
| Task<ReportResponse> SendFoundReport(Report report); | |||
| Task<ReportResponse> SendFoundReport(FoundReportRepositoryItem reportRepositoryItem); | |||
| Task<ReportResponse> SendMissingReport(Report report); | |||
| Task<ReportResponse> SendMissingReport(MissingReportRepositoryItem reportRepositoryItem); | |||
| Task<int> TrySendPendingReports(); | |||
| Task<int> TrySendFoundPendingReports(); | |||
| @@ -6,6 +6,6 @@ | |||
| <PropertyGroup> | |||
| <ActiveDebugProfile>CaritasPWA</ActiveDebugProfile> | |||
| <NameOfLastUsedPublishProfile>D:\Work\Caritas\cwebplusApp\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> | |||
| <ShowAllFiles>true</ShowAllFiles> | |||
| <ShowAllFiles>false</ShowAllFiles> | |||
| </PropertyGroup> | |||
| </Project> | |||