Esempio n. 1
0
        public bool LoadUsingTeacher(string _teacherID)
        {
            usingTeacher = new Teacher();
            bool isMinistry = false, isAdmin = false;

            byte[] avatar  = null;
            bool   success = teacherDA.LoadTeacher(_teacherID, usingTeacher, ref isMinistry, ref isAdmin, ref avatar);

            usingTeacher.Avatar = ImageHelper.BytesToImage(avatar);
            if (isAdmin)
            {
                usingTeacher.Type = Teacher.TeacherType.Adminstrator;
            }
            else if (isMinistry)
            {
                usingTeacher.Type = Teacher.TeacherType.Ministry;
            }
            else
            {
                string classID = null;
                teacherDA.GetInchargeClass(_teacherID, ref classID);
                if (classID == null)
                {
                    usingTeacher.Type = Teacher.TeacherType.Teacher;
                    return(success);
                }
                usingTeacher.Type        = Teacher.TeacherType.FormerTeacher;
                usingTeacher.FormClassID = classID;
            }
            return(success);
        }