angular.module('messagequotesService',[]).factory('Messagequotes',function($http){
	
	return {
		getPaging:function(filter){
			return $http({method:'POST',
				headers:headers,
				url:url_server + 'messagequotespaging',
				data:filter,
				withCredentials: true});
			// return $http({method:'POST',url:url_server + 'messagequotespaging',data:filter});
		},
		getSelect:function(){
			return $http({method:'POST',url:url_server + 'messagequotes/getall'});
		},
		getSelect2:function(filter){
			return $http({method:'POST',url:url_server + 'messagequotes/search',data:filter});
		},
		show:function(id){
			return $http({method:'GET',
				headers:headers,
				url:url_server + 'messagequotes/'+id,
				withCredentials: true});
			// return $http.get(url_server+ 'messagequotes/'+id);
		},
		save:function(messagequotesData){
			return $http({method:'POST',
				headers:headers,
				url:url_server + 'messagequotes',
				data:messagequotesData,
				withCredentials: true});
			// return $http({method:'POST',
			// 				url:url_server+'messagequotes',
			// 				data:messagequotesData});
		},
		update:function(id, messagequotesData){
			 return $http.put(url_server+'messagequotes/'+id,messagequotesData,{headers:headers, withCredentials: true });
			// return $http.put(url_server+'messagequotes/'+id,messagequotesData);
		},
		destroy:function(id){
			return $http.delete(url_server+'messagequotes/'+id,{headers:headers, withCredentials: true });
			// return $http.delete(url_server + 'messagequotes/'+id);
		},
		// get message quote login
		getMessageQuoteLogin:function(){
			return $http({method:'POST',url:'messagequotes/getMessageQuoteLogin'});
		}
	};
});
