zoukankan      html  css  js  c++  java
  • 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

    }
  • 相关阅读:
    初探element+vue+vue-router
    git命令移动文件夹到另一文件夹
    javascript最大公约数与最小公倍数
    求1-100数字的和
    [摘录]代码优化规则
    基于.NET平台常用的框架和开源程序整理
    软件架构师的12项修炼
    Service Oriented Architecture and WCF 【转】
    电商网站的初期技术选型【转】
    论SOA架构的几种主要开发方式【转】
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1758091.html
Copyright © 2011-2022 走看看