public RuleConditionsListAttribute() : base() { List <int> values = new List <int>(); List <string> names = new List <string>(); string[] enumNames = PXEnumDescriptionAttribute.GetNames(typeof(PXCondition)); values.Add(0); names.Add(enumNames[0]); values.Add(1); names.Add(enumNames[1]); values.Add(2); names.Add(enumNames[2]); values.Add(3); names.Add(enumNames[3]); values.Add(4); names.Add(enumNames[4]); values.Add(5); names.Add(enumNames[5]); values.Add(6); names.Add(enumNames[6]); values.Add(7); names.Add(enumNames[7]); values.Add(8); names.Add(enumNames[8]); values.Add(9); names.Add(enumNames[9]); //values.Add(10); names.Add(enumNames[10]); SKIP BEETWEEN values.Add(11); names.Add(enumNames[11]); values.Add(12); names.Add(enumNames[12]); this._AllowedLabels = names.ToArray(); this._AllowedValues = values.ToArray(); this._NeutralAllowedLabels = names.ToArray(); }
static CRMarketingListMaint() { var commonValuesList = new List <int>(); var commonLabelsList = new List <string>(); var numberValuesList = new List <int>(); var numberLabelsList = new List <string>(); var dateValuesList = new List <int>(); var dateLabelsList = new List <string>(); foreach (var info in PXEnumDescriptionAttribute.GetFullInfo(typeof(PXCondition))) { var key = (byte)(int)Enum.Parse(typeof(PXCondition), info.Key.ToString()); switch (info.Value.Key) { case "NUMBER": numberValuesList.Add(key); numberLabelsList.Add(info.Value.Value); break; case "DATETIME": dateValuesList.Add(key); dateLabelsList.Add(info.Value.Value); break; case "COMMON": numberValuesList.Add(key); numberLabelsList.Add(info.Value.Value); dateValuesList.Add(key); dateLabelsList.Add(info.Value.Value); commonValuesList.Add(key); commonLabelsList.Add(info.Value.Value); break; case "HIDDEN": break; default: commonValuesList.Add(key); commonLabelsList.Add(info.Value.Value); break; } } _commonConditionsValues = commonValuesList.ToArray(); _commonConditionsLabels = commonLabelsList.ToArray(); _numberConditionsValues = numberValuesList.ToArray(); _numberConditionsLabels = numberLabelsList.ToArray(); _dateConditionsValues = dateValuesList.ToArray(); _dateConditionsLabels = dateLabelsList.ToArray(); }
private void Initialize() { MovePrimaryViewToFirst(); graphTypeName = GetType().FullName; propertyListAtt = new CRPropertyListAttribute(Items.View.BqlSelect); propertyListAtt.Initialize(); conditionNames = PXEnumDescriptionAttribute.GetNames(typeof(PXCondition)); List <string> values = new List <string>(); foreach (object item in Enum.GetValues(typeof(PXCondition))) { values.Add(item.ToString()); } conditionValues = values.ToArray(); selectTable = Items.Cache.GetItemType(); itemsKeyProperty = SearchKeyProperty(selectTable); }
public RuleConditionsListAttribute() : base() { var enums = PXEnumDescriptionAttribute.GetValueNamePairs(typeof(PXCondition), localize: false); var conditions = new[] { PXCondition.EQ, PXCondition.NE, PXCondition.GT, PXCondition.GE, PXCondition.LT, PXCondition.LE, PXCondition.LIKE, PXCondition.RLIKE, PXCondition.LLIKE, PXCondition.NOTLIKE, //PXCondition.BETWEEN, PXCondition.ISNULL, PXCondition.ISNOTNULL, }; this._AllowedValues = conditions.Select(i => (int)i).ToArray(); this._AllowedLabels = enums.Where(i => conditions.Contains((PXCondition)i.Key)).Select(i => i.Value).ToArray(); this._NeutralAllowedLabels = this._AllowedLabels.ToArray(); // to make copy }
private void TraceResult(EPRule rule, List <EPRuleBaseCondition> conditions, int count) { PXTrace.WriteInformation(Messages.TraceRuleResult, rule.StepName, rule.Name, count, count > 0 ? "Satisfied" : "Unsatisfied"); string result = null; foreach (var condition in conditions) { result += string.Format(Messages.TraceCondition, GraphHelper.GetType(condition.Entity).Name, condition.FieldName, PXEnumDescriptionAttribute.GetInfo(typeof(PXCondition), (PXCondition)(condition.Condition ?? 0)).Value, condition.Value, condition.Value2); } PXTrace.WriteInformation(Messages.TraceConditions, result); }