Exemplo n.º 1
0
        //添加勾中的题目信息到下面的ListView的方法
        private void AddQuestions()
        {
            List <T_Question_Collection_ex> result = Datas.Where(c => c.IsSelected).Select(c => c.Data).
                                                     Select(c => new T_Question_Collection_ex
            {
                Key      = c.Key,
                Question = c.Question,
                Level    = c.Level,
                Score    = "0",
                Variable = ""
            }).ToList();


            result.ForEach
            (
                d =>
            {
                //判断当前项是否已存在
                if (!DatasEx.Any(e => e.Key == d.Key))
                {
                    //将新项添加到集合中
                    d.OrderNo = (DatasEx.Count + 1).ToString();
                    d.Sort    = DatasEx.Count + 1;
                    DatasEx.Add(d);
                }
            });
        }
Exemplo n.º 2
0
        //初始化
        public override void Loaded()
        {
            DifficultyLevel = "0";
            Date1           = DateTime.Now.AddMonths(-1);
            Date2           = DateTime.Now;
            Datas           = GetAllQCInf();
            if (MouldInfo.Key != null)
            {
                MouldName = MouldInfo.Mould_Name;
                //题库
                List <T_Question_Collection_ex> questionResult =
                    ExamHandle.TryGetData <T_Question_Collection_ex>(
                        @" SELECT A.* ,B.F_SCORE,B.F_SORT,B.F_VARIABLE ,'' FROM  T_QUESTION_COLLECTION A,T_INTEGRANT_QUESTION B WHERE  A.F_KEY = B.F_QUESTION_KEY AND B.F_MOULD_KEY = ? ORDER BY A.F_QUESTION",
                        MouldInfo.Key);

                var DatasExTemp = new List <T_Question_Collection_ex>(questionResult);
                foreach (T_Question_Collection_ex int_question in DatasExTemp)
                {
                    DatasEx.Add(int_question);
                }
                foreach (T_Question_Collection_ex child in DatasEx)
                {
                    child.OrderNo = (DatasEx.IndexOf(child) + 1).ToString();
                    child.Sort    = (DatasEx.IndexOf(child));
                }
            }
        }