De code hieronder laat toe om de naam, het adres en de stad die worden geïmporteerd vanuit CheckVatPort in hoofdletters te dwingen. Dit kan wenselijk zijn vanuit sinds de wijziging van de dienst betreffende de Belgische BTW-nummers.
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using MercatorApi;
using MercatorExtensions;
using MercatorUi;
using System.Windows.Forms;
namespace SigCli
{
public class Customizer : MercatorUi.ICustomizers.IFormLoadCustomizer, MercatorUi.ICustomizers.IFormClosedCustomizer
{
public void FormLoadCustomize(Form windowsForm)
{
MercatorUi.Forms.Sig.SigForm sigForm = (MercatorUi.Forms.Sig.SigForm)windowsForm;
sigForm.ReadCheckVatPort += sigForm_ReadCheckVatPort;
}
public void FormClosedCustomize(Form windowsForm)
{
MercatorUi.Forms.Sig.SigForm sigForm = (MercatorUi.Forms.Sig.SigForm)windowsForm;
sigForm.ReadCheckVatPort -= sigForm_ReadCheckVatPort;
}
private void sigForm_ReadCheckVatPort(object sender, EventArgs e)
{
MercatorUi.Forms.Sig.SigForm sigForm = (MercatorUi.Forms.Sig.SigForm)sender;
sigForm.DataSourceRow[sigForm.Sig.Letter1 + "_NOM"] = sigForm.DataSourceRow[sigForm.Sig.Letter1 + "_NOM"].ToString().ToUpper();
sigForm.DataSourceRow[sigForm.Sig.Letter1 + "_ADRESSE"] = sigForm.DataSourceRow[sigForm.Sig.Letter1 + "_ADRESSE"].ToString().ToUpper();
sigForm.DataSourceRow[sigForm.Sig.Letter1 + "_VILLE"] = sigForm.DataSourceRow[sigForm.Sig.Letter1 + "_VILLE"].ToString().ToUpper();
}
}
}