From e10d31313f2835dcf30e30bc17d2ff46a521ef1f Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 23 Apr 2018 12:41:04 +0530 Subject: [PATCH] activity changes done --- Apollo/assets/js/controllers/activityCtrl.js | 21 +++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Apollo/assets/js/controllers/activityCtrl.js b/Apollo/assets/js/controllers/activityCtrl.js index 41e97646..69cda7bb 100755 --- a/Apollo/assets/js/controllers/activityCtrl.js +++ b/Apollo/assets/js/controllers/activityCtrl.js @@ -105,7 +105,8 @@ if(myModel.status.length > 0) { description: myModel.Description, status: myModel.switchsetting, activityStatus:myModel.status, - createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID + createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID } }; $http(addactivity).then(function (response) { @@ -114,7 +115,11 @@ if(myModel.status.length > 0) { $scope.init(); swal("","Activity details added successfully.", "success"); $state.go($state.current, {}, { reload: true }); - } else { + } + else if(response.data.activityStatus==false){ + swal("",response.data.message, "warning"); + } + else { $scope.ldloading[loading.replace('-', '_')] = false; swal(" ", "Something went wrong.please try again.", "error"); } @@ -149,7 +154,8 @@ swal("Warning!", "Status are required", "warning"); '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(getActivity).then(function (response) { @@ -224,7 +230,8 @@ swal("Warning!", "Status are required", "warning"); description: myModel.Description, status: myModel.IsActive, activityStatus:listStatus.list, - updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID + updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID } }; $http(update).then(function (response) { @@ -236,7 +243,11 @@ swal("Warning!", "Status are required", "warning"); $scope.editId = -1; - } else { + } + else if(response.data.activityStatus==false){ + swal("",response.data.message, "warning"); + } + else { $scope.ldloading3[loading.replace('-', '_')] = false; swal(" ","Something went wrong.please try again", "error"); }