当前位置: 首页>>代码示例>>Java>>正文


Java DrugDao.merge方法代码示例

本文整理汇总了Java中org.oscarehr.common.dao.DrugDao.merge方法的典型用法代码示例。如果您正苦于以下问题:Java DrugDao.merge方法的具体用法?Java DrugDao.merge怎么用?Java DrugDao.merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.oscarehr.common.dao.DrugDao的用法示例。


在下文中一共展示了DrugDao.merge方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Delete

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public void Delete() {
	try {
		DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");
		Drug drug = drugDao.find(getDrugId());
		if (drug != null) {
			drug.setArchived(true);
			drugDao.merge(drug);
		}
	} catch (Exception e) {
		logger.error("unexpected error", e);
	}
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:13,代码来源:RxPrescriptionData.java

示例2: Delete

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public void Delete() {
    try {
    	DrugDao drugDao=(DrugDao) SpringUtils.getBean("drugDao");
    	Drug drug=drugDao.find(getDrugId());
    	if (drug!=null)
    	{
    		drug.setArchived(true);
    		drugDao.merge(drug);
    	}
    } catch (Exception e) {
        logger.error("unexpected error", e);
    }
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:14,代码来源:RxPrescriptionData.java

示例3: update

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	if (!securityInfoManager.hasPrivilege(LoggedInInfo.getLoggedInInfoFromSession(request), "_rx", "u", null)) {
		throw new RuntimeException("missing required security object (_rx)");
	}
	
	String demographicNo = request.getParameter("demographicNo");
	int drugId = Integer.parseInt(request.getParameter("drugId"));
	int swapDrugId = Integer.parseInt(request.getParameter("swapDrugId"));

	CaseManagementManager caseManagementManager = (CaseManagementManager) SpringUtils.getBean("caseManagementManager");
	List<Drug> drugs = caseManagementManager.getPrescriptions(demographicNo, true);
	DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");

	Drug myDrug = null;
	Drug swapDrug = null;

	for (Drug drug : drugs) {
		if (drug.getId().intValue() == drugId) {
			myDrug = drug;
		}
		if (drug.getId().intValue() == swapDrugId) {
			swapDrug = drug;
		}
	}

	if (myDrug == null || swapDrug == null) {
		MiscUtils.getLogger().warn("Couldn't find the drugs to swap!");
	} else {
		int myPosition = myDrug.getPosition();
		int swapPosition = swapDrug.getPosition();
		myDrug.setPosition(swapPosition);
		swapDrug.setPosition(myPosition);
		drugDao.merge(myDrug);
		drugDao.merge(swapDrug);
	}

	try {
		response.getWriter().println("ok");
	} catch (IOException e) {
		logger.error("error", e);
	}
	return null;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:44,代码来源:RxReorderAction.java

示例4: update

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	String demographicNo = request.getParameter("demographicNo");
    int drugId = Integer.parseInt(request.getParameter("drugId"));
    int swapDrugId = Integer.parseInt(request.getParameter("swapDrugId"));
    String direction = request.getParameter("direction");
    
    CaseManagementManager caseManagementManager = (CaseManagementManager) SpringUtils.getBean("caseManagementManager");        
    List<Drug> drugs = caseManagementManager.getPrescriptions(demographicNo, true);
    DrugDao drugDao = (DrugDao)SpringUtils.getBean("drugDao");
    
    Drug myDrug = null;
    Drug swapDrug = null;

    for(Drug drug:drugs) {
    	if(drug.getId().intValue() == drugId) {
    		myDrug = drug;
    	}
    	if(drug.getId().intValue() == swapDrugId) {
    		swapDrug = drug;
    	}
    }
    
    if(myDrug == null || swapDrug == null) {
    	MiscUtils.getLogger().warn("Couldn't find the drugs to swap!");        	
    } else {
    	int myPosition = myDrug.getPosition();
    	int swapPosition = swapDrug.getPosition();
    	myDrug.setPosition(swapPosition);
    	swapDrug.setPosition(myPosition);
    	drugDao.merge(myDrug);
    	drugDao.merge(swapDrug);
    }

    
    try {
    	response.getWriter().println("ok");
    }catch(IOException e) {
    	logger.error("error",e);
    }
    return null;
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:42,代码来源:RxReorderAction.java


注:本文中的org.oscarehr.common.dao.DrugDao.merge方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。