소스 검색

Bug: Don't save ReportRepositoryItem witout Report (report == null)

master
Flo Smilari 4 년 전
부모
커밋
56539f79a5
1개의 변경된 파일24개의 추가작업 그리고 16개의 파일을 삭제
  1. 24
    16
      Shared/Services/Fundvelo/ReportRepositoryService.cs

+ 24
- 16
Shared/Services/Fundvelo/ReportRepositoryService.cs 파일 보기

@@ -75,28 +75,36 @@ namespace cwebplusApp.Shared.Services {
}
public async Task SaveFoundReport(FoundReportRepositoryItem foundReportRepositoryItem) {
var newRecord = new StoreRecord<FoundReportRepositoryItem> {
Storename = FoundReportRepository_Store_Name,
Data = foundReportRepositoryItem
};
if (foundReportRepositoryItem.ID == 0) {
foundReportRepositoryItem.ID = GetCurrentTimeInMillis();
await this.dbManager.AddRecord(newRecord);
if (foundReportRepositoryItem.GetReport() is not null) {
var newRecord = new StoreRecord<FoundReportRepositoryItem> {
Storename = FoundReportRepository_Store_Name,
Data = foundReportRepositoryItem
};
if (foundReportRepositoryItem.ID == 0) {
foundReportRepositoryItem.ID = GetCurrentTimeInMillis();
await this.dbManager.AddRecord(newRecord);
} else {
await this.dbManager.UpdateRecord(newRecord);
}
} else {
await this.dbManager.UpdateRecord(newRecord);
Console.WriteLine("b9a082d4: FoundReportRepositoryItem not saved to DB due to underlaying report is NULL!");
}
}
public async Task SaveMissingReport(MissingReportRepositoryItem missingReportRepositoryItem) {
var newRecord = new StoreRecord<MissingReportRepositoryItem> {
Storename = MissingReportRepository_Store_Name,
Data = missingReportRepositoryItem
};
if (missingReportRepositoryItem.ID == 0) {
missingReportRepositoryItem.ID = GetCurrentTimeInMillis();
await this.dbManager.AddRecord(newRecord);
if (missingReportRepositoryItem.GetReport() is not null) {
var newRecord = new StoreRecord<MissingReportRepositoryItem> {
Storename = MissingReportRepository_Store_Name,
Data = missingReportRepositoryItem
};
if (missingReportRepositoryItem.ID == 0) {
missingReportRepositoryItem.ID = GetCurrentTimeInMillis();
await this.dbManager.AddRecord(newRecord);
} else {
await this.dbManager.UpdateRecord(newRecord);
}
} else {
await this.dbManager.UpdateRecord(newRecord);
Console.WriteLine("b7it83r1: MissingReportRepositoryItem not saved to DB due to underlaying report is NULL!");
}
}

Loading…
취소
저장