Esempio n. 1
0
        private void btnReturnLogin_Click(object sender, EventArgs e)
        {
            DialogResult result = PublicClass.ShowMessageOKCancel("确定要返回主窗体吗?");

            if (result == DialogResult.OK)
            {
                //删除考生试卷
                PublicClass.SowerExamPlugn.foDeleteFolder(PublicClass.StudentDir);

                frmBusicWorkMain busicWorkMain = new frmBusicWorkMain();
                busicWorkMain.Show();
                this.Close();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 为下一步考试检查考试环境
        /// </summary>
        /// <returns></returns>
        private bool ShowForm()
        {
            //检查环境
            CheckEnvironment();

            #region 配置SQL服务器相关参数
            if (bSQlCheckPassed == false)
            {
                sbCheckResult.AppendFormat("\n\n其中包括为正确指定SQL服务器相关参数,是否立即对此进行配置?");

                DialogResult dialogResult = PublicClass.ShowMessageOKCancel(sbCheckResult.ToString());
                if (dialogResult == DialogResult.OK)
                {
                    //检测和设置数据库连通性
                    if (CheckSqlConnect())
                    {
                        bSQlCheckPassed = true;
                        bAllCheckPassed = true;
                        sbCheckResult.Clear();
                        checkResult.Clear();
                    }
                    else
                    {
                        //删除考生试卷
                        PublicClass.SowerExamPlugn.foDeleteFolder(PublicClass.StudentDir);
                        frmBusicWorkMain busicWorkMain = new frmBusicWorkMain();
                        busicWorkMain.Show();
                        this.Close();
                        return(false);
                    }
                }
                else
                {
                    //删除考生试卷
                    PublicClass.SowerExamPlugn.foDeleteFolder(PublicClass.StudentDir);
                    frmBusicWorkMain busicWorkMain = new frmBusicWorkMain();
                    busicWorkMain.Show();
                    this.Close();
                    return(false);
                }
            }
            else
            {
                bAllCheckPassed = true;
                sbCheckResult.Clear();
                checkResult.Clear();
            }
            #endregion

            //考试时如需要指定账套起始日期(用友财务类科目),进行系统日期检测
            CheckSystemTime();
            //检查环境
            CheckEnvironment();

            #region 题库
            if (PublicClass.JobType == JobType.TiKu)
            {
                if (!bAllCheckPassed)
                {
                    sbCheckResult.AppendFormat("\n\n如果要继续考试(会影响答题和评分)请按[确定];退出考试请按[取消]。");
                    DialogResult result = PublicClass.ShowMessageOKCancel(sbCheckResult.ToString());
                    if (result == DialogResult.OK)
                    {
                        bAllCheckPassed = true;
                    }
                    else
                    {
                        //删除考生试卷
                        PublicClass.SowerExamPlugn.foDeleteFolder(PublicClass.StudentDir);
                        frmBusicWorkMain busicWorkMain = new frmBusicWorkMain();
                        busicWorkMain.Show();
                        this.Close();
                        return(false);
                    }
                }
                else
                {
                    bAllCheckPassed = true;
                }
            }
            #endregion

            #region 作业
            if (PublicClass.JobType == JobType.ShiJuan)
            {
                if (!bAllCheckPassed)
                {
                    sbCheckResult.AppendFormat("\n如果要继续考试(会影响答题和评分)请按[确定];退出考试请按[取消]。");
                    DialogResult result = PublicClass.ShowMessageOKCancel(sbCheckResult.ToString());
                    if (result == DialogResult.OK)
                    {
                        bAllCheckPassed = true;
                    }
                    else
                    {
                        //删除考生试卷
                        PublicClass.SowerExamPlugn.foDeleteFolder(PublicClass.StudentDir);
                        frmBusicWorkMain busicWorkMain = new frmBusicWorkMain();
                        busicWorkMain.Show();
                        this.Close();
                        return(false);
                    }
                }
                else
                {
                    bAllCheckPassed = true;
                }
            }
            #endregion

            return(bAllCheckPassed);
        }