public void OpretOrdre() { KundeCollection.Add(new Kunde(KundeCVRnummer, Navn, Firma, Adresse, By, Postnr, Mail, Telefonnr)); OrdrerCollection.Add(new Ordre(Date, Laminering, Fragt, OpTil10, Montering, Afhentes, KundeCVRnummer, ProduktCollection)); OnPropertyChanged(); SaveOrdrer(); SaveKunder(); frame.Navigate(typeof(Forside)); //var SorteretEfterDato = (from ordre in OrdrerCollection orderby ordre.Date descending select ordre); //OrdrerCollection.Clear(); //foreach (var ordre in SorteretEfterDato) //{ // OrdrerCollection.Add(ordre); //} }
public async void Load() { string curFile = @"C:\Users\rasmu\AppData\Local\Packages\347085fc-770a-47bf-87e0-14e3e41dd8a6_2g8htre5d9nf2\LocalState\Ordrer.json"; if (File.Exists(curFile)) { var ordrerCollection = await GemAktiveredeOrdre.LoadOrdreFromJsonAsync(); OrdrerCollection.Clear(); foreach (var ordre in ordrerCollection) { OrdrerCollection.Add(ordre); } } string curFile2 = @"C:\Users\rasmu\AppData\Local\Packages\347085fc-770a-47bf-87e0-14e3e41dd8a6_2g8htre5d9nf2\LocalState\DeaktiveredeOrdrer.json"; if (File.Exists(curFile2)) { var deaktiveredeOrdrerCollection = await GemDeaktiveredeOrdrer.LoadOrdreFromJsonAsync(); DeaktiveredeOrdrerCollection.Clear(); foreach (var ordre in deaktiveredeOrdrerCollection) { DeaktiveredeOrdrerCollection.Add(ordre); } } string curFile3 = @"C:\Users\rasmu\AppData\Local\Packages\347085fc-770a-47bf-87e0-14e3e41dd8a6_2g8htre5d9nf2\LocalState\Kunder.json"; if (File.Exists(curFile3)) { var kundeCollection = await GemKunde.LoadKunderFromJsonAsync(); KundeCollection.Clear(); foreach (var kunde in kundeCollection) { KundeCollection.Add(kunde); } } }
public void OpretKunde() { KundeCollection.Add(new Kunde(KundeCVRnummer, Navn, Firma, Adresse, By, Postnr, Mail, Telefonnr)); OnPropertyChanged(); SaveKunder(); }