AX2012单元格显示颜色 displayOption

时间:2023-03-08 15:37:18

public void displayOption(HV_WMSLocationStatusHistory _record, FormRowDisplayOption _options)
{
    #define.Yellow(255,255,0)
    #define.Green(0,255,0)
    #define.Red(255, 0, 0)

//Onhand
    if(_record.PdsCWInventQtyOnHand > 0)
    {
        _options.backColor(WinAPI::RGB2int(#Yellow));
        _options.affectedElementsByControl(HV_WMSLocationStatusHistory_PdsCWInventQtyOnHand.id());
    }
    if(_record.InventQtyOnHand > 0)
    {
        _options.backColor(WinAPI::RGB2int(#Yellow));
        _options.affectedElementsByControl(HV_WMSLocationStatusHistory_InventQtyOnHand.id());
    }

//Receipt
    if(_record.dispPeriodTTLReceiptPdsCWQty() > 0)
    {
        _options.backColor(WinAPI::RGB2int(#Green));
        _options.affectedElementsByControl(dispPeriodTTLReceiptPdsCWQty.id());
    }

if(_record.dispPeriodTTLReceiptQty() > 0)
    {
        _options.backColor(WinAPI::RGB2int(#Green));
        _options.affectedElementsByControl(dispPeriodTTLReceiptQty.id());
    }
    //Issue
    if(_record.dispPeriodTTLIssuePdsCWQty() < 0)
    {
        _options.backColor(WinAPI::RGB2int(#red));
        _options.affectedElementsByControl(dispPeriodTTLIssuePdsCWQty.id());
    }

if(_record.dispPeriodTTLIssueQty() < 0)
    {
        _options.backColor(WinAPI::RGB2int(#red));
        _options.affectedElementsByControl(dispPeriodTTLIssueQty.id());
    }
    super(_record, _options);
}