Exemplo n.º 1
0
        public EditInspectionViewModel(InspectieViewModel inspection, FestiSpecProvider dataServer)
        {
            _previousPage = inspection;
            _dataServer   = dataServer;
            _inspection   = inspection.SelectedInspectie;

            Datum         = _inspection.Datum;
            GebruikerList = new ObservableCollection <GebruikerVM>();
            foreach (var g in _inspection.InspectieModel.Gebruiker1.ToList())
            {
                GebruikerVM gVM = new GebruikerVM(g);
                gVM.IsIncluded = true;
                GebruikerList.Add(gVM);
            }
            PostCode        = _inspection.Postcode;
            huisnummer      = _inspection.Huisnummer;
            Naam            = _inspection.Naam;
            Wens            = _inspection.Wens;
            SelectedKlant   = new KlantVM(_inspection.InspectieModel.Klant);
            SelectedStatus  = new StatusVM(_inspection.InspectieModel.Status);
            SelectedOfferte = new OfferteVM(_inspection.InspectieModel.Offerte);

            KlantList   = _dataServer.GetKlanten();
            StatusList  = _dataServer.GetStatus();
            OfferteList = _dataServer.GetOfferte().ToList();

            EditInspectionCommand = new RelayCommand(EditInspection);
            ShowMapCommand        = new RelayCommand(CalculateRoute);

            apiConnector = new GeodanRepository("6c4c63db-de9a-11e8-8aac-005056805b87");
        }
Exemplo n.º 2
0
        private void AddOfferte()
        {
            OfferteVM tmp;

            if (Betaald)
            {
                tmp = new OfferteVM(new Offerte()
                {
                    Betaald = 1, Prijs = Prijs, Toelichting = Toelichting
                });

                dataServer.AddOfferte(tmp.OfferteModel);
                offerte.OfferteList.Add(tmp);
                return;
            }
            tmp = new OfferteVM(new Offerte()
            {
                Betaald = 0, Prijs = Prijs, Toelichting = Toelichting
            });

            dataServer.AddOfferte(tmp.OfferteModel);
            offerte.OfferteList.Add(tmp);

            offerte.CloseAddWindow();
        }
 public void NotifyOfferteEdited(OfferteVM offerte)
 {
     _editOfferteWindow.Close();
     foreach (var o in OfferteList.ToList())
     {
         if (o.Id == offerte.Id)
         {
             OfferteList.Remove(o);
             break;
         }
     }
     OfferteList.Add(offerte);
     _editOfferteWindow = null;
 }