private void OpenTicketButton_Click(object sender, EventArgs e) { int selectedIndex = ResultGrid.CurrentCell.RowIndex; int ticketId = Convert.ToInt32(ResultGrid.Rows[selectedIndex].Cells["TicketIdCol"].Value); try { TicketRepository ticketRepo = new TicketRepository(); TicketResource ticketRes = ticketRepo.GetTicketByTicketID(ticketId); TicketAlterationRepository alterationRepo = new TicketAlterationRepository(); TicketAlterationResource alterationRes = alterationRepo.GetAlterationsByTicketId(ticketId); AlterationForm alterationForm = new AlterationForm(ticketRes, alterationRes); alterationForm.Show(); } catch (Exception ex) { MessageBox.Show("There was an error. Please contact Jay with this message: " + ex.Message); } //TODO get Neil's feedback on what behavior he prefers //this.Close(); }