0

C#クライアント側を使用してアプリケーションを介して Sage 200 に注文を挿入していますAPIs

「オーダーで支払う」タブの「全額支払い」チェックボックスをチェックしたいのですが。

ここに画像の説明を入力

現在、機能していない PaymentType プロパティを設定しています。

order.PaymentType = Sage.Accounting.SOP.SOPOrderPaymentTypeEnum.EnumSOPOrderPaymentTypeFull;

order は のインスタンスです Sage.Accounting.SOP.SOPOrder

そのプロパティを確認する方法を知っていますか?

4

2 に答える 2

0

The following method should supply the required results.

    private static void SetPaymentWithOrder(Sage.Accounting.SOP.SOPOrder sopOrder)
    {
        // Indicate that order has payment
        sopOrder.PaymentWithOrder = true;

        // This is full payment order
        sopOrder.PaymentType = Sage.Accounting.SOP.SOPOrderPaymentTypeEnum.EnumSOPOrderPaymentTypeFull;

        // Fetch the the Payment Methods. SOPPaymentMethods contructor accepts the boolean flag whether to fetch payment methods including card processing method or not.
        Sage.Accounting.SOP.SOPPaymentMethods paymentMethodsCollection = new Sage.Accounting.SOP.SOPPaymentMethods(false);

        // Set the first payment method of the collection to the order
        sopOrder.PaymentMethod = paymentMethodsCollection.First;
    }

enter image description here

于 2016-03-16T17:28:25.643 に答える
0

これを理解できたかどうかはわかりません。

これを知っているかどうかはわかりませんが、ビュー フォームでセールス オーダーを変更することはできません。少なくとも変更しようとするべきではありません。

Enter/Amend Sales Order フォームのいずれかを使用すると、これを行うことができます。潜在的に起こっていることは、コントロールがバインドされているプロパティが、コードの実行後に UI を更新していないことです。

次のコマンドを使用して、これを強制的に実行できます。

基礎となるバインドされたオブジェクトの取得

public Sage.Accounting.SOP.SOPOrderReturn SOPOrderReturn
{
    get
    {
        //Loop over the boundobjects collection
        //check if the bound object is of the type we want - e.g. SOPOrderReturn
        //if correct type, return this object
        Sage.Common.Collections.BoundObjectCollection boundObjects = this.form.BoundObjects;

        if (boundObjects != null)
        {
            foreach (object boundObject in boundObjects)
            {
                if (boundObject is Sage.Accounting.SOP.SOPOrderReturn)
                {
                    this._sopOrderReturn = boundObject as Sage.Accounting.SOP.SOPOrderReturn;
                    break;
                }
            }
        }
        return this._sopOrderReturn;
    }
}

修正可能なフォームである正しい基になるフォーム タイプを取得し、データ バインディングを中断し、変更を実行し、データ バインディングを再開します。

Sage.MMS.SOP.MaintainOrderForm maintainOrderForm = this.form.UnderlyingControl as Sage.MMS.SOP.MaintainOrderForm;

maintainOrderForm.BindingContext[this.SOPOrderReturn].SuspendBinding();
this.SOPOrderReturn.PaymentWithOrder = true;
this.SOPOrderReturn.PaymentType = Sage.Accounting.SOP.SOPOrderPaymentTypeEnum.EnumSOPOrderPaymentTypeFull;
maintainOrderForm.BindingContext[this.SOPOrderReturn].ResumeBinding();

トリックを行う必要があります。

于 2016-09-02T12:22:28.513 に答える