private void ClickVerify(object sender, RoutedEventArgs e)
        {
            if (TextBoxNumPad.Text.Length != 4)
            {
                MessageBox.Show("Incorrect pin");
                return;
            }

            //Calls method VerifyPin, which returns true or false.
            //If it returns true, continues program. If false, displays error message

            string pinCode = TextBoxNumPad.Text;

            if (controller.VerifyPin(pinCode) == true)
            {
                MoodWindow moodWindow = new MoodWindow();
                moodWindow.GetController(controller);
                moodWindow.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Wrong PinCode BITCH");
                TextBoxNumPad.Text = "";
                UpdateCircles();
            }
        }
예제 #2
0
        public void UpdateCircles()
        {
            switch (TextBoxNumPad.Text.Length)
            {
            case 1:
                Ellipse1.Style = (Style)FindResource("FilledEllipse");
                Ellipse2.Style = (Style)FindResource("EmptyEllipse");
                Ellipse3.Style = (Style)FindResource("EmptyEllipse");
                Ellipse4.Style = (Style)FindResource("EmptyEllipse");
                break;

            case 2:
                Ellipse1.Style = (Style)FindResource("FilledEllipse");
                Ellipse2.Style = (Style)FindResource("FilledEllipse");
                Ellipse3.Style = (Style)FindResource("EmptyEllipse");
                Ellipse4.Style = (Style)FindResource("EmptyEllipse");
                break;

            case 3:
                Ellipse1.Style = (Style)FindResource("FilledEllipse");
                Ellipse2.Style = (Style)FindResource("FilledEllipse");
                Ellipse3.Style = (Style)FindResource("FilledEllipse");
                Ellipse4.Style = (Style)FindResource("EmptyEllipse");
                break;

            case 4:
                Ellipse1.Style = (Style)FindResource("FilledEllipse");
                Ellipse2.Style = (Style)FindResource("FilledEllipse");
                Ellipse3.Style = (Style)FindResource("FilledEllipse");
                Ellipse4.Style = (Style)FindResource("FilledEllipse");

                //The password has been entered.
                //Verify it here
                //Then:
                MoodWindow moodWindow = new MoodWindow();
                moodWindow.Show();
                this.Close();
                break;
            }
        }