course details changes done
This commit is contained in:
parent
374cfd4259
commit
fdb3a91d3e
@ -10,22 +10,40 @@ app.controller("activityCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$
|
|||||||
"ActivityID": "",
|
"ActivityID": "",
|
||||||
"ActivityName": "",
|
"ActivityName": "",
|
||||||
"Description": "",
|
"Description": "",
|
||||||
"switchsetting": true
|
"switchsetting": true,
|
||||||
|
"status":""
|
||||||
|
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
* edit batch details
|
* edit activity details
|
||||||
* created by subaram
|
* created by surendiran
|
||||||
* */
|
* */
|
||||||
|
$scope.p = {
|
||||||
|
"status":""
|
||||||
|
}
|
||||||
|
|
||||||
$scope.editId = -1;
|
$scope.editId = -1;
|
||||||
$scope.setEditId = function (pid) {
|
$scope.setEditId = function (p) {
|
||||||
$scope.editId = pid;
|
$scope.editId = p.ActivityID;
|
||||||
|
$scope.editStatusList = [];
|
||||||
|
angular.forEach(p.statusDetails, function (values, keys) {
|
||||||
|
|
||||||
|
$scope.editStatusList.push(values.ListCode);
|
||||||
|
})
|
||||||
|
$scope.viewEditStatus = {
|
||||||
|
list: $scope.editStatusList,
|
||||||
|
}
|
||||||
|
console.log($scope.viewEditStatus);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$scope.viewId = -1;
|
$scope.viewId = -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cancel edit div
|
* cancel edit div
|
||||||
* created by subaram
|
* created by surendiran
|
||||||
* */
|
* */
|
||||||
$scope.cancel = function () {
|
$scope.cancel = function () {
|
||||||
$scope.init();
|
$scope.init();
|
||||||
@ -40,10 +58,9 @@ app.controller("activityCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$scope.activityForm = {
|
$scope.activityForm = {
|
||||||
|
|
||||||
submit: function (form, myModel,loading) {
|
submit: function (form, myModel,loading) {
|
||||||
|
|
||||||
var firstError = null;
|
var firstError = null;
|
||||||
if (form.$invalid) {
|
if (form.$invalid) {
|
||||||
var field = null, firstError = null;
|
var field = null, firstError = null;
|
||||||
@ -61,9 +78,9 @@ $scope.activityForm = {
|
|||||||
// 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 {
|
||||||
|
|
||||||
$scope.ldloading1 = {};
|
$scope.ldloading = {};
|
||||||
|
|
||||||
$scope.ldloading1[loading.replace('-', '_')] = true;
|
$scope.ldloading[loading.replace('-', '_')] = true;
|
||||||
|
|
||||||
|
|
||||||
var addactivity = {
|
var addactivity = {
|
||||||
@ -77,18 +94,19 @@ $scope.activityForm = {
|
|||||||
activityName: myModel.ActivityName,
|
activityName: myModel.ActivityName,
|
||||||
description: myModel.Description,
|
description: myModel.Description,
|
||||||
status: myModel.switchsetting,
|
status: myModel.switchsetting,
|
||||||
|
activityStatus:myModel.status,
|
||||||
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$http(addactivity).then(function (response) {
|
$http(addactivity).then(function (response) {
|
||||||
if (response.data.status == 200 && response.data.activityStatus) {
|
if (response.data.status == 200 && response.data.activityStatus) {
|
||||||
$scope.ldloading1[loading.replace('-', '_')] = false;
|
$scope.ldloading[loading.replace('-', '_')] = false;
|
||||||
$scope.init();
|
$scope.init();
|
||||||
swal("Success!", response.data.message, "success");
|
swal("Success!", response.data.message, "success");
|
||||||
$state.go($state.current, {}, { reload: true });
|
$state.go($state.current, {}, { reload: true });
|
||||||
} else {
|
} else {
|
||||||
$scope.ldloading1[loading.replace('-', '_')] = false;
|
$scope.ldloading[loading.replace('-', '_')] = false;
|
||||||
swal("Failed!", response.data.details, "error");
|
swal("Failed!", response.data.message, "error");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -103,6 +121,7 @@ $scope.activityForm = {
|
|||||||
*
|
*
|
||||||
* created by surendiran
|
* created by surendiran
|
||||||
* */
|
* */
|
||||||
|
$scope.statusList = [];
|
||||||
$scope.loader = '';
|
$scope.loader = '';
|
||||||
$scope.emptyData = '';
|
$scope.emptyData = '';
|
||||||
$scope.init = function () {
|
$scope.init = function () {
|
||||||
@ -121,10 +140,26 @@ $scope.activityForm = {
|
|||||||
$scope.emptyData = true;
|
$scope.emptyData = true;
|
||||||
$scope.loader = true;
|
$scope.loader = true;
|
||||||
$scope.activityInfo = response.data.details;
|
$scope.activityInfo = response.data.details;
|
||||||
|
$scope.masterActivityStatus=response.data.masterStatusList;
|
||||||
|
angular.forEach($scope.masterActivityStatus, function (values, keys) {
|
||||||
|
$scope.statusData = {
|
||||||
|
name: values.ListName,
|
||||||
|
id: values.ListCode
|
||||||
|
};
|
||||||
|
$scope.statusList.push($scope.statusData);
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
$scope.emptyData = false;
|
$scope.emptyData = false;
|
||||||
$scope.loader = false;
|
$scope.loader = false;
|
||||||
$scope.activityInfo = "";
|
$scope.activityInfo = "";
|
||||||
|
$scope.masterActivityStatus=response.data.masterStatusList;
|
||||||
|
angular.forEach($scope.masterActivityStatus, function (values, keys) {
|
||||||
|
$scope.statusData = {
|
||||||
|
name: values.ListName,
|
||||||
|
id: values.ListCode
|
||||||
|
};
|
||||||
|
$scope.statusList.push($scope.statusData);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -134,7 +169,7 @@ $scope.activityForm = {
|
|||||||
* update the Activity details
|
* update the Activity details
|
||||||
* created by Surendiran
|
* created by Surendiran
|
||||||
* */
|
* */
|
||||||
$scope.updateActivity = function (myModel, form, loading) {
|
$scope.updateActivity = function (myModel,listStatus, form, loading) {
|
||||||
|
|
||||||
var firstError = null;
|
var firstError = null;
|
||||||
if (form.$invalid) {
|
if (form.$invalid) {
|
||||||
@ -164,11 +199,12 @@ $scope.activityForm = {
|
|||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
ListCode: myModel.ListCode,
|
activityID: myModel.ActivityID,
|
||||||
ListName: myModel.ListName,
|
activityName: myModel.ActivityName,
|
||||||
description: myModel.Description,
|
description: myModel.Description,
|
||||||
status: myModel.IsActive,
|
status: myModel.IsActive,
|
||||||
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
activityStatus:listStatus.list,
|
||||||
|
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$http(update).then(function (response) {
|
$http(update).then(function (response) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user