Exemple #1
0
        /// <summary>
        /// 从缓存层获取指标
        /// </summary>
        private void getIndicator()
        {
            indicatorList    = IndicatorCache.getCache();
            classList        = CodeCache.getClass();
            detectionList    = CodeCache.getDetection();
            subDetectionList = CodeCache.getSubDetection();
            indicatorModels  = (from indicator in indicatorList
                                from classType in classList
                                from detection in detectionList
                                from subDetection in subDetectionList
                                where indicator.classId == classType.id && indicator.detectionId == detection.id && indicator.subDetectionId == subDetection.id
                                select new IndicatorModel()
            {
                indicatorId = indicator.id,
                classId = indicator.classId,
                className = classType.codeName,
                detectionId = indicator.detectionId,
                detectionName = detection.codeName,
                subDetectionId = indicator.subDetectionId,
                subDetectionName = subDetection.codeName,
                indicatorName = indicator.indicatorName,
                indicatorDesc = indicator.indicatorDesc,
                indicatorInstr = indicator.indicatorInstr,
                isObsolete = indicator.isObsolete == 1 ? "已废弃" : "生效中"
            }).ToList();

            pagingPanel.setDetail(indicatorModels.Count);
            dgv_indicator.DataSource = indicatorModels.Skip(pageSize * (pageNum - 1)).Take(pageSize).ToList();
        }
Exemple #2
0
 private void getAllList()
 {
     indicatorList    = IndicatorCache.getCache();
     classList        = CodeCache.getClass();
     detectionList    = CodeCache.getDetection();
     subDetectionList = CodeCache.getSubDetection();
 }
Exemple #3
0
 private void cbb_detection_SelectedIndexChanged(object sender, EventArgs e)
 {
     cbb_subDetection.DataSource = null;
     if (cbb_detection.DataSource != null)
     {
         List <Tb_code> subDetections = CodeCache.getSubDetection().Where(c => c.parentId == ((Tb_code)cbb_detection.SelectedItem).id).ToList();
         cbb_subDetection.DataSource    = subDetections;
         cbb_subDetection.DisplayMember = "codeName";
         cbb_subDetection.ValueMember   = "id";
     }
 }
Exemple #4
0
        private void buildTree()
        {
            var classList        = CodeCache.getClass();
            var detectionList    = CodeCache.getDetection();
            var subDetectionList = CodeCache.getSubDetection();

            foreach (Tb_code classItem in classList)
            {
                var classNode = addNode(rootNode, classItem);
                foreach (Tb_code detectionItem in detectionList.Where(c => c.parentId == classItem.id))
                {
                    var detectionNode = addNode(classNode, detectionItem);
                    foreach (Tb_code subDetectionItem in subDetectionList.Where(c => c.parentId == detectionItem.id))
                    {
                        addNode(detectionNode, subDetectionItem);
                    }
                }
            }
        }
Exemple #5
0
 private void traversalNode(Node pNode)
 {
     if (pNode.HasChildNodes)
     {
         foreach (Node node in pNode.Nodes)
         {
             if (node.Style != null)
             {
                 if (node.Style.BackColor == Color.LawnGreen)//修改过的node
                 {
                     var tb_code = node.Tag as Tb_code;
                     tb_code.codeName = node.Text;
                     CodeCache.addCache(tb_code);
                     node.Style = null;
                 }
                 if (node.Style.BackColor == Color.Red)//新增的node
                 {
                     Tb_code tb_code = new Tb_code();
                     tb_code.codeName = node.Text;
                     if (node.Level == 2)//检测内容
                     {
                         tb_code.codeType = 6;
                         tb_code.id       = CodeCache.getDetection().Count == 0 ? 6000 : CodeCache.getDetection().Max(c => c.id) + 1; //检测内容从6000开始
                     }
                     if (node.Level == 3)                                                                                             //检测分项
                     {
                         tb_code.codeType = 7;
                         tb_code.id       = CodeCache.getSubDetection().Count == 0 ? 7000 : CodeCache.getSubDetection().Max(c => c.id) + 1;//检测分项从7000开始
                     }
                     tb_code.parentId = (node.Parent.Tag as Tb_code).id;
                     CodeCache.addCache(tb_code);
                     node.Style = null;
                     node.Tag   = tb_code;//将code赋给tag,以便在新增node的新增子node中,可以找到parentId
                 }
             }
             traversalNode(node);
         }
     }
 }