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) { } } }); }
private void butAddService_Click(object sender, EventArgs e) { AddService add = new AddService(); this.Hide(); add.ShowDialog(); this.Show(); }
/// <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(); }
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(); }