Example #1
0
 private void btnCategory_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     //CategoryGameForm
 }
Example #2
0
 private void btnCBack_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     ReturnToMenu();
 }
Example #3
0
 private void btnAdmin_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     //AdminForm aform = new AdminForm(volume , UserName);
     //aform.Show();
 }
Example #4
0
        private void btnLevel_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }

            //LevelGameForm
        }
Example #5
0
 private void btnExitGame_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     exitGame     = true;
     DialogResult = DialogResult.OK;
 }
 private void btnClose_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     this.Close();
     Cform.Show();
 }
Example #7
0
 private void btnAnswer_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     answer       = true;
     DialogResult = DialogResult.OK;
 }
Example #8
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     MusicManagers.playSound();
     if (cbUsers.SelectedItem != null)
     {
         if (Admin && cbUsers.SelectedItem.ToString() != "Admin")
         {
             Admin = false;
             Controls.Remove(Password);
             Password.Text    = "";
             cbUsers.Location = new Point(104, 224);
             Menu mainForm = new Menu(cbUsers.SelectedItem.ToString(), this);
             mainForm.Show();
             this.Hide();
             return;
         }
         if (!Admin)
         {
             if (cbUsers.SelectedItem.ToString() == "Admin")
             {
                 Admin             = true;
                 cbUsers.Location  = new Point(cbUsers.Location.X, cbUsers.Location.Y - 40);
                 Password.Location = new Point(cbUsers.Location.X, cbUsers.Location.Y + 40);
                 Password.Height   = 31;
                 Password.Width    = 240;
                 Password.Font     = new Font("Candara", 14, FontStyle.Regular);
                 Controls.Add(Password);
             }
             else
             {
                 Menu mainForm = new Menu(cbUsers.SelectedItem.ToString(), this);
                 mainForm.Show();
                 this.Hide();
             }
         }
         else
         {
             if (Password.Text == pass)
             {
                 Menu mainForm = new Menu("Admin", this);
                 Admin = false;
                 Controls.Remove(Password);
                 Password.Text    = "";
                 cbUsers.Location = new Point(104, 224);
                 mainForm.Show();
                 this.Hide();
             }
             else
             {
                 InfoForm iform = new InfoForm("Неверный пароль!", true);
                 iform.ShowDialog();
                 Password.Text = "";
             }
         }
     }
 }
Example #9
0
        private void btnRegistration_Click(object sender, EventArgs e)
        {
            MusicManagers.playSound();
            Registration reg = new Registration();

            reg.ShowDialog();
            UserManager userManager = new UserManager();

            cbUsers.DataSource = userManager.GetList().Select(u => u.Login).ToList();
        }
Example #10
0
        private void btnCookBook_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }
            CategoriesForm cform = new CategoriesForm(int.Parse(lbUserLevel.Text.Split(' ')[1]), this, volume);

            cform.Show();
            this.Hide();
        }
Example #11
0
        private void btnGame_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }
            GameForm gForm = new GameForm(int.Parse(lbUserLevel.Text.Split(' ')[1]), this, UserName, volume);

            gForm.Show();
            this.Hide();
        }
Example #12
0
 private void btnUserChange_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     auth.GetUsers();
     auth.Show();
     closing = true;
     this.Close();
 }
Example #13
0
        private void btnAgain_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }
            Random        rnd   = new Random();
            List <string> words = CorrectOrder.OrderBy(i => rnd.Next()).ToList();

            UserWords.Clear();
            lbWords.Items.Clear();
            Counter = 0;
            for (int i = 0; i < words.Count; i++)
            {
                lbWords.Items.Add(words[i]);
            }
            lbWords.SelectedIndex = -1;
        }
Example #14
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }
            TestManager testManager = new TestManager(false);

            if (Counter != CorrectOrder.Count && Counter != 100)
            {
                InfoForm iform = new InfoForm("Остались незаполненные слова!", volume);
                iform.Show();
                return;
            }
            else
            {
                answer = true;
                right  = testManager.CheckIsUserRight(UserWords, CorrectOrder);
            }
            DialogResult = DialogResult.OK;
        }
Example #15
0
        private void btnRandom_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }
            RecipeManager recipesManager = new RecipeManager();
            List <Recipe> recipes        = recipesManager.GetList();
            List <int>    indexes        = new List <int>();

            for (int i = 0; i < recipes.Count; i++)
            {
                if (recipes[i].Level > Level)
                {
                    recipes.RemoveAt(i);
                    i--;
                }
                else
                {
                    indexes.Add(i);
                }
            }
            //TestManager
        }
Example #16
0
 //test nado
 private void btnAgain_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     lbIngreds.Items.Clear();
     //test sdelat
     lbRecipeIngreds.Items.Clear();
     countWrong = indexes.Count;
     for (int i = 0; i < indexes.Count; i++)
     {
         RecipeIngredients[indexes[i]] = "__________";
     }
     for (int i = 0; i < RecipeIngredients.Count; i++)
     {
         lbRecipeIngreds.Items.Add(RecipeIngredients[i]);
     }
     for (int i = 0; i < RecipeIngredients.Count; i++)
     {
         lbIngreds.Items.Add(Ingredients[i]);
     }
     lbIngreds.SelectedIndex = -1;
 }