EAS BOS开发客户端端常用代码(2)

2019-03-29 15:28

1.4 客户端对审核的操作

应用框架预定义了一个审核操作actionAuditing

public void actionAuditing_actionPerformed(ActionEvent e) throws Exception { //检查单据状态 if (!checkStatus(tblMain, BillStatusEnum.SUBMITED)) {

MsgBox.showInfo(this,

Day4Resource.getStrResource(\// 状态不正确,终止处理

SysUtil.abort(); } IPurOrder purorder = (IPurOrder) getBizInterface(); String[] billIdlist = getSelectedListId();

//常用的弹出对话框方法

int i = MsgBox.showConfirm2(this, \if (i == MsgBox.OK) { //审核操作 purOrder.audit(new ObjectStringPK(bill)); //完成其他业务逻控制 // 刷新列表界面 actionRefresh_actionPerformed(null); }

}

1.5 关联生成

public void actionCreateTo_actionPerformed(ActionEvent e) throws Exception { checkSelected(); // 未审核单据不能关联生成

}

if (!checkStatus(tblMain, BillStatusEnum.AUDITED)) { MsgBox.showInfo(this, \ SysUtil.abort(); }

//有系统调用配置好的‘botp’规则 super.actionCreateTo_actionPerformed(e);

1.6 动态调用UI界面,并在UI之间传递变量

private void makePurOrderUI(PurOrderInfo srcBillInfo)

throws EASBizException, UIException,

BOSException, Exception { String destBillEditUIClassName = “com.kingdee….PurOrderEditUI”; Map map = new UIContext(this); map.put(\ map.put(UIContext.OWNER, this); map.put(\ IUIWindow uiWindow = null ;

// UIFactoryName.MODEL 为弹出模式

uiWindow = UIFactory.createUIFactory(UIFactoryName.MODEL).

create(destBillEditUIClassName, map, null,

OprtState.ADDNEW); //可对创建的ui进行操作

//((CoreBillEditUI).uiWindow.getUIObject()).

//setMakeRelations(btpResult.getBOTRelationCollection()); //开始展现UI

uiWindow.show(); }

1.7 关于编码规则

// 是否存在编码规则

protected boolean isCodeRuleEnable(IObjectValue objValue)

throws EASBizException, BOSException { String companyId = OrgInnerUtils.getCurCompany(); ICodingRuleManager codeRuleMgr = null;

codeRuleMgr = CodingRuleManagerFactory.getRemoteInstance(); return codeRuleMgr.isExist(objValue, companyId); }

// 得到自动编码

protected String getAutoCode(IObjectValue objValue)

throws EASBizException, BOSException { String companyId = OrgInnerUtils.getCurCompany();

ICodingRuleManager codeRuleMgr = null;

codeRuleMgr = CodingRuleManagerFactory.getRemoteInstance(); if (codeRuleMgr.isUseIntermitNumber(objValue, companyId)) { return codeRuleMgr.readNumber(objValue, companyId); } else { return codeRuleMgr.getNumber(objValue, companyId); } }

1.8 如何得到当前选中行的id

// 得到当前选中行的id

public String[] getSelectedListId() { checkSelected(); // SelectManager 是kdtable中行管理类 ArrayList blocks = tblMain.getSelectManager().getBlocks(); ArrayList idList = new ArrayList(); Iterator iter = blocks.iterator(); while (iter.hasNext()) { KDTSelectBlock block = (KDTSelectBlock) iter.next(); int top = block.getTop(); int bottom = block.getBottom();

for (int rowIndex = top; rowIndex <= bottom; rowIndex++) { ICell cell = tblMain.getRow(rowIndex).

getCell(getKeyFieldName());

}

if (!idList.contains(cell.getValue())) { idList.add(cell.getValue()); } } }

String[] listId = null;

if (idList != null && idList.size() > 0) { Iterator iterat = idList.iterator(); listId = new String[idList.size()]; int index = 0; while (iterat.hasNext()) { listId[index] = (String) iterat.next(); index++; } }

return listId;

1.9 关于数字精度的设置

private void changeShowData(int fistRow, int lastRow)

throws EASBizException, BOSException { for (int i = fistRow; i <= lastRow; i++)

{

IRow row = tblMain.getRow(i); // 根据币别设置精度 ICell cell = row.getCell(“columnName”); //假定精度为2 int precision = 2; if (cell != null && cell.getValue() != null) { try { precision = Integer.parseInt(cell.getValue().toString());

} catch (Exception e) { precision = 2; } } // 当该行的币别精度不能于原币精度时才更改精度 if (precision != basePrecision) { for (int j = 0; j

tblMain.getColumn(\ \

tblMain.getColumn(\ \

tblMain.getColumn(\ HorizontalAlignment.RIGHT);

tblMain.getColumn(\ .setNumberFormat(\

tblMain.getColumn(\ .setHorizontalAlign(HorizontalAlignment.RIGHT); } } } }

1.10 返回当前列表的主键

protected String getKeyFieldName() { return \}


EAS BOS开发客户端端常用代码(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2016年煤炼油行业现状及发展趋势分析 (目录)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: