course changes done

This commit is contained in:
gandhimathi 2018-04-20 11:18:50 +05:30
parent f872dd2038
commit ba275fa9d3

View File

@ -34,8 +34,8 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
$rootScope.updateMoreItems = [];
$scope.editId = -1;
$scope.setEditId = function (pid,p) {
$scope.localSubjectDetails="";
$scope.localSubjectDetails = JSON.parse(localStorage.getItem('localSubjectDetails'));
// $scope.localSubjectDetails="";
// $scope.localSubjectDetails = JSON.parse(localStorage.getItem('localSubjectDetails'));
$scope.localUniversityDetails="";
$scope.localUniversityDetails = JSON.parse(localStorage.getItem('localUniversityDetails'));
@ -106,7 +106,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
// get exist subject details
$scope.editSubject = [];
/* $scope.editSubject = [];
angular.forEach(p.existSubjects, function (values, keys) {
$scope.getDeactiveSub = {
@ -123,7 +123,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
$scope.viewSubject = {
list: $scope.editSubject,
}
}*/
$scope.editId = pid;
};
@ -214,7 +214,8 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
specilization1:myModel.specilization1,
specilization2:myModel.specilization2,
subjects:myModel.subject
// subjects:myModel.subject,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(addCourse).then(function (response) {
@ -304,7 +305,9 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
specilization1:myModel.Specilization1,
specilization2:myModel.Specilization2,
existCourseID:myModel.CourseID,
subjects:subjects.list
// subjects:subjects.list,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(update).then(function (response) {
@ -344,7 +347,9 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(getCourse).then(function (response) {
@ -354,70 +359,17 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
$scope.data = response.data.details;
// $scope.university=response.data.universityDetails;
// $scope.feesDetails=response.data.feesDetails;
// $scope.myModel.ListName=$scope.feesDetails[0];
// $scope.myModel.programListName=$scope.myModel.ListName.programType[0].ListCode;
// // single sitting regular course details in model
// $scope.myModelRegular = {
// "FeesType":$scope.feesDetails[0].ListCode,
// "FeesName":$scope.feesDetails[0].ListName,
// "program":$scope.feesDetails[0].programType[0].ListCode,
// "programName":$scope.feesDetails[0].programType[0].ListName,
// "FeesAmount":"",
// };
// // single sitting lateral course details in model
// $scope.myModelLateral = {
// "FeesType":$scope.feesDetails[0].ListCode,
// "FeesName":$scope.feesDetails[0].ListName,
// "program":$scope.feesDetails[0].programType[1].ListCode,
// "programName":$scope.feesDetails[0].programType[1].ListName,
// "FeesAmount":"",
// };
// // single sitting Sem_Year course details in model
// $scope.myModelSemYear = {
// "FeesType":$scope.feesDetails[1].ListCode,
// "FeesName":$scope.feesDetails[1].ListName,
// "program":$scope.feesDetails[1].programType[0].ListCode,
// "programName":"",
// "FeesAmount":"",
// };
// $rootScope.myModelSemYear1 = {
// "FeesType":$scope.feesDetails[1].ListCode,
// "FeesName":$scope.feesDetails[1].ListName,
// "program":$scope.feesDetails[1].programType[0].ListCode,
// "programName":"",
// "FeesAmount":"",
// };
} else {
$scope.emptyData=false;
$scope.loader=true;
// getUniversity_FeesDetails();
// $scope.university=response.data.universityDetails;
// $scope.feesDetails=response.data.feesDetails;
// $scope.myModel.ListName=$scope.feesDetails[0];
// $scope.myModel.programListName=$scope.myModel.ListName.programType[0].ListCode;
}
});
};
function getUniversity_FeesDetails() {
localStorage.setItem('localSubjectDetails', '');
// localStorage.setItem('localSubjectDetails', '');
localStorage.setItem('localUniversityDetails', '');
$scope.subjectDetails=[];
@ -428,26 +380,29 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(getCourseUnivFee).then(function (response) {
if (response.data.status==200 && response.data.courseStatus) {
$scope.university=response.data.universityDetails;
$scope.subjectDetails=[];
// $scope.subjectDetails=[];
$scope.feesDetails=response.data.feesDetails;
$scope.myModel.ListName=$scope.feesDetails[0];
$scope.myModel.programListName=$scope.myModel.ListName.programType[0].ListCode;
//hide subject details
angular.forEach(response.data.subjectetails, function (values, keys) {
/* 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
@ -501,7 +456,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
}
localStorage.setItem('localUniversityDetails', JSON.stringify($scope.university));
localStorage.setItem('localSubjectDetails', JSON.stringify($scope.subjectDetails));
// localStorage.setItem('localSubjectDetails', JSON.stringify($scope.subjectDetails));
});