Ejemplo n.º 1
0
        private void frmBlockDrop_Load(object sender, EventArgs e)
        {
            this.KeyPreview = false;
            GetDataTbBlockDrop();
            SetTextLabelMain();
            Db.Connection();
            UseName         = Db.GetAcountUsing(Db.Connec);
            lblUseName.Text = UseName;
            MaxPoint        = Db.MaxScoreBlockDrop(Db.Connec, UseName);
            if (MaxPoint >= 10)
            {
                lblMaxPoint.Text = MaxPoint + "";
            }

            else
            {
                lblMaxPoint.Text = "0" + MaxPoint;
            }
            lbl1.Visible       = false;
            lbl2.Visible       = false;
            lbl3.Visible       = false;
            lbl4.Visible       = false;
            lbl5.Visible       = false;
            lbl6.Visible       = false;
            lbl7.Visible       = false;
            lblMain.Visible    = false;
            btnChoi.Visible    = true;
            btnChoiLai.Visible = false;
        }
Ejemplo n.º 2
0
        private void frmScore_Load(object sender, EventArgs e)
        {
            Db.Connection();

            UseName = Db.GetAcountUsing(Db.Connec);

            lblUseName.Text = Db.GetAcountUsing(Db.Connec);

            if (Db.MaxScoreCharFallOut(Db.Connec, UseName) >= 10)
            {
                lblMaxPointCharFallOut.Text = Db.MaxScoreCharFallOut(Db.Connec, UseName).ToString();
            }
            else
            {
                lblMaxPointCharFallOut.Text = "0" + Db.MaxScoreCharFallOut(Db.Connec, UseName).ToString();
            }

            if (Db.MaxScoreEggDrop(Db.Connec, UseName) >= 10)
            {
                lblMaxPointEggDrop.Text = Db.MaxScoreEggDrop(Db.Connec, UseName).ToString();
            }
            else
            {
                lblMaxPointEggDrop.Text = "0" + Db.MaxScoreEggDrop(Db.Connec, UseName).ToString();
            }

            if (Db.MaxScoreFlappyBird(Db.Connec, UseName) >= 10)
            {
                lblMaxPointFlappyBird.Text = Db.MaxScoreFlappyBird(Db.Connec, UseName).ToString();
            }

            else
            {
                lblMaxPointFlappyBird.Text = "0" + Db.MaxScoreFlappyBird(Db.Connec, UseName).ToString();
            }

            if (Db.MaxScoreBlockDrop(Db.Connec, UseName) >= 10)
            {
                lblMaxPointBlockDrop.Text = Db.MaxScoreBlockDrop(Db.Connec, UseName).ToString();
            }

            else
            {
                lblMaxPointBlockDrop.Text = "0" + Db.MaxScoreBlockDrop(Db.Connec, UseName).ToString();
            }

            if (Db.MaxScoreTypingTest(Db.Connec, UseName) >= 10)
            {
                lblFastestSpeedTestPractice.Text = Db.MaxScoreTypingTest(Db.Connec, UseName).ToString();
            }

            else
            {
                lblFastestSpeedTestPractice.Text = "0" + Db.MaxScoreTypingTest(Db.Connec, UseName).ToString();
            }

            int MaxSpeed = Db.MaxScoreSpeedTestABC(Db.Connec, UseName);

            if (MaxSpeed >= 60)
            {
                lblMaxMinuteTestABC.Text = "0" + (MaxSpeed / 60);
                if (MaxSpeed % 60 >= 10)
                {
                    lblMaxSecondTestABC.Text = (MaxSpeed % 60).ToString();
                }

                else
                {
                    lblMaxSecondTestABC.Text = (MaxSpeed % 60) + "0";
                }
            }

            else
            {
                lblMaxMinuteTestABC.Text = "00";
                if (MaxSpeed >= 10)
                {
                    lblMaxSecondTestABC.Text = MaxSpeed.ToString();
                }

                else
                {
                    lblMaxSecondTestABC.Text = MaxSpeed + "0";
                }
            }

            Db.Connec.Close();
        }