Пример #1
0
        private void acceptImageButton_Click(object sender, EventArgs e)
        {
            if (CardNumber != string.Empty)
            {
                m_playercenterThirdPartyInterface.GetPlayer(CardNumber);
            }
            else
            {
                m_playercenterThirdPartyInterface.StartGetPlayer(PlayerId);
            }


            if (!string.IsNullOrEmpty(txtbxPointsAwarded.Text))
            {
                try
                {
                    PointsAwarded = 0M;
                    decimal tempManualPlayerPoints = 0;
                    decimal.TryParse(txtbxPointsAwarded.Text, out tempManualPlayerPoints);

                    if (tempManualPlayerPoints == 0)
                    {
                        return; //nothing to do
                    }
                    IsPointsAwardedSuccess = false;

                    string reasonMessage       = "Manual point award for player " + lblPlayerNameIndicator.Text + " (ID = " + m_playercenterThirdPartyInterface.PlayerSelected.Id.ToString() + ") for " + tempManualPlayerPoints.ToString() + " point(s). Reason: " + (string.IsNullOrWhiteSpace(txtManualPointAdjustReason.Text)? "None" : txtManualPointAdjustReason.Text);
                    SetPlayerPointsAwarded msg = new SetPlayerPointsAwarded(PlayerId, tempManualPlayerPoints, reasonMessage);

                    msg.Send();

                    if (msg.ReturnCode == (int)GTIServerReturnCode.Success)
                    {
                        IsPointsAwardedSuccess = true;
                        PointsAwarded          = tempManualPlayerPoints;
                        MessageForm.Show(Resources.InfoPointsAwardSuccessed, Resources.PlayerCenterName);
                    }
                }
                catch
                {
                    MessageForm.Show(Resources.InfoPointsAwardFailed, Resources.PlayerCenterName);
                }
            }

            //DialogResult = DialogResult.OK;
            Close();
        }
Пример #2
0
        /// <summary>
        /// Handles the find player 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 FindPlayerClick(object sender, EventArgs e)
        {
            personalInfoGroupBox.Text = "Personal Information";

            if (ChkDataChange())
            {
                MCPFindPlayerForm findForm = new MCPFindPlayerForm(m_parent);
                Application.DoEvents();

                if (findForm.ShowDialog(this) == DialogResult.OK)
                {
                    if (
                        GetThisStaffPermissionToAwardPoints() &&
                        m_parent.Settings.ThirdPartyPlayerInterfaceUsesPIN &&
                        m_parent.Settings.ThirdPartyPlayerInterfaceID != 0 &&
                        findForm.SelectedPlayer.PlayerCardPINError == true
                        )
                    {
                        SetPlayerCenterThirdPartyInterfaceNewValue(findForm.SelectedPlayer);
                        m_playerCenterThirdPartyInterface.UICurrent = this;
                        m_playerCenterThirdPartyInterface.GetPlayer(findForm.SelectedPlayer.PlayerCard);
                        Application.DoEvents();
                    }

                    Application.DoEvents();
                    m_player = findForm.SelectedPlayer;
                    SetPlayerValues(false);//RALLY DE8358
                    m_dataChanged = false;

                    if (m_player != null && GetThisStaffPermissionToAwardPoints())
                    {
                        if (!m_isManualAwardPointsEnable)
                        {
                            ShowManualAwardPointsButton(true);
                        }
                    }
                }
            }

            GC.Collect(); // DE2476 - Try to clean up memory after a player is saved and reloaded.
        }