Files
dbois/public/js/lib/dataservices/customerDataservice.js
T
2017-12-29 14:44:18 +01:00

55 lines
1.6 KiB
JavaScript

/**
* Created by Pensare Software.
* Customer: Theo Weijmer
* Date: 25/12/2017
* Time: 09:50
*/
dbo.customerDataService = {
getAllCustomers: function ( archive = 'F', callback ) {
$.getJSON( 'index.php/beheer/customersController/getAllCustomers/' + archive )
.done( function ( data ) {
callback( data );
} );
},
getCustomer: function ( userID, callback ) {
$.getJSON( 'index.php/beheer/customersController/getCustomer/' + userID )
.done( function ( data ) {
callback( data );
} );
},
checkCustomername: function ( username, callback ) {
$.post( 'index.php/beheer/userController/checkCustomername', 'json' )
.done( function ( data ) {
console.log( data );
callback( data );
} );
},
saveCustomer: function ( submitDATA, callback ) {
$.post( 'index.php/beheer/customersController/saveCustomer', submitDATA, function () {
}, 'json' )
.done( function ( data ) {
callback( data );
} );
},
archiveCustomer: function(userID, status, callback){
$.get('index.php/beheer/customersController/archiveCustomer/' + userID + '/' + status)
.done(function(){
callback();
});
},
removeCustomer: function ( userID, callback ) {
$.getJSON( 'index.php/beheer/customersController/removeCustomer/' + userID )
.done( function ( data ) {
callback( data );
} );
}
}