예제 #1
0
        public void SearchFilter()
        {
            if (BackUpOrdrerCollection.Count == 0)
            {
                foreach (var ordre in OrdrerCollection)
                {
                    BackUpOrdrerCollection.Add(ordre);
                }
            }
            var FilteredOrdrer = (from ordre in BackUpOrdrerCollection where ordre.OrdreNummer.Contains(SearchInput) select ordre).ToList();

            if (SearchInput == "")
            {
                OrdrerCollection.Clear();
                foreach (var ordre in BackUpOrdrerCollection)
                {
                    OrdrerCollection.Add(ordre);
                }
            }
            else
            {
                OrdrerCollection.Clear();
                foreach (var ordre in FilteredOrdrer)
                {
                    OrdrerCollection.Add(ordre);
                }
            }
        }
        public async void Load()
        {
            var ordrerCollection = await PersistencyService.LoadNotesFromJsonAsync();

            OrdrerCollection.Clear();
            foreach (var note in ordrerCollection)
            {
                OrdrerCollection.Add(note);
            }
        }
예제 #3
0
        public void DeaktiverOrdre()
        {
            if (SelectedOrdre != null)
            {
                var OrdreToDeactivate = (from ordre in OrdrerCollection where SelectedOrdre.OrdreNummer == ordre.OrdreNummer select ordre).FirstOrDefault();

                OrdreToDeactivate.Aktiveret = false;
                OrdrerCollection.Remove(OrdreToDeactivate);
                DeaktiveredeOrdrerCollection.Add(OrdreToDeactivate);
                SaveOrdrer();
                OnPropertyChanged();
            }
        }
예제 #4
0
        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);
            //}
        }
예제 #5
0
 public void SaveOrdrer()
 {
     foreach (var ordre in OrdrerCollection)
     {
         if (ordre.Aktiveret == false)
         {
             OrdrerCollection.Remove(ordre);
             DeaktiveredeOrdrerCollection.Add(ordre);
         }
         else
         {
             DeaktiveredeOrdrerCollection.Remove(ordre);
         }
     }
     GemAktiveredeOrdre.SaveOrdreAsJsonAsync(OrdrerCollection);
     GemDeaktiveredeOrdrer.SaveOrdreAsJsonAsync(DeaktiveredeOrdrerCollection);
 }
예제 #6
0
        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 OpretOdre()
 {
     OrdrerCollection.Add(new Ordre(SelectedMedie, SelectedFolie, Farve, Længde, Bredde, Antal, Laminering, Fragt, OpTil10, Montering, Afhentes, Kommentar));
     OnPropertyChanged();
     Save();
 }