Exemple #1
0
        // It use to make it draggable. //
        #endregion

        private void TopUpToPlayer()
        {
            PlayerDataBaseControl.Load();

            PointCardDataBaseControl.pointCardID = txtPointCardID.Text;
            PointCardDataBaseControl.Load();

            int beforeGoldCoins = int.Parse(PlayerDataBaseControl.GetData("PlayerGoldCoins"));
            int newGoldCoins    = beforeGoldCoins + PointCardDataBaseControl.goldCoins;

            PlayerDataBaseControl.Updata_PlayerGoldCoins(newGoldCoins);

            PointCardDataBaseControl.Updata_Status("Actived");

            TopUpHistoryDataBaseControl.topUpDate = DateTime.Now.ToString("dd/MM/yyyy");
            TopUpHistoryDataBaseControl.Insert();

            MessageBox.Show("Top " + txtPointCardID.Text + " to " + PlayerDataBaseControl.playerAccountName + "(" + PlayerDataBaseControl.playerID + ")" + " Success.\n" +
                            "\n" +
                            "The Point Card retail value is          " + PointCardDataBaseControl.retailValue + ".\n" +
                            "The Point Card gold coins value is " + PointCardDataBaseControl.goldCoins + ".\n" +
                            "\n" +
                            "The PlayerGoldCoins of " + txtPlayerAccountName.Text + " from " + beforeGoldCoins + " to " + newGoldCoins + ".");

            txtPlayerID.Text          = "";
            txtPlayerAccountName.Text = "";
            txtPointCardID.Text       = "";
        }
        private void RefreshPage()
        {
            PointCardDataBaseControl.Load();

            lblPointCardIDOutput.Text          = PointCardDataBaseControl.pointCardID;
            lblRetailValueOutput.Text          = PointCardDataBaseControl.retailValue.ToString();
            lblGoldCoinsOutput.Text            = PointCardDataBaseControl.goldCoins.ToString();
            lblStatusOutput.Text               = PointCardDataBaseControl.status;
            lblGenerationDateOutput.Text       = PointCardDataBaseControl.generationDate;
            lblRemainLuckyDrawTimesOutput.Text = PointCardDataBaseControl.remainLuckyDrawTimes.ToString();
        }