/* * when * order is closed * then * topup the voucher to user account and set the order status to redeemed */ public override void Define() { SalesOrder salesOrder = null; When() .Match <SalesOrder>(() => salesOrder, s => s.OrderProgressTypeId == OrderProgressStatus.CLOSED); ; Then() .Do(ctx => salesOrder.AutoTopupCreditPoints()) .Do(ctx => new LogHelper().Log(salesOrder.SalesOrderName + "has been processed by AutoTopupVoucherRule")); }