public void SetChapterType(int chapterType)
        {
            g_ChapterType = chapterType;
            switch (g_ChapterType)
            {
            case 1:
                lblInfo.Text         = "技巧练习--专业的技巧助您快速掌握答题技巧";
                this.picHeader.Image = global::DirvingTest.Properties.Resources.edit_group;
                ChapterManager.GetChapterList((int)chapterType, out chapterList);
                //chapterList = ModelManager.m_DicSkillList;
                //g_Relation_Question_List = QuestionManager.m_Relation_Question_Skill;
                lblClearQuestions.Visible = false;
                break;

            case 2:
                lblInfo.Text = "套题练习--专业的题库分类助您快速掌握相关题型";
                ChapterManager.GetChapterList((int)chapterType, out chapterList);
                //chapterList = ModelManager.m_DicBankList;
                //g_Relation_Question_List = QuestionManager.m_Relation_Question_Suite;
                lblClearQuestions.Visible = false;
                break;

            case 3:
                lblInfo.Text = "错题练习--强化练习容易错误的题目,帮助更好通过考试。";
                ChapterManager.GetChapterList((int)chapterType, out chapterList);
                lblClearQuestions.Visible = true;
                //chapterList = ModelManager.m_DicIntensifyList;
                //g_Relation_Question_List = QuestionManager.m_Relation_Question_Intensity;
                break;
            }
        }
        public FormChapterAdd()
        {
            InitializeComponent();
            chapterManager = new ChapterManager();
            m_chapter      = new ChapterInfo();

            chapterManager.GetChapterTypeList(out List <ChapterType> chapterTypeList);

            cboxChapterType.Items.Clear();
            foreach (ChapterType chapterTypeInfo in chapterTypeList)
            {
                cboxChapterType.Items.Add(chapterTypeInfo);
            }
        }
Exemple #3
0
        private void cboxChaperType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboxChaperType.SelectedIndex < 0)
            {
                return;
            }

            isLoadSuccess = false;
            ChapterType chapterType = (ChapterType)cboxChaperType.SelectedItem;

            ChapterManager.GetChapterList(chapterType.ID, out List <ChapterInfo> chapterInfoList);

            comboBoxChapter.Items.Clear();
            ChapterInfo modelNull = new ChapterInfo();

            modelNull.ID   = 0;
            modelNull.Name = "全部";
            comboBoxChapter.Items.Add(modelNull);

            ChapterInfo modelNotSplit = new ChapterInfo();

            modelNotSplit.ID   = -1;
            modelNotSplit.Name = "未分类";
            comboBoxChapter.Items.Add(modelNotSplit);

            foreach (ChapterInfo chapterInfo in chapterInfoList)
            {
                comboBoxChapter.Items.Add(chapterInfo);
            }

            comboBoxChapter.SelectedIndex = 0;

            cboxClassification.SelectedIndex = 0;

            comboBoxType.SelectedIndex = 0;

            textBoxFilterTittle.Text = "";

            isLoadSuccess = true;

            RefreshQuestions();
            //textBoxFilterOptions.Text = "";
        }
Exemple #4
0
        private void FormQuestionManage_Load(object sender, EventArgs e)
        {
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.PaleTurquoise;
            dataGridView1.EditMode = DataGridViewEditMode.EditOnEnter;
            dataGridView1.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            dataGridView1.Rows.Clear();

            //dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders;
            dataGridView1.RowsDefaultCellStyle.WrapMode = (DataGridViewTriState.True);



            foreach (var classification in Question._ModelClassificationInfo)
            {
                cboxClassification.Items.Add(classification);
            }
            cboxClassification.SelectedIndex = 0;

            foreach (var typeInfo in Question._TypeInfo)
            {
                comboBoxType.Items.Add(typeInfo);
            }
            comboBoxType.SelectedIndex = 0;

            chapterManager = new ChapterManager();
            chapterManager.GetChapterTypeList(out List <ChapterType> chapterTypeList, true);
            cboxChaperType.Items.Clear();

            foreach (ChapterType chapterType in chapterTypeList)
            {
                cboxChaperType.Items.Add(chapterType);
            }

            cboxChaperType.SelectedIndex = 0;

            isLoadSuccess = true;
        }
Exemple #5
0
        /// <summary>
        /// 更新技巧和章节信息
        /// </summary>
        private void UpdateGroups(int ChapterId, int SkillId, int bankId)
        {
            comboBoxChapter.Items.Clear();
            comboBoxChapter.BeginUpdate();
            int         index       = 0;
            ChapterInfo chapterNull = new ChapterInfo();

            chapterNull.ID   = 0;
            chapterNull.Name = "未分类";

            comboBoxChapter.Items.Add(chapterNull);

            ChapterManager.GetChapterList(0, out List <ChapterInfo> chapterInfos);
            int i = 0;

            foreach (var chapterInfo in chapterInfos)
            {
                i++;
                comboBoxChapter.Items.Add(chapterInfo);
                if (chapterInfo.ID == ChapterId)
                {
                    index = i;
                }
            }

            comboBoxChapter.SelectedIndex = index;
            comboBoxChapter.EndUpdate();

            comboBoxSkill.Items.Clear();

            comboBoxSkill.BeginUpdate();
            index = 0;
            ChapterInfo skillNull = new ChapterInfo();

            skillNull.ID   = 0;
            skillNull.Name = "未分类";
            comboBoxSkill.Items.Add(skillNull);

            ChapterManager.GetChapterList(1, out List <ChapterInfo> chapterSkills);
            i = 0;
            foreach (var chapterInfo in chapterSkills)
            {
                i++;
                comboBoxSkill.Items.Add(chapterInfo);
                if (chapterInfo.ID == SkillId)
                {
                    index = i;
                }
            }
            comboBoxSkill.SelectedIndex = index;
            comboBoxSkill.EndUpdate();

            cboxBank.Items.Clear();
            cboxBank.BeginUpdate();
            index = 0;
            ChapterInfo bankNull = new ChapterInfo();

            bankNull.ID   = 0;
            bankNull.Name = "未分类";
            cboxBank.Items.Add(bankNull);

            ChapterManager.GetChapterList(2, out List <ChapterInfo> chapterBanks);
            i = 0;
            foreach (var chapterInfo in chapterBanks)
            {
                i++;
                cboxBank.Items.Add(chapterInfo);
                if (chapterInfo.ID == bankId)
                {
                    index = i;
                }
            }
            cboxBank.SelectedIndex = index;
            cboxBank.EndUpdate();
        }