using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using MercatorApi;
using MercatorUi;
using System.Windows.Forms;
namespace Main
{
public class Customizer : MercatorUi.ICustomizers.IExec
{
public void Main(MercatorUi.ICustomizers.ExecAction Action)
{
if (Action == MercatorUi.ICustomizers.ExecAction.DossierOpen)
{
Dialogs.BeforeAnswerYesNo += new Dialogs.BeforeAnswerYesNoEventHandler(Dialogs_BeforeAnswerYesNo);
}
else if (Action == MercatorUi.ICustomizers.ExecAction.DossierClose)
{
Dialogs.BeforeAnswerYesNo -= new Dialogs.BeforeAnswerYesNoEventHandler(Dialogs_BeforeAnswerYesNo);
}
}
void Dialogs_BeforeAnswerYesNo(Dialogs.BeforeAnswerYesNoEventArgs e)
{
if (e.Message == _Divers.Iif_langue(Globals.Langue, "Remove linked lines ?", "Verbonden lijnen wissen ?", "Effacer les lignes liées ?"))
{
Form wonTop = MercatorUi.Globals.Main.WonTopForm();
if (wonTop is MercatorUi.Forms.Billing.BillingForm)
{
MercatorUi.Forms.Billing.BillingForm billingForm = (MercatorUi.Forms.Billing.BillingForm)wonTop;
if (billingForm.BillingEngine.Journal == "VEN")
e.Action = YesNoAskEnum.Yes; // simuler réponse à la question = OUI
}
}
}
}
}