public override void Process(ActionData actionData)
        {
            var script = actionData.GetAsString("ScriptName");

            if (!string.IsNullOrEmpty(script))
            {
                _expressionService.EvalCommand(script, "", actionData.DataObject, true);
            }
        }
 private void OnActionData(EventParameters <ActionData> obj)
 {
     if (obj.Value.Action.ActionType == ActionNames.ExecuteScript)
     {
         var script = obj.Value.GetAsString("ScriptName");
         if (!string.IsNullOrEmpty(script))
         {
             _expressionService.EvalCommand(script, "", obj.Value.DataObject, true);
         }
     }
 }
 private bool CanExecuteAutomationCommand(AutomationCommandData arg)
 {
     if (arg == null)
     {
         return(false);
     }
     if (_paymentEditor.SelectedTicket != null && _paymentEditor.SelectedTicket.IsLocked && arg.VisualBehaviour == 1)
     {
         return(false);
     }
     if (!arg.CanExecute(_paymentEditor.SelectedTicket))
     {
         return(false);
     }
     return(_expressionService.EvalCommand(FunctionNames.CanExecuteAutomationCommand, arg.AutomationCommand, new { Ticket = _paymentEditor.SelectedTicket }, true));
 }
Beispiel #4
0
        public void RecalculateTicket(Ticket ticket)
        {
            var total = ticket.TotalAmount;

            ticket.Calculations.Where(x => x.CalculationType == 5).ToList().ForEach(
                x => x.Amount = _expressionService.EvalCommand(FunctionNames.Calculation, "_" + x.Name, new { Ticket = ticket }, 0m));
            ticket.Recalculate();
            if (total != ticket.TotalAmount)
            {
                _applicationState.NotifyEvent(RuleEventNames.TicketTotalChanged,
                                              new
                {
                    Ticket          = ticket,
                    PreviousTotal   = total,
                    TicketTotal     = ticket.GetSum(),
                    DiscountTotal   = ticket.GetPreTaxServicesTotal(),
                    PaymentTotal    = ticket.GetPaymentAmount(),
                    RemainingAmount = ticket.GetRemainingAmount()
                });
            }
        }
Beispiel #5
0
 private bool CanExecuteAutomationCommand(CommandContainerButton arg)
 {
     return(arg.IsEnabled && arg.CommandContainer.CanExecute(SelectedTicket) && _expressionService.EvalCommand(FunctionNames.CanExecuteAutomationCommand, arg.CommandContainer.AutomationCommand, new { Ticket = SelectedTicket }, true));
 }
Beispiel #6
0
 private bool CanSelectAutomationCommand(AutomationCommandData arg)
 {
     return(arg.CanExecute(SelectedTicket) && _expressionService.EvalCommand(FunctionNames.CanExecuteAutomationCommand, arg.AutomationCommand, new { Ticket = SelectedTicket }, true));
 }