Exemplo n.º 1
0
        public List <TeacherDetail> QueryAllTeacher()
        {
            List <TeacherDetail> teacherList = new List <TeacherDetail>();
            var list = zhenjiaoRepository.QueryAllTeacher();

            for (int i = 0; i < list.Count; i++)
            {
                var section = loginRepository.QuerySection(list[i].Departmentid);
                if (section == null)
                {
                    continue;
                }
                var teacher = new TeacherDetail
                {
                    teacherId   = list[i].Teacherid,
                    Tname       = list[i].Tname,
                    Sex         = list[i].Sex,
                    Profession  = list[i].Profession,
                    sectionName = section.Name,
                    Phone       = list[i].Phone,
                    entryTime   = list[i].EntryTime
                };
                teacherList.Add(teacher);
            }
            return(teacherList);
        }
Exemplo n.º 2
0
        public TeacherDetail QueryTeacherById(string id)
        {
            var teacher     = new TeacherDetail();
            var teacherList = QueryAllTeacher();

            for (int i = 0; i < teacherList.Count; i++)
            {
                if (teacherList[i].teacherId == id)
                {
                    teacher = teacherList[i];
                    break;
                }
            }
            return(teacher);
        }