| } | } | ||||
| public async Task SaveFoundReport(FoundReportRepositoryItem foundReportRepositoryItem) { | 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 { | } 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) { | 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 { | } else { | ||||
| await this.dbManager.UpdateRecord(newRecord); | |||||
| Console.WriteLine("b7it83r1: MissingReportRepositoryItem not saved to DB due to underlaying report is NULL!"); | |||||
| } | } | ||||
| } | } | ||||