Ejemplo n.º 1
0
        /// <summary>
        //  make sure that a new record created by the server is in 'insert' mode
        //  and mark it as a 'computed' record
        //  the same we doing for RecordsTable.cs method fillData()
        /// </summary>
        internal void SetInsertModeToCurrentRecord()
        {
            Debug.Assert(Task.getMode() == Constants.TASK_MODE_CREATE);

            Record record = Dataview.getCurrRec();

            record.setMode(DataModificationTypes.Insert);
            Dataview.currRecCompute(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// compute record if it is new
        /// </summary>
        private void ComputeRecord()
        {
            Record record = Dataview.getCurrRec();

            if (record != null && record.getMode() == DataModificationTypes.Insert)
            {
                record.setComputed(false);
                Dataview.currRecCompute(false);
            }
            else if (Task.DataviewManager.HasLocalData)
            {
                Dataview.currRecCompute(false);
            }
        }
Ejemplo n.º 3
0
        internal ReturnResultBase UpdateEmptyDataview()
        {
            ReturnResultBase result = new ReturnResult();

            if (PositionCache.Count == 0 && ((DataView)Task.DataView).HasMainTable)
            {
                Dataview.MoveToEmptyDataviewIfAllowed();

                if (!Dataview.isEmptyDataview())
                {
                    if (Task.checkProp(PropInterface.PROP_TYPE_ALLOW_CREATE, true))
                    {
                        // change to create mode
                        if (Task.getMode() != Constants.TASK_MODE_CREATE)
                        {
                            Task.setOriginalTaskMode(Constants.TASK_MODE_CREATE);
                            Task.setMode(Constants.TASK_MODE_CREATE);
                            Dataview.getCurrRec().setMode(DataModificationTypes.Insert);
                            Dataview.getCurrRec().setNewRec();
                            //ComputeRecord();
                        }

                        // MG_ACT_CRELINE may be disabled .i.e. PROP_TYPE_ALLOW_CREATE expression can be changed
                        (Task).enableCreateActs(true);
                    }
                    // exit from the ownerTask
                    else
                    {
                        result = new ReturnResult(MsgInterface.RT_STR_NO_RECS_IN_RNG);
                        //ClientManager.Instance.EventsManager.handleInternalEvent(Task, InternalInterface.MG_ACT_EXIT);
                    }
                }
            }
            else
            {
                Dataview.setEmptyDataview(false);
            }
            return(result);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// return the current record
 /// </summary>
 /// <returns></returns>
 internal IRecord GetCurrentRecord()
 {
     return(Dataview.getCurrRec());
 }