首页 > 其他 > 详细

UEP-保存

时间:2018-01-15 23:15:00      阅读:192      评论:0      收藏:0      [点我收藏+]
uep的保存操作分为ajaxgrid和ajaxform两种方式
1、ajaxgrid
 public void storeInfoSave(){
	try {
		//两个dataWrap  一个dataWrap对应一个表
		WzStoreInfo neWzStoreInfo = dataWrap.getData();
		List<WzStoreCover> updateList = this.coverWrap.getUpdateList();
		List<WzStoreCover> insertList = this.coverWrap.getInsertList() ;
		List<WzStoreCover> deleteList = this.coverWrap.getDeleteList();
          wzStoreCoverService.update(updateList,insertList,deleteList);	
		dataWrap.setData(neWzStoreInfo);
		responseData.setAjaxDataWrap("dataWrap", dataWrap);
		} catch (Exception e) {
			e.printStackTrace();
			responseData.setMessage("保存失败!"+e.getMessage());
		}
	}

  public void update( List<WzStoreCover> updateList,List<WzStoreCover> insertList, List<WzStoreCover> deleteList)
	throws Exception {
	if(insertList!=null && insertList.size()>0){
		supplyDAO.create(insertList);
	}
	if(updateList!=null && updateList.size()>0){	
          supplyDAO.update(updateList);			
	}
	if(deleteList!=null && deleteList.size()>0){
		for (WzStoreCover bean : deleteList){
			supplyDAO.remove(WzStoreUnitList.class, bean.getIncode());
		}
	}
}
2、ajaxform
  public void save() {
	try {
		//保存仓库信息
		WzStoreBill wzStoreBill = dataWrapBill.getData();
		JPAUtil.update(wzStoreBill);
		responseData.setAjaxDataWrap("dataWrapBill", dataWrapBill);
	} catch (Exception e) {
		e.printStackTrace();
		responseData.setMessage("保存失败!"+e.getMessage());
	}
}

  

UEP-保存

原文:https://www.cnblogs.com/kkdf/p/8290046.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!