示例#1
0
        private void GetByIdOperation()
        {
            long id = -1;

            while (id < 0)
            {
                id = view.EnterId();
            }
            switch (view.entity)
            {
            case Entity.Pupil:
                List <Pupil> pupils = new List <Pupil>()
                {
                    pupilDAO.Get(id)
                };
                view.PrintPupils(pupils);
                break;

            case Entity.Teacher:
                List <Teacher> teachers = new List <Teacher>()
                {
                    teacherDAO.Get(id)
                };
                view.PrintTeachers(teachers);
                break;
            }
        }