EditUI:
this.kdtEntrys.getRow(0).getCell(1).setValue("这个是第一行的第1个单元格的值");
public void loadFields()
{
/**
* 设置默认值
*/
editData.setBizDate(new Date());
editData.setUsage("这个是用途..");
editData.setDescription("这个是参考信息..");
editData.setState(stateEnum.Add);//因为空间在业务提交之后,该控件值为空了,所以设置默认值
refreshData();
super.loadFields();
}
/**
* 手动刷新EditUI
* 重新装载editData
*/
public void refreshData(){
if(editData.getId()!=null){
PurRegOrderInfo instance=PurRegOrderFactory.getRemoteInstance().getPurRegOrderInfo(new ObjectUuidPK(editData.getId()));
editData=instance;
setDataObject(editData);
loadFields();
loadData();
}
}
ListUI界面审核和反审核
PurRegOrderListUI
/**
* 控件生效
*/
@Override
public void onLoad() throws Exception {
// TODO Auto-generated method stub
super.onLoad();
btnAudit.setEnabled(true);
btnUnAudit.setEnabled(true);
}
/**
*列表界面的判定:
*提交之后才能审核,也就是控件值未提交,审核才可以使用
*列表界面是没有editData对象的,通过id转为对象
*/
public void actionAudit_actionPerformed(ActionEvent e) throws Exception
{
super.actionAudit_actionPerformed(e);
checkSelected();
stateEnum state=stateEnum.Submit;
ArrayList arrayList=getSelectedIdValues();
PurRegOrderInfo info=null;
for (int i = 0; i < arrayList.size(); i++) {
info=PurRegOrderFactory.getRemoteInstance().getPurRegOrderInfo(new ObjectUuidPK(arrayList.get(i).toString()));
if(!info.getState().equals(stateEnum.Submit)){//单据数据控件不为提交,则不能审核
MsgBox.showWarning("存在单据状态为"+state.getAlias()+"的单据,不能审核.");
return ;
}
}
//单据进行审核
/**
* 是这个接口的
* boolean com.kingdee.eas.luojiabao.test.IPurRegOrder.audit(String id) throws BOSException, EASBizException
*/
for (int i = 0; i < arrayList.size(); i++) {
PurRegOrderFactory.getRemoteInstance().audit(arrayList.get(i).toString().trim());
}
this.refreshList();
}
/**
* 反审核,单据如果为非审核状态,则不能反审核。只有为审核状态才能反审核
*/
public void actionUnAudit_actionPerformed(ActionEvent e) throws Exception
{
super.actionUnAudit_actionPerformed(e);
checkSelected();
stateEnum state=stateEnum.Submit;
//ArrayList com.kingdee.eas.framework.client.CoreBillListUI.getSelectedIdValues() 这个是ListUI界面也就是我选中的info
ArrayList arrayList=getSelectedIdValues();
PurRegOrderInfo info=null;
for (int i = 0; i < arrayList.size(); i++) {
info=PurRegOrderFactory.getRemoteInstance().getPurRegOrderInfo(new ObjectUuidPK(arrayList.get(i).toString()));
if(info.getState().equals(stateEnum.Audit)){//单据数据控件不为审核,不能反审核
/*MsgBox.showWarning("存在单据状态不为审核的单据,不能反审核.");*/
PurRegOrderFactory.getRemoteInstance().unAudit(arrayList.get(i).toString().trim());
}
}
this.refreshList();
}
PurRegOrderControllerBean
/**
* 工具栏点击保存状态控件客户端的控件相应变成保存,并且客户端需要刷新
* 如果已经点了保存,不能提交
*/
@Override
protected IObjectPK _save(Context ctx, IObjectValue model)
throws BOSException, EASBizException {
PurRegOrderInfo info=(PurRegOrderInfo) model;
info.setState(stateEnum.Save);
return super._save(ctx, model);
}
/**
* 工具栏点击状态控件客户端的控件相应变成提交,并且客户端需要刷新
*/
@Override
protected IObjectPK _submit(Context ctx, IObjectValue model)
throws BOSException, EASBizException {
PurRegOrderInfo info=(PurRegOrderInfo) model;
info.setState(stateEnum.Submit);
return super._submit(ctx, model);
}
/**
* 工具栏点击审核状态控件客户端的控件相应变成审核,传id变成实体,并且客户端需要刷新
*/
@Override
protected boolean _audit(Context ctx, String id) throws BOSException,
EASBizException {
//如果id为空的话,抛出异常
if(id==null){
throw new IllegalArgumentException();
}
IPurRegOrder instance=PurRegOrderFactory.getLocalInstance(ctx);
PurRegOrderInfo info=instance.getPurRegOrderInfo(new ObjectUuidPK(id));
info.setState(stateEnum.Audit);
instance.update(new ObjectUuidPK(id),info);//客户端刷新
return super._audit(ctx, id);
}
/**
* 工具栏点击反审核状态的控件,则状态相应变成提交,传id变成shiti, 并且客户端需要刷新
*/
@Override
protected boolean _unAudit(Context ctx, String id) throws BOSException,
EASBizException {
if(id==null){
throw new IllegalArgumentException();
}
IPurRegOrder instance=PurRegOrderFactory.getLocalInstance(ctx);
PurRegOrderInfo info=instance.getPurRegOrderInfo(new ObjectUuidPK(id));
info.setState(stateEnum.Submit);
instance.update(new ObjectUuidPK(id),info);
return super._unAudit(ctx, id);
}
}