Esempio n. 1
0
        public virtual SourceValuesCollectionItem GetBranchIDsValueFromField(
            PXGraph graph,
            PXCache attributeCache,
            object extRow,
            SourceSpecificationItem calendarOrganizationIdSourceSpec)
        {
            bool?  result   = null;
            object branchID = null;

            if (calendarOrganizationIdSourceSpec.BranchSourceType != null || calendarOrganizationIdSourceSpec.BranchSourceFormula != null)
            {
                PXCache cache = GetSourceCache(graph, attributeCache, calendarOrganizationIdSourceSpec.BranchSourceType);

                object row = GetSourceRow(cache, extRow);

                if (calendarOrganizationIdSourceSpec.BranchSourceFormula != null)
                {
                    BqlFormula.Verify(cache, row, calendarOrganizationIdSourceSpec.BranchSourceFormula, ref result, ref branchID);
                }
                else
                {
                    branchID = BqlHelper.GetOperandValue(cache, row, calendarOrganizationIdSourceSpec.BranchSourceType);
                }
            }

            return(new SourceValuesCollectionItem()
            {
                SpecificationItem = calendarOrganizationIdSourceSpec,
                BranchIDs = ((int?)branchID).SingleToList()
            });
        }
        public virtual TKeyWithKeyWithSourceValues GetIDsValueFromField(
            PXGraph graph,
            PXCache attributeCache,
            object extRow,
            TSourceSpecificationItem sourceSpecification,
            Type fieldType,
            Action <TKeyWithKeyWithSourceValues, List <int?> > setter)
        {
            int?value = null;

            if (fieldType != null)
            {
                PXCache cache = GetSourceCache(graph, attributeCache, fieldType);

                object row = GetSourceRow(cache, extRow);

                value = (int?)BqlHelper.GetOperandValue(cache, row, fieldType);
            }

            var item = new TKeyWithKeyWithSourceValues()
            {
                SpecificationItem = sourceSpecification,
            };

            setter(item, value.SingleToList());

            return(item);
        }
Esempio n. 3
0
        public void Verify(PXCache cache, object item, List <object> pars, ref bool?result, ref object value)
        {
            value = BqlHelper.GetOperandValue <TOrganizationIDField>(cache, item);

            result = (int?)value == GetOrganizationID(cache.Graph);

            if (pars != null)
            {
                pars.Add(BqlHelper.GetParameterValue(cache.Graph, BranchIDParameter));
            }
        }
        public virtual string GetHeaderMasterFinPeriodID(PXCache cache, object row)
        {
            if (HeaderFindingMode == HeaderFindingModes.Parent)
            {
                object parentRow = PXParentAttribute.SelectParent(cache, row, BqlCommand.GetItemType(HeaderMasterFinPeriodIDType));

                return((string)BqlHelper.GetOperandValue(cache.Graph, parentRow, HeaderMasterFinPeriodIDType));
            }

            return((string)BqlHelper.GetCurrentValue(cache.Graph, HeaderMasterFinPeriodIDType));
        }
Esempio n. 5
0
        public virtual SourceValuesCollectionItem GetOrganizationIDsValueFromField(
            PXGraph graph,
            PXCache attributeCache,
            object extRow,
            SourceSpecificationItem sourceSpecification)
        {
            int?organizationID = null;

            if (sourceSpecification.OrganizationSourceType != null)
            {
                PXCache cache = GetSourceCache(graph, attributeCache, sourceSpecification.OrganizationSourceType);

                object row = GetSourceRow(cache, extRow);

                organizationID = (int?)BqlHelper.GetOperandValue(cache, row, sourceSpecification.OrganizationSourceType);
            }

            return(new SourceValuesCollectionItem()
            {
                SpecificationItem = sourceSpecification,
                OrganizationIDs = organizationID.SingleToList()
            });
        }