示例#1
0
        public static object GetValuePendingOrCurrent(PXCache cache, Type sourceType, object row)
        {
            object value = cache.GetValuePending(row, sourceType.Name);

            if (value != PXCache.NotSetValue)
            {
                return(value);
            }

            return(BqlHelper.GetOperandValue(cache, row ?? cache.Current, sourceType));
        }
示例#2
0
        public static object GetCurrentValue(PXGraph graph, Type sourceType, object row = null)
        {
            if (typeof(IBqlField).IsAssignableFrom(sourceType))
            {
                Type cacheType = BqlCommand.GetItemType(sourceType);

                PXCache cache = graph.Caches[cacheType];

                return(BqlHelper.GetOperandValue(cache, row ?? cache.Current, sourceType));
            }

            throw new NotImplementedException();
        }
示例#3
0
        public static object GetValuePendingOrRow <TField>(PXCache cache, object row)
            where TField : IBqlField
        {
            object value = cache.GetValuePending(row, typeof(TField).Name);

            if (value != PXCache.NotSetValue)
            {
                cache.RaiseFieldUpdating <TField>(row, ref value);

                return(value);
            }

            return(BqlHelper.GetOperandValue(cache, row, typeof(TField)));
        }