course details changes done
This commit is contained in:
parent
38d52bdc6b
commit
31981b525a
@ -11,14 +11,21 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
|
|||||||
"universityName":"",
|
"universityName":"",
|
||||||
"switchsetting": true
|
"switchsetting": true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* edit batch details
|
* edit batch details
|
||||||
* created by subaram
|
* created by subaram
|
||||||
* */
|
* */
|
||||||
$scope.editId = -1;
|
$scope.editId = -1;
|
||||||
|
$scope.editModel = {
|
||||||
|
"editDate": "",
|
||||||
|
"editBatchName": "",
|
||||||
|
|
||||||
|
};
|
||||||
$scope.setEditId = function (pid,p) {
|
$scope.setEditId = function (pid,p) {
|
||||||
|
$scope.editModel.editBatchName = p.BatchName;
|
||||||
|
$scope.editModel.editDate = p.BatchDate;
|
||||||
$scope.localUniversityDetails="";
|
$scope.localUniversityDetails="";
|
||||||
$scope.localUniversityDetails = JSON.parse(localStorage.getItem('localUniversityDetails'));
|
$scope.localUniversityDetails = JSON.parse(localStorage.getItem('localUniversityDetails'));
|
||||||
|
|
||||||
@ -61,8 +68,8 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
|
|||||||
* created by subaram
|
* created by subaram
|
||||||
* */
|
* */
|
||||||
$scope.batchForm = {
|
$scope.batchForm = {
|
||||||
|
|
||||||
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;
|
||||||
@ -93,7 +100,8 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
batchcode: myModel.batchCode,
|
batchcode: myModel.batchCode,
|
||||||
batcheName: myModel.batchName,
|
batcheName: myModel.batchName,
|
||||||
|
batcheDate: $filter('date')(new Date(myModel.date), 'dd-MM-yyyy'),
|
||||||
universityName: myModel.universityName,
|
universityName: myModel.universityName,
|
||||||
status: myModel.switchsetting,
|
status: myModel.switchsetting,
|
||||||
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
||||||
@ -128,8 +136,8 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
|
|||||||
* update the batch details
|
* update the batch details
|
||||||
* created by subaram
|
* created by subaram
|
||||||
* */
|
* */
|
||||||
$scope.updateBatch = function (myModel, form, loading) {
|
$scope.updateBatch = function (myModel, form, loading,editModel) {
|
||||||
|
|
||||||
var firstError = null;
|
var firstError = null;
|
||||||
if (form.$invalid) {
|
if (form.$invalid) {
|
||||||
var field = null, firstError = null;
|
var field = null, firstError = null;
|
||||||
@ -138,7 +146,7 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
|
|||||||
if (firstError === null && !form[field].$valid) {
|
if (firstError === null && !form[field].$valid) {
|
||||||
firstError = form[field].$stop_name;
|
firstError = form[field].$stop_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (form[field].$pristine) {
|
if (form[field].$pristine) {
|
||||||
form[field].$dirty = true;
|
form[field].$dirty = true;
|
||||||
}
|
}
|
||||||
@ -147,10 +155,10 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
|
|||||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||||
} else {
|
} else {
|
||||||
$scope.ldloading = {};
|
$scope.ldloading = {};
|
||||||
|
|
||||||
$scope.ldloading[loading.replace('-', '_')] = true;
|
$scope.ldloading[loading.replace('-', '_')] = true;
|
||||||
|
|
||||||
|
|
||||||
var update = {
|
var update = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: apiPoint.url + 'updateBatchDetails/',
|
url: apiPoint.url + 'updateBatchDetails/',
|
||||||
@ -159,7 +167,8 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
batchCode: myModel.BatchCode,
|
batchCode: myModel.BatchCode,
|
||||||
batchName: myModel.BatchName,
|
batchName: editModel.editBatchName,
|
||||||
|
batchDate: editModel.editDate,
|
||||||
status: myModel.IsActive,
|
status: myModel.IsActive,
|
||||||
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
||||||
}
|
}
|
||||||
@ -170,8 +179,8 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
|
|||||||
$scope.editId = -1;
|
$scope.editId = -1;
|
||||||
$scope.init();
|
$scope.init();
|
||||||
swal("", "Updated Successfully.", "success");
|
swal("", "Updated Successfully.", "success");
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$scope.ldloading[loading.replace('-', '_')] = false;
|
$scope.ldloading[loading.replace('-', '_')] = false;
|
||||||
swal("", response.data.message, "error");
|
swal("", response.data.message, "error");
|
||||||
@ -201,15 +210,15 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
|
|||||||
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$http(getBranch).then(function (response) {
|
$http(getBranch).then(function (response) {
|
||||||
if (response.data.status==200 && response.data.batchStatus) {
|
if (response.data.status==200 && response.data.batchStatus) {
|
||||||
|
|
||||||
$scope.emptyData=true;
|
$scope.emptyData=true;
|
||||||
$scope.loader=true;
|
$scope.loader=true;
|
||||||
|
|
||||||
$scope.data = response.data.details;
|
$scope.data = response.data.details;
|
||||||
|
|
||||||
$scope.university=response.data.universityDetails;
|
$scope.university=response.data.universityDetails;
|
||||||
|
|
||||||
|
|
||||||
@ -226,6 +235,26 @@ app.controller('batchCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTabl
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* get date format
|
||||||
|
* created by kms
|
||||||
|
* */
|
||||||
|
$scope.getDateFormat = function (modelDate,type) {
|
||||||
|
if(type=='1'){
|
||||||
|
$scope.myModel.batchName=$filter('date')(new Date(modelDate), 'MMM-yyyy');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
|
||||||
|
$scope.editModel.editBatchName=$filter('date')(new Date(modelDate), 'MMM-yyyy');
|
||||||
|
$scope.editModel.editDate=$filter('date')(new Date(modelDate), 'dd-MM-yyyy');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user