private void Button_Click_Delete(object sender, RoutedEventArgs e) { if (fbpresenter == null) { MessageBox.Show("Не подключена база данных", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); } else { SetCurrentlySelectedObject(); if (ObjectForOperation != null) { DataBaseResultRequest?.Invoke(((Button)sender).Content.ToString()); } } }
private void Button_Click_Save(object sender, RoutedEventArgs e) { if (fbpresenter == null) { MessageBox.Show("Не подключена база данных", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); } else { SaveFileDialog saveFileDialog = new SaveFileDialog() { Filter = "Database file (*.mbf)|*.mdf" }; //var result = saveFileDialog.ShowDialog(); //string path = result.Value(); if (saveFileDialog.ShowDialog() == true) { pathForDB = saveFileDialog.FileName; DataBaseResultRequest?.Invoke(((Button)sender).Content.ToString()); } } fbpresenter = null; }
public void CallEventDB(string mode) { DataBaseResultRequest?.Invoke(mode); }