app.controller('delegatiFirmaCtrl', 
function ($scope,$mdDialog,utilsSvc,DelegatoFirma) {
	
	
	$scope.delegati= [];
	
	DelegatoFirma.List({}).$promise.then(function(data){
		$scope.delegati = data;
	});
	
	$scope.setStatus = function(index) {
		DelegatoFirma.SetStatus({id: $scope.delegati[index].id,status:$scope.delegati[index].abilitaDelegatoFirmaEstrattoreDistinte})
			.$promise.then(function(data){
				utilsSvc.showMessage('Modifica salvata');
			})
	}
	
	$scope.cancelDialog = function() {
    	$mdDialog.cancel();
    }
    
	
	
});