zoukankan      html  css  js  c++  java
  • get last saved dialog of values

    get last saved dialog of values
    below as X++ Code remark by the Class and report.

    write down : Jimmy  on September 07th 2010

    1)Class

    class QVS_SalesMarginReportNew extends RunBaseReport
    {
        DialogField dlg_FromDate;
        DialogField dlg_ToDate;
    
        FromDate    FromDate;
        ToDate      ToDate;
    
    
        #DEFINE.CurrentVersion(1)
        #LOCALMACRO.CurrentList
            FromDate,ToDate
        #ENDMACRO
    }
    
    public Object dialog()
    {
        DialogRunbase   dialog;
    ;
        dialog          = super();
        dialog.addGroup("@SDL1404");
        dlg_FromDate    = dialog.addFieldValue(TypeId(FromDate),FromDate);
        dlg_ToDate      = dialog.addFieldValue(TypeId(ToDate),ToDate);
    
        return dialog;
    }
    
    public boolean getFromDialog()
    {
    ;
        FromDate   = dlg_FromDate.value();
        ToDate     = dlg_ToDate.value();
    
        return true;
    }
    
    public container pack()
    {
        ;
        return [#CurrentVersion, #CurrentList]+[super()];
    }
    
    public boolean unpack(container packedClass)
    {
        container       base;
        boolean         ret = false;
        Integer         version    = conPeek(packedClass,1);
    
        switch (version)
        {
            case #CurrentVersion:
                [version, #CurrentList, base] = packedClass;
                ret = super(base);
                break;
        }
        return ret;
    }
    

    2)Report

    public class ReportRun extends ObjectRun
    {
        DialogField          dlgFromDate;
        DialogField          dlgToDate;
        FromDate             FromDate;
        ToDate               ToDate;
    
        #define.CurrentVersion(1)
    
        #localmacro.CurrentList
            FromDate,
            ToDate
        #endmacro
    }
    
    public Object dialog(Object _dialog)
    {
        DialogRunbase dialog = _dialog;
    ;
        dialog.addGroup("Period Date");
        dlgFromDate = dialog.addFieldValue(TypeId(FromDate),FromDate);
        dlgToDate   = dialog.addFieldValue(TypeId(ToDate),ToDate);
    
        return dialog;
    }
    
    public boolean  getFromDialog()
    {
    ;
        FromDate    = dlgFromDate.value();
        ToDate      = dlgToDate.value();
    
        return true;
    }
    
    public container pack()
    {
    ;
        return [#CurrentVersion, #CurrentList];
    }
    
    public boolean unpack(container packedClass)
    {
        boolean         ret;
        Integer         version =  RunBase::getVersion(packedClass);
    
        switch (version)
        {
            case #CurrentVersion:
                [version, #CurrentList] = packedClass;
                ret = true;
                break;
            default:
                ret = false;
        }
        return ret;
    }
    

  • 相关阅读:
    单档作业(带明细档)——项次自动自增
    单档——PK单号新增、修改时不允许编辑,PK单号自动生成
    单档——控件关联查询
    报表查询——自动刷新数据,双击明细打开关联作业
    asp.net练习②——Paginaton无刷新分页
    strcpy 用法
    2008年“超搞”语录
    IT职场里的某些人感悟(欢迎各抒己见)
    SQL2005无法正常登录
    经典短文
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1820464.html
Copyright © 2011-2022 走看看