コード例 #1
0
        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.");
            }
        }
コード例 #2
0
ファイル: Commands.cs プロジェクト: chantsunman/Scutex
		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.");
				}
			}
		}