class NEC_WHSWorkTable
{
/// <summary>
///
/// </summary>
/// <param name="args"></param>
[PostHandlerFor(formStr(WHSWorkTableListPage), formMethodStr(WHSWorkTableListPage, init))]
public static void WHSWorkTableListPage_Post_init(XppPrePostArgs args)
{
FormRun sender=args.getThis();
FormControl printer= sender.design(0).controlName("WorkTable_Print");
printer.visible(false);
printer.enabled(false);
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormDataSourceEventHandler(formDataSourceStr(WHSWorkTableListPage, WHSWorkTable), FormDataSourceEventType::Activated)]
public static void WHSWorkTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
WHSWorkTable rec;
boolean flag = false;
WHSWorkTable whsWorkTable = sender.cursor();
FormDataSource whsWorkTable_ds = sender.formRun().dataSource("whsWorkTable");
FormRun element = sender.formRun();
FormControl printinWork = element.design(0).controlName("NECWorkTable_Print");
for (rec = getFirstSelection(whsWorkTable_ds); rec; rec = whsWorkTable_ds.getNext())
{
if(rec.WorkId && rec.WorkStatus == WHSWorkStatus::Cancelled)
{
printinWork.enabled(false);
}
else
{
printinWork.enabled(true);
}
}
}
}
{
/// <summary>
///
/// </summary>
/// <param name="args"></param>
[PostHandlerFor(formStr(WHSWorkTableListPage), formMethodStr(WHSWorkTableListPage, init))]
public static void WHSWorkTableListPage_Post_init(XppPrePostArgs args)
{
FormRun sender=args.getThis();
FormControl printer= sender.design(0).controlName("WorkTable_Print");
printer.visible(false);
printer.enabled(false);
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormDataSourceEventHandler(formDataSourceStr(WHSWorkTableListPage, WHSWorkTable), FormDataSourceEventType::Activated)]
public static void WHSWorkTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
WHSWorkTable rec;
boolean flag = false;
WHSWorkTable whsWorkTable = sender.cursor();
FormDataSource whsWorkTable_ds = sender.formRun().dataSource("whsWorkTable");
FormRun element = sender.formRun();
FormControl printinWork = element.design(0).controlName("NECWorkTable_Print");
for (rec = getFirstSelection(whsWorkTable_ds); rec; rec = whsWorkTable_ds.getNext())
{
if(rec.WorkId && rec.WorkStatus == WHSWorkStatus::Cancelled)
{
printinWork.enabled(false);
}
else
{
printinWork.enabled(true);
}
}
}
}
No comments:
Post a Comment