/// <summary> /// Handles the select button being pressed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Select_Button_Click(object sender, EventArgs e) { // Checks if nothing is selected or if the window is already open if (DataTable.SelectedRows.Count <= 0) { return; } else if (editWindow.Visible) { editWindow.Focus(); } else { try { Console.Write("Opening claim " + GetCellData("clmClaimNumber") + "..."); if (editWindow.IsDisposed) { editWindow = new EditWindow(); } Console.WriteLine("...Done"); editWindow.ShowDialog(); Console.Write("Closing claim " + GetCellData("clmClaimNumber") + "..."); editWindow.Dispose(); Console.WriteLine("...Done"); } catch (Exception ex) { Console.WriteLine("...Failed"); string errorMsg = ((ex.InnerException == null) ? ex.Message : ex.InnerException.Message) + Environment.NewLine + ex.StackTrace; MessageBox.Show(errorMsg, "Error"); Console.WriteLine(errorMsg); } } }
/// <summary> /// Handles the select button being pressed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Select_Button_Click(object sender, EventArgs e) { // Checks if nothing is selected or if the window is already open if (DataTable.SelectedRows.Count <= 0) return; else if (editWindow.Visible) editWindow.Focus(); else { try { Console.Write("Opening claim " + GetCellData("clmClaimNumber") + "..."); if (editWindow.IsDisposed) editWindow = new EditWindow(); Console.WriteLine("...Done"); editWindow.ShowDialog(); Console.Write("Closing claim " + GetCellData("clmClaimNumber") + "..."); editWindow.Dispose(); Console.WriteLine("...Done"); } catch (Exception ex) { Console.WriteLine("...Failed"); string errorMsg = ((ex.InnerException == null) ? ex.Message : ex.InnerException.Message) + Environment.NewLine + ex.StackTrace; MessageBox.Show(errorMsg, "Error"); Console.WriteLine(errorMsg); } } }