/* (non-Javadoc)
  * @see com.cloud.erp.dao.SalesContractDao#delSalesContract(java.lang.Integer)
  */
 @Override
 public boolean delSalesContract(Integer contractId) {
   // TODO Auto-generated method stub
   Integer userId = Constants.getCurrentUser().getUserId();
   String status = Constants.PERSISTENCE_DELETE_STATUS;
   Date date = new Date();
   SalesContract salesContract = (SalesContract) baseDao.get(SalesContract.class, contractId);
   salesContract.setLastmod(date);
   salesContract.setModifier(userId);
   salesContract.setStatus(status);
   baseDao.deleteToUpdate(salesContract);
   String hql =
       "from SalesContractEntry t where t.status='A' and t.contract.interId=" + contractId;
   List<SalesContractEntry> salesContractEntries = baseDao.find(hql);
   for (SalesContractEntry salesContractEntry : salesContractEntries) {
     salesContractEntry.setLastmod(date);
     salesContractEntry.setModifier(userId);
     salesContractEntry.setStatus(status);
     baseDao.deleteToUpdate(salesContractEntry);
   }
   hql = "from SalesContractScheme t where t.status='A' and t.contract.interId=" + contractId;
   List<SalesContractScheme> salesContractSchemes = baseDao.find(hql);
   for (SalesContractScheme salesContractScheme : salesContractSchemes) {
     salesContractScheme.setLastmod(date);
     salesContractScheme.setModifier(userId);
     salesContractScheme.setStatus(status);
     baseDao.deleteToUpdate(salesContractScheme);
   }
   return true;
 }
 @Override
 public SalesContract findSalesContractById(Integer contractId) {
   // TODO Auto-generated method stub
   return (SalesContract) baseDao.get(SalesContract.class, contractId);
 }