Example #1
0
  /** 查看详细信息 */
  public String view() throws Exception {
    if ((null != param_type) && (null != param_type.getId())) {
      param_type = paramService.getById(param_type.getId());
    }

    return VIEW;
  }
Example #2
0
  /** 执行查询的方法,返回json数据 */
  public void list() throws Exception {
    Map<String, Object> paraMap = new HashMap<String, Object>();

    if (pagination == null) {
      pagination = new Pagination(this.getRequest());
    }

    if (null != param_type) {
      // 设置查询条件,开发人员可以在此增加过滤条件
      if ((null != param_type.getName()) && (0 < param_type.getName().trim().length())) {
        // 从页面传来name的值
        paraMap.put("name", "%" + param_type.getName().trim() + "%");
      }
    }

    pagination = paramService.findByPage(pagination, paraMap);

    convObjectToJson(pagination, null);
  }
Example #3
0
 /** 保存信息(包括新增和修改) */
 public String save() throws Exception {
   if ("add".equalsIgnoreCase(this.flag)) {
     paramService.save(param_type);
   } else {
     if (null != param_type
         && null != param_type.getId()
         && !"".equals(param_type.getId().trim())) {
       ParamType info = paramService.getById(param_type.getId().trim());
       if (null != info) {
         // 更改名称
         info.setName(param_type.getName());
         paramService.update(info);
       }
     }
   }
   return RELOAD;
 }