void RefreshGroups()
        {
            dataGridView1.Rows.Clear();
            chapterManager.GetChapterList(_Type, out DataTable data);
            if (null == data)
            {
                return;
            }

            foreach (DataRow row in data.Rows)
            {
                ChapterInfo modelChapter = new ChapterInfo();
                modelChapter.ID               = Convert.ToInt32(row["id"].ToString());
                modelChapter.Classification   = Convert.ToInt32(row["classification_id"].ToString());
                modelChapter.IsEnable         = row["status"].ToString() == "1";
                modelChapter.Name             = row["name"].ToString();
                modelChapter.Count            = Convert.ToInt32(row["count"].ToString());
                modelChapter.ChapterType      = Convert.ToInt32(row["type"].ToString());
                modelChapter.ChapterSqlString = row["sql"].ToString();
                modelChapter.SqlParamter      = row["sql_parameter"].ToString();
                string classficationName = row["classification_name"].ToString();

                AddItem(modelChapter, classficationName);
            }
        }
        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;
            }
        }
Пример #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 = "";
        }
Пример #4
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();
        }