default batch done

This commit is contained in:
gandhimathi 2018-03-23 15:21:57 +05:30
parent a8262fd2c8
commit d905b229f5

View File

@ -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
}]);