public class GHMCPurchOrderCreateFormEventHandler
{
[PostHandlerFor(formStr(PurchCreateOrder), formMethodStr(PurchCreateOrder, run))]
public static void PurchCreateOrder_Post_run(XppPrePostArgs args)
{
FormRun formRun = args.getThis();
if (formRun.args().menuItemName() == menuItemDisplayStr(GHMCAffidavitPurchCreateOrder))
{
FormDataSource formDataSource = formRun.dataSource(tableStr(PurchTable));
PurchTable purchTable = formDataSource.cursor();
purchTable.PurchPoolId = GHMCPurchParameters::find().AffidavitPurchPoolId;
}
}
[FormDataFieldEventHandler(formDataFieldStr(PurchCreateOrder, PurchTable, OrderAccount), FormDataFieldEventType::Modified)]
public static void OrderAccount_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
{
FormDataSource formDataSource = sender.datasource();
FormRun formRun = formDataSource.formRun();
if (formRun.args().menuItemName() == menuItemDisplayStr(GHMCAffidavitPurchCreateOrder))
{
PurchTable purchTable = formDataSource.cursor();
purchTable.PurchPoolId = GHMCPurchParameters::find().AffidavitPurchPoolId;
}
}
}
{
[PostHandlerFor(formStr(PurchCreateOrder), formMethodStr(PurchCreateOrder, run))]
public static void PurchCreateOrder_Post_run(XppPrePostArgs args)
{
FormRun formRun = args.getThis();
if (formRun.args().menuItemName() == menuItemDisplayStr(GHMCAffidavitPurchCreateOrder))
{
FormDataSource formDataSource = formRun.dataSource(tableStr(PurchTable));
PurchTable purchTable = formDataSource.cursor();
purchTable.PurchPoolId = GHMCPurchParameters::find().AffidavitPurchPoolId;
}
}
[FormDataFieldEventHandler(formDataFieldStr(PurchCreateOrder, PurchTable, OrderAccount), FormDataFieldEventType::Modified)]
public static void OrderAccount_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
{
FormDataSource formDataSource = sender.datasource();
FormRun formRun = formDataSource.formRun();
if (formRun.args().menuItemName() == menuItemDisplayStr(GHMCAffidavitPurchCreateOrder))
{
PurchTable purchTable = formDataSource.cursor();
purchTable.PurchPoolId = GHMCPurchParameters::find().AffidavitPurchPoolId;
}
}
}
No comments:
Post a Comment