Ejemplo n.º 1
0
        void _bgWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            //_TeacherEntityID = null;
            _CounselStudent.Clear();
            _TeacherEntityID = _UDTTransfer.GetTeacherTagIDByTeacherID(PrimaryKey, DAO.CounselTeacherRecord.CounselTeacherType.認輔老師.ToString());
            if (_TeacherEntityID.HasValue)
            {
                _CounselStudent = _UDTTransfer.GetCounselStudentListByTeacherTagID(_TeacherEntityID.Value);
            }


            //foreach (DAO.CounselTeacherRecord ctr in Utility.GetCounselTeacherDictByTeacherID(PrimaryKey))
            //{
            //    if (ctr.counselTeacherType == DAO.CounselTeacherRecord.CounselTeacherType.認輔老師)
            //        _TeacherEntityID = ctr.TeacherTag_ID;
            //}

            //if (_TeacherEntityID.HasValue)
            //{
            //    _CounselStudent = _UDTTransfer.GetCounselStudentListByTeacherTagID(_TeacherEntityID.Value);
            _StudDict.Clear();
            List <string> sidList = (from data in _CounselStudent select data.StudentID.ToString()).ToList();

            foreach (StudentRecord stud in Student.SelectByIDs(sidList))
            {
                int sid = int.Parse(stud.ID);
                if (!_StudDict.ContainsKey(sid))
                {
                    _StudDict.Add(sid, stud);
                }
            }
            //}
        }