private void ProfitsBtn_Click(object sender, RoutedEventArgs e) { try { ImpBL bl = ImpBL.Instance; double profits = bl.GetProfits(); profitsTextBox.Text = profits.ToString(); } catch (Exception err) { MessageBox.Show(err.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }