OnDetailColumnChanged

From AutoCount Resource Center
Revision as of 06:12, 2 October 2017 by 61.6.9.94 (talk) (Created page with "{{NavigateDeveloper|collapsed}} ==OnDetailColumnChanged== '''OnDetailColumnChanged''' is triggered when user changes the value at detail area. ===OnDetailColumnChanged even...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Go to menu

Go to top
Resources For AutoCount Software Developers


OnDetailColumnChanged

OnDetailColumnChanged is triggered when user changes the value at detail area.

OnDetailColumnChanged event in Sales Invoice

public void OnDetailColumnChanged(BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceDetailColumnChangedEventArgs e)

Example

public void OnDetailColumnChanged(BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceDetailColumnChangedEventArgs e)
{
    if (e.ChangedColumnName == "Qty" || e.ChangedColumnName == "UOM")
    {
        e.CurrentDetailRecord.FOCQty = GetFOCQty(e.CurrentDetailRecord.SmallestQty);
    }
}

private BCE.Data.DBDecimal GetFOCQty(decimal qty)
{
    if (qty >= 10)
    {
        return Math.Floor(qty / 10);
    }
    else
    {
        return DBNull.Value;
    }
}

When Qty value is changed, it will refresh the value of FOCQty. The value of FOCQty is based on the qty of every 10 unit.
In this example, you will also see the example using of DBDecimal and DBNull.Value.