My Rule Wizard set up:
I know I’m doing something wrong in calling up the PartCost.AvgTotalCost value in the DelegateArgs.
My Rule Wizard set up:
I know I’m doing something wrong in calling up the PartCost.AvgTotalCost value in the DelegateArgs.
private void CreateRowRulePartUnitPriceCustomCondition()
{
// Description: ChkUnitPrice
// **** begin autogenerated code ****
RuleAction warningPart_UnitPrice = RuleAction.AddControlSettings(this.oTrans, "Part.UnitPrice", SettingStyle.Warning);
RuleAction[] ruleActions = new RuleAction[] {
warningPart_UnitPrice};
// Create RowRule and add to the EpiDataView.
RowRule rrCreateRowRulePartUnitPriceCustomCondition = new RowRule("Part.UnitPrice", new RowRuleConditionDelegate2(this.PartUnitPricePartCostAvgTotalCost_CustomRuleCondition), "PartCost.AvgTotalCost", ruleActions);
((EpiDataView)(this.oTrans.EpiDataViews["Part"])).AddRowRule(rrCreateRowRulePartUnitPriceCustomCondition);
// **** end autogenerated code ****
}
private bool PartUnitPricePartCostAvgTotalCost_CustomRuleCondition(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
bool result = false;
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put Row Rule condition evaluation logic here
double uprice = System.Double.Parse(args.Arg1.ToString());
if (uprice <= PartCost.AvgTotalCost)
{
return true;
}
return result;
}
}