Exemple #1
0
 public void ProcessRoleMList(List<RoleM> list) {
   for (Iterator<RoleM> it = list.iterator(); it.hasNext(); ) {
     RoleM rm = (RoleM) it.next();
     Map<String, Object> cellMap = new HashMap<String, Object>();
     cellMap.put("id", rm.getId());
     cellMap.put(
         "cell",
         new Object[] {
           rm.getRolename(),
           rm.getNote(),
           BaseTools.formateDbDate(rm.getCreatetime()),
           "<a id='editrole' name='editrole' href='role.jsp?operate=edit&folder=setting&id="
               + rm.getId()
               + "'>[编辑]</a>"
         });
     rows.add(cellMap);
   }
 }
Exemple #2
0
 /**
  * 获取所有角色用于前台select控件显示
  *
  * @return
  */
 @Action(
     value = "findAllRoleForSelect",
     results = {@Result(name = "json", type = "json")})
 public String findAllRoleForSelect() {
   this.setRolestr("");
   List<RoleM> list = this.getRoleMService().findAllRoleM();
   if (!list.isEmpty()) {
     this.setRolestr("<option value='0'>---请选择---</option>");
     for (Iterator<RoleM> it = list.iterator(); it.hasNext(); ) {
       RoleM rm = (RoleM) it.next();
       this.rolestr += "<option value='" + rm.getId() + "'>" + rm.getRolename() + "</option>";
     }
     this.setSucflag(true);
     return "json";
   }
   this.setSucflag(true);
   return "json";
 }