コード例 #1
0
 private void CreateTestButton_Click(object sender, RoutedEventArgs e)
 {
     if (TestName.Text != "")
     {
         if (themeId != -1)
         {
             int  num1;
             bool isNum = int.TryParse(TestTime.Text, out num1);
             if (TestTime.Text != "" && isNum != false)
             {
                 int min = int.Parse(TestTime.Text);
                 time = new DateTime(2020, 5, 24, 01, min, 00);
                 DTOTest test = new DTOTest()
                 {
                     TestName = TestName.Text, TestTime = time, MixQuestionsOrder = mixQuestionOrder, MixAnswersOrder = mixAnswersOrder, ThemeId = themeId
                 };
                 client.AddTest(test);
                 main.Content = new AdminTests(client, mw, main);
             }
             else
             {
                 MessageBox.Show("Please, enter correct test time!!!");
             }
         }
         else
         {
             MessageBox.Show("Please select test theme!!!");
         }
     }
     else
     {
         MessageBox.Show("Please enter name!!!");
     }
 }