/// <summary> /// builds record computer /// </summary> /// <returns></returns> internal virtual RecordComputer Build() { RecordComputer recordComputer = new RecordComputer(); recordComputer.DataviewSynchronizer = LocalDataviewManager.DataviewSynchronizer; int nextViewDataViewHeaderId = -1; int?nextLinkStartAfterField = GetNextLinkStartField(ref nextViewDataViewHeaderId); for (int i = 0; i < TaskViews.Fields.Count; i++) { if (i == nextLinkStartAfterField) { ComputeLinkStrategy computeStrategy = new ComputeLinkStrategy() { View = TaskViews.LinkViews[nextViewDataViewHeaderId] }; RecomputeId unitId = RecomputeIdFactory.GetRecomputeId(computeStrategy.View.DataviewHeader); //add computer for fetch of the links recordComputer.Add(unitId, computeStrategy); linkComputers.Add(unitId, computeStrategy); nextLinkStartAfterField = GetNextLinkStartField(ref nextViewDataViewHeaderId); } //add computer for fields AddComputeFieldStrategy(recordComputer, TaskViews.Fields[i]); } // Add the range expression computer - must be after all other computation is taken care of. AddBoundaryExpressionComputeStrategy(recordComputer, PropInterface.PROP_TYPE_TASK_PROPERTIES_RANGE, UnitComputeErrorCode.RangeFailed); return(recordComputer); }
public GatewayResult AddDataControlView(RuntimeReadOnlyView view, DcValuesBuilderBase dcValuesBuilder) { GatewayResult result = null; DataControlViews.Add(view); int boundControlId = ((DataControlSourceViewDefinition)view.DataSourceViewDefinition).BoundControlId; var dsId = view.DataSourceViewDefinition.TaskDataSource.DataSourceDefinition.Id; var strategy = new DataControlValuesComputeStrategy(boundControlId, dcValuesBuilder, view.RangeBuilder, dsId); var unitId = RecomputeIdFactory.GetRecomputeId(typeof(DcValues), boundControlId); RecordComputer.Add(unitId, strategy); result = view.OpenDataSource(); view.BuildCursor(); if (result.Success) { view.Prepare(); } return(result); }
public DCValuesRecompute(Task task, int ditIndex) { control = task.getForm().getCtrl(ditIndex); unitId = RecomputeIdFactory.GetRecomputeId(control); }
/// <summary> /// get linked record /// </summary> /// <param name="curRec"></param> /// <returns></returns> internal override bool getLinkedRecord(Record curRec) { IClientCommand dataViewCommand = CommandFactory.CreateRecomputeUnitDataViewCommand(_task.getTaskTag(), RecomputeIdFactory.GetRecomputeId(this), curRec.getId()); ReturnResult result = _task.DataviewManager.Execute(dataViewCommand); return(result.Success); }