33. 表格对象记录取值方法

Posted on 2016-05-12 16:35  zkx4213  阅读(242)  评论(0编辑  收藏  举报

方法1:
var i=1;
O_PARAMETER.FObject.each(
  function(v) {
    var empId = v.get("FEmployee");
    LB_Logger("debug", empId);
    LB_sqlExecute("insert into T_ZKX_TestUser (ID,FEmployee) values (?,?)",[i,empId]);
    i++;
  }
);

 

<%@ livebos language='javascript' %>
var fun = ABS_LOADBEAN("com.plug.FunctionHelper");

O_PARAMETER.FObject.each(
  function(v) {
    var vid = fun.utilHelper.getNextID("T_HR_TrainFile");
    var empId = v.get("FEmployee");
    var orgid;
    var funit;
    var rs = LB_sqlResultSet("select a.orgid orgid,b.funit funit from tUser a, lborganization b where b.id = a.orgid and a.FEmp = ?",[empId]);
    while(rs.next()) {
      orgid = rs.getString("orgid");
      funit = rs.getString("funit");
    }
    LB_Logger("debug", "------------------------------------------empId="+empId);
    LB_sqlExecute("insert into T_HR_TrainFile (ID,FEmployee,FDept,Funit,FTrainProject) values (?,?)",[vid,empId,orgid,funit,V_1.ID]);
  }
);

 

方法2:

//表格字段的名称:FObject

var ho = O_PARAMETER.getColumn("FObject");
var temp = ho.getRecord();
temp.beforeFirst();
var i = 1;
while(temp.next()) {
  var empId = temp.getInt("FEmployee");
  LB_sqlExecute("insert into T_ZKX_TestUser(ID,FEmployee) values (?,?)",[i,empId]);
  i++;
}

 

Copyright © 2024 zkx4213
Powered by .NET 9.0 on Kubernetes