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; } }
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; } }