Пример #1
0
        private void Result()
        {
            if (isEnded)
            {
                Close();
                return;
            }

            isEnded = true;

            SQLData.Q1               = KettelTest.GetAnswer(KettelTest.Type.Q1);
            SQLData.B                = KettelTest.GetAnswer(KettelTest.Type.B);
            SQLData.Q3               = KettelTest.GetAnswer(KettelTest.Type.Q3);
            SQLData.Q4               = KettelTest.GetAnswer(KettelTest.Type.Q4);
            SQLData.math_result      = MathematicalTest.GetAnswer();
            SQLData.math_time        = MathematicalTest.GetBonusTime();
            SQLData.memory_count     = MemoryTest.GetAnswer();
            SQLData.encryption_count = EncryptionTest.answersCount;
            SQLData.miss_count       = MissingDetailsTest.GetAnswer();

            SQLScripts.SetAnswers();
            SQLScripts.RemoveUser();
            this.Size = new Size(900, 700);

            ResultView view = new ResultView();

            view.AddElement();
            view.AlignX();
            missingDetailsElement?.Hide();
            AlignElements();
        }
Пример #2
0
        private void Login()
        {
            if (!isLoginStarted)
            {
                loginLabel          = new Label();
                loginLabel.Text     = "Введите номер данный вам преподавателем";
                loginLabel.AutoSize = true;
                Controls.Add(loginLabel);
                loginLabel.Location = new Point((Size.Width - loginLabel.Width) / 2, 40);

                loginTextBox = new TextBox();
                Controls.Add(loginTextBox);
                loginTextBox.Size     = new Size(180, 17);
                loginTextBox.Location = new Point((Size.Width - loginTextBox.Width) / 2, 80);
                isLoginStarted        = true;
            }
            else
            {
                if (SQLScripts.VerifyUser(loginTextBox.Text.ToLower()))
                {
                    errorLabel.Visible = false;

                    SQLData.user_name = loginTextBox.Text;
                    IncreaseIterator();
                }
                else
                {
                    errorLabel.Visible  = true;
                    errorLabel.Text     = "Такого пользователя не существует!";
                    errorLabel.Location = new Point((Size.Width - errorLabel.Size.Width) / 2, errorLabel.Location.Y);
                }
            }
        }
Пример #3
0
 private static void Main(string[] args)
 {
     if (!addMode)
     {
         JsonMaker.CreateKettelJson();
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         mainForm = new MainWindow();
         Application.Run(mainForm);
     }
     else
     {
         SQLScripts.AddUsersScript();
     }
 }