/// <summary>
        /// a factory method that creates an data view command from the send command
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        internal RemoteDataViewCommandBase CreateDataViewCommand(ClientOriginatedCommand command)
        {
            RemoteDataViewCommandBase remoteDataViewCommandBase = new DummyDataViewCommand(command);
            ExecOperCommand           execOperCommand           = command as ExecOperCommand;

            if (execOperCommand != null && execOperCommand.Operation != null && execOperCommand.Operation.getType() == ConstInterface.MG_OPER_UPDATE)
            {
                remoteDataViewCommandBase = new RemoteDataViewCommandUpdateNonModifiable(execOperCommand);
            }
            else if (!(command is DataviewCommand)) //this is local dataview commands
            {
                remoteDataViewCommandBase = new RemoteDataViewCommandBase(command);
            }
            else //if (command.Type == ConstInterface.CMD_TYPE_DATAVIEW)
            {
                DataviewCommand dataviewCommand = command as DataviewCommand;
                switch (dataviewCommand.CommandType)
                {
                case DataViewCommandType.SetTransactionState:
                    remoteDataViewCommandBase = new SetTransactionStateRemoteDataViewCommand((SetTransactionStateDataviewCommand)dataviewCommand);
                    break;

                case DataViewCommandType.AddUserRange:
                    remoteDataViewCommandBase = new AddUserRangeRemoteDataViewCommand((AddUserRangeDataviewCommand)command);
                    break;

                case DataViewCommandType.ResetUserRange:
                    remoteDataViewCommandBase = new ResetUserRangeRemoteDataviewCommand(command);
                    break;

                case DataViewCommandType.AddUserLocate:
                    remoteDataViewCommandBase = new AddUserLocateRemoteDataViewCommand((AddUserLocateDataViewCommand)command);
                    break;

                case DataViewCommandType.ResetUserLocate:
                    remoteDataViewCommandBase = new ResetUserLocateRemoteDataviewCommand(command);
                    break;

                case DataViewCommandType.AddUserSort:
                    remoteDataViewCommandBase = new AddUserSortRemoteDataViewCommand((AddUserSortDataViewCommand)command);
                    break;

                case DataViewCommandType.ResetUserSort:
                    remoteDataViewCommandBase = new ResetUserSortRemoteDataviewCommand(command);
                    break;

                case DataViewCommandType.DataViewToDataSource:
                    remoteDataViewCommandBase = new RemoteDataViewToDataSourceCommand((DataViewOutputCommand)command);
                    break;

                case DataViewCommandType.ControlItemsRefresh:
                    remoteDataViewCommandBase = new RemoteControlItemsRefreshCommand((ControlItemsRefreshCommand)command);
                    break;
                }
            }

            return(remoteDataViewCommandBase);
        }
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="command"></param>
 public ResetUserLocateDataviewCommand(DataviewCommand command)
     : base(command)
 {
 }
 public LocalClearDataViewCommand(DataviewCommand command)
     : base(command)
 {
 }
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="command"></param>
 public ResetUserSortLocalDataviewCommand(DataviewCommand command)
     : base(command)
 {
 }
        /// <summary>
        /// helper function for command type == dataview
        /// </summary>
        /// <param name="command"></param>
        /// <param name="localDataViewCommandBase"></param>
        /// <returns></returns>
        private LocalDataViewCommandBase CreateDataViewCommand(DataviewCommand dataviewCommand)
        {
            LocalDataViewCommandBase localDataViewCommandBase = null;

            switch (dataviewCommand.CommandType)
            {
            case DataViewCommandType.Init:
                localDataViewCommandBase = new LocalInitDataViewCommand(dataviewCommand);
                break;

            case DataViewCommandType.Clear:
                localDataViewCommandBase = new LocalClearDataViewCommand(dataviewCommand);
                break;

            case DataViewCommandType.Prepare:
                localDataViewCommandBase = new LocalDataViewCommandPrepare(dataviewCommand);
                break;

            case DataViewCommandType.FirstChunk:
                localDataViewCommandBase = new LocalDataViewCommandFetchFirstChunk(dataviewCommand);
                break;

            case DataViewCommandType.RecomputeUnit:
                localDataViewCommandBase = new RecomputeUnitLocalDataViewCommand((RecomputeUnitDataviewCommand)dataviewCommand);
                ((RecomputeUnitLocalDataViewCommand)localDataViewCommandBase).Record = ((DataView)LocalDataviewManager.Task.DataView).GetRecordById(
                    ((RecomputeUnitDataviewCommand)dataviewCommand).ClientRecId);
                break;

            case DataViewCommandType.ExecuteLocalUpdates:
                localDataViewCommandBase = new LocalDataViewCommandExecuteLocalUpdates(dataviewCommand);
                break;

            case DataViewCommandType.InitDataControlViews:
                localDataViewCommandBase = new InitDataControlLocalViewsCommand(dataviewCommand);
                break;

            case DataViewCommandType.OpenTransaction:
                localDataViewCommandBase = new OpenTransactionLocalDataCommand(dataviewCommand);
                break;

            case DataViewCommandType.CloseTransaction:
                localDataViewCommandBase = new CloseTransactionLocalDataViewCommandBase(dataviewCommand);
                break;

            case DataViewCommandType.AddUserRange:
                localDataViewCommandBase = new AddUserRangeLocalDataCommand((AddUserRangeDataviewCommand)dataviewCommand);
                break;

            case DataViewCommandType.ResetUserRange:
                localDataViewCommandBase = new ResetUserRangeLocalDataviewCommand(dataviewCommand);
                break;

            case DataViewCommandType.DbDisconnect:
                localDataViewCommandBase = new LocalClientDbDisconnectCommand((ClientDbDisconnectCommand)dataviewCommand);
                break;

            case DataViewCommandType.AddUserLocate:
                localDataViewCommandBase = new AddUserLocateLocalDataCommand((AddUserLocateDataViewCommand)dataviewCommand);
                break;

            case DataViewCommandType.AddUserSort:
                localDataViewCommandBase = new AddUserSortLocalDataCommand((AddUserSortDataViewCommand)dataviewCommand);
                break;

            case DataViewCommandType.ResetUserLocate:
                localDataViewCommandBase = new ResetUserLocateDataviewCommand(dataviewCommand);
                break;

            case DataViewCommandType.ResetUserSort:
                localDataViewCommandBase = new ResetUserSortLocalDataviewCommand(dataviewCommand);
                break;

            case DataViewCommandType.DbDelete:
                localDataViewCommandBase = new LocalClientDbDeleteCommand((ClientDbDeleteCommand)dataviewCommand);
                break;

            case DataViewCommandType.DataViewToDataSource:
                localDataViewCommandBase = new LocalDataViewToDataSourceCommand((DataViewOutputCommand)dataviewCommand);
                break;

            case DataViewCommandType.FetchAll:
                localDataViewCommandBase = new LocalDataViewFetcherCommand(dataviewCommand);
                break;

            case DataViewCommandType.ControlItemsRefresh:
                localDataViewCommandBase = new LocalDataViewCommandControlItemsRefersh((ControlItemsRefreshCommand)dataviewCommand);
                break;

            case DataViewCommandType.SQLExecute:
                localDataViewCommandBase = new SQLExecuteLocalDataViewCommand((SQLExecuteCommand)dataviewCommand);
                break;
            }

            return(localDataViewCommandBase);
        }
Example #6
0
 public LocalDataViewCommandExecuteLocalUpdates(DataviewCommand command)
     : base(command)
 {
 }
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="command"></param>
 public ResetUserRangeLocalDataviewCommand(DataviewCommand command)
     : base(command)
 {
 }
Example #8
0
 public InitDataControlLocalViewsCommand(DataviewCommand command)
     : base(command)
 {
 }
 public LocalDataViewCommandPrepare(DataviewCommand command)
     : base(command)
 {
 }
Example #10
0
 public OpenTransactionLocalDataCommand(DataviewCommand command)
     : base(command)
 {
 }
Example #11
0
 internal LocalInitDataViewCommand(DataviewCommand command)
     : base(command)
 {
 }