1耐齐、案例一 對(duì)List界面記錄字段進(jìn)行批量修改
//批量修改
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());
# 創(chuàng)建新的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、案例二 自定義流水號(hào)
# 獲取流水號(hào)
private static String getMark(){
String mark = null;
String prifex ="GZG";
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String nowTime = sdf.format(new Date());# 取當(dāng)前時(shí)間
mark = prifex + nowTime;
return mark;
}
**3、案例三 檢查自定義權(quán)限項(xiàng) **
public void transCheck_actionPerformed(ActionEvent evt) throws Exception
{
# 'transPay_ManCheck' 為開發(fā)的權(quán)限項(xiàng)
if(!PermissionUtils.CheckFunctionPermission("transPay_ManCheck",false)){
MsgBox.showError("你沒有付款單與交易明細(xì)對(duì)賬平臺(tái)權(quán)限!");
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坎怪、案例四 判斷當(dāng)前用戶是否是職員
# 當(dāng)前用戶非職員不能做單
if (SysContext.getSysContext().getCurrentUserInfo().getType().getName() != "PERSON") {
MsgBox.showInfo(this,"當(dāng)前用戶非職員不能做單");
SysUtil.abort();
}
未完待續(xù)