Exemplo n.º 1
0
        public void GetStudentSubjectDetails(int studentid, string courseType)
        {
            List <string> getPreviousYearSubjects = GetPreviousSubjectDetails(studentid);


            // OCP Violoation
            switch (courseType)
            {
            case "Computers":
                ComputerStudent fullTimeStudent  = new ComputerStudent();
                List <string>   fullTimeSubjects = fullTimeStudent.GetStudentSubjects();
                break;

            case "Electronic":
                PartTimeStudent partTimeStudent  = new PartTimeStudent();
                List <string>   partTimeSubjects = partTimeStudent.GetStudentSubjects();
                break;
            }
        }
Exemplo n.º 2
0
        public void GetStudentSubjectDetails(int studentid, string courseType)
        {
            List <string> getPreviousYearSubjects = GetPreviousSubjectDetails(studentid);


            // OCP Violoation
            switch (courseType)
            {
            case "Computers":
                ComputerStudent computerStudent = new ComputerStudent();
                List <string>   courseComputer  = computerStudent.GetStudentSubjects();
                break;

            case "Electronics":
                ComputerStudent ElectronicsStudent = new ComputerStudent();
                List <string>   courseElectronics  = electronicsStudent.GetStudentSubjects();
                break;
            }
        }