course details changes done

This commit is contained in:
gandhimathi 2018-01-25 17:47:31 +05:30
parent e4bd7485da
commit 9e8d4e0d1d

View File

@ -18,7 +18,10 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
"transferAmount":"", "transferAmount":"",
"degreeAmount":"", "degreeAmount":"",
"migrationAmount":"", "migrationAmount":"",
"otherAmount":"" "otherAmount":"",
"specilization1":"",
"specilization2":"",
}; };
$rootScope.myModel1 = { $rootScope.myModel1 = {
"ListName": "", "ListName": "",
@ -125,7 +128,8 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
} }
angular.element('.ng-invalid[name=' + firstError + ']').focus(); angular.element('.ng-invalid[name=' + firstError + ']').focus();
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error"); // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
} else { }
else {
if(semYearModel.program=='Y001' && semYearModel.programName!="" || semYearModel.FeesAmount!=""){ if(semYearModel.program=='Y001' && semYearModel.programName!="" || semYearModel.FeesAmount!=""){
$scope.addMoreItems.push({ $scope.addMoreItems.push({
@ -137,6 +141,11 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
}); });
} }
if(regularModel.FeesAmount=='' && lateralModel.FeesAmount=='' && $scope.addMoreItems.length==0){
swal("Failed!", 'Please Enter Single/Sem-Year Fees ', "error");
}
else{
$scope.ldloading1 = {}; $scope.ldloading1 = {};
$scope.ldloading1[loading.replace('-', '_')] = true; $scope.ldloading1[loading.replace('-', '_')] = true;
@ -162,7 +171,9 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
regularFeesAmounts:regularModel, regularFeesAmounts:regularModel,
lateralFeesAmounts:lateralModel, lateralFeesAmounts:lateralModel,
semFeesAmounts:$scope.addMoreItems, semFeesAmounts:$scope.addMoreItems,
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
specilization1:myModel.specilization1,
specilization2:myModel.specilization2
} }
}; };
$http(addCourse).then(function (response) { $http(addCourse).then(function (response) {
@ -176,6 +187,9 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
swal("Failed!", response.data.message, "error"); swal("Failed!", response.data.message, "error");
} }
}); });
}
} }
@ -243,7 +257,10 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
lateralFeesAmounts:lateral, lateralFeesAmounts:lateral,
semFeesAmounts:$rootScope.updateMoreItems, semFeesAmounts:$rootScope.updateMoreItems,
status: myModel.IsActive, status: myModel.IsActive,
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
specilization1:myModel.Specilization1,
specilization2:myModel.Specilization2,
existCourseID:myModel.CourseID
} }
}; };
$http(update).then(function (response) { $http(update).then(function (response) {
@ -258,7 +275,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
} else { } else {
$scope.ldloading[loading.replace('-', '_')] = false; $scope.ldloading[loading.replace('-', '_')] = false;
$rootScope.init(); // $rootScope.init();
swal("Failed!", response.data.message, "error"); swal("Failed!", response.data.message, "error");
} }
}); });