Customers
This commit is contained in:
@@ -5,16 +5,16 @@
|
||||
* Time: 14:19
|
||||
*/
|
||||
|
||||
dbo.customersInit = function (){
|
||||
dbo.customersInit = function () {
|
||||
|
||||
if ( dbo.customersModel !== undefined ) {
|
||||
|
||||
} else {
|
||||
dbo.customersModel = {
|
||||
|
||||
customers : ko.observableArray( [] ),
|
||||
customer : ko.observable(),
|
||||
archive: ko.observable( true ),
|
||||
customers: ko.observableArray( [] ),
|
||||
customer : ko.observable(),
|
||||
archive : ko.observable( false ),
|
||||
|
||||
init: function () {
|
||||
var vm = dbo.customersModel;
|
||||
@@ -24,9 +24,8 @@ dbo.customersInit = function (){
|
||||
|
||||
newCustomer: function () {
|
||||
var vm = dbo.customersModel;
|
||||
|
||||
dbo.editCostomerModal.newEditCostumer( false, function () {
|
||||
vm.refreshCostumers();
|
||||
dbo.editCustomerModal.newEditCustomer( false, function () {
|
||||
vm.refreshCustomers();
|
||||
} );
|
||||
},
|
||||
|
||||
@@ -35,15 +34,15 @@ dbo.customersInit = function (){
|
||||
|
||||
vm.archive( !vm.archive() );
|
||||
|
||||
vm.refreshCostumers();
|
||||
vm.refreshCustomers();
|
||||
},
|
||||
|
||||
editCostumer: function () {
|
||||
editCustomer: function () {
|
||||
var customer = this;
|
||||
var vm = dbo.customersModel;
|
||||
|
||||
dbo.editCostumerModal.newEditCostumer( customer, function () {
|
||||
vm.refreshCostumers();
|
||||
dbo.editCustomerModal.newEditCustomer( customer, function () {
|
||||
vm.refreshCustomers();
|
||||
} );
|
||||
},
|
||||
|
||||
@@ -53,12 +52,12 @@ dbo.customersInit = function (){
|
||||
|
||||
var status = self.archive == 'F' ? 'T' : 'F';
|
||||
|
||||
dbo.customerDataService.archiveCostumer( self.id, status, function () {
|
||||
vm.refreshCostumers();
|
||||
dbo.customerDataService.archiveCustomer( self.id, status, function () {
|
||||
vm.refreshCustomers();
|
||||
} );
|
||||
},
|
||||
|
||||
removeCostumer: function () {
|
||||
removeCustomer: function () {
|
||||
var vm = dbo.customersModel;
|
||||
var self = this;
|
||||
|
||||
@@ -72,14 +71,14 @@ dbo.customersInit = function (){
|
||||
}, function ( response ) {
|
||||
console.log( response );
|
||||
if ( response ) {
|
||||
dbo.customerDataService.removeUser( self.id, function ( data ) {
|
||||
dbo.customerDataService.removeCustomer( self.id, function ( data ) {
|
||||
if ( data.result ) {
|
||||
tellMe( {
|
||||
title : 'opdrachtgever verwijderd',
|
||||
message : 'de opdrachtgever is succesvol verwijderd',
|
||||
modalClass: 'modal-success'
|
||||
}, function () {
|
||||
vm.refreshCostumers();
|
||||
vm.refreshCustomers();
|
||||
} );
|
||||
} else {
|
||||
tellMe( {
|
||||
|
||||
Reference in New Issue
Block a user