zoukankan      html  css  js  c++  java
  • SysMultiTableLookup class

    https://files.cnblogs.com/Jimmyx/Class_SysMultiTableLookup.rar

    The SysMultiTableLookup.rar is a class to show multi table information.

    When you want to create a sales line in SO, You can selet an item and see some information of item. Those information is from invent table.

    But sometimes you want those information from multi tables, How to do?

    SysMultiTableLookup class provide a solution to it.

    It is from http://kashperuk.blogspot.com/

    I had used it on creating a sales line.

    Overwrite lookup method of SalesLine_ItemId on SalesTable Form

    commont lookup method in tables

     

    // <GBR>
    public client static void lookupByInventLocationType_BR(FormStringControl ctrl, InventLocationType _inventLocationType)
    {
        SysTableLookup       sysTableLookup = SysTableLookup::newParameters(tablenum(InventLocation), ctrl);
        Query                query = new Query();
        QueryBuildDataSource queryBuildDataSource;
        ;

        sysTableLookup.addLookupfield(fieldnum(InventLocation, InventLocationId));
        sysTableLookup.addLookupfield(fieldnum(InventLocation, Name));
        sysTableLookup.addLookupfield(fieldnum(InventLocation, InventSiteId));

        queryBuildDataSource = query.addDataSource(tablenum(InventLocation));
        queryBuildDataSource.addRange(fieldnum(InventLocation, InventLocationType)).value(queryValue(_inventLocationType));

        sysTableLookup.parmQuery(query);
        sysTableLookup.performFormLookup();
    }

    // </GBR>

    Lookup method on the salesLine Form
    public void lookup(FormControl _formControl, str _filterStr)
    {
    Query query
    = new Query();
    QueryBuildDataSource queryBuildDataSource,queryBuildDataSource2 ;
    QueryBuildRange queryBuildRange;
    SysMultiTableLookup sysTableLookup ;
    //Not SysTableLookup class
    ;


    queryBuildDataSource
    = query.addDataSource(tableNum(InventTable)); //link a another table
    queryBuildDataSource2 = queryBuildDataSource.addDataSource(tablenum(InventTableModule));
    queryBuildDataSource2.joinMode(JoinMode::InnerJoin) ;
    queryBuildDataSource2.relations(
    true) ;

    sysTableLookup
    = SysMultiTableLookup::newParameters(_formControl,query) ;

    sysTableLookup.addLookupField(fieldNum(InventTable, ItemId));
    sysTableLookup.addLookupField(fieldNum(InventTable, ItemName));
    sysTableLookup.addLookupField(fieldNum(InventTable, NameAlias));
    sysTableLookup.addLookupfield(fieldNum(InventTable, ItemGroupId));
    sysTableLookup.addLookupfield(fieldNum(InventTable, ItemType));
    sysTableLookup.addLookupField(fieldNum(InventTableModule,price),
    2) ;
    sysTableLookup.addLookupField(fieldNum(InventTableModule,UnitId),
    2) ; // get a field from another table. 2 is second datasource


    queryBuildDataSource2.addRange(fieldNum(InventTableModule, ModuleType)).value(
    "0");

    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();
    // super(_formControl, _filterStr);
    }
  • 相关阅读:
    MySQL主从复制(Master-Slave)与读写分离(MySQL-Proxy)实践
    利用scp传输文件小结
    SSH无密码登录配置小结
    vim 清空
    mysql root用户 远程登录其它机器,看不到数据库
    音视频编解码开发经验2
    nginx、php-fpm、mysql用户权限解析
    ffmpeg处理RTMP流媒体的命令 发送流媒体的命令(UDP,RTP,RTMP)
    音视频编解码开发经验1
    mysql LAST_INSERT_ID 使用与注意事项
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1896965.html
Copyright © 2011-2022 走看看