private void btnUpdateService_Click(object sender, RoutedEventArgs e)
        {
            if (gridServices.ActiveRecord != null)
            {
                DataRecord record = gridServices.ActiveRecord as DataRecord;
                int id = (int)record.Cells["ServiceId"].Value;

                Service service = servicesService.GetServiceById(id);

                UpdateServiceWindow updateServiceWindow = new UpdateServiceWindow(this.Owner, service);
                updateServiceWindow.Show();
            }
            else
            {
                MessageBox.Show("You must select a service to update.");
            }
        }
Exemple #2
0
		private static void UpdateService(object sender, ExecutedRoutedEventArgs e)
		{
			MainWindow mainWindow = (MainWindow)sender;

			if (mainWindow.ServicesScreen != null)
			{
				if (mainWindow.ServicesScreen.SelectedService != null)
				{
					UpdateServiceWindow updateServiceWindow = new UpdateServiceWindow(mainWindow, mainWindow.ServicesScreen.SelectedService);
					updateServiceWindow.Show();
				}
				else
				{
					MessageBox.Show("You must select a service first.");
				}
			}
		}