Ver código fonte

Offline mode

- Resend reports workflow
master
Flo Smilari 4 anos atrás
pai
commit
2075cb446b

+ 5
- 1
Pages/CaritasServiceFundVeloFoundConclusion.razor Ver arquivo

base.OnInitialized(); base.OnInitialized();
PageHistoryManager.AddPageToHistory(NavigationManager.Uri); PageHistoryManager.AddPageToHistory(NavigationManager.Uri);
try { 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; 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 });

+ 5
- 1
Pages/CaritasServiceFundVeloMissingConclusion.razor Ver arquivo

base.OnInitialized(); base.OnInitialized();
PageHistoryManager.AddPageToHistory(NavigationManager.Uri); PageHistoryManager.AddPageToHistory(NavigationManager.Uri);
try { 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; responseStatus = response == null ? ResposeStatus.NoConnection : System.Net.HttpStatusCode.OK == response.StatusCode ? ResposeStatus.OK : ResposeStatus.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 });

+ 2
- 2
Pages/CaritasServiceFundVeloMissingKeyDataPage.razor Ver arquivo

private void updateDtoFromGUI() { private void updateDtoFromGUI() {
MissingReport report = ReportDataProvider.GetMissingReport(); MissingReport report = ReportDataProvider.GetMissingReport();
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 : null;
report.TypId = selectedBcType != null ? selectedBcType.Id : null;
if (SelectedBrand != null) { if (SelectedBrand != null) {
if (SelectedBrand.Id == -999) { if (SelectedBrand.Id == -999) {
report.NeueMarke = SelectedBrand.Bezeichnung; report.NeueMarke = SelectedBrand.Bezeichnung;

+ 3
- 1
Shared/Services/BicycleRestService.cs Ver arquivo

return await SendReport(report, subResourceUrl, new FoundReportRepositoryItem((FoundReport)report, ReportRepositoryService.GetCurrentTimeInMillis())); 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"); string subResourceUrl = configuration.GetValue<string>("subresource_url_foundreport");
return await SendReport(reportRepositoryItem.Report, subResourceUrl, reportRepositoryItem); return await SendReport(reportRepositoryItem.Report, subResourceUrl, reportRepositoryItem);
} }
await reportRepositoryService.SaveReport(reportRepositoryItem); await reportRepositoryService.SaveReport(reportRepositoryItem);
return response; return response;
} }
} }
} }

+ 4
- 0
Shared/Services/IBicycleRestService.cs Ver arquivo

Task<ReportResponse> SendFoundReport(Report report); Task<ReportResponse> SendFoundReport(Report report);
Task<ReportResponse> SendFoundReport(FoundReportRepositoryItem reportRepositoryItem);
Task<ReportResponse> SendMissingReport(Report report); Task<ReportResponse> SendMissingReport(Report report);
Task<ReportResponse> SendMissingReport(MissingReportRepositoryItem reportRepositoryItem);
Task<int> TrySendPendingReports(); Task<int> TrySendPendingReports();
Task<int> TrySendFoundPendingReports(); Task<int> TrySendFoundPendingReports();

+ 1
- 1
cwebplusApp.csproj.user Ver arquivo

<PropertyGroup> <PropertyGroup>
<ActiveDebugProfile>CaritasPWA</ActiveDebugProfile> <ActiveDebugProfile>CaritasPWA</ActiveDebugProfile>
<NameOfLastUsedPublishProfile>D:\Work\Caritas\cwebplusApp\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>D:\Work\Caritas\cwebplusApp\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<ShowAllFiles>true</ShowAllFiles>
<ShowAllFiles>false</ShowAllFiles>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

Carregando…
Cancelar
Salvar