java vo 非空校验_Java CommunityServiceVo.validate方法代码示例

import ims.core.vo.CommunityServiceVo; //导入方法依赖的package包/类

private void insertServices()

{

form.grdDetails().getRows().clear();

Boolean bActiveOnly = Boolean.TRUE;

SupportNetworkServicesVoCollection voColl = domain.listSupportNetworkServiceByPatient(form.getGlobalContext().Core.getPatientShort(),bActiveOnly);

if (voColl != null && voColl.size()>0)

{

SupportNetworkServicesVo vo = null;

GenForm.grdDetailsRow row = null;

for(int i=0;i

{

vo = voColl.get(i);

row = form.grdDetails().getRows().newRow();

if (vo.getSuppliedServiceIsNotNull())

row.setComunityService(vo.getSuppliedService().getName());

else if (vo.getServiceIsNotNull())

row.setComunityService(vo.getService().getServiceName());

row.setCurrentFrequency(vo.getFrequencyOfService());

//create Community Service vo

CommunityServiceVo voComSer = new CommunityServiceVo();

voComSer.setCurrentFrequency(vo.getFrequencyOfService());

//copy if supplied

if (vo.getSuppliedServiceIsNotNull())

{

SuppNetworkServiceProfessionDetailVo voSerProfDet = new SuppNetworkServiceProfessionDetailVo();

voSerProfDet.setAddress(vo.getSuppliedService().getAddress());

voSerProfDet.setEmailAddress(vo.getSuppliedService().getEmailAddress());

voSerProfDet.setMobilePhone(vo.getSuppliedService().getMobilePhone());

voSerProfDet.setName(vo.getSuppliedService().getName());

voSerProfDet.setServiceLocation(vo.getSuppliedService().getServiceLocation());

voSerProfDet.setWorkPhone(vo.getSuppliedService().getWorkPhone());

voComSer.setSuppliedService(voSerProfDet);

}

voComSer.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());

voComSer.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());

voComSer.setService(vo.getService());

voComSer.setLocationService(vo.getLocationService());

voComSer.setIsCurrentlyActive(new Boolean(true));

voComSer.setComments(vo.getComments());

String[] arrErrors = voComSer.validate();

if(arrErrors != null)

{

engine.showErrors(arrErrors);

}

try

{

domain.saveCommunitService(voComSer);

}

catch (StaleObjectException e)

{

engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());

return;

}

row.setValue(voComSer);

}

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值