public void SaveUge() { GemUge gem = new GemUge(); gem.importTilGemDenneUge(); Persistance.SaveJson(gem, "Uge" + Dato.GetDenneUge() + ".json"); Persistance.MessageDialogHelper.Show("Udlægget er gemt", "Gemt!"); }
public async Task nyDenneUge() { Uge ugeX = new Uge(); DenneTempUge = ugeX; DenneTempUge.StrUgenummer = "" + Dato.GetDenneUge(); DenneTempUge.IntUgenummer = Dato.GetDenneUge(); await CheckStandard(); DenneTempUge.BoligListe = StandardListe; GemUge gem = new GemUge(); gem.importTilGemDenneUge(); Persistance.SaveJson(gem, "Uge" + Dato.GetDenneUge() + ".json"); }
private async Task CheckNewWeek() { try { GemUge SavedJsonClass = await Persistance.LoadUgeFraJsonAsync("Uge" + Dato.GetDenneUge() + ".json"); GemUge hentet = new GemUge(); hentet = SavedJsonClass; hentet.exportFraGemDenneUge(); } catch (FileNotFoundException) { Persistance.MessageDialogHelper.Show("Ingen fil for denne uge fundet, der vil derfor blive oprettet en tom uge", "No current week"); await Singleton.GetInstance().nyDenneUge(); } try { GemUge SavedJsonClass = await Persistance.LoadUgeFraJsonAsync("Uge" + Dato.GetNæsteUge() + ".json"); GemUge hentet = new GemUge(); hentet = SavedJsonClass; hentet.exportFraGemNæsteUge(); } catch (FileNotFoundException) { await Singleton.GetInstance().nyNæsteUge(); } }