Esempio n. 1
0
        private void BatchWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            picLoadingAdvTreeMakeUpBatch.Visible = false;

            // 解凍 畫面 控制項
            ResumeAllLayout();

            // 清除舊項目
            advTreeMakeUpBatch.Nodes.Clear();

            // 清除舊項目
            dataGridViewX1.Rows.Clear();

            string semesterNodeString = _schoolYear + "學年度第" + _semester + "學期";

            DevComponents.AdvTree.Node semesterNode = new DevComponents.AdvTree.Node(semesterNodeString);

            // 父 Node 不可選,也不可拖曳
            semesterNode.Selectable      = false;
            semesterNode.DragDropEnabled = false;


            // 將 補考梯次 子 node 批次 加入  學年度學期父 node
            foreach (UDT_MakeUpBatch batchRecord in _batchList)
            {
                // 封存不出現
                if (!string.IsNullOrWhiteSpace(batchRecord.is_archive))
                {
                    continue;
                }

                string batchNodeString = batchRecord.MakeUp_Batch;

                DevComponents.AdvTree.Node batchNode = new DevComponents.AdvTree.Node(batchNodeString);

                // 補考梯次 子 node 可以選,但也不可拖曳
                batchNode.DragDropEnabled = false;

                // Node 的 Tag 為 補考梯次的系統編號
                batchNode.Tag = batchRecord.UID;

                batchNode.NodeMouseDown += new System.Windows.Forms.MouseEventHandler(NodeMouseDown);

                semesterNode.Nodes.Add(batchNode);
            }

            //  預設將node 展開
            semesterNode.ExpandAll();

            advTreeMakeUpBatch.Nodes.Add(semesterNode);

            FISCA.Presentation.MotherForm.SetStatusBarMessage("取得補考梯次完成");

            //  假如有補考梯次,主動觸發 滑鼠點擊 第一個項目 , 帶出 補考群組
            if (advTreeMakeUpBatch.Nodes.Count > 0)
            {
                if (advTreeMakeUpBatch.Nodes[0].Nodes.Count > 0)
                {
                    DevComponents.AdvTree.Node defaultNode = advTreeMakeUpBatch.Nodes[0].Nodes[0];

                    defaultNode.SetSelectedCell(defaultNode.Cells[0], DevComponents.AdvTree.eTreeAction.Mouse);

                    NodeMouseDown(defaultNode, new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));
                }
            }
        }