diff --git a/Apollo/assets/js/controllers/courseCtrl.js b/Apollo/assets/js/controllers/courseCtrl.js index 8ad67ac0..530fa905 100755 --- a/Apollo/assets/js/controllers/courseCtrl.js +++ b/Apollo/assets/js/controllers/courseCtrl.js @@ -85,6 +85,17 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab } }); + + // get exist subject details + $scope.editSubject = []; + angular.forEach(p.existSubjects, function (values, keys) { + + $scope.editSubject.push(values.SubjectID); + }) + $scope.viewSubject = { + list: $scope.editSubject, + } + $scope.editId = pid; }; @@ -173,7 +184,8 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab semFeesAmounts:$scope.addMoreItems, createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID, specilization1:myModel.specilization1, - specilization2:myModel.specilization2 + specilization2:myModel.specilization2, + subjects:myModel.subject } }; $http(addCourse).then(function (response) { @@ -206,7 +218,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab * update the course details * created by kms * */ - $scope.updateCourse = function (myModel, form,regular,lateral,semYear, loading) { + $scope.updateCourse = function (myModel, form,regular,lateral,semYear, loading,subjects) { var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -246,6 +258,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab }, data: { courseID: myModel.CourseID, + universityID: myModel.UniversityID, courseCode: myModel.CourseCode, courseName: myModel.CourseName, provFess:myModel.PC, @@ -261,7 +274,8 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, specilization1:myModel.Specilization1, specilization2:myModel.Specilization2, - existCourseID:myModel.CourseID + existCourseID:myModel.CourseID, + subjects:subjects.list } }; $http(update).then(function (response) { @@ -374,6 +388,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab }; function getUniversity_FeesDetails() { + $scope.subjectDetails=[]; var getCourseUnivFee = { method: 'POST', url: apiPoint.url + 'getCourseUnivFeesDetails/', @@ -388,11 +403,19 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab if (response.data.status==200 && response.data.courseStatus) { $scope.university=response.data.universityDetails; + $scope.subjectDetails=[]; $scope.feesDetails=response.data.feesDetails; $scope.myModel.ListName=$scope.feesDetails[0]; $scope.myModel.programListName=$scope.myModel.ListName.programType[0].ListCode; + angular.forEach(response.data.subjectetails, function (values, keys) { + $scope.subData = { + SubjectID: values.SubjectID, + SubjectName: values.SubjectCode +'-'+values.SubjectName + }; + $scope.subjectDetails.push($scope.subData); + }) // single sitting regular course details in model $scope.myModelRegular = {