コード例 #1
0
        private void Save(object parameter)
        {
            if (SelectedService == null)
            {
                MessageBox.Show("Барлық мәліметтерді енгізіңіз");
                return;
            }

            AdditionalService.Service = SelectedService;
            _additionalServices.Add(AdditionalService);
            _view.Close();
        }
コード例 #2
0
        /// <summary>
        /// this is a click event for addService button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addServiceButton_Clicked(object sender, RoutedEventArgs e)
        {
            Button     serviceVehicleButton = (Button)sender;
            Vehicle    vehicleItem          = serviceVehicleButton.DataContext as Vehicle;
            AddService addServiceWindow     = new AddService(vehicleItem.Id, vehicleItem.CarManufacture, vehicleItem.CarModel, vehicleItem.VehicleOdometer);

            addServiceWindow.Owner = this;
            addServiceWindow.WindowStartupLocation =
                WindowStartupLocation.CenterOwner;

            if (addServiceWindow.ShowDialog() == true)
            {
                UpdateStatus(5000, "Service Added");
                FillVehicleTable();
                UpdateStatus(50, "Ready...");
            }
            addServiceWindow.Close();
        }