private void EditCommand_Executed(object sender, ExecutedRoutedEventArgs e) { //deep read the currently selected calibration LinearCalibration lc = LinearCalibration.GetAllLC("[IDCalibration] = " + ((LinearCalibration)cbLCSelection.SelectedItem).CalibrationID, true)?.Single(); CalibrationDataDialog cldDlg = new CalibrationDataDialog(ref lc); if (cldDlg.ShowDialog() == true) { try { lc.Update(); CALogger.WriteToLogFile(string.Format("Изменена калибровка ID{0};{1} - {2}", lc.CalibrationID, lc.Description, lc.CalibrationType.ToString())); FillData(); } catch (Exception ex) { MessageBox.Show(ex.Message + " в " + ex.Source, "Ошибка"); } } }