예제 #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            AddService addService = new AddService();

            addService.newAuto = car;
            addService.ShowDialog();
        }
        public ServiceMatrixDiagramViewModel(ServiceMatrixDiagramAdapter adapter)
        {
            this.Adapter = adapter;
            this.Diagram = adapter.ViewModel;
            IsServiceMatrixLicenseExpired = !GlobalSettings.Instance.IsLicenseValid;

            this.OnShowAddEndpoint = new RelayCommand(() => {
                var window = new AddEndpoint();
                var result = window.ShowDialog();

                if ((result.HasValue ? result.Value : false) && !String.IsNullOrEmpty(window.EndpointName.Text))
                {
                    try
                    {
                        this.Adapter.AddEndpoint(window.EndpointName.Text, window.EndpointHostType.SelectedValue.ToString());
                    }
                    catch (OperationCanceledException) { }
                }
            });

            this.OnShowAddService = new RelayCommand(() =>
            {
                var window = new AddService();
                var result = window.ShowDialog();

                if ((result.HasValue ? result.Value : false) && !String.IsNullOrEmpty(window.ServiceName.Text))
                {
                    try
                    {
                        this.Adapter.AddService(window.ServiceName.Text);
                    }
                    catch (OperationCanceledException) { }
                }
            });
        }
예제 #3
0
        private void butAddService_Click(object sender, EventArgs e)
        {
            AddService add = new AddService();

            this.Hide();
            add.ShowDialog();

            this.Show();
        }
예제 #4
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();
        }
예제 #5
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            int Count = 0;

            if (dgvDichVu.RowCount > 1)
            {
                for (int i = 0; i <= dgvDichVu.RowCount; i++)
                {
                    Count++;
                }
            }

            using (AddService add = new AddService(Count))
            {
                add.ShowDialog();
            }
            dgvDichVu.DataSource = GetAll();
            BindingData();
        }