Ejemplo n.º 1
0
        public DesignCPSViewModel getModelForDesignCPSToView(int id)
        {
            CPSDesignManager mg       = new CPSDesignManager();
            string           mjr      = mg.getStudentMajor(id.ToString());
            string           ctlg     = mg.catalogNeedsTofollow(id.ToString());
            string           lastName = mg.getStudentLastName(id.ToString());

            DesignCPSViewModel v = new DesignCPSViewModel();

            v.searchId  = id.ToString();
            v.lastName  = lastName;
            v.majorName = mjr;
            v.firstName = mg.getStudentFirstName(id.ToString());


            List <Course> fclist = mg.getListFoundation(mjr, ctlg);

            v.FoundationClassesList = fclist;
            v.CoreClassesList       = mg.getListCoreCourses(mjr, ctlg);
            ctlg             = Regex.Replace(ctlg, "^Catalog", "Academic Year");
            v.academicYear   = ctlg;
            v.DfacultiesList = mg.getAllFacultyAdvisorForDepartment(mjr);

            return(v);
        }
        }//getUpdatedListOfElectiveCourses

        public DesignCPSViewModel getModelForGenerateCPS(string studentId)
        {
            DesignCPSViewModel vmodel = new DesignCPSViewModel();
            CPSDesignManager   mg     = new CPSDesignManager();
            string             mj     = mg.getStudentMajor(studentId);
            string             ct     = mg.catalogNeedsTofollow(studentId);

            vmodel.searchId  = studentId;
            vmodel.lastName  = mg.getStudentLastName(studentId);
            vmodel.firstName = mg.getStudentFirstName(studentId);
            vmodel.majorName = mj;

            List <Course>         assignedFC = getAssignedFoundationCourses(studentId, ct, mj);
            List <Course>         coreCS     = mg.getListCoreCourses(mj, ct);
            List <List <Course> > regAllCS   = getRegisteredCoursesDetails(studentId, ct, mj);
            List <List <Course> > cmptdAllCS = getAllCompletedCourseDetails(studentId, ct, mj);

            List <Course> fcListView = getUpdatedListOfFoundationCourses(regAllCS, cmptdAllCS, assignedFC);
            List <Course> ccListView = getUpdatedListOfCoreCourses(regAllCS, cmptdAllCS, coreCS);
            List <Course> ecListView = getUpdatedListOfElectiveCourses(regAllCS, cmptdAllCS);

            vmodel.CoreClassesList       = ccListView;
            vmodel.ElectiveClassesList   = ecListView;
            vmodel.FoundationClassesList = fcListView;

            ct = Regex.Replace(ct, "^Catalog", "Academic Year");
            vmodel.academicYear = ct;

            return(vmodel);
        }