private void btnResidenceNew_Click(object sender, RoutedEventArgs e)
        {
            WinResidences winResidences = new WinResidences();

            winResidences.status            = "new";
            winResidences.selectedResidence = null;
            winResidences.ShowDialog();

            if (winResidences.selectedResidence != null)
            {
                cmbKindOfResidence.SelectedIndex = 0;
                lstResidences.ItemsSource        = null;
                residences.AllResidences.Add(winResidences.selectedResidence);
                // niet vergeten : ook AllHolidayHomes en AllCaravans dienen bijgewerkt te worden
                if (winResidences.selectedResidence is HolidayHome)
                {
                    residences.AllHolidayHomes.Add((HolidayHome)winResidences.selectedResidence);
                }
                else
                {
                    residences.AllCaravans.Add((Caravan)winResidences.selectedResidence);
                }
                lstResidences.ItemsSource  = residences.AllResidences;
                lstResidences.SelectedItem = winResidences.selectedResidence;
            }
        }
 private void BtnResidenceEdit_Click(object sender, RoutedEventArgs e)
 {
     if (lstResidences.SelectedItem != null)
     {
         Residence residence       = (Residence)lstResidences.SelectedItem;
         Window    residenceWindow = new WinResidences(residence);
         residenceWindow.ShowDialog();
         UpdateResidences();
     }
 }
        private void BtnResidenceNew_Click(object sender, RoutedEventArgs e)
        {
            WinResidences residenceWindow = new WinResidences();

            residenceWindow.ShowDialog();
            if (residenceWindow.Residence != null)
            {
                residences.Add(residenceWindow.Residence);
            }
            UpdateResidences();
        }
        private void btnResidenceView_Click(object sender, RoutedEventArgs e)
        {
            if (lstResidences.SelectedIndex == -1)
            {
                return;
            }
            WinResidences winResidences = new WinResidences();

            winResidences.status            = "view";
            winResidences.selectedResidence = (Residence)lstResidences.SelectedItem;
            winResidences.ShowDialog();
        }
Beispiel #5
0
        private void btnResidenceView_Click(object sender, RoutedEventArgs e)
        {
            if (lstResidences.SelectedItem == null)
            {
                return;
            }

            WinResidences winResidences = new WinResidences();

            winResidences.selectedResidence = (Residence)lstResidences.SelectedItem;
            winResidences.reasonForEntry    = WinResidences.ReasonForEntry.viewResidence;
            winResidences.ShowDialog();
        }
        private void btnResidenceEdit_Click(object sender, RoutedEventArgs e)
        {
            if (lstResidences.SelectedIndex == -1)
            {
                return;
            }

            WinResidences winResidences = new WinResidences();

            winResidences.status            = "edit";
            winResidences.selectedResidence = (Residence)lstResidences.SelectedItem;
            winResidences.ShowDialog();

            cmbKindOfResidence_SelectionChanged(null, null);
            lstResidences.SelectedItem = winResidences.selectedResidence;
        }
Beispiel #7
0
        private void btnResidenceNew_Click(object sender, RoutedEventArgs e)
        {
            WinResidences winResidences = new WinResidences();

            winResidences.selectedResidence = null;
            winResidences.reasonForEntry    = WinResidences.ReasonForEntry.newResidence;
            winResidences.ShowDialog();

            if (winResidences.refreshRequired)
            {
                cmbKindOfResidence.SelectedIndex = 0;
                PopulateResidences();
                lstResidences.SelectedItem = winResidences.selectedResidence;
                lstResidences_SelectionChanged(null, null);
            }
        }