1、案例一 对List界面记录字段进行批量修改
//批量修改
protected void btnBatchUpdate_actionPerformed(ActionEvent e)throws Exception {
checkSelected();#检查是否有选中的记录
ArrayList arIds = getSelectedIdValues(); #取到选择的记录ID
IUIFactory uiFactory = UIFactory.createUIFactory(UIFactoryName.MODEL);
UIContext uiContext = new UIContext();
uiContext.put(UIContext.OWNER, this);
uiContext.put("billType", "付款单");
uiContext.put("ids", arIds);
uiContext.put("ar",new ArrayList());
# 创建新的BatchUpdateRecPayUI窗口
IUIWindow uiWindow = uiFactory.create(BatchUpdateRecPayUI.class.getName(), uiContext, null);
uiWindow.show();
if(uiContext.get("ar")!=null){
ArrayList ar = (ArrayList) uiContext.get("ar");
if(ar.size()>0)
refreshList();
}
}
public void checkSelected() {
if ((this.tblMain.getRowCount() != 0) &&(this.tblMain.getSelectManager().size() != 0))
return;
MsgBox.showWarning(this, EASResource.getString("com.kingdee.eas.framework.FrameWorkResource.Msg_MustSelected") );
SysUtil.abort();
}
2、案例二 自定义流水号
# 获取流水号
private static String getMark(){
String mark = null;
String prifex ="GZG";
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String nowTime = sdf.format(new Date());# 取当前时间
mark = prifex + nowTime;
return mark;
}
**3、案例三 检查自定义权限项 **
public void transCheck_actionPerformed(ActionEvent evt) throws Exception
{
# 'transPay_ManCheck' 为开发的权限项
if(!PermissionUtils.CheckFunctionPermission("transPay_ManCheck",false)){
MsgBox.showError("你没有付款单与交易明细对账平台权限!");
return;
}
IUIWindow uiWindow = null;
try
{
IUIFactory uiFactory = UIFactory.createUIFactory(UIFactoryName.NEWTAB);
UIContext ctx = new UIContext();
ctx.put(UIContext.OWNER, this);
ctx.put("queryDialog", getQueryDlg());
uiWindow = uiFactory.create(TransPayBillCheckUI.class.getName(), ctx, null);
uiWindow.show();
}
catch (UIException e)
{
handleException(e);
}
}
4、案例四 判断当前用户是否是职员
# 当前用户非职员不能做单
if (SysContext.getSysContext().getCurrentUserInfo().getType().getName() != "PERSON") {
MsgBox.showInfo(this,"当前用户非职员不能做单");
SysUtil.abort();
}
未完待续