zoukankan      html  css  js  c++  java
  • AX 2009 表格下勾选的编辑行

    Grid下的CheckBox

    在AX下,想要获取已勾选的CheckBox,要通过Map来实现,以下给出一个获取类,调用和使用。

    class FormMarkupClass
    {
        Map                mapMark;

        
    public NoYes editMark(
        boolean      _set,
        Common       _common,
        NoYes        _mark)
        {
        NoYes   click;

        
    if (! mapMark)
            
    this.initMapMark();

        
    if (_set)
        {
            
    if (_mark)
            {
                mapMark.insert(_common.RecId,_common);
                click 
    = NoYes::Yes;
            }
            
    else
            {
                
    if (mapMark.exists(_common.RecId))
                    mapMark.remove(_common.RecId);

                click 
    = NoYes::No;
            }
        }
        
    else
            click 
    = mapMark.exists(_common.RecId);

        
    return click;
        }

        
    int elements()
        {
            
    if (mapMark)
                
    return mapMark.elements();
            
    else
                
    return false;
        }

        Map getMap()
        {
            
    return mapMark;
        }

        MapEnumerator getMapEnumerator()
        {
            
    return mapMark.getEnumerator();
        }

        MapIterator getMapIterator()
        {
           MapIterator it 
    = new MapIterator(mapMark);
           ;
           
    return  it;
        }

        
    public void initMapMark(container _con = connull())
        {
            mapMark 
    = (_con) ? Map::create(_con) : new Map(typeId2Type(typeid(recId)), Types::Record);
        }

        NoYes isMarked(Common _common)
        {
            
    if (mapMark != null )
            {
               
    return mapMark.exists(_common.RecId);
            }
            
    return NOyes::No;
        }
    }

    窗体初始化方法对其初始化

    public void init()
    {
        super();

        g_FormMarkup 
    = new FormMarkupClass();
        g_FormMarkup.initFormMarkup();
    }

    数据源添加display方法

    edit NoYes included(boolean    set, ModelApply   _model, NoYes   _included)
    {
        
    return g_FormMarkup.editMark(set, _model, _included);
    }

    调用

    void clicked()
    {

       MapIterator    m_mapItor;
       ModelApply     m_Model;
       ;

       m_mapItor
    = g_FormMarkup.getMapIterator();

        
    while (m_mapItor.more())
        {
            update_recordset m_Model
             setting
                ModelClass 
    = ModelClass::RedSend
             
    where 
                m_Model.RecId
    == m_mapItor.key();
            m_mapItor.next();
        }
        Model_ds.executeQuery();
    }
    作者:Kurodo
    出处:http://Kurodo.cnblogs.com
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    MOSS中的User的Title, LoginName, DisplayName, SID之间的关系
    如何在Network Monitor中高亮间隔时间过长的帧?
    SharePoint服务器如果需要安装杀毒软件, 需要注意什么?
    如何查看SQL Profiler? 如何查看SQL死锁?
    什么是Telnet
    The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain.
    Windows SharePoint Service 3.0的某个Web Application无搜索结果
    网络连接不上, 有TCP错误, 如果操作系统是Windows Server 2003, 请尝试一下这里
    在WinDBG中查看内存的命令
    The virtual machine could not be started because the hypervisor is not running
  • 原文地址:https://www.cnblogs.com/Kurodo/p/2145908.html
Copyright © 2011-2022 走看看