private void TicketListGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { var row = TicketListGridView.CurrentRow; if (row != null) { var id = (int)(row.Cells[0].Value); var ticketDetailsForm = new TicketDetails(id); ticketDetailsForm.FormClosed += new FormClosedEventHandler(ob_FormClosed); ticketDetailsForm.Show(this); } }
private void UpdateTicketStatus(string ticketNumber) { logger.logMessage(string.Format("Ticket {0} scanned", ticketNumber), LogLevel.message); var scannedTicket = new ScannedTicket(ticketNumber, currentSystemInformation); var ticketMarked = new Business.TicketConfirmerService(logger).ConfirmArrival(scannedTicket); var userMessage = new StringBuilder(); LabelLastScanned.Text = ticketMarked.TicketNumber; labelLastScannedTable.Text = ticketMarked.TableNumber.HasValue ? ticketMarked.TableNumber.Value.ToString() : "No Table"; if (ticketMarked.StatusOfScan == TicketScannedStatus.Ok) { Console.WriteLine(ticketNumber); if (ticketMarked.TicketNotPaid) { var ticketDetailsForm = new TicketDetails(ticketMarked.TicketId, "This ticket is not paid for, Please collect money"); ticketDetailsForm.FormClosed += new FormClosedEventHandler(ob_FormClosed); ticketDetailsForm.Show(this); } SimpleTicketNumberTextBox.Clear(); ScannerTabPage.BackColor = Color.LightGreen; //ScannedTextBoxInError = false; } else { if (ticketMarked.StatusOfScan == TicketScannedStatus.TicketAlreadyScanned) { SimpleTicketNumberTextBox.SelectAll(); ScannerTabPage.BackColor = Color.Red; //ScannedTextBoxInError = true; MessageBox.Show(ticketMarked.TicketScannedMessage); } else { SimpleTicketNumberTextBox.SelectAll(); ScannerTabPage.BackColor = Color.Red; //ScannedTextBoxInError = true; MessageBox.Show("Ticket not found."); } } }