Ejemplo n.º 1
0
 /**
  * 功能描述:为formBean赋初值
  *
  * @param dataCount
  * @param formBean
  */
 public void setFormBean(DataCount dataCount, DefaultForm formBean)
     throws DBException, LogicException {
   if (dataCount != null) {
     formBean.setNewFriend(dataCount.getNewFriend().toString());
     formBean.setNewSalutation(dataCount.getNewSalutation().toString());
     formBean.setNewShortMessage(dataCount.getNewShortMessage().toString());
     formBean.setNewTeacherAppraise(dataCount.getNewTeacherAppraise().toString());
   }
 }
Ejemplo n.º 2
0
 /**
  * 功能描述:用户查操作评语时设置统计表的新评语字段值减1
  *
  * @param userId
  * @return
  * @throws DBException
  */
 public boolean minusNewTeacherAppraise(Long userId) throws DBException {
   DataCount dataCount = findDataCountByUserId(userId);
   // 判断是否存在这样的用户统计实体
   if (dataCount != null) {
     Long newTeacherAppraise = dataCount.getNewTeacherAppraise();
     if (newTeacherAppraise != null && newTeacherAppraise.longValue() > 0) {
       dataCount.setNewTeacherAppraise(new Long(newTeacherAppraise.longValue() - 1));
       dataCountDao.update(dataCount);
       return true;
     }
   }
   return false;
 }