Пример #1
0
        private void btnSequence_Click(object sender, EventArgs e)
        {
            FormSimulation _simulaForm = FormMain.m_formSimulation;

            //List<Question> list = QuestionManager.GenQuestionBySkill(SkillId);
            List <Question> list = QuestionManager.GenQuestionFromRelation(g_ChapterId, g_Relation_Question_List);

            if (g_ChapterId != g_FirstChapterId)
            {
                if (!LicenseHelper.IsValid())
                {
                    if (DialogResult.Yes == MessageBox.Show("此章节需要升级为授权用户用方能使用,是否打开授权界面?", "授权提示", MessageBoxButtons.YesNo))
                    {
                        FormLicence form = new FormLicence();
                        form.ShowDialog();
                        if (!LicenseHelper.IsValid())
                        {
                            return;
                        }
                    }
                    else
                    {
                        return;
                    }
                }
            }


            int count = list.Count;

            if (count == 0)
            {
                MessageBox.Show("此章节下面没绑定题目,请重新选择!", "提示信息", MessageBoxButtons.OK);
                return;
            }

            list.Sort();
            _simulaForm.SetQuestions(list, false);

            _simulaForm.SetShowType(1);
            _simulaForm.ResetControlsInfo(Math.Min(count, 100));


            _simulaForm.Show();
        }