我有条件说明......除此之外,WalgreensRewardsDRLookupEnabledPPI类应该检查是否 字段WAG_REWARDS_DR_ROLLOUT_LOOKUP_ LOCKED为true。如果是,则检查事务参数 ITransactionHashtableWag.EMPLOYEE_DISCOUNT_APPLIED_ENABLE_LOOKUP。只有当它 为true,返回值为10,否则返回值为0.如果WAG_REWARDS_DR_ROLLOUT_LOOKUP_ LOCKED为false,则返回10。
请告知以下实施代码是否正确..
if (WAG_REWARDS_DR_ROLLOUT_LOOKUP_ LOCKED == true)
{
if ( (WAG_REWARDS_DR_ROLLOUT_LOOKUP_ LOCKED == true) && (ITransactionHashtableWag.EMPLOYEE_DISCOUNT_APPLIED_ENABLE_LOOKUP == true)
{
return 10 ;
}
}
else
return 0;
请指教以上实施是否正确。!!
答案 0 :(得分:1)
这不正确。当WAG_REWARDS_DR_ROLLOUT_LOOKUP_LOCKED为true且EMPLOYEE_DISCOUNT_APPLIED_ENABLE_LOOKUP为false时,您没有return语句。 您可以大大简化为:
if (WAG_REWARDS_DR_ROLLOUT_LOOKUP_LOCKED
&& ITransactionHashtableWag.EMPLOYEE_DISCOUNT_APPLIED_ENABLE_LOOKUP) {
return 10;
}
return 0;