From d905b229f5d5d49ec8795f468ea7651f73da4b53 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 23 Mar 2018 15:21:57 +0530 Subject: [PATCH] default batch done --- Apollo/assets/js/controllers/batchCtrl.js | 42 ++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) 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 + }]);