Example #1
0
        private void Form_Game_FormClosing(object sender, FormClosingEventArgs e)
        {
            DataSet_AccountsTableAdapters.QueriesTableAdapter queriesTableAdapter = new DataSet_AccountsTableAdapters.QueriesTableAdapter();

            int scorActual = (int)queriesTableAdapter.GetScore(Id_User);

            queriesTableAdapter.UpdateScore(scorActual + Score, Id_User);
            queriesTableAdapter.Update_NrGaini(scorActual + Score, Id_User);

            int numarSageti = (int)queriesTableAdapter.Get_NrSageti(Id_User);

            queriesTableAdapter.Update_NrSageti(numarSageti + (3 - nrSageti), Id_User);

            int ScoreMaxim = (int)queriesTableAdapter.Get_ScoreMax(Id_User);

            if (Score > ScoreMaxim)
            {
                queriesTableAdapter.Update_ScoreMax(Score, Id_User);
            }

            form_Start.Show();

            timer_Arrow.Stop();
            timer_Chicken.Stop();
            timer_Disappear.Stop();

            //actualizeaza scor
        }
Example #2
0
        public Form_Lobby(Form form, int Id_User)
        {
            InitializeComponent();;

            this.Id_User = Id_User;

            form_Login = form;

            queriesTableAdapter = new DataSet_AccountsTableAdapters.QueriesTableAdapter();

            Punctaj  = (int)queriesTableAdapter.GetScore(Id_User);
            UserName = queriesTableAdapter.GetUserName(Id_User);

            label_Salut.Text = "Bine ai revenit " + UserName + "!";

            label_Salut.Location = new Point((Width - label_Salut.Width) / 2, label_Salut.Location.Y);
        }