diff --git a/Apollo/assets/js/controllers/batchCtrl.js b/Apollo/assets/js/controllers/batchCtrl.js index 2abc1d7b..1965ed58 100755 --- a/Apollo/assets/js/controllers/batchCtrl.js +++ b/Apollo/assets/js/controllers/batchCtrl.js @@ -9,7 +9,7 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl "batchCode": "", "batchName": "", "universityName":"", - "switchsetting": true + "switchsetting": true, }; @@ -188,6 +188,45 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl }); } }; + + + /* + * change default batch options + * */ + $scope.changeBtachDefault = function (details) { + if(details.IsDefault==true){ + $scope.defaultBatch = false; + } + else{ + $scope.defaultBatch = true; + } + var changeDefault = { + method: 'POST', + url: apiPoint.url + 'updateBatchDefault/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + batchCode: details.BatchCode, + IsDefault: $scope.defaultBatch, + universityID: details.UniversityID, + updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID + } + }; + $http(changeDefault).then(function (response) { + if (response.data.status==200 && response.data.batchStatus) { + $scope.init(); + swal("", "Updated Successfully.", "success"); + + + } else { + + swal("", response.data.message, "error"); + } + }); + + + } /* *get Batch details when page loading called from view file * @@ -257,4 +296,5 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl + }]);