示例#1
0
        private async void SelectClientButton_Click(object sender, RoutedEventArgs e)
        {
            if (vm.SelectedClient != null)
            {
                Mouse.OverrideCursor = Cursors.Wait;
                await vm.SetupAsync("ReservationForm");

                Mouse.OverrideCursor = null;
                ReservationForm rf = new ReservationForm(vm);
                rf.Show();
                Close();
            }
            else
            {
                MessageBox.Show("Selecteer aub een klant.");
            }
        }
示例#2
0
        private async void MakeClientButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                IsFilledIn();

                Client toAdd = new Client();
                toAdd = new Client((ClientType)ClientType.SelectedItem, vm.GetDiscounts((ClientType)ClientType.SelectedItem), new Address(Street.Text, Town.Text, StreetNumber.Text), Name.Text, BtwNumber.Text, new List <ReservationsPerYear>());

                vm.AddClient(toAdd);

                Mouse.OverrideCursor = Cursors.Wait;
                await vm.SetupAsync("ReservationForm");

                Mouse.OverrideCursor = null;
                ReservationForm rf = new ReservationForm(vm);
                rf.Show();
                Close();
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }