De code hieronder laat toe om knoppen die met betaalwijzen CZAM (terminals van Atos-Worldline) overeenstemmen, anderen dan “Standaard keuze” te verbergen. De code kan eenvoudig worden aangepast om knoppen volgens een andere logica te verbergen.
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Windows.Forms;
using MercatorApi;
using MercatorExtensions;
using MercatorUi;
namespace Billing
{
public class Customizer : MercatorUi.ICustomizers.IBillingEngineCreated, MercatorUi.ICustomizers.IBillingEngineClosed
{
public void BillingEngineCreated(MercatorUi.Engine.Gescom.BillingEngine BillingEngine)
{
BillingEngine.PaymentsTouchAddingButton += BillingEngine_PaymentsTouchAddingButton;
}
public void BillingEngineClosed(MercatorUi.Engine.Gescom.BillingEngine BillingEngine)
{
BillingEngine.PaymentsTouchAddingButton -= BillingEngine_PaymentsTouchAddingButton;
}
private void BillingEngine_PaymentsTouchAddingButton(object sender, MercatorUi.Engine.Gescom.BillingEngine.PaymentsTouchAddingButtonEventArgs e)
{
if (e.Type == MercatorUi.Engine.Gescom.BillingEngine.PaymentsTouchAddingButtonEventArgs.ButtonType.Mode)
{
string czam = e.DataRow["CZAM"].ToString();
e.CancelAddingButton = (czam != "") && (czam != "0") && (czam != "19"); // 19 = Selectie of standaard
}
}
}
}