Пример #1
0
        public LocalDataViewCommandSort(ColumnSortEventCommand command)
            : base(command)
        {
            //Prepare Sort collection.
            Sorts = new SortCollection();
            Sort sort = new Sort();

            sort.fldIdx = command.FldId;
            sort.dir    = (command.Direction == 0) ? true : false;
            Sorts.add(sort);

            RefreshEventCommand refreshCommand = CommandFactory.CreateRealRefreshCommand(command.TaskTag, InternalInterface.MG_ACT_RT_REFRESH_VIEW, 0, null, command.ClientRecId);

            localDataViewCommandViewRefresh              = new LocalDataViewCommandViewRefresh(refreshCommand);
            localDataViewCommandViewRefresh.RefreshMode  = ViewRefreshMode.CurrentLocation;
            localDataViewCommandViewRefresh.KeepUserSort = true;
        }
Пример #2
0
        /// <summary>
        /// helper function for command type == event
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        private LocalDataViewCommandBase CreateEventCommand(EventCommand eventCommand)
        {
            LocalDataViewCommandBase localDataViewCommandBase = null;

            switch (eventCommand.MagicEvent)
            {
            case InternalInterface.MG_ACT_DATAVIEW_TOP:
                localDataViewCommandBase = new LocalDataViewCommandFetchTopChunk(eventCommand);
                break;

            case InternalInterface.MG_ACT_DATAVIEW_BOTTOM:
                localDataViewCommandBase = new LocalDataViewCommandFetchBottomChunk(eventCommand);
                break;

            case InternalInterface.MG_ACT_CACHE_PREV:
                localDataViewCommandBase = new LocalDataViewCommandFetchPrevChunk(eventCommand);
                break;

            case InternalInterface.MG_ACT_CACHE_NEXT:
                localDataViewCommandBase = new LocalDataViewCommandFetchNextChunk(eventCommand);
                break;

            case InternalInterface.MG_ACT_RT_REFRESH_VIEW:
                localDataViewCommandBase = new LocalDataViewCommandViewRefresh((RefreshEventCommand)eventCommand);
                break;

            case InternalInterface.MG_ACT_SUBFORM_REFRESH:
                localDataViewCommandBase = new LocalDataViewCommandSubformRefresh((SubformRefreshEventCommand)eventCommand);
                break;

            case InternalInterface.MG_ACT_RTO_CREATE:
                localDataViewCommandBase = new LocalDataViewCommandGoToCreateMode(eventCommand);
                break;

            case InternalInterface.MG_ACT_COMPUTE:
                localDataViewCommandBase = new LocalDataViewCommandCompute((ComputeEventCommand)eventCommand);
                ((LocalDataViewCommandCompute)localDataViewCommandBase).Record = ((DataView)LocalDataviewManager.Task.DataView).GetRecordById(eventCommand.ClientRecId);
                break;

            case InternalInterface.MG_ACT_RTO_LOCATE:
                localDataViewCommandBase = new LocalDataViewCommandLocateInQuery((LocateQueryEventCommand)eventCommand);
                break;

            case InternalInterface.MG_ACT_COL_SORT:
                localDataViewCommandBase = new LocalDataViewCommandSort((ColumnSortEventCommand)eventCommand);
                break;

            case InternalInterface.MG_ACT_RT_REFRESH_RECORD:
                localDataViewCommandBase = new GetCurrentRecordLocalDataViewCommand(eventCommand);
                break;

            case InternalInterface.MG_ACT_ROLLBACK:
                localDataViewCommandBase = new RollbackTransactionLocalDataViewCommand((RollbackEventCommand)eventCommand);
                break;

            /////NOT Implemented commands
            case InternalInterface.MG_ACT_RT_REFRESH_SCREEN:
                localDataViewCommandBase = new LocalDataViewCommandViewRefreshScreen(eventCommand);
                break;

            case InternalInterface.MG_ACT_RTO_SEARCH:
                localDataViewCommandBase = new LocalDataviewCommandLocateNext(eventCommand);
                break;

            case InternalInterface.MG_ACT_UPDATE_DATAVIEW_TO_DATASOURCE:
                localDataViewCommandBase = new LocalUpdateRemoteDataViewToDataSourceCommand((UpdateDataViewToDataSourceEventCommand)eventCommand);
                break;

            default:
                Logger.Instance.WriteExceptionToLog("in DataView.fetchChunkFromServer() unknown magicEvent: " + eventCommand.MagicEvent);
                break;
            }

            return(localDataViewCommandBase);
        }