/// <summary> /// Handles the assign card button click and prompts /// for a card. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">An EventArgs object that contains the /// event data.</param> private void AssignCardClick(object sender, EventArgs e) { // PDTS 1064 GTI.Modules.Shared.MagCardForm magForm = new GTI.Modules.Shared.MagCardForm(m_displayMode, m_parent.MagCardReader); if (magForm.ShowDialog() == DialogResult.OK) { // m_magCardImageLabel.Text = magForm.MagCardNumber; m_magCard.Text = magForm.MagCardNumber; m_dataChanged = true; } }
/// <summary> /// Handles the search by card button click. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">An EventArgs object that contains the /// event data.</param> private void SearchByCardClick(object sender, EventArgs e) { // PDTS 1064 GTI.Modules.Shared.MagCardForm magForm = new GTI.Modules.Shared.MagCardForm(m_parent.MagCardReader); magForm.ClearCardButtonVisible = false; if (magForm.ShowDialog() == DialogResult.OK) { // Remove the previous results. m_resultsList.Items.Clear(); // Spawn a new thread to find players and wait until done. // FIX: DE2476 m_parent.FindPlayers(magForm.MagCardNumber, string.Empty, string.Empty); m_parent.ShowWaitForm(this); // Block until we are done. // END: DE2476 if (m_parent.LastAsyncException != null) { if (m_parent.LastAsyncException is ServerCommException) { m_parent.ServerCommFailed(); } else { MessageForm.Show(m_parent.LastAsyncException.Message); } } else { // Add the player(s) to the result list. PlayerListItem[] players = m_parent.LastFindPlayersResults; if (players != null && players.Length > 0) { m_resultsList.Items.AddRange(players); m_resultsList.SelectedIndex = 0; // Rally DE1889 - If only one player, automatically select. if (m_resultsList.Items.Count == 1) { m_selectPlayerButton.PerformClick(); } } else { MessageForm.Show(Properties.Resources.InfoPlayerNotFound, Properties.Resources.PlayerCenterName); } } } }