Beispiel #1
0
        private void action(XmlElement actionElement, ActionImpl actionImpl)
        {
            actionImpl.EventType = EventTypeHelper.fromText(actionElement.GetAttribute("event"));
            DelegationImpl delegation = new DelegationImpl();

            delegation.ProcessDefinition = ProcessDefinition;
            actionImpl.ActionDelegation  = delegation;
            this.delegation <ActionImpl>(actionElement, delegation);
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        protected void Action_ShipmentAddOrder(PXGraph graph, ActionImpl action)
        {
            var shipmentEntry = (SOShipmentEntry)graph;

            foreach (SOShipmentPlan line in shipmentEntry.soshipmentplan.Select())
            {
                line.Selected = true;
                shipmentEntry.soshipmentplan.Update(line);
            }

            shipmentEntry.addSO.Press();
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        protected void Action_SalesOrderAddInvoice(PXGraph graph, ActionImpl action)
        {
            var orderEntry = (SOOrderEntry)graph;

            foreach (InvoiceSplits line in orderEntry.invoicesplits.Select())
            {
                line.Selected = true;
                orderEntry.invoicesplits.Update(line);
            }

            orderEntry.addInvoiceOK.Press();
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        protected void Action_SalesOrderAddStockItem(PXGraph graph, ActionImpl action)
        {
            var orderEntry = (SOOrderEntry)graph;

            foreach (SOSiteStatusSelected line in orderEntry.sitestatus.Select())
            {
                line.Selected = true;
                orderEntry.sitestatus.Update(line);
            }

            orderEntry.addInvSelBySite.Press();
            orderEntry.sitestatusfilter.Cache.Clear();
        }
    /// <summary>
    /// Adds all lines of a given order to the shipment.
    /// </summary>
    protected void Action_AddOrder(PXGraph graph, ActionImpl action)
    {
        SOShipmentEntry shipmentEntry = (SOShipmentEntry)graph;

        shipmentEntry.addsofilter.Current.OrderType = ((EntityValueField)action.Fields.Single(f => f.Name == "OrderType")).Value;
        shipmentEntry.addsofilter.Current.OrderNbr  = ((EntityValueField)action.Fields.Single(f => f.Name == "OrderNbr")).Value;
        shipmentEntry.addsofilter.Update(shipmentEntry.addsofilter.Current);

        foreach (SOShipmentPlan line in shipmentEntry.soshipmentplan.Select())
        {
            line.Selected = true;
            shipmentEntry.soshipmentplan.Update(line);
        }

        shipmentEntry.addSO.Press();
    }
Beispiel #6
0
        private void definitionObject(XmlElement definitionObjectElement, DefinitionObjectImpl definitionObject, ProcessBlockImpl processBlock)
        {
            definitionObject.Actions     = new ArrayList();
            definitionObject.Name        = definitionObjectElement.GetProperty("name");
            definitionObject.Description = definitionObjectElement.GetProperty("description");

            IEnumerator iter = definitionObjectElement.GetChildElements("action").GetEnumerator();

            while (iter.MoveNext())
            {
                XmlElement actionElement = (XmlElement)iter.Current;
                ActionImpl action        = new ActionImpl();
                action.DefinitionObjectId = definitionObject.Id;
                this.action(actionElement, action);
                definitionObject.Actions.Add(action);
            }
        }
Beispiel #7
0
        /// <summary>
        ///
        /// </summary>
        protected void Action_SalesInvoiceAddOrder(PXGraph graph, ActionImpl action)
        {
            var    invoiceEntry = (SOInvoiceEntry)graph;
            string orderNbr     = ((EntityValueField)action.Fields.Single(f => f.Name == "OrderNbr")).Value;
            string orderType    = ((EntityValueField)action.Fields.Single(f => f.Name == "OrderType")).Value;
            string shipmentNbr  = ((EntityValueField)action.Fields.Single(f => f.Name == "ShipmentNbr")).Value;

            foreach (SOOrderShipment line in invoiceEntry.shipmentlist.Select().Select <SOOrderShipment>().Where(_ =>
                                                                                                                 _.OrderType == orderType &&
                                                                                                                 _.OrderNbr == orderNbr &&
                                                                                                                 _.ShipmentNbr == shipmentNbr))
            {
                line.Selected = true;
                invoiceEntry.shipmentlist.Update(line);
            }

            invoiceEntry.addShipment.Press();
        }
Beispiel #8
0
        public void RunActionsForEvent(EventType eventType, long definitionObjectId, ExecutionContextImpl executionContext, DbSession dbSession)
        {
            log.Debug("processing '" + eventType + "' events for executionContext " + executionContext);

            // find all actions for definitionObject on the given eventType
            Object[] values = new Object[] { eventType, definitionObjectId };
            IType[]  types  = new IType[] { DbType.INTEGER, DbType.LONG };

            IList       actions = dbSession.Find(queryFindActionsByEventType, values, types);
            IEnumerator iter    = actions.GetEnumerator();

            log.Debug("list" + actions);
            while (iter.MoveNext())
            {
                ActionImpl action = (ActionImpl)iter.Current;
                log.Debug("action: " + action);
                delegationHelper.DelegateAction(action.ActionDelegation, executionContext);
            }
            log.Debug("ende runActionsForEvent!");
        }
Beispiel #9
0
            public override bool TryGetMember(
                GetMemberBinder binder, out object result)
            {
                // Converting the property name to lowercase
                // so that property names become case-insensitive.
                var name = binder.Name.ToLower();

                if (!itemsByName.ContainsKey(name))
                    itemsByName[name] = new ActionImpl(name);

                result = itemsByName[name];

                return true;
            }
Beispiel #10
0
        /// <summary>
        ///
        /// </summary>
        protected void Action_PaymentLoadOrders(PXGraph graph, ActionImpl action)
        {
            var paymentEntry = (ARPaymentEntry)graph;

            paymentEntry.LoadOrdersProc(false, paymentEntry.loadOpts.Current);
        }