protected virtual void EPAssignmentMap_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { //EPSetup ep = setup.Current; EPAssignmentMap row = e.Row as EPAssignmentMap; if (row != null) { if (row.EntityType != null && row.GraphType == null) { Type entityType = System.Web.Compilation.PXBuildManager.GetType(row.EntityType, false); var primary = (entityType == null) ? null : EntityHelper.GetPrimaryGraphType(this, entityType); if (primary != null) { AssigmentMap.Current.GraphType = primary.FullName; AssigmentMap.Cache.SetStatus(AssigmentMap.Current, PXEntryStatus.Updated); AssigmentMap.Cache.IsDirty = true; } } PositionFilter.Current.MapID = row.AssignmentMapID; this.Nodes.Cache.AllowInsert = row.EntityType != null; EPAssignmentRoute route = PXSelect <EPAssignmentRoute, Where <EPAssignmentRoute.assignmentMapID, Equal <Required <EPAssignmentRoute.assignmentMapID> > > > .Select(this, row.AssignmentMapID); PXUIFieldAttribute.SetEnabled <EPAssignmentMap.graphType>(sender, row, route == null); var list = GraphTypeList().ToList().OrderBy(o => o.Name); PXStringListAttribute.SetLocalizable <EPAssignmentMap.graphType>(sender, null, false); PXStringListAttribute.SetList <EPAssignmentMap.graphType>(sender, row, list.Select(x => x.SubKey).ToArray(), list.Select(x => x.Name).ToArray()); } }
public static void SetLineTypeList <LineTypeField>(PXCache cache, object row, bool includeIN, bool includeTemplate, bool includePickup) where LineTypeField : class, IBqlField { CustomListAttribute dropDownList = GetDropDownList(includeIN, includeTemplate, includePickup); PXStringListAttribute.SetList <LineTypeField>(cache, row, dropDownList.AllowedValues, dropDownList.AllowedLabels); }
public static CRListAttributesHelper CreateFrom(PXGraph graph, PXCache fieldCache, string field) { CRListAttributesHelper result = null; PXStringListAttribute stringListAtt = GetAttribute <PXStringListAttribute>(fieldCache, field); if (stringListAtt != null) { result = new CRStringListAttHelper(stringListAtt); } PXIntListAttribute intListAtt = GetAttribute <PXIntListAttribute>(fieldCache, field); if (intListAtt != null) { result = new CRIntListAttHelper(intListAtt); } CRBaseListAttribute baseListAtt = GetAttribute <CRBaseListAttribute>(fieldCache, field); if (baseListAtt != null) { result = new CRBaseListAttHelper(baseListAtt); } if (result != null) { result.Graph = graph; } return(result); }
protected virtual void PMProject_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } PMProject pmProjectRow = (PMProject)e.Row; PMProjectSSExt pmProjectSSExtRow = PXCache <PMProject> .GetExtension <PMProjectSSExt>(pmProjectRow); pmProjectSSExtRow.SyncedInSmartsheet = pmProjectSSExtRow.UsrSmartsheetContractID != null; Dictionary <string, string> fields = new Dictionary <string, string>(); foreach (PMTemplateListSS pmTemplateListSSRow in PXSelectJoinGroupBy < PMTemplateListSS, InnerJoin <PMSSMapping, On <PMSSMapping.templateSS, Equal <PMTemplateListSS.templateSS>, And <PMSSMapping.nameAcu, IsNotNull, And <PMSSMapping.nameAcu, NotEqual <Required <PMSSMapping.nameAcu> > > > > >, Aggregate < GroupBy <PMTemplateListSS.templateSS> > > .Select(this.Base, "")) { fields.Add(pmTemplateListSSRow.TemplateSS, pmTemplateListSSRow.TemplateName); } PXStringListAttribute.SetList <PMProjectSSExt.usrTemplateSS>(sender, pmProjectRow, fields.Keys.ToArray(), fields.Values.ToArray()); PXUIFieldAttribute.SetEnabled <PMProjectSSExt.usrTemplateSS>(sender, pmProjectRow, !(bool)pmProjectSSExtRow.SyncedInSmartsheet); }
public SalesTaxMaint() { APSetup setup = APSetup.Current; PXUIFieldAttribute.SetVisible <TaxCategoryDet.taxID>(Categories.Cache, null, false); PXUIFieldAttribute.SetEnabled <TaxCategoryDet.taxID>(Categories.Cache, null, false); PXUIFieldAttribute.SetVisible <TaxCategoryDet.taxCategoryID>(Categories.Cache, null, true); PXUIFieldAttribute.SetEnabled <TaxCategoryDet.taxCategoryID>(Categories.Cache, null, true); //SWUIFieldAttribute.SetVisible<TaxCategory.taxCategoryID>(Category.Cache, null, false); PXUIFieldAttribute.SetVisible <TaxZoneDet.taxID>(Zones.Cache, null, false); PXUIFieldAttribute.SetEnabled <TaxZoneDet.taxID>(Zones.Cache, null, false); PXUIFieldAttribute.SetVisible <TaxZoneDet.taxZoneID>(Zones.Cache, null, true); PXUIFieldAttribute.SetEnabled <TaxZoneDet.taxZoneID>(Zones.Cache, null, true); //SWUIFieldAttribute.SetVisible<TaxZone.taxZoneID>(Zone.Cache, null, false); FieldDefaulting.AddHandler <BAccountR.type>((sender, e) => { if (e.Row != null) { e.NewValue = BAccountType.VendorType; } }); if (!PXAccess.FeatureInstalled <CS.FeaturesSet.vATReporting>()) { PXStringListAttribute.SetList <TX.Tax.taxType>(Tax.Cache, null, new CSTaxType.ListSimpleAttribute()); } }
protected virtual void ItemTypeValuesDependOnStkItemFlag(PXCache cache, InventoryItem row, bool isStock) { INItemTypes.CustomListAttribute strings = isStock ? (INItemTypes.CustomListAttribute) new INItemTypes.StockListAttribute() : new INItemTypes.NonStockListAttribute(); PXStringListAttribute.SetList <InventoryItem.itemType>(cache, row, strings.AllowedValues, strings.AllowedLabels); }
/// <summary> /// For the specified BQL field and its value, returns the label defined for that /// value by a cache-level instance of <see cref="PXStringListAttribute"/> /// residing on the field. /// </summary> /// <remarks> /// This method can be used when the string list is changed dynamically /// at the cache level. /// </remarks> public static string For <TField>(PXCache cache, string fieldValue) where TField : IBqlField { if (cache == null) { throw new ArgumentNullException(nameof(cache)); } if (fieldValue == null) { throw new ArgumentNullException(nameof(fieldValue)); } PXStringListAttribute stringListAttribute = cache .GetAttributesReadonly <TField>() .OfType <PXStringListAttribute>() .SingleOrDefault(); if (stringListAttribute == null) { throw new PXException( Messages.FieldDoesNotHaveCacheLevelAttribute, typeof(TField).FullName, nameof(PXStringListAttribute)); } string label; if (!stringListAttribute.ValueLabelDic.TryGetValue(fieldValue, out label)) { throw new PXException( Messages.StringListAttributeDoesNotDefineLabelForValue, fieldValue); } return(label); }
public static void SetLineTypeList <LineTypeField>(PXCache cache, object row, bool showSOInvoice = false, bool showNone = false, bool showProjects = false, bool showAPAR = false) where LineTypeField : class, IBqlField { CustomListAttribute dropDownList = GetDropDownList(showSOInvoice, showNone, showProjects, showAPAR); PXStringListAttribute.SetList <LineTypeField>(cache, row, dropDownList.AllowedValues, dropDownList.AllowedLabels); }
protected override void FillInventoryMatrixItem(EntryMatrix newRow, int colAttributeIndex, InventoryMapValue inventoryValue) { if (inventoryValue?.InventoryID == null) { return; } var item = InventoryItem.PK.Find(Base, inventoryValue.InventoryID); if (!IsItemStatusDisabled(item)) { newRow.InventoryIDs[colAttributeIndex] = inventoryValue.InventoryID; try { newRow.Quantities[colAttributeIndex] = GetQty(Header.Current.SiteID, inventoryValue.InventoryID); } catch (PXSetPropertyException exception) { newRow.InventoryIDs[colAttributeIndex] = null; newRow.Errors[colAttributeIndex] = exception.Message; } } else { string label = PXStringListAttribute.GetLocalizedLabel <InventoryItem.itemStatus>(Base.Caches <InventoryItem>(), item); newRow.Errors[colAttributeIndex] = PXLocalizer.LocalizeFormat(Messages.InventoryItemIsInStatus, label); } }
public LumItemsCOCMaint() { var _dataAttribute = SelectFrom <CSAttributeDetail> .Where <CSAttributeDetail.attributeID.IsEqual <@P.AsString> > .View.Select(this, "ENDC"); PXStringListAttribute.SetList <LumItemsCOC.endCustomer>(base.Caches[typeof(LumItemsCOC)], null, _dataAttribute.FirstTableItems.Select(x => x.ValueID).ToArray(), _dataAttribute.FirstTableItems.Select(x => x.Description).ToArray()); }
protected virtual void EPAssignmentMap_GraphType_FieldSelecting( PXCache cache, PXFieldSelectingEventArgs args, PXFieldSelecting baseHandler) { baseHandler(cache, args); PXStringListAttribute.AppendList <EPAssignmentMap.graphType>(cache, args.Row, typeof(SubcontractEntry).FullName.CreateArray(), Constants.SubcontractTypeName.CreateArray()); }
private void AddSubcontractType() { var allowedValues = POOrderType.RegularSubcontract.CreateArray(); var allowedLabels = Messages.Subcontract.CreateArray(); PXStringListAttribute.AppendList <POOrder.orderType>(Base.PurchaseOrders.Cache, null, allowedValues, allowedLabels); }
public INIssueEntry() { INSetup record = insetup.Current; PXStringListAttribute.SetList <INTran.tranType>(transactions.Cache, null, new INTranType.IssueListAttribute().AllowedValues, new INTranType.IssueListAttribute().AllowedLabels); //PXDimensionSelectorAttribute.SetValidCombo<INTran.subItemID>(transactions.Cache, true); //PXDimensionSelectorAttribute.SetValidCombo<INTranSplit.subItemID>(splits.Cache, true); }
public LifeSyncPreferenceMaint() { var _rateData = SelectFrom <CurrencyRateType> .View.Select(this); PXStringListAttribute.SetList <LifeSyncPreference.internalCostModelRateType>( base.Caches[typeof(LifeSyncPreference)], null, _rateData.FirstTableItems.Select(x => x.CuryRateTypeID).ToArray(), _rateData.FirstTableItems.Select(x => x.CuryRateTypeID).ToArray()); }
public virtual void SOLine_TestField_FieldSelecting(PXCache sender, PXFieldSelectingEventArgs e) { if (e.Row != null) { List <string> values = new List <string>(); values.AddRange(new[] { "First", "Second" }); PXStringListAttribute.SetList <SOLineExt.testField>(sender, null, values.ToArray(), values.ToArray()); } }
public RQRequestEnq() { Records.View.WhereAndCurrent <RQRequestSelection>(); PXStringListAttribute.SetList <InventoryItem.itemType>( this.Caches[typeof(InventoryItem)], null, new string[] { INItemTypes.FinishedGood, INItemTypes.Component, INItemTypes.SubAssembly, INItemTypes.NonStockItem, INItemTypes.LaborItem, INItemTypes.ServiceItem, INItemTypes.ChargeItem, INItemTypes.ExpenseItem }, new string[] { IN.Messages.FinishedGood, IN.Messages.Component, IN.Messages.SubAssembly, IN.Messages.NonStockItem, IN.Messages.LaborItem, IN.Messages.ServiceItem, IN.Messages.ChargeItem, IN.Messages.ExpenseItem } ); }
protected virtual void ReleaseChecksFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { PXUIFieldAttribute.SetVisible <ReleaseChecksFilter.curyID>(sender, null, (bool)CMSetup.Current.MCActivated); if (e.Row == null) { return; } PaymentMethod paymentType = PXSelect <PaymentMethod, Where <PaymentMethod.paymentMethodID, Equal <Current <ReleaseChecksFilter.payTypeID> > > > .Select(this); //PXUIFieldAttribute.SetVisible<APPayment.printCheck>(APPaymentList.Cache, null, (paymentType != null && (bool)paymentType.PrintChecks)); //PXUIFieldAttribute.SetEnabled<APPayment.printCheck>(APPaymentList.Cache, null, (paymentType != null && (bool)paymentType.PrintChecks)); var actions = new List <string>(); var actionNames = new List <string>(); AddAvailableAction(this.Release, "R", actions, actionNames, e.Row); if (paymentType != null && paymentType.PrintOrExport == true) { AddAvailableAction(this.Reprint, "D", actions, actionNames, e.Row); AddAvailableAction(this.VoidReprint, "V", actions, actionNames, e.Row); } PXStringListAttribute.SetList <ReleaseChecksFilter.action>(Filter.Cache, null, actions.ToArray(), actionNames.ToArray()); var row = e.Row as ReleaseChecksFilter; if (row == null) { return; } if (actions.Count > 0) { if (row.Action == null || !actions.Contains(row.Action)) { row.Action = actions[0]; } } else { row.Action = null; } string action = row.Action; this.APPaymentList.SetProcessEnabled(action != null); this.APPaymentList.SetProcessAllEnabled(action != null); APPaymentList.SetProcessDelegate(list => ReleasePayments(list, action)); }
protected virtual void SOFieldMapping_SourceObject_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e) { SOFieldMapping row = e.Row as SOFieldMapping; if (row != null) { List <string> sourceObjects = GetSourceObjects(); PXStringListAttribute.SetList <SOFieldMapping.sourceObject>(cache, row, sourceObjects.ToArray(), sourceObjects.ToArray()); } }
protected virtual void EPAssignmentMap_GraphType_FieldSelecting(PXCache sender, PXFieldSelectingEventArgs e) { EPAssignmentMap row = e.Row as EPAssignmentMap; if (row != null) { var list = Definitions.SiteMapNodes.OrderBy(x => x.Title); PXStringListAttribute.SetLocalizable <EPAssignmentMap.graphType>(sender, null, false); PXStringListAttribute.SetList <EPAssignmentMap.graphType>(sender, row, list.Select(x => x.GraphType).ToArray(), list.Select(x => x.Title).ToArray()); } }
protected void SetDataFieldLists(CRMerge document) { var dacInfo = ReadProperties(document); if (dacInfo != null) { PXStringListAttribute.SetList <CRMergeCriteria.dataField>(Criteria.Cache, null, dacInfo.FieldNames, dacInfo.FieldLabels); PXStringListAttribute.SetList <CRMergeMethod.dataField>(Methods.Cache, null, dacInfo.FieldNames, dacInfo.FieldLabels); } }
private void AppendOpperation() { var cache = Graph.Caches[typeof(OperationParam)]; var field = typeof(OperationParam.action).Name; var state = cache.GetStateExt(null, field) as PXStringState; var actionName = ActionName; if (state == null || state.AllowedValues == null || !state.AllowedValues.Contains(actionName)) { PXStringListAttribute.AppendList(cache, null, field, new[] { actionName }, new[] { actionName }); } }
/// <summary> Initial Project Type DDL </summary> public void _(Events.FieldSelecting <ENGineering.prjtype> e) { var prjType = SelectFrom <ENGProjectType> .View.Select(Base).RowCast <ENGProjectType>(); if (e.Row != null) { PXStringListAttribute.SetList <ENGineering.prjtype>( e.Cache, null, prjType.Select(x => x.Prjtype).ToArray(), prjType.Select(x => x.Description).ToArray()); } }
protected virtual void SOFieldMapping_SourceField_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e) { SOFieldMapping row = e.Row as SOFieldMapping; if (row == null || String.IsNullOrEmpty(row.SourceObject)) { return; } List <string> sourceFields = GetSourceFields(row.SourceObject); PXStringListAttribute.SetList <SOFieldMapping.sourceField>(cache, row, sourceFields.ToArray(), sourceFields.ToArray()); }
/// <summary> Get Country DDL </summary> protected void _(Events.FieldSelecting <SOPackageDetailExt.usrCountry> e) { if (e.Row != null) { var ddl = new PXGraph().Select <CSAttributeDetail>() .Where(x => x.AttributeID == "MADEIN"); PXStringListAttribute.SetList <SOPackageDetailExt.usrCountry>( e.Cache, e.Row, ddl.Select(x => x.ValueID).ToArray(), ddl.Select(x => x.Description).ToArray()); } }
protected virtual void ReleaseChecksFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { PXUIFieldAttribute.SetVisible <ReleaseChecksFilter.curyID>(sender, null, PXAccess.FeatureInstalled <FeaturesSet.multicurrency>()); ReleaseChecksFilter filter = e.Row as ReleaseChecksFilter; if (filter == null) { return; } PaymentMethod paymentMethod = PXSelect <PaymentMethod, Where <PaymentMethod.paymentMethodID, Equal <Required <ReleaseChecksFilter.payTypeID> > > > .Select(this, filter.PayTypeID); Reprint.SetEnabled(paymentMethod != null && paymentMethod.PrintOrExport == true); VoidReprint.SetEnabled(paymentMethod != null && paymentMethod.PrintOrExport == true); List <Tuple <string, string> > availableActions = new List <Tuple <string, PXAction> > { new Tuple <string, PXAction>(ReleaseChecksFilter.action.ReleaseChecks, Release), new Tuple <string, PXAction>(ReleaseChecksFilter.action.ReprintChecks, Reprint), new Tuple <string, PXAction>(ReleaseChecksFilter.action.VoidAndReprintChecks, VoidReprint) } .Select(t => new { ShortCut = t.Item1, State = t.Item2.GetState(filter) as PXButtonState }) .Where(t => t.State?.Enabled == true) .Select(t => new Tuple <string, string>(t.ShortCut, t.State.DisplayName)).ToList(); string[] actions = availableActions.Select(t => t.Item1).ToArray(); PXStringListAttribute.SetLocalizable <ReleaseChecksFilter.action>(Filter.Cache, null, false); PXStringListAttribute.SetList <ReleaseChecksFilter.action>(Filter.Cache, null, actions, availableActions.Select(t => t.Item2).ToArray()); PXUIFieldAttribute.SetEnabled <ReleaseChecksFilter.action>(Filter.Cache, filter, availableActions.Count > 1); if (availableActions.Count > 0) { if (filter.Action == null || !actions.Contains(filter.Action)) { filter.Action = actions[0]; } } else { filter.Action = null; } string action = filter.Action; APPaymentList.SetProcessEnabled(action != null); APPaymentList.SetProcessAllEnabled(action != null); APPaymentList.SetProcessDelegate(list => ReleasePayments(list, action)); }
protected virtual void APDiscount_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { APDiscount row = e.Row as APDiscount; if (row != null) { PXUIFieldAttribute.SetEnabled <APDiscount.excludeFromDiscountableAmt>(sender, row, row.Type == DiscountType.Line); PXUIFieldAttribute.SetEnabled <APDiscount.skipDocumentDiscounts>(sender, row, row.Type == DiscountType.Group); PXStringListAttribute.SetList <APDiscount.type>(sender, null, new Tuple <string, string>[] { new Tuple <string, string> (DiscountType.Line, AR.Messages.Line), new Tuple <string, string> (DiscountType.Group, AR.Messages.Group), new Tuple <string, string> (DiscountType.Document, AR.Messages.Document) }); } }
protected virtual void SOFieldMapping_TargetObject_FieldSelecting(PXCache sender, PXFieldSelectingEventArgs e) { if (e.Row == null) { return; } List <string> values = new List <string>(); List <string> labels = new List <string>(); GetTargetObjects(values, labels); PXStringListAttribute.SetList <SOFieldMapping.targetObject>(sender, e.Row, values.ToArray(), labels.ToArray()); }
/// <summary> Set Date Code DDL </summary> protected void _(Events.RowSelected <SOPackageDetailEx> e, PXRowSelected baseMethod) { baseMethod?.Invoke(e.Cache, e.Args); if (e.Row != null) { var splitData = SelectFrom <SOShipLineSplit> .Where <SOShipLineSplit.shipmentNbr.IsEqual <P.AsString> .And <SOShipLineSplit.lineNbr.IsEqual <P.AsInt> > > .View.Select(Base, e.Row.ShipmentNbr, e.Row.GetExtension <SOPackageDetailExt>().UsrShipmentSplitLineNbr).RowCast <SOShipLineSplit>();; PXStringListAttribute.SetList <SOPackageDetailExt.usrDateCode>( e.Cache, e.Row, splitData.Select(x => x?.LotSerialNbr).ToArray(), splitData.Select(x => x?.LotSerialNbr).ToArray()); } }
protected virtual void AddPrepaymentToDocTypeList() { PXStringListAttribute attribute = Base.Adjustments.Cache.GetAttributesReadonly <APAdjust.adjdDocType>(null) .OfType <PXStringListAttribute>().FirstOrDefault(); if (attribute != null) { var allowedValues = new List <string>(attribute.ValueLabelDic.Keys); var allowedLabels = new List <string>(attribute.ValueLabelDic.Values); allowedValues.Add(APDocType.Prepayment); allowedLabels.Add(AP.Messages.Prepayment); PXStringListAttribute.SetList <APAdjust.adjdDocType>(Base.Adjustments.Cache, null, allowedValues.ToArray(), allowedLabels.ToArray()); } }
protected virtual void FixedAsset_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { FixedAsset cls = (FixedAsset)e.Row; if (cls == null) { return; } PXUIFieldAttribute.SetEnabled <FixedAsset.accumDeprSubMask>(sender, cls, cls.UseFASubMask != true); bool?UpdateGL = null; foreach (FABookSettings books in DepreciationSettings.Select()) { if ((UpdateGL = books.UpdateGL) == true) { break; } } PXUIFieldAttribute.SetEnabled <FixedAsset.holdEntry>(sender, e.Row, (UpdateGL != true)); if (((FixedAsset)e.Row).HoldEntry == false && UpdateGL == true) { ((FixedAsset)e.Row).HoldEntry = true; if (sender.GetStatus(e.Row) == PXEntryStatus.Notchanged) { sender.SetStatus(e.Row, PXEntryStatus.Updated); sender.IsDirty = true; } } if (cls.IsTangible == true) { PXStringListAttribute.SetList <FixedAsset.assetType>(sender, null, new FixedAsset.assetType.TangibleListAttribute().AllowedValues, new FixedAsset.assetType.TangibleListAttribute().AllowedLabels); } else { PXStringListAttribute.SetList <FixedAsset.assetType>(sender, null, new FixedAsset.assetType.NonTangibleListAttribute().AllowedValues, new FixedAsset.assetType.NonTangibleListAttribute().AllowedLabels); } }