• about Posted & Unposted of button function


    the following code as about posted and unposted action

    remark by Jimmy Jun 14th 2010

    代码
    void clicked()
    {
    Dialog dialog;
    DialogField dlgGlueItem,dlgUserId,FieldMove;
    UserId UserId;
    Noyes ApproveMove;
    QVS_GlueTraceability GlueTraceability;
    boolean isRemove
    = false;
    ;
    if(!QVS_GlueTraceability)
    throw warning("@SYS36901");
    dialog
    = new dialog("Post glue Traceability");
    dlgGlueItem
    = dialog.addField(TypeId(ItemId),"Blue Item Number");
    dlgGlueItem.active(
    false);
    dlgGlueItem.value(QVS_GlueTraceability.ItemGlue);

    dlgUserId
    = dialog.addfield(typeid(UserId),"@SYS16181");
    UserId
    = curUserId();
    if (UserId)
    dlgUserId.active(
    false);
    else
    dlgUserId.active(
    true);
    dlgUserId.value(UserId);

    FieldMove
    = dialog.addField(Typeid(Noyes),"@SYS12778" + ' ' + '@SYS1711');
    if(QVS_GlueTraceability.Posted)
    {
    if(!hasSecuritykeyAccess(securitykeynum(QVS_GlueTraceabilityUnPost),AccessType::Edit))
    throw Error("@SYS57330");
    isRemove
    = true;
    Fieldmove.visible(
    true);
    }
    else
    Fieldmove.visible(
    false);

    if (dialog.run())
    {
    try
    {
    UserId
    = dlgUserId.value();
    ApproveMove
    = FieldMove.value();
    if(ApproveMove)
    {
    TTSBEGIN;
    select firstonly forupdate GlueTraceability
    where GlueTraceability.RecId == QVS_GlueTraceability.RecId;

    if(GlueTraceability)
    {
    GlueTraceability.Posted
    = Noyes::No;
    GlueTraceability.Postby
    = '';
    GlueTraceability.Cancelby
    = UserId;
    GlueTraceability.update();
    }
    TTSCOMMIT;
    QVS_GlueTraceability_DS.reread();
    QVS_GlueTraceability_ds.executeQuery();
    QVS_GlueTraceability_ds.active();
    info(
    "@SYS21533");
    }
    else
    {
    if(isRemove && !ApproveMove)
    return ;
    TTSBEGIN;
    select firstonly forupdate GlueTraceability
    where GlueTraceability.RecId == QVS_GlueTraceability.RecId;

    if(GlueTraceability)
    {
    GlueTraceability.Posted
    = Noyes::Yes;
    GlueTraceability.Postby
    = UserId;
    GlueTraceability.Cancelby
    = '';
    GlueTraceability.update();
    }
    TTSCOMMIT;
    QVS_GlueTraceability_DS.reread();
    QVS_GlueTraceability_ds.executeQuery();
    QVS_GlueTraceability_ds.active();

    info(
    "Posting successful!");
    }
    //endif

    }
    catch (Exception::Deadlock)
    retry;
    }
    //endif

    }
  • 相关阅读:
    我的git笔记
    我的 Sublime Text 2 笔记
    在Windows系统配置Jekyll
    纯CSS3打造七巧板
    JavaScript原型之路
    基于Grunt构建一个JavaScript库
    How React Works (一)首次渲染
    hadoop2.4 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
    pyinstaller打包python源程序访问hive
    hadoop balance均衡datanode存储不起作用问题分析
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1758091.html
Copyright © 2020-2023  润新知