/// <summary> /// 匯入前準備 /// </summary> /// <param name="Option"></param> public override void Prepare(ImportOption Option) { _Option = Option; _HighConcernDict = UDTTransfer.GetHighConcernDictAll(); _StudentNumIDDict = UDTTransfer.GetStudentNumIDDictAll(); // 取得學生資料 List <string> studentIDList = _StudentNumIDDict.Values.ToList(); List <StudentRecord> recList = Student.SelectByIDs(studentIDList); foreach (StudentRecord rec in recList) { _StudentRecDict.Add(rec.ID, rec); } }
public static void Main() { _bgLLoadUDT.DoWork += _bgLLoadUDT_DoWork; _bgLLoadUDT.RunWorkerCompleted += _bgLLoadUDT_RunWorkerCompleted; _bgLLoadUDT.RunWorkerAsync(); Dictionary <string, UDT_HighConcern> _HighConcernDict = new Dictionary <string, UDT_HighConcern>(); _HighConcernDict = UDTTransfer.GetHighConcernDictAll(); ListPaneField HighConcernField = new ListPaneField("高關懷特殊身分"); HighConcernField.GetVariable += delegate(object sender, GetVariableEventArgs e) { if (_HighConcernDict.ContainsKey(e.Key)) { e.Value = "是"; } }; K12.Presentation.NLDPanels.Student.AddListPaneField(HighConcernField); ListPaneField HighCountField = new ListPaneField("高關懷減免人數"); HighCountField.GetVariable += delegate(object sender, GetVariableEventArgs e) { if (_HighConcernDict.ContainsKey(e.Key)) { e.Value = _HighConcernDict[e.Key].NumberReduce; } }; K12.Presentation.NLDPanels.Student.AddListPaneField(HighCountField); ListPaneField HighDocNoField = new ListPaneField("高關懷文號"); HighDocNoField.GetVariable += delegate(object sender, GetVariableEventArgs e) { if (_HighConcernDict.ContainsKey(e.Key)) { e.Value = _HighConcernDict[e.Key].DocNo; } }; K12.Presentation.NLDPanels.Student.AddListPaneField(HighDocNoField); // 當高關懷特殊身分有更新 FISCA.InteractionService.SubscribeEvent("KH_HighConcern_HighConcernContent", (sender, args) => { _HighConcernDict = UDTTransfer.GetHighConcernDictAll(); HighConcernField.Reload(); HighCountField.Reload(); HighDocNoField.Reload(); }); }