/**
 * This is a generated class and is not intended for modfication.  To customize behavior
 * of this service wrapper you may modify the generated sub-class of this class - RrinvisService.as.
 */
package services.rrinvisservice
{
import mx.rpc.AsyncToken;
import com.adobe.fiber.core.model_internal;
import mx.rpc.AbstractOperation;
import valueObjects.Pnl;
import valueObjects.Rrinvis;
import mx.data.RPCDataManager;
import mx.data.ManagedOperation;
import mx.data.ManagedAssociation;
import mx.data.ManagedQuery;
import mx.data.ItemReference;
import mx.collections.ItemResponder;
import mx.rpc.remoting.RemoteObject; 
import mx.rpc.remoting.Operation;
import com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.serializers.utility.TypeUtility;

[ExcludeClass]internal class _Super_RrinvisService extends RemoteObjectServiceWrapper
{      
    private var _rrinvisRPCDataManager : RPCDataManager;         
    private var managersArray : Array = new Array();
        
    public const DATA_MANAGER_RRINVIS : String = "Rrinvis";         
        
    public function getDataManager(dataManagerName:String) : RPCDataManager
    {
        switch (dataManagerName)
        {
             case (DATA_MANAGER_RRINVIS):
                return _rrinvisRPCDataManager;      
            default:
                return null;
        }
    }
    
    /**
     * Commit all of the pending changes for this DataService, as well as all of the pending changes of all DataServices
     * sharing the same DataStore.  By default, a DataService shares the same DataStore with other DataServices if they have 
     * managed association properties and share the same set of channels. 
     *
     * @see mx.data.DataManager
     * @see mx.data.DataStore
     *
     * @param itemsOrCollections:Array This is an optional parameter which defaults to null when
     *  you want to commit all pending changes.  If you want to commit a subset of the pending
     *  changes use this argument to specify a list of managed ListCollectionView instances
     *  and/or managed items.  ListCollectionView objects are most typically ArrayCollections
     *  you have provided to your fill method.  The items appropriate for this method are
     *  any managed version of the item.  These are any items you retrieve from getItem, createItem
     *  or using the getItemAt method from a managed collection.  Only changes for the
     *  items defined by any of the values in this array will be committed.
     *
     * @param cascadeCommit if true, also commit changes made to any associated
     *  items supplied in this list.
     *
     *  @return AsyncToken that is returned in <code>call</code> property of
     *  either the <code>ResultEvent.RESULT</code> or in the
     *  <code>FaultEvent.FAULT</code>.
     *  Custom data can be attached to this object and inspected later
     *  during the event handling phase.  If no changes have been made
     *  to the relevant items, null is returned instead of an AsyncToken.
     */
    public function commit(itemsOrCollections:Array=null, cascadeCommit:Boolean=false):AsyncToken
    {
        return _rrinvisRPCDataManager.dataStore.commit(itemsOrCollections, cascadeCommit);
    }
    
    /**
     *  Reverts all pending (uncommitted) changes for this DataService, as well as all of the pending changes of all DataServics
     *  sharing the same DataStore.  By default, a DataService shares the same DataStore with other DataServices if they have 
     * managed association properties and share the same set of channels. 
     *
     * @see mx.data.DataManager
     * @see mx.data.DataStore
     *
     *  @return true if any changes were reverted.
     *  
     */
    public function revertChanges():Boolean
    {
        return _rrinvisRPCDataManager.dataStore.revertChanges();
    }    
       
    // Constructor
    public function _Super_RrinvisService()
    {
        // initialize service control
        _serviceControl = new RemoteObject(); 
        
        var operations:Object = new Object();
        var operation:Operation;         
         
        operation = new Operation(null, "getAllRrinvis");
         operation.resultElementType = valueObjects.Pnl;
        operations["getAllRrinvis"] = operation;
         
     valueObjects.Pnl._initRemoteClassAlias();
        operation = new Operation(null, "getRrinvisByID");
         operation.resultElementType = valueObjects.Rrinvis;
        operations["getRrinvisByID"] = operation;
         
     valueObjects.Rrinvis._initRemoteClassAlias();
        operation = new Operation(null, "createRrinvis");
         operation.resultType = Date;          
        operations["createRrinvis"] = operation;
         
        operation = new Operation(null, "updateRrinvis");
        operations["updateRrinvis"] = operation;
         
        operation = new Operation(null, "deleteRrinvis");
        operations["deleteRrinvis"] = operation;
         
        operation = new Operation(null, "count");
         operation.resultType = int;          
        operations["count"] = operation;
         
        operation = new Operation(null, "getRrinvis_paged");
         operation.resultElementType = valueObjects.Rrinvis;
        operations["getRrinvis_paged"] = operation;
         
     valueObjects.Rrinvis._initRemoteClassAlias();
    
        _serviceControl.operations = operations;   
        _serviceControl.convertResultHandler = TypeUtility.convertResultHandler;
        _serviceControl.source = "RrinvisService";
        _serviceControl.endpoint = "gateway.php";
        _serviceControl.destination = "RrinvisService";
        
        var managedAssociation : ManagedAssociation;
        var managedAssocsArray : Array;
        // initialize Rrinvis data manager     
        _rrinvisRPCDataManager = new RPCDataManager();        
        managersArray.push(_rrinvisRPCDataManager);
        
        managedAssocsArray = new Array();
        
        _rrinvisRPCDataManager.destination = "rrinvisRPCDataManager";
        _rrinvisRPCDataManager.service = _serviceControl;        
        _rrinvisRPCDataManager.identities =  "id";      
        _rrinvisRPCDataManager.itemClass = valueObjects.Rrinvis; 
        
                   
    
        var dmOperation : ManagedOperation;
        var dmQuery : ManagedQuery;
         
        dmOperation = new ManagedOperation("createRrinvis", "create");
        dmOperation.parameters = "item";
        _rrinvisRPCDataManager.addManagedOperation(dmOperation);     
            
        dmQuery = new ManagedQuery("getRrinvis_paged");
        dmQuery.propertySpecifier = "id,type,doc,dayy,genleg,status,qty,amount,account,deptment";
        dmQuery.countOperation = "count";
        dmQuery.pagingEnabled = true;
        dmQuery.positionalPagingParameters = true;
        dmQuery.parameters = "startIndex,numItems";
        _rrinvisRPCDataManager.addManagedOperation(dmQuery);                 

        dmOperation = new ManagedOperation("deleteRrinvis", "delete");
        dmOperation.parameters = "id";
        _rrinvisRPCDataManager.addManagedOperation(dmOperation);     
            
        dmOperation = new ManagedOperation("updateRrinvis", "update");
        dmOperation.parameters = "item";
        _rrinvisRPCDataManager.addManagedOperation(dmOperation);     
            
        dmOperation = new ManagedOperation("getRrinvisByID", "get");
        dmOperation.parameters = "id";
        _rrinvisRPCDataManager.addManagedOperation(dmOperation);     
            
        _serviceControl.managers = managersArray;
                      
         model_internal::initialize();
    }

    /**
      * This method is a generated wrapper used to call the 'getAllRrinvis' operation. It returns an AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function getAllRrinvis() : AsyncToken
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("getAllRrinvis");
        var _internal_token:AsyncToken = _internal_operation.send() ;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'getRrinvisByID' operation. It returns an ItemReference whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.data.ItemReference
      * @see mx.rpc.CallResponder 
      *
      * @return an ItemReference whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function getRrinvisByID(itemID:int) : ItemReference
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("getRrinvisByID");
        var _internal_token:ItemReference = _internal_operation.send(itemID) as ItemReference;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'createRrinvis' operation. It returns an ItemReference whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.data.ItemReference
      * @see mx.rpc.CallResponder 
      *
      * @return an ItemReference whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function createRrinvis(item:valueObjects.Rrinvis) : ItemReference
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("createRrinvis");
        var _internal_token:ItemReference = _internal_operation.send(item) as ItemReference;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'updateRrinvis' operation. It returns an ItemReference whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.data.ItemReference
      * @see mx.rpc.CallResponder 
      *
      * @return an ItemReference whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function updateRrinvis(item:valueObjects.Rrinvis) : ItemReference
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("updateRrinvis");
        var _internal_token:ItemReference = _internal_operation.send(item) as ItemReference;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'deleteRrinvis' operation. It returns an AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function deleteRrinvis(itemID:int) : AsyncToken
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("deleteRrinvis");
        var _internal_token:AsyncToken = _internal_operation.send(itemID) ;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'count' operation. It returns an AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function count() : AsyncToken
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("count");
        var _internal_token:AsyncToken = _internal_operation.send() ;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'getRrinvis_paged' operation. It returns an AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function getRrinvis_paged() : AsyncToken
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("getRrinvis_paged");
        var _internal_token:AsyncToken = _internal_operation.send() ;

        return _internal_token;
    }   
     
}

}