public String edit() {
   Userinfo user = (Userinfo) session.get(Const.LOGIN_KEY);
   orgRight = orgFightService.getNodeBySid(orgsid);
   orgRightParent = orgFightService.getNodeBySid(orgRight.getPsid().toString());
   if (orgRightParent == null) {
     orgRightParent = new OrgRight();
     orgRightParent.setOrgName("无上级部门");
     orgRightParent.setSid(orgRight.getPsid());
   }
   commonService.logNew(
       3, "用户【" + user.getUsername() + "】修改了id为【" + orgRight.getSid() + "】的单位信息成功!", Log.CAOZUO);
   return "add";
 }
 public String SearchFightUsers() {
   boolean r = orgFightService.SearchFightUsers();
   if (r) {
     this.setMsg("exist");
   } else {
     this.setMsg("noexist");
   }
   return Const.ACTION_MSG;
 }
 public String searchExistName() {
   String orgsid = orgRight.getSid().equalsIgnoreCase("") ? "null" : orgRight.getSid();
   boolean r = orgFightService.searchExistName(orgRight.getOrgName(), orgsid);
   if (r) {
     this.setMsg("exist");
   } else {
     this.setMsg("noexist");
   }
   return Const.ACTION_MSG;
 }
 public String delete() {
   Userinfo user = (Userinfo) session.get(Const.LOGIN_KEY);
   if (!orgFightService.delete(this.selectedorgsid)) {
     msg = "对不起,删除单位信息失败!";
   } else {
     commonService.logNew(
         3, "用户【" + user.getUsername() + "】删除了id为【" + selectedorgsid + "】的单位信息成功!", Log.CAOZUO);
     msg = "删除单位信息成功!";
   }
   return Const.ACTION_MSG;
 }
 public String save() {
   this.searchExistName();
   Userinfo user = (Userinfo) session.get(Const.LOGIN_KEY);
   if (msg == "noexist") {
     if (!orgFightService.saveOrUpdate(orgRight)) {
       msg = "savefailed";
     } else {
       commonService.logNew(
           3,
           "用户【" + user.getUsername() + "】添加了【" + orgRight.getOrgName() + "】的单位信息成功!",
           Log.CAOZUO);
       msg = "savesuccess";
     }
   }
   return Const.ACTION_MSG;
 }
 public String add() {
   if (orgsid != null) {
     orgRightParent = orgFightService.getNodeBySid(orgsid);
   }
   return "add";
 }
 public String list() {
   orgFightList = orgFightService.getAllNodes();
   return Const.ACTION_SUCCESS;
 }