angular.module('notetasksService',[]).factory('Notetasks',function($http){
	return {
		getPaging:function(filter){
			return $http({method:'POST',url:url_server + 'notetaskspaging',data:filter,withCredentials: true});
		},
		getSelect:function(){
			return $http({method:'POST',url:url_server + 'notetasks/getall'});
		},
		getSelect2:function(filter){
			return $http({method:'POST',url:url_server + 'notetasks/search',data:filter});
		},
		show:function(id){
			
			return $http({method:'GET',
				headers:headers,
				url:url_server+ 'notetasks/'+id,
				withCredentials: true});
			// return $http.get(url_server+ 'notetasks/'+id);
		},
		save:function(notetasksData){
			
			return $http({method:'POST',
				headers:headers,
				url:url_server+'notetasks',
				data:notetasksData,
				withCredentials: true});
			// return $http({method:'POST',
			// 				url:url_server+'notetasks',
			// 				data:notetasksData});
		},
		update:function(id, notetasksData){
			
			return $http.put(url_server+'notetasks/'+id,notetasksData, {
				headers:headers, withCredentials: true });
			// return $http.put(url_server+'notetasks/'+id,notetasksData);
		},
		destroy:function(id){
			return $http.delete(url_server + 'notetasks/'+id);
		}
	};
});


// taskType
angular.module('notetasktypesService',[]).factory('Notetasktypes',function($http){
	return {
		getPaging:function(filter){
			return $http({method:'POST',url:url_server + 'notetasktypespaging',data:filter});
		},
		getSelect:function(){
			
			return $http({method:'POST',
				headers:headers,
				url:url_server+'notetasktypes/getall',
				withCredentials: true});
			// return $http({method:'POST',url:url_server + 'notetasktypes/getall'});
		},
		getSelect2:function(filter){
			return $http({method:'POST',url:url_server + 'notetasktypes/search',data:filter});
		},
		show:function(id){
			return $http.get(url_server+ 'notetasktypes/'+id);
		},
		save:function(notetasktypesData){
			return $http({method:'POST',
							url:url_server+'notetasktypes',
							data:notetasktypesData});
		},
		update:function(id, notetasktypesData){
			return $http.put(url_server+'notetasktypes/'+id,notetasktypesData);
		},
		destroy:function(id, status){
			return $http({method:'POST',
							url:url_server+'notetasktypes/active',
							data:{id:id, status:status}});
		}
	};
});
