Пример #1
0
 public void coundowndo(object source, ElapsedEventArgs e)
 {
     this.Label1.Dispatcher.Invoke(
         new Action(
             delegate
     {
         String time   = Label1.Content.ToString();
         String[] t    = time.Split(':');
         String hour   = t[0];
         String minute = t[1];
         String second = t[2];
         if (second.Equals("00"))
         {
             if (minute.Equals("00"))
             {
                 if (hour.Equals("00"))
                 {
                     Window2 window2 = new Window2("考试结束");
                     window2.ShowDialog();
                 }
                 else
                 {
                     hour = (int.Parse(hour) - 1).ToString();
                     if (hour.Length == 1)
                     {
                         hour = "0" + hour;
                     }
                     second = "59";
                     minute = "59";
                 }
             }
             else
             {
                 minute = (int.Parse(minute) - 1).ToString();
                 if (minute.Length == 1)
                 {
                     minute = "0" + minute;
                 }
                 second = "59";
             }
         }
         else
         {
             second = (int.Parse(second) - 1).ToString();
             if (second.Length == 1)
             {
                 second = "0" + second;
             }
         }
         Label1.Content = hour + ":" + minute + ":" + second;
     }
             ));
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (index == 1)
     {
         Window2 window2 = new Window2("这已经是第一页");
         window2.ShowDialog();
     }
     else
     {
         index--;
         show();
     }
 }
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (index == cnt)
     {
         Window2 window2 = new Window2("这已经是最后一页");
         window2.ShowDialog();
     }
     else
     {
         index++;
         show();
     }
 }
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            String str = TextBox1.Text;
            Class1 a   = new Class1();

            ListView1.Items.Clear();
            if (a.isdigit(str) == true)
            {
                for (int i = 1; i <= cnt; i++)
                {
                    String name = testid[i];
                    for (int j = 0; j < name.Length; j++)
                    {
                        if (j + str.Length - 1 < name.Length && name.Substring(j, str.Length).Equals(str))
                        {
                            ListView1.Items.Add("考试号 " + name);
                            break;
                        }
                    }
                }
            }
            else
            {
                for (int i = 1; i <= cnt; i++)
                {
                    String name = testname[i];
                    for (int j = 0; j < name.Length; j++)
                    {
                        if (j + str.Length - 1 < name.Length && name.Substring(j, str.Length).Equals(str))
                        {
                            ListView1.Items.Add("考试名 " + name);
                            break;
                        }
                    }
                }
            }
            if (ListView1.Items.IsEmpty == true)
            {
                Window2 window2 = new Window2("无查询结果");
                window2.ShowDialog();
            }
        }
Пример #5
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (judge == 1)
     {
         state = 1;
         this.Close();
     }
     else if (judge == 0)
     {
         Class1 a = new Class1();
         a.killthread();
         this.Close();
         Window2 window2 = new Window2("关闭成功");
         window2.ShowDialog();
     }
     else if (judge == 2)
     {
         state = 2;
         this.Close();
     }
 }
Пример #6
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     saveanswer();
     if (Chosenindex == 0)
     {
         Window2 window2 = new Window2("这已经是第一题");
         window2.ShowDialog();
     }
     else if (Chosenindex > chosennum)
     {
         Chosenindex--;
         index = getsubindex();
         page7init();
     }
     else
     {
         Chosenindex--;
         index = getChosenindex();
         pageinit();
     }
 }
Пример #7
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     saveanswer();
     if (Chosenindex == chosennum + subnum - 1)
     {
         Window2 window2 = new Window2("这已经是最后题");
         window2.ShowDialog();
     }
     else if (Chosenindex >= chosennum - 1)
     {
         Chosenindex++;
         index = getsubindex();
         page7init();
     }
     else
     {
         Chosenindex++;
         index = getChosenindex();
         pageinit();
     }
 }
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     if (state[index] == 0)
     {
         Window2 window2 = new Window2("当前考试暂未开始");
         window2.ShowDialog();
     }
     else if (state[index] == 1)
     {
         Window2 window2 = new Window2("请再次确认您以关闭全部非法软件", 24);
         window2.ShowDialog();
         int    Time  = gettime();
         Class1 a     = new Class1();
         String state = a.getstudenttestsubmit(Studentid, testid[index]);
         if (state != null)
         {
             window2 = new Window2("您以交卷,无法考试", 34);
             window2.ShowDialog();
             return;
         }
         if (Time <= 0)
         {
             window2 = new Window2("您的考试时间已经用完");
             window2.ShowDialog();
             return;
         }
         //MessageBox.Show("fuck1");
         Page5 page5 = new Page5(testid[index], Time, testname[index], Studentid, chosennum[index], subjectnum[index], ref PageChange1);
         PageChange1.Content = new Frame()
         {
             Content = page5
         };
     }
     else if (state[index] == 2)
     {
         Window2 window2 = new Window2("当前考试已结束");
         window2.ShowDialog();
     }
 }
Пример #9
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Studentid = TextBox1.Text;
            Password  = PasswordBox1.Password;
            Class1 class1 = new Class1();

            if (class1.studentlogin(Studentid, Password) == true)
            {
                String str = "您已经进入检测状态,请不要打开使用任何浏览器及通讯软件,也不要试图做其他非法行动,我们会上报您的违规行为";
                MessageBox.Show(str, "在线考试系统提示");
                Page2 page2 = new Page2(ref PageChange1, Studentid);
                PageChange1.Content = new Frame()
                {
                    Content = page2
                };
            }
            else
            {
                Window2 window2 = new Window2("账号密码错误,请重新登录");
                window2.ShowDialog();
            }
        }
Пример #10
0
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     String[] str = TextBox2.Text.Split('/');
     try
     {
         int temp = int.Parse(str[0]);
         if (temp >= 1 && temp <= cnt)
         {
             index = temp;
         }
         else
         {
             Window2 window2 = new Window2("请输入1到" + cnt.ToString() + "页数范围");
             window2.ShowDialog();
         }
         show();
     }
     catch (Exception ee)
     {
         Window2 window2 = new Window2("请输入合法数字");
         window2.ShowDialog();
     }
 }